diff options
author | Dan Williams <dcbw@redhat.com> | 2010-08-26 09:18:37 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-08-26 09:18:37 -0500 |
commit | 022d8e665ceffe2a167e0029619c2bd08ceb912e (patch) | |
tree | 4b531642930b2c59e8c567fe4e3d1d168f5f2ed1 | |
parent | 6ebc201636769cbdecffceab613d3f91f426be09 (diff) | |
parent | f917852de3f4676f259edd2f272b561c9068435b (diff) | |
download | NetworkManager-022d8e665ceffe2a167e0029619c2bd08ceb912e.tar.gz |
Merge remote branch 'origin/master' into gsoc
94 files changed, 15220 insertions, 3353 deletions
diff --git a/.gitignore b/.gitignore index 22f990911d..033eaada1e 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils system-settings/plugins/ifcfg-rh/tests/network-scripts/Test_Write_* system-settings/plugins/ifcfg-rh/tests/network-scripts/*-Test_Write_* +system-settings/plugins/ifupdown/tests/test-ifupdown m4/gtk-doc.m4 m4/intltool.m4 @@ -108,4 +109,7 @@ m4/lt*.m4 policy/org.freedesktop.network-manager-settings.system.policy policy/org.freedesktop.NetworkManager.policy +data/NetworkManager.service +data/org.freedesktop.NetworkManager.service + cli/src/nmcli diff --git a/Makefile.am b/Makefile.am index 7e34571218..64be5c8526 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ SUBDIRS = \ cli \ tools \ policy \ + data \ initscript \ test \ po \ @@ -24,7 +25,11 @@ EXTRA_DIST = \ intltool-merge.in \ intltool-update.in -DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes --with-docs=yes --with-udev-dir=$$dc_install_base/lib/udev +DISTCHECK_CONFIGURE_FLAGS = \ + --with-tests=yes \ + --with-docs=yes \ + --with-udev-dir=$$dc_install_base/lib/udev \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) DISTCLEANFILES = intltool-extract intltool-merge intltool-update diff --git a/configure.ac b/configure.ac index e1b93471a3..5b1fbd64ba 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,12 @@ dnl AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="") AC_SUBST(LIBDL) +dnl +dnl Checks for new dbus-glib property access function +dnl +AC_CHECK_LIB([dbus-glib-1], [dbus_glib_global_set_disable_legacy_property_access], ac_have_dg_prop="1", ac_have_dg_prop="0") +AC_DEFINE_UNQUOTED(HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS, $ac_have_dg_prop, [Define if you have a dbus-glib with dbus_glib_global_set_disable_legacy_property_access()]) + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) @@ -231,6 +237,14 @@ else fi AC_SUBST(UDEV_BASE_DIR) +# systemd +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], + [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) + PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8) AC_SUBST(LIBNL_CFLAGS) AC_SUBST(LIBNL_LIBS) @@ -241,9 +255,12 @@ AC_SUBST(UUID_CFLAGS) AC_SUBST(UUID_LIBS) PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) - AC_SUBST(POLKIT_CFLAGS) +# Check for polkit_authority_get_sync() +AC_CHECK_LIB([polkit-gobject-1], [polkit_authority_get_sync], ac_have_pk_auth_get_sync="1", ac_have_pk_auth_get_sync="0") +AC_DEFINE_UNQUOTED(HAVE_POLKIT_AUTHORITY_GET_SYNC, $ac_have_pk_auth_get_sync, [Define if you have a polkit with polkit_authority_get_sync()]) + 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 @@ -305,21 +322,30 @@ AC_SUBST(PPPD_PLUGIN_DIR) 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 + # NM only works with ISC dhclient - other derivatives don't have + # the same userland. dhclient 4.x is required for IPv6 support; + # with older versions NM won't be able to use DHCPv6. + /*) DHCLIENT_PATH="${with_dhclient}" + DHCLIENT_VERSION=4 + if test -x "${with_dhclient}"; then + case `"${with_dhclient}" --version 2>&1` in + "isc-dhclient-4"*) DHCLIENT_VERSION=4; break;; + "isc-dhclient-V3"*) DHCLIENT_VERSION=3; break;; + esac + fi 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;; + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=4; break;; + "isc-dhclient-V3"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=3; break;; esac done if test -n "${DHCLIENT_PATH}"; then @@ -367,6 +393,7 @@ if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then AC_MSG_WARN([Falling back to ISC dhclient, ${DHCLIENT_PATH}]) fi AC_SUBST(DHCLIENT_PATH) +AC_SUBST(DHCLIENT_VERSION) AC_SUBST(DHCPCD_PATH) # resolvconf support @@ -484,6 +511,9 @@ tools/Makefile system-settings/Makefile system-settings/plugins/Makefile system-settings/plugins/ifupdown/Makefile +system-settings/plugins/ifupdown/tests/Makefile +system-settings/plugins/ifnet/Makefile +system-settings/plugins/ifnet/tests/Makefile system-settings/plugins/ifcfg-rh/Makefile system-settings/plugins/ifcfg-rh/tests/Makefile system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile @@ -522,6 +552,7 @@ man/nm-online.1 man/nmcli.1 po/Makefile.in policy/Makefile +data/Makefile docs/Makefile docs/libnm-glib/Makefile docs/libnm-util/Makefile @@ -539,6 +570,7 @@ echo if test -n "${DHCLIENT_PATH}"; then echo ISC dhclient support: ${DHCLIENT_PATH} + echo ISC dhclient version: ${DHCLIENT_VERSION} else echo ISC dhclient support: no fi @@ -549,6 +581,12 @@ else echo dhcpcd support: no fi +if test -n "${with_systemdsystemunitdir}"; then + echo systemd support: ${with_systemdsystemunitdir} +else + echo systemd support: no +fi + echo echo Building documentation: ${with_docs} echo Building tests: ${with_tests} diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000000..f91d3a8255 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,26 @@ + +if HAVE_SYSTEMD +systemdsystemunit_DATA = NetworkManager.service + +NetworkManager.service: NetworkManager.service.in + $(edit) $< >$@ + +servicedir = $(datadir)/dbus-1/system-services +service_in_files = org.freedesktop.NetworkManager.service.in +service_DATA = $(service_in_files:.service.in=.service) + +$(service_DATA): $(service_in_files) Makefile + $(edit) $< >$@ +endif + +edit = sed \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' + +EXTRA_DIST = \ + NetworkManager.service.in \ + org.freedesktop.NetworkManager.service.in + +CLEANFILES = NetworkManager.service org.freedesktop.NetworkManager.service + diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in new file mode 100644 index 0000000000..d93fc6709d --- /dev/null +++ b/data/NetworkManager.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=Network Manager +After=syslog.target + +[Service] +Type=dbus +BusName=org.freedesktop.NetworkManager +ExecStart=@sbindir@/NetworkManager --no-daemon + +[Install] +WantedBy=network.target multi-user.target +Alias=dbus-org.freedesktop.NetworkManager.service diff --git a/data/org.freedesktop.NetworkManager.service.in b/data/org.freedesktop.NetworkManager.service.in new file mode 100644 index 0000000000..5bd091b4d3 --- /dev/null +++ b/data/org.freedesktop.NetworkManager.service.in @@ -0,0 +1,11 @@ +# This D-Bus service activation file is only for systemd support since +# an auto-activated NetworkManager would be quite surprising for those people +# who have NM installed but turned off. Thus the Exec path available to +# D-Bus is /bin/false, but systemd knows the real Exec path due to the NM +# systemd .service file. + +[D-BUS Service] +Name=org.freedesktop.NetworkManager +Exec=/bin/false +User=root +SystemdService=dbus-org.freedesktop.NetworkManager.service diff --git a/include/NetworkManagerVPN.h b/include/NetworkManagerVPN.h index d792847d6a..f4ef93d3d4 100644 --- a/include/NetworkManagerVPN.h +++ b/include/NetworkManagerVPN.h @@ -166,6 +166,9 @@ typedef enum { */ #define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes" +/* boolean: prevent this VPN connection from ever getting the default route */ +#define NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT "never-default" + /* Deprecated */ #define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 8ff15b39b3..88f71af2a2 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -319,12 +319,8 @@ nm_permission_result_to_client (const char *nm) } static void -get_permissions_reply (DBusGProxy *proxy, - GHashTable *permissions, - GError *error, - gpointer user_data) +update_permissions (NMClient *self, GHashTable *permissions) { - NMClient *self = NM_CLIENT (user_data); NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); GHashTableIter iter; gpointer key, value; @@ -332,13 +328,11 @@ get_permissions_reply (DBusGProxy *proxy, NMClientPermissionResult perm_result; GList *keys, *keys_iter; - priv->perm_call = NULL; - /* get list of old permissions for change notification */ keys = g_hash_table_get_keys (priv->permissions); g_hash_table_remove_all (priv->permissions); - if (!error) { + if (permissions) { /* Process new permissions */ g_hash_table_iter_init (&iter, permissions); while (g_hash_table_iter_next (&iter, &key, &value)) { @@ -377,12 +371,31 @@ get_permissions_reply (DBusGProxy *proxy, g_list_free (keys); } -static DBusGProxyCall * -get_permissions (NMClient *self) +static void +get_permissions_sync (NMClient *self) +{ + gboolean success; + GHashTable *permissions = NULL; + + success = dbus_g_proxy_call_with_timeout (NM_CLIENT_GET_PRIVATE (self)->client_proxy, + "GetPermissions", 3000, NULL, + G_TYPE_INVALID, + DBUS_TYPE_G_MAP_OF_STRING, &permissions, G_TYPE_INVALID); + update_permissions (self, success ? permissions : NULL); + if (permissions) + g_hash_table_destroy (permissions); +} + +static void +get_permissions_reply (DBusGProxy *proxy, + GHashTable *permissions, + GError *error, + gpointer user_data) { - return org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy, - get_permissions_reply, - self); + NMClient *self = NM_CLIENT (user_data); + + NM_CLIENT_GET_PRIVATE (self)->perm_call = NULL; + update_permissions (NM_CLIENT (user_data), error ? NULL : permissions); } static void @@ -391,8 +404,11 @@ client_recheck_permissions (DBusGProxy *proxy, gpointer user_data) NMClient *self = NM_CLIENT (user_data); NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); - if (!priv->perm_call) - priv->perm_call = get_permissions (self); + if (!priv->perm_call) { + priv->perm_call = org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy, + get_permissions_reply, + self); + } } static GObject* @@ -442,7 +458,7 @@ constructor (GType type, G_CALLBACK (client_recheck_permissions), object, NULL); - priv->perm_call = get_permissions (NM_CLIENT (object)); + get_permissions_sync (NM_CLIENT (object)); priv->bus_proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus", diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 62ae13d2ba..eb3288d117 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -192,11 +192,18 @@ fetch_connections_done (DBusGProxy *proxy, int i; if (error) { - g_warning ("%s: error fetching connections: (%d) %s.", - __func__, - error->code, - error->message ? error->message : "(unknown)"); + /* Ignore settings service spawn errors */ + if ( !g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN) + && !g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NAME_HAS_NO_OWNER)) { + g_warning ("%s: error fetching connections: (%d) %s.", + __func__, + error->code, + error->message ? error->message : "(unknown)"); + } g_clear_error (&error); + + /* We tried to read connections and failed */ + g_signal_emit (self, signals[CONNECTIONS_READ], 0); return; } diff --git a/po/POTFILES.in b/po/POTFILES.in index 509ec67bbf..e5ddd8b033 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -20,4 +20,5 @@ 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 +system-settings/plugins/ifnet/connection_parser.c @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: es\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-31 11:38+0200\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-16 21:27+0200\n" "Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n" "Language-Team: Español <gnome-es-list@gnome.org>\n" "MIME-Version: 1.0\n" @@ -25,76 +25,76 @@ msgstr "" "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 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "NOMBRE" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "DISPOSITIVOS" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "ALCANCE" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "PREDETERMINADO" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "SERVICIO DBUS" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "OBJETO SPEC" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TIPO" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "MARCA DE TIEMPO" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "MARCA DE TIEMPO-REAL" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOCONECTAR" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "SÓLOLECTURA" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -115,40 +115,40 @@ msgstr "" "<timeout>]\n" " down id <id> | uuid <id>\n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "Error: 'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "Error: 'con list': %s; campos permitidos: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "Detalles de conexiones" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "sistema" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "usuario" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 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/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 @@ -164,11 +164,11 @@ msgstr "nunca" 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/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 @@ -184,272 +184,272 @@ msgstr "sÃ" msgid "no" msgstr "no" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "Conexiones de sistema" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 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 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Error: falta el argumento %s." -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, 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 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Parámetro desconocido: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, 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 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "Error: %s." -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "Error: 'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "Error: 'con status': %s; campos permitidos: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "Conexiones activas" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "conexión no activa en dispositivo '%s'" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "conexión o dispositivo no activos" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "dispositivo '%s' incompatible con conexión '%s'" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "no se encontró dispositivo para conexión '%s'" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "activando" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 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/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../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 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "Conectando VPN (preparar)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "Conectando VPN (necesita autenticación)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "Conectando VPN" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "Conectando VPN (Obteniendo configuración IP)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN conectada" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "Conexión VPN falló" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN desconectada" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "razón desconocida" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "ninguna" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "el usuario estaba desconectado" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "la conexión de red de base fue interrumpida" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "El servicio VPN se detuvo inesperadamente" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "El servicio VPN retornó configuración inválida" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "El intento de conexión se agotó" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "el servicio VPN no inició a tiempo" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "el servicio VPN falló en el inicio" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "secretos VPN inválidos" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "secretos VPN válidos" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "la conexión fue eliminada" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "estado: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "Conexión activada\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "Error: Activación de conexión falló." -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, 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 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Error: Pausa de %d segundos expiró." -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Error: Activación de conexión falló: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, 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 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "Estado de conexión activa: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, 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 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "Error: Conexión desconocida: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, 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 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Error: id o uuid ha sido especificado." -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "Error: Dispositivo inapropiado: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "Error: Dispositivo no apropiado." -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "Advertencia: Conexión inactiva\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Error: comando 'con' '%s' es inválido." -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Error: no se pudo conectar a D-Bus." -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "Error: no se pudo obtener configuración de sistema." -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "Error: No se pudo obtener configuración de usuario." -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" @@ -458,173 +458,185 @@ msgstr "" #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "DISPOSITIVO" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "ESTADO" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "GENERAL" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "FUNCIONALIDADES" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "PROPIEDADES-WIFI" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "PROPIEDADES ALÃMBRICAS" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "CONFIGURACIONES IP4" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "DNS IP4" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "CONFIGURACIONES IP6" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "DNS IP6" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "CONTROLADOR" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "HWADDR" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "DETECTAR-PORTADOR" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "VELOCIDAD" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "PORTADOR" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "DIRECCIÓN" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "PREFIJO" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "PUERTA DE ENLACE" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "MODO" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREC" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "TASA" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "SEÑAL" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "SEGURIDAD" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "INDICADORES-WPA" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "INDICADORES-RSN" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "ACTIVO" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -647,204 +659,205 @@ msgstr "" " wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "sin gestión" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "no disponible" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "desconectado" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "conectando (preparar)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "conectando (configurando)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "conectando (necesita autenticación)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "conectando (obteniendo configuración IP)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "conectado" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "conexión falló" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "desconocido" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(ninguno)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: error convirtiendo dirección IP4 0x%X" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "Encriptado: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP" -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA" -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2" -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "Empresa" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "Ad-Hoc" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "Infraestructura" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "Error: 'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "Error: 'dev list': %s; campos permitidos: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "Detalles de dispositivos" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(desconocido)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "desconocido" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "encendido" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "apagado" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "Error: 'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "Error: 'dev status': %s; campos permitidos: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Estado de dispositivos" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, 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 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Error: Dispositivo '%s' no encontrado." -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Éxito: Dispositivo '%s' desconectado correctamente." -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, 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 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Estado de dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Error: iface tiene que especificarse." -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "Error: 'dev wifi' '%s'" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "Error: 'dev wifi': %s; campos permitidos: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "lista de scan WiFi" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, 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 +#: ../cli/src/devices.c:1173 #, 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 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Error: comando 'dev wifi' '%s' inválido." -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Error: comando 'dev' '%s' inválido." @@ -1482,27 +1495,27 @@ msgstr "No se pudo verificar el archivo PKCS#12: %d" msgid "Could not generate random data." msgstr "No se pudo generar datos aleatorios." -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, 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 +#: ../libnm-util/nm-utils.c:2085 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 +#: ../libnm-util/nm-utils.c:2097 #, 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 +#: ../libnm-util/nm-utils.c:2109 #, 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 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." @@ -1574,12 +1587,10 @@ msgstr "" "de energiÌ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 poliÌ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 poliÌtica de sistema evita activar o desactivar los dispositivos " @@ -1592,7 +1603,6 @@ msgstr "" "ancha moÌ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 poliÌtica de sistema evita activar o desactivar la red del sistema" @@ -1602,7 +1612,6 @@ msgstr "" "La poliÌ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 poliÌtica del sistema evita el uso de conexiones especiÌficas de usuario" @@ -1658,16 +1667,16 @@ 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 +#: ../src/main.c:573 #, 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 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1676,19 +1685,19 @@ msgstr "" "# Mezclado de %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "cliente DHCP inútil pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "'dhclient' pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "'dhcpcd' pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "'%s' Cliente DHCP sin soporte " @@ -1703,13 +1712,13 @@ msgstr "Nivel de registro desconocido '%s'" msgid "Unknown log domain '%s'" msgstr "Dominio de registro desconocido '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/named-manager/nm-named-manager.c:384 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 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." @@ -1718,6 +1727,6 @@ msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." msgid "Auto %s" msgstr "Auto %ss" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "Sistema" @@ -7,18 +7,88 @@ 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: 2010-04-27 15:25+0000\n" -"PO-Revision-Date: 2010-02-25 11:06+0100\n" -"Last-Translator: Miguel Anxo Bouzada <mbouzada@gmail.com>\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-08-11 21:19+0000\n" +"PO-Revision-Date: 2010-08-23 00:53+0000\n" +"Last-Translator: Francisco Diéguez <Unknown>\n" "Language-Team: Galego <proxecto@trasno.net>\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" +"X-Launchpad-Export-Date: 2010-08-23 01:00+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NOME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "DISPOSITIVOS" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "AMBITO" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "PREDEFINIDO" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBXECTO" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "MARCADETEMPO" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONECTAR" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SO-LECTURA" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -30,319 +100,535 @@ msgid "" "<timeout>]\n" " down id <id> | uuid <id>\n" msgstr "" +"Uso: nmcli con { ORDE | help }\n" +" ORDE := { list | status | up | down }\n" +"\n" +" list [id <id> | uuid <id> | system | user]\n" +" status\n" +" up id <id> | uuid <id> [iface <interface>] [ap <hwaddr>] [--nowait] [--" +"timeout <timeout>]\n" +" down id <id> | uuid <id>\n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "" - -#: ../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 "" - -#: ../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 "" - -#: ../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 "" +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Erro: 'con list': %s" + +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Erro: 'con list': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Detalles da conexión" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "usuario" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "nunca" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "si" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "non" -#: ../cli/src/connections.c:163 -#, fuzzy, c-format -#| msgid "Modify system connections" -msgid "System connections:\n" -msgstr "Modificar as conexións do sistema" +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Conexións do sistema" -#: ../cli/src/connections.c:167 -#, fuzzy, c-format -#| msgid "Modify system connections" -msgid "User connections:\n" -msgstr "Modificar as conexións do sistema" +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Conexións do usuario" -#: ../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 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." -msgstr "" +msgstr "Erro: falta o argumento %s" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." -msgstr "" - -#: ../cli/src/connections.c:196 -#, fuzzy -#| msgid "Modify system connections" -msgid "System-wide connections" -msgstr "Modificar as conexións do sistema" +msgstr "Erro: %s - non existe dita conexión." -#: ../cli/src/connections.c:205 -#, fuzzy -#| msgid "Modify system connections" -msgid "User connections" -msgstr "Modificar as conexións do sistema" - -#: ../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 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" -msgstr "" +msgstr "Parámetros descoñecidos: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." -msgstr "" - -#. 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 "" - -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "" +msgstr "Erro: non se especificou un parámetro válido" -#: ../cli/src/connections.c:297 -#, fuzzy -#| msgid "Modify system connections" -msgid "Active connections" -msgstr "Modificar as conexións do sistema" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "" +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Erro: %s." -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "" +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Erro: «con status»: %s" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "" +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Erro: «con status»: %s; campos permitidos: %s" #: ../cli/src/connections.c:659 +msgid "Active connections" +msgstr "Conexións activas" + +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" -msgstr "" +msgstr "non hai conexións activas no dispositivo «%s»" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" -msgstr "" +msgstr "non hai conexións activas ou dispositivo" + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "o dispositivo «%s» non é compatÃbel coa conexión «%s»" + +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "non foi posÃbel encontrar un dispositivo para a conexión «%s»" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1098 msgid "activating" -msgstr "" +msgstr "activando" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1100 msgid "activated" -msgstr "" +msgstr "activada" -#: ../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 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" -msgstr "" +msgstr "descoñecido" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" -msgstr "" +msgstr "Conectándose á VPN (preparando)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" -msgstr "" +msgstr "Conexión VPN (requÃrese autenticación)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" -msgstr "" +msgstr "Conexión VPN" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" -msgstr "" +msgstr "Conectándose á VPN (obtendo a configuración de IP)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1120 msgid "VPN connected" -msgstr "" +msgstr "Conectado á VPN" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" -msgstr "" +msgstr "Produciuse un fallo ao conectarse á VPN" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" -msgstr "" +msgstr "Desconectado á VPN" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1135 msgid "unknown reason" -msgstr "" +msgstr "razón descoñecida" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1137 msgid "none" -msgstr "" +msgstr "ninguna" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" -msgstr "" +msgstr "o usuario desconectouse" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" -msgstr "" +msgstr "a conexión de rede base foi interrompida" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" -msgstr "" +msgstr "o servizo de VPN deteuse de forma inesperada" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" -msgstr "" +msgstr "o servizo de VPN devolveu unha configuración non válida" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" -msgstr "" +msgstr "o intento de conexión superou o tempo de espera máximo" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" -msgstr "" +msgstr "o servizo de VPN non se iniciou a tempo" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" -msgstr "" +msgstr "o servizo de VPN fallou ao iniciarse" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" -msgstr "" +msgstr "non hai segredos VPN válidos" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" -msgstr "" +msgstr "segredos VPN non válidos" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" -msgstr "" +msgstr "eliminouse a conexión" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" -msgstr "" +msgstr "estado: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" -msgstr "" +msgstr "Conexión activada\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." -msgstr "" +msgstr "Erro: A activación da conexión fallou." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" -msgstr "" +msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "" +msgstr "Erro: A activación da conexión fallou: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "" +msgstr "Erro: Alcanzouse o tempo de espera de %d segundos." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "" +msgstr "Erro: Produciuse un fallo ao activar a conexión: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "" +msgstr "Erro: Produciuse un fallo ao obter a conexión activa para «%s»." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" -msgstr "" +msgstr "Estado da conexión activa: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" -msgstr "" +msgstr "Camiño da conexión activa: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." -msgstr "" +msgstr "Erro: Conexión descoñecida: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "" +msgstr "Erro: O valor do tempo de espera máximo «%s» non é válido." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "" +msgstr "Erro: debe especificar o id ou o uuid." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." -msgstr "" +msgstr "Erro: Non se encontrou un dispositivo axeitado: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." -msgstr "" +msgstr "Erro: Non se encontrou o dispositivo axeitado." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" -msgstr "" +msgstr "Aviso: A conexión non está activa.\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "" +msgstr "Erro: «con» a orde «%s» non é válida" -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "" +msgstr "Erro: non é posÃbel conectarse a D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." -msgstr "" +msgstr "Erro: Non é posÃbel obter as opcións do sistema." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." -msgstr "" +msgstr "Erro: Non é posÃbel obter as opcións do usuario." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" +"Erro: Non é posÃbel obter as conexións: os servizos de opcións non están " +"executándose." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "DISPOSITIVO" +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ESTADO" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "XERAL" + +#. 0 #: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "CAPACIDADES" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "PROPIEDADES-WIFI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "PROPIEDADES-CONCABLES" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "CONFIGURACIONS-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP4-CONFIGURACIONS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "CONTROLADOR" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ENDEREZO-HARDWARE" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "DETECTAR-CARRIERV" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "VELOCIDADE" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ENDEREZO" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIXO" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "PASARELA" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MODO" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "TAXA" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SINAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SEGURIDADE" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "OPCIONS-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "OPCIONS-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "ACTIVA" + +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -352,340 +638,247 @@ msgid "" " status\n" " list [iface <iface>]\n" " disconnect iface <iface> [--nowait] [--timeout <timeout>]\n" -" wifi [list [iface <iface>] | apinfo iface <iface> hwaddr <hwaddr>]\n" +" wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" "\n" msgstr "" +"Uso: nmcli dev { ORDE | help }\n" +"\n" +" ORDE := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface <interface>]\n" +" disconnect iface <interface> [--nowait] [--timeout <tempo-de-espera>]\n" +" wifi [list [iface <interface>] [hwaddr <enderezo-hardware>]]\n" +"\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" -msgstr "" +msgstr "non xestionada" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" -msgstr "" +msgstr "non dispoñÃbel" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" -msgstr "" +msgstr "desconectado" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" -msgstr "" +msgstr "conectando (preparando)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" -msgstr "" +msgstr "conectando (configurando)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" -msgstr "" +msgstr "conectando (precisa autenticación)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" -msgstr "" +msgstr "conectando (obtendo a configuración IP)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" -msgstr "" +msgstr "conectado" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:244 msgid "connection failed" -msgstr "" +msgstr "produciuse un fallo na conexión" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" -msgstr "" +msgstr "Descoñecido" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:299 msgid "(none)" -msgstr "" +msgstr "(ningún)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" -msgstr "" +msgstr "%s: produciuse un erro ao converter o enderezo IP4 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr "" - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr "" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr "" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr "" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr "" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "" +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Cifrado: " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "" +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "" +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Empresa " -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infraestrutura" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -msgid "%u Mb/s" -msgstr "" +msgid "Error: 'dev list': %s" +msgstr "Erro: «dev list»: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Erro: «dev list»: %s campos permitidos: %s" -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Detalles do dispositivo" -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(descoñecido)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "descoñecido)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" -msgstr "" +msgstr "activado" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" -msgstr "" +msgstr "desactivado" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" +msgid "Error: 'dev status': %s" +msgstr "Erro: «dev status»: %s" -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "" - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Erro: «dev status»: %s campos permitidos: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" -msgstr "" +msgstr "Estado dos dispositivos" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." -msgstr "" +msgstr "Erro: falta o argumento «%s»." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." -msgstr "" +msgstr "Erro: Non é posÃbel encontrar o dispositivo %s." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "" +msgstr "Éxito: O dispositivo «%s» desconectouse correctamente." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "" +msgstr "Erro: Fallou a desconexión do dispositivo «%s» (%s): %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" -msgstr "" +msgstr "Estado do dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." -msgstr "" +msgstr "Erro: non se especificou a interface." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "" +msgid "Error: 'dev wifi': %s" +msgstr "Erro: «dev wifi»: %s" -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "" - -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "" +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Erro: «dev wiki»: %s; campos permitidos: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Lista de escaneo WiFi" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "" +msgstr "Erro: Non se encontrou o punto de acces co enderezo hardware «%s»." -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:1173 #, c-format -msgid "%u MHz" -msgstr "" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erro: O dispositivo «%s» non é un dispositivo WiFi." -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1237 #, c-format -msgid "%u MB/s" -msgstr "" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "" +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erro: «dev wifi» a orde «%s» non é válida." -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erro: «dev» a orde «%s» non é válida." -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "" +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EXECUTANDO" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "" +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "" +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" -#: ../cli/src/devices.c:907 -#, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "" +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" -#: ../cli/src/devices.c:943 -#, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "" +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -699,90 +892,102 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" +"Usage: nmcli nm { ORDE | help }\n" +"\n" +" ORDE := { 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 +#: ../cli/src/network-manager.c:83 msgid "asleep" -msgstr "" +msgstr "dormido" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" -msgstr "" +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 "" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Erro:«'nm status»: %s" -#: ../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 "" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Erro: 'nm status': %s; campos permitidos: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" -msgstr "" +msgstr "Estado de NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -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 "activado" -#: ../cli/src/network-manager.c:104 +#: ../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 "desactivado" + +#: ../cli/src/network-manager.c:148 msgid "running" -msgstr "" +msgstr "en execución" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" -msgstr "" - -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "" +msgstr "non está a executarse" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -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 "Erro: '--fields' valor '%s' non é válido aquÃ; campos permitidos: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi activada" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "" +msgstr "Erro: parámetro «wifi» non válido: «%s»." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN activada" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "" +msgstr "Erro: parámetro «wwan» non válido: «%s»." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "" +msgstr "Erro: «nm» a orde «%s» non é válida." -#: ../cli/src/nmcli.c:65 +#: ../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" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] <field1,field2,...>|all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -790,35 +995,182 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" +"Uso: %s [OPCIÓNS] OBXECTO { ORDE | ayuda }\n" +"\n" +"OPCIÓNS\n" +" -t[erse] saÃda terse \n" +" -p[retty] saÃda pretty\n" +" -v[ersion] mostrar a versión do programa\n" +" -h[elp] imprimir esta axuda\n" +"\n" +"OBXECTO\n" +" nm estado do NetworkManager\n" +" con conexións do NetworkManager\n" +" dev dispositivos administrados por NetworkManager\n" +"\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "" +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Erro: O obxecto «%s» é descoñecido, tente a executar «nmcli help»." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Erro: A opción «--terse» especifÃcase en segundo lugar." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Erro: A opción «--terse» é mutuamente exclusiva con «--pretty»." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Erro: A opción «--pretty» especifÃcase en segundo lugar." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Erro: A opción «--pretty» é mutuamente exclusiva con «--terse»." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Erro: falta o argumento para a 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 "Erro: «%s» non é un argumento válido para a opción «%s»." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Erro: faltan os campos para «%s»." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" -msgstr "" +msgstr "ferramenta nmcli, versión %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "" +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Erro: A opción «%s» é descoñecida, tente «nmcli --help»" -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "" +msgstr "Sinal %d capturada, apagando..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "" +msgstr "Erro: non foi posÃbel conectarse a NetworkManager" -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" +msgstr "Éxito" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase de paso 104/128-bit)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (descoñecido)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (descoñecido)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "calquera, " + +#: ../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 "automático" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non definido" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "o campo «%s» ten que estar só" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo «%s» non válido" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "A opcións «--terse» require que especifique «--fields»" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "" +"Option '--terse' requires specific '--fields' option values , not '%s'" msgstr "" +"A opción «--terse» require que especifique os valores da opción «--fields», " +"non «%s»" #: ../libnm-util/crypto.c:120 #, c-format @@ -853,17 +1205,20 @@ 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" +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" +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" +msgstr "" +"Ficheiro PEM malformado: o cifrado da chave privada «%s» é descoñecido" #: ../libnm-util/crypto.c:222 #, c-format @@ -950,15 +1305,15 @@ msgstr "Non hai memoria abondo para o búfer da chave descifrada." #, 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." +"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." +"Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / " +"%s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format @@ -1057,7 +1412,8 @@ 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." +msgstr "" +"Produciuse un erro ao establecer a chave simétrica para o descifrado." #: ../libnm-util/crypto_nss.c:216 #, c-format @@ -1145,32 +1501,132 @@ msgstr "Non foi posÃbel verficar o ficheiro PKCS#12: %d" msgid "Could not generate random data." msgstr "Non foi posÃbel xerar datos aleatorios." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1975 #, 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:2034 +#: ../libnm-util/nm-utils.c:2085 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:2046 +#: ../libnm-util/nm-utils.c:2097 #, 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:2058 +#: ../libnm-util/nm-utils.c:2109 #, 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:2077 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Non foi posÃbel asignar memoria para os datos do ficheiro PEM." +#: ../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" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Permitir o control das conexións de rede" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Permitir o uso de conexións especÃficas do usuario" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Activar ou desactivar os dispositivos WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Activar ou desactivar os dispositivos de banda ancha móbiles" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Activar ou desactivar a rede do 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 "" +"Poñer o NetworkManager en suspensión e espertalo (só debe ser usado polo " +"sistema de xestión de rede)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "A normativa do sistema evita o control das conexións de rede" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"A normativa do sistema evita a activación e desactivación dos dispositivos " +"WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"A normativa do sistema evita a activación ou desactivación dos dispositivos " +"de banda ancha." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"A normativa do sistema evita a activación ou desactivación da rede do sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "" +"System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"A normativa do sistema evita poñer o NetworkManager en suspensión ou " +"espertalo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "" +"A normativa do sistema evita o uso de conexións especÃficas do usuario" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1188,10 +1644,11 @@ msgstr "" "non é posÃbel conectar ao netlink para monitorizar o estado da lingazón: %s" #: ../src/nm-netlink-monitor.c:265 -#, fuzzy, c-format -#| msgid "unable to allocate netlink handle: %s" +#, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "non é posÃbel asignar un manexador para a ligazon de rede: %s" +msgstr "" +"non é posÃbel activar a ligazón de rede para xestionar o paso de " +"creadenciais: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1217,22 +1674,21 @@ msgstr "non é posÃbel unir ao grupo da ligazón de rede: %s" msgid "error updating link cache: %s" msgstr "produciuse un erro ao actualizar a caché de ligazóns: %s" -#: ../src/main.c:502 +#: ../src/main.c:498 #, 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/main.c:562 -#, fuzzy, c-format -#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +#: ../src/main.c:569 +#, c-format msgid "%s. 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" +msgstr "%s. Use --help para ver a lista das opcións válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1241,38 +1697,38 @@ msgstr "" "# Fusionado desde %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." -msgstr "" +msgstr "non se encontrou un cliente de DHCP usábel." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." -msgstr "" +msgstr "Non foi posÃbel encontrar «dhclient»." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." -msgstr "" +msgstr "Non foi posÃbel encontrar «dhcpcd»." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "" +msgstr "cliente DHCP «%s» non compatÃbel" #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "" +msgstr "Nivel de rexistro «%s» descoñecido" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "" +msgstr "Dominio de rexistro «%s» descoñecido" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:384 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:345 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" @@ -1281,53 +1737,15 @@ msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 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" - +#, 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" +#~ "non é posÃbel unir ao grupo netlink para monitorizar o estado da ligazón: %s" -#~| msgid "unable to connect to netlink for monitoring link status: %s" +#, c-format #~ msgid "unable to connect to netlink: %s" #~ msgstr "non é posÃbel conectar coa ligazón de rede: %s" @@ -5,12 +5,12 @@ # Rajesh Ranjan <rranjan@redhat.com>, 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" +"Project-Id-Version: hi\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-20 12:39+0530\n" +"PO-Revision-Date: 2010-07-26 13:05+0530\n" "Last-Translator: Rajesh Ranjan <rranjan@redhat.com>\n" -"Language-Team: Hindi <Red Hat>\n" +"Language-Team: Hindi <fedora-trans-hi@redhat.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -499,6 +499,16 @@ msgstr "IP4-SETTINGS" msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 #: ../cli/src/devices.c:88 msgid "DRIVER" @@ -1501,6 +1511,88 @@ msgstr "गोपित कà¥à¤‚जी को PEM फाइल में लि msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल आà¤à¤•à¤¡à¤¼à¤¾ के लिठसà¥à¤®à¥ƒà¤¤à¤¿ नहीं आबंटित कर सका." +#: ../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 संजाल के दà¥à¤µà¤¾à¤°à¤¾ साà¤à¤¾ कनेकà¥à¤¶à¤¨ को सिसà¥à¤Ÿà¤® नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "संजाल कनेकà¥à¤¶à¤¨ के नियंतà¥à¤°à¤£ सà¥à¤µà¥€à¤•à¤¾à¤° करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "उपयोकà¥à¤¤à¤¾ विशिषà¥à¤Ÿ कनेकà¥à¤¶à¤¨ के उपयोग की सà¥à¤µà¥€à¤•à¥ƒà¤¤à¤¿ दें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi यà¥à¤•à¥à¤¤à¤¿à¤¯à¤¾à¤ सकà¥à¤°à¤¿à¤¯ या निषà¥à¤•à¥à¤°à¤¿à¤¯ करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "मोबाइल बà¥à¤°à¤¾à¤¡à¤¬à¥ˆà¤‚ड यà¥à¤•à¥à¤¤à¤¿à¤¯à¤¾à¤ सकà¥à¤°à¤¿à¤¯ या निषà¥à¤•à¥à¤°à¤¿à¤¯ करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "तंतà¥à¤° संजालन सकà¥à¤°à¤¿à¤¯ या निषà¥à¤•à¥à¤°à¤¿à¤¯ करें" + +#: ../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 " NetworkManager को सà¥à¤²à¥€à¤ª सà¥à¤¥à¤¿à¤¤à¤¿ या वेकअप सà¥à¤¥à¤¿à¤¤à¤¿ में रखें (केवल सिसà¥à¤Ÿà¤® पावर मैनेजमेंट के दà¥à¤µà¤¾à¤°à¤¾ पà¥à¤°à¤¯à¥‹à¤— किया जाà¤à¤—ा)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "सिसà¥à¤Ÿà¤® कनेकà¥à¤¶à¤¨ के नियंतà¥à¤°à¤£ को सिसà¥à¤Ÿà¤® नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "WiFi यà¥à¤•à¥à¤¤à¤¿ के सकà¥à¤°à¤¿à¤¯à¤£ या निषà¥à¤•à¥à¤°à¤¿à¤¯à¤£ को तंतà¥à¤° नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "मोबाइल बà¥à¤°à¥‰à¤¡à¤¬à¥ˆà¤‚ड यà¥à¤•à¥à¤¤à¤¿ के सकà¥à¤°à¤¿à¤¯à¤£ या निषà¥à¤•à¥à¤°à¤¿à¤¯à¤£ को तंतà¥à¤° नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "तंतà¥à¤° संजालन के यà¥à¤•à¥à¤¤à¤¿ के सकà¥à¤°à¤¿à¤¯à¤£ या निषà¥à¤•à¥à¤°à¤¿à¤¯à¤£ को तंतà¥à¤° नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "NetworkManager को सà¥à¤²à¥€à¤ª या वेकअप सà¥à¤¥à¤¿à¤¤à¤¿ में लाने के लिठनेटवरà¥à¤•à¤®à¥ˆà¤¨à¥‡à¤œà¤° रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "सिसà¥à¤Ÿà¤® नीति उपयोकà¥à¤¤à¤¾ विशेष कनेकà¥à¤¶à¤¨ के उपयोग को रोकता है" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1608,35 +1700,3 @@ msgstr "सà¥à¤µà¤¤à¤ƒ %s" 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 संजाल के दà¥à¤µà¤¾à¤°à¤¾ साà¤à¤¾ कनेकà¥à¤¶à¤¨ को सिसà¥à¤Ÿà¤® नीति रोकता है" - @@ -1,963 +1,1716 @@ # Indonesian translation for network-manager -# Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 +# Copyright (C) 2010 THE network-manager'S COPYRIGHT HOLDER # This file is distributed under the same license as the network-manager package. -# Andika Triwidada <andika@gmail.com>, 2007. +# Andika Triwidada <andika@gmail.com>, 2010. # 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" +"Project-Id-Version: network-manager master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-10 16:04+0700\n" "Last-Translator: Andika Triwidada <andika@gmail.com>\n" -"Language-Team: Indonesian <id@li.org>\n" +"Language-Team: GNOME Indonesian Translation Team <gnome@i15n.org>\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" +"X-Poedit-Language: Indonesian\n" +"X-Poedit-Country: Indonesia\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:158 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id <id> | uuid <id> | system | user]\n" +" status\n" +" up id <id> | uuid <id> [iface <iface>] [ap <hwaddr>] [--nowait] [--timeout " +"<timeout>]\n" +" down id <id> | uuid <id>\n" +msgstr "" +"Cara pakai: nmcli con { PERINTAH | help }\n" +" PERINTAH := { list | status | up | down }\n" +"\n" +" list [id <id> | uuid <id> | system | user]\n" +" status\n" +" up id <id> | uuid <id> [iface <iface>] [ap <hwaddr>] [--nowait] [--timeout " +"<timeout>]\n" +" down id <id> | uuid <id>\n" -#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:915 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format -msgid "Passphrase for wireless network %s" -msgstr "Frasa-kunci untuk jaringan nirkabel %s" +msgid "Error: 'con list': %s" +msgstr "Galat: 'con list': %s" -#: ../gnome/applet/applet-dbus.c:265 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format -msgid "Connection to the wireless network '%s' failed." -msgstr "Koneksi ke jaringan nirkabel '%s' gagal." +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Galat: 'con list': %s; ruas yang diijinkan: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Rincian koneksi" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "system" +msgstr "system" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "user" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "never" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "ya" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "tidak" + +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Koneksi sistem" + +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Koneksi pengguna" + +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Galat: argumen %s hilang." -#: ../gnome/applet/applet-dbus.c:270 -msgid "Connection to the wired network failed." -msgstr "Koneksi ke jaringan berkabel gagal." +#: ../cli/src/connections.c:488 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Galat: %s - koneksi tak ada." -#: ../gnome/applet/applet.c:184 -msgid "Error displaying connection information:" -msgstr "Kesalahan menampilkan informasi sambungan:" +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parameter tak dikenal: %s\n" -#: ../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)!" +#: ../cli/src/connections.c:529 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Galat: tak ada parameter valid yang dinyatakan." -#: ../gnome/applet/applet.c:213 -msgid "No active connections!" -msgstr "Tidak ada koneksi aktif!" +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Galat: %s." -#: ../gnome/applet/applet.c:234 +#: ../cli/src/connections.c:650 #, c-format -msgid "Wired Ethernet (%s)" -msgstr "Ethernet Berkabel (%s)" +msgid "Error: 'con status': %s" +msgstr "Galat: 'con status': %s" -#: ../gnome/applet/applet.c:236 +#: ../cli/src/connections.c:652 #, c-format -msgid "Wireless Ethernet (%s)" -msgstr "Ethernet Nirkabel (%s)" +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Galat: 'con status': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/applet.c:332 ../gnome/applet/applet.c:358 -msgid "NetworkManager Applet" -msgstr "Applet NetworkManager" +#: ../cli/src/connections.c:659 +msgid "Active connections" +msgstr "Koneksi aktif" -#: ../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." +#: ../cli/src/connections.c:1027 +#, c-format +msgid "no active connection on device '%s'" +msgstr "tak ada koneksi aktif pada perangkat '%s'" -#: ../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." +#: ../cli/src/connections.c:1035 +#, c-format +msgid "no active connection or device" +msgstr "tak ada koneksi atau perangkat aktif " + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "perangkat '%s' tak kompatibel dengan koneksi '%s'" -#: ../gnome/applet/applet.c:339 ../gnome/applet/applet.c:366 -msgid "translator-credits" -msgstr "Andika Triwidada <andika@gmail.com>, 2007." +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "tak ditemukan perangkat bagi koneksi '%s'" -#: ../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." +#: ../cli/src/connections.c:1098 +msgid "activating" +msgstr "mengaktifkan" + +#: ../cli/src/connections.c:1100 +msgid "activated" +msgstr "diaktifkan" + +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "tak diketahui" + +#: ../cli/src/connections.c:1112 +msgid "VPN connecting (prepare)" +msgstr "VPN sedang menyiapkan" + +#: ../cli/src/connections.c:1114 +msgid "VPN connecting (need authentication)" +msgstr "VPN sedang menyambung (perlu otentikasi)" + +#: ../cli/src/connections.c:1116 +msgid "VPN connecting" +msgstr "VPN sedang menyambung" + +#: ../cli/src/connections.c:1118 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN sedang menyambung (sedang mengambil konfigurasi IP)" + +#: ../cli/src/connections.c:1120 +msgid "VPN connected" +msgstr "VPN terhubung" + +#: ../cli/src/connections.c:1122 +msgid "VPN connection failed" +msgstr "Sambungan VPN gagal" + +#: ../cli/src/connections.c:1124 +msgid "VPN disconnected" +msgstr "VPN diputus" + +#: ../cli/src/connections.c:1135 +msgid "unknown reason" +msgstr "alasan tidak diketahui" + +#: ../cli/src/connections.c:1137 +msgid "none" +msgstr "tidak ada" + +#: ../cli/src/connections.c:1139 +msgid "the user was disconnected" +msgstr "pengguna diputus" -#: ../gnome/applet/applet.c:422 -msgid "VPN Login Failure" -msgstr "Kegagalan Login VPN" +#: ../cli/src/connections.c:1141 +msgid "the base network connection was interrupted" +msgstr "koneksi jaringan dasar terputus" -#: ../gnome/applet/applet.c:423 +#: ../cli/src/connections.c:1143 +msgid "the VPN service stopped unexpectedly" +msgstr "layanan VPN berhenti secara tak terduga" + +#: ../cli/src/connections.c:1145 +msgid "the VPN service returned invalid configuration" +msgstr "layanan VPN mengembalikan konfigurasi yang tak valid" + +#: ../cli/src/connections.c:1147 +msgid "the connection attempt timed out" +msgstr "usaha koneksi kehabisan waktu" + +#: ../cli/src/connections.c:1149 +msgid "the VPN service did not start in time" +msgstr "layanan VPN tak mulai pada waktunya" + +#: ../cli/src/connections.c:1151 +msgid "the VPN service failed to start" +msgstr "layanan VPN gagal dimulai" + +#: ../cli/src/connections.c:1153 +msgid "no valid VPN secrets" +msgstr "tak ada rahasia VPN yang valid" + +#: ../cli/src/connections.c:1155 +msgid "invalid VPN secrets" +msgstr "rahasia VPN tak valid" + +#: ../cli/src/connections.c:1157 +msgid "the connection was removed" +msgstr "koneksi dihapus" + +#: ../cli/src/connections.c:1171 #, 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." +msgid "state: %s\n" +msgstr "keadaan: %s\n" -#: ../gnome/applet/applet.c:427 -msgid "VPN Start Failure" -msgstr "Kegagalan Memulai VPN" +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 +#, c-format +msgid "Connection activated\n" +msgstr "Koneksi diaktifkan\n" -#: ../gnome/applet/applet.c:428 +#: ../cli/src/connections.c:1177 #, 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." +msgid "Error: Connection activation failed." +msgstr "Galat: Aktivasi koneksi gagal." -#: ../gnome/applet/applet.c:432 ../gnome/applet/applet.c:442 -msgid "VPN Connect Failure" -msgstr "Kegagalan Koneksi VPN" +#: ../cli/src/connections.c:1196 +#, c-format +msgid "state: %s (%d)\n" +msgstr "keadaan: %s (%d)\n" -#: ../gnome/applet/applet.c:433 +#: ../cli/src/connections.c:1206 #, 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." +msgid "Error: Connection activation failed: %s." +msgstr "Galat: Aktivasi koneksi gagal: %s." -#: ../gnome/applet/applet.c:437 -msgid "VPN Configuration Error" -msgstr "Kesalahan Konfigurasi VPN" +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Galat: Timeout %d detik telah berlalu." -#: ../gnome/applet/applet.c:438 +#: ../cli/src/connections.c:1266 #, c-format -msgid "The VPN connection '%s' was not correctly configured." -msgstr "Koneksi VPN '%s' tidak dikonfigurasi dengan benar." +msgid "Error: Connection activation failed: %s" +msgstr "Galat: Aktivasi koneksi gagal: %s" -#: ../gnome/applet/applet.c:443 +#: ../cli/src/connections.c:1280 #, 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." +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Galat: Memperoleh koneksi aktif bagi '%s' gagal." -#: ../gnome/applet/applet.c:513 -msgid "VPN Login Message" -msgstr "Pesan Login VPN" +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Keadaan koneksi aktif: %s\n" -#: ../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)." +#: ../cli/src/connections.c:1290 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Path koneksi aktif: %s\n" -#: ../gnome/applet/applet.c:749 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung pelarikan nirkabel." +msgid "Error: Unknown connection: %s." +msgstr "Galat: Koneksi tak dikenal: %s." -#: ../gnome/applet/applet.c:757 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung deteksi link." +msgid "Error: timeout value '%s' is not valid." +msgstr "Galat: nilai timeout '%s' tak valid." -#: ../gnome/applet/applet.c:903 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format -msgid "Preparing device %s for the wired network..." -msgstr "Sedang menyiapkan perangkat %s untuk jaringan berkabel..." +msgid "Error: id or uuid has to be specified." +msgstr "Galat: id atau uuid mesti dinyatakan." -#: ../gnome/applet/applet.c:905 +#: ../cli/src/connections.c:1412 #, c-format -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "Menyiapkan perangkat %s untuk jaringan nirkabel '%s'..." +msgid "Error: No suitable device found: %s." +msgstr "Galat: tak ditemukan perangkat yang cocok: %s." -#: ../gnome/applet/applet.c:913 +#: ../cli/src/connections.c:1414 #, c-format -msgid "Configuring device %s for the wired network..." -msgstr "Mengkonfigur perangkat %s untuk jaringan berkabel..." +msgid "Error: No suitable device found." +msgstr "Galat: tak ditemukan perangkat yang cocok." -#: ../gnome/applet/applet.c:915 +#: ../cli/src/connections.c:1509 #, c-format -msgid "Attempting to join the wireless network '%s'..." -msgstr "Sedang berupaya bergabung ke jaringan nirkabel '%s'..." +msgid "Warning: Connection not active\n" +msgstr "Peringatan: Sambungan tak aktif\n" -#: ../gnome/applet/applet.c:923 +#: ../cli/src/connections.c:1566 #, c-format -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "Menunggu Kunci Jaringan untuk jaringan nirkabel '%s'..." +msgid "Error: 'con' command '%s' is not valid." +msgstr "Galat: 'con' perintah '%s' tak valid." -#: ../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..." +#: ../cli/src/connections.c:1602 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Galat: tak bisa menyambung ke D-Bus." -#: ../gnome/applet/applet.c:933 ../gnome/applet/applet.c:943 +#: ../cli/src/connections.c:1609 #, c-format -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "Meminta sebuah alamat jaringan dari jaringan nirkabel '%s'..." +msgid "Error: Could not get system settings." +msgstr "Galat: Tak bisa memperoleh tatanan sistem." -#: ../gnome/applet/applet.c:951 -msgid "Finishing connection to the wired network..." -msgstr "Menyelesaikan koneksi ke jaringan berkabel..." +#: ../cli/src/connections.c:1617 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Galat: Tak bisa memperoleh tatanan pengguna." -#: ../gnome/applet/applet.c:953 +#: ../cli/src/connections.c:1627 #, c-format -msgid "Finishing connection to the wireless network '%s'..." -msgstr "Mengakhiri koneksi ke jaringan nirkabel '%s'..." +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Galat: Tak bisa mendapat koneksi: layanan penataan tak berjalan." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr " WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr " WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface <iface>]\n" +" disconnect iface <iface> [--nowait] [--timeout <timeout>]\n" +" wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" +"\n" +msgstr "" +"Cara pakai: nmcli dev { PERINTAH | help }\n" +"\n" +" PERINTAH := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface <iface>]\n" +" disconnect iface <iface> [--nowait] [--timeout <timeout>]\n" +" wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "tak dikelola" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "tak tersedia" -#: ../gnome/applet/applet.c:1070 -msgid "NetworkManager is not running" -msgstr "NetworkManager tidak sedang jalan" +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "terputus" -#: ../gnome/applet/applet.c:1078 ../gnome/applet/applet.c:1864 -msgid "Networking disabled" -msgstr "Fungsi jaringan dimatikan" +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "sedang menyambung (bersiap)" -#: ../gnome/applet/applet.c:1083 -msgid "No network connection" -msgstr "Tidak ada koneksi jaringan" +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "sedang menyambung (sedang menata)" -#: ../gnome/applet/applet.c:1088 -msgid "Manual network configuration" -msgstr "Konfigurasi jaringan manual" +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "sedang menyambung (perlu otentikasi)" -#: ../gnome/applet/applet.c:1090 -msgid "Wired network connection" -msgstr "Koneksi jaringan berkabel" +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "sedang menyambung (sedang mengambil konfigurasi IP)" -#: ../gnome/applet/applet.c:1094 -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Telah tersambung ke jaringan nirkabel Ad-Hoc" +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "terhubung" -#: ../gnome/applet/applet.c:1096 +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "koneksi gagal" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Tak dikenal" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(tidak ada)" + +#: ../cli/src/devices.c:324 #, c-format -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "Koneksi jaringan nirkabel ke '%s' (%d%%)" +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: galat mengubah alamat IP4 0x%X" -#: ../gnome/applet/applet.c:1117 +#: ../cli/src/devices.c:393 #, c-format -msgid "VPN connection to '%s'" -msgstr "Koneksi VPN ke '%s'" +msgid "%u MHz" +msgstr "%u MHz" -#: ../gnome/applet/applet.c:1125 +#: ../cli/src/devices.c:394 #, c-format -msgid "VPN connecting to '%s'" -msgstr "Sedang menyambung VPN ke '%s\"" +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../gnome/applet/applet.c:1555 -msgid "_Connect to Other Wireless Network..." -msgstr "Sambung ke Jaringan Nirkabel Lain..." +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Terenkripsi:" -#: ../gnome/applet/applet.c:1576 -msgid "Create _New Wireless Network..." -msgstr "Buat Jaringan Nirkabel Baru" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../gnome/applet/applet.c:1695 -msgid "_Manual configuration..." -msgstr "Konfigurasi manual..." +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " -#: ../gnome/applet/applet.c:1718 -msgid "_VPN Connections" -msgstr "Sambungan VPN" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../gnome/applet/applet.c:1763 -msgid "_Configure VPN..." -msgstr "Mengkonfigur VPN..." +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Enterprise " -#: ../gnome/applet/applet.c:1767 -msgid "_Disconnect VPN..." -msgstr "Memutus VPN..." +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../gnome/applet/applet.c:1789 -msgid "_Dial Up Connections" -msgstr "Koneksi Dial Up" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktur" -#: ../gnome/applet/applet.c:1800 +#: ../cli/src/devices.c:486 #, c-format -msgid "Connect to %s..." -msgstr "Menyambung ke %s..." +msgid "Error: 'dev list': %s" +msgstr "Galat: 'dev list': %s" -#: ../gnome/applet/applet.c:1806 +#: ../cli/src/devices.c:488 #, c-format -msgid "Disconnect from %s..." -msgstr "Memutus dari %s..." +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Galat: 'dev list': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/applet.c:1856 -msgid "No network devices have been found" -msgstr "Tidak menemukan perangkat jaringan" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Rincian perangkat" -#: ../gnome/applet/applet.c:2051 -msgid "NetworkManager is not running..." -msgstr "NetworkManager tidak sedang jalan..." +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(tak diketahui)" -#: ../gnome/applet/applet.c:2208 -msgid "Enable _Networking" -msgstr "Fungsikan Jaringan" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "tak diketahui)" -#: ../gnome/applet/applet.c:2214 -msgid "Enable _Wireless" -msgstr "Fungsikan Nirkabel" +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../gnome/applet/applet.c:2220 -msgid "Connection _Information" -msgstr "Informasi Koneksi" +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "nyala" -#: ../gnome/applet/applet.c:2231 -msgid "_Help" -msgstr "Bantuan" +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "mati" -#: ../gnome/applet/applet.c:2240 -msgid "_About" -msgstr "_Ihwal" +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Galat: 'dev status': %s" -#: ../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" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Galat: 'dev status': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/wireless-security-option.c:157 -msgid "Open System" -msgstr "Sistem Terbuka" +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Status perangkat" -#: ../gnome/applet/wireless-security-option.c:160 -msgid "Shared Key" -msgstr "Kunci Bersama" +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Galat: argumen '%s' hilang." -#: ../gnome/applet/wireless-security-option.c:208 -msgid "Automatic (Default)" -msgstr "Otomatis (Default)" +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Galat: Perangkat '%s' tak ditemukan." -#: ../gnome/applet/wireless-security-option.c:215 -msgid "AES-CCMP" -msgstr "AES-CCMP" +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Sukses: Perangkat '%s' diputus dengan sukses." -#: ../gnome/applet/wireless-security-option.c:223 -msgid "TKIP" -msgstr "TKIP" +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Galat: Pemutusan perangkat '%s' (%s) gagal: %s " -#: ../gnome/applet/wireless-security-option.c:231 -msgid "Dynamic WEP" -msgstr "WEP Dinamis" +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Keadaan perangkat: %d (%s)\n" -#: ../gnome/applet/wso-none.c:53 -msgid "None" -msgstr "Tak Ada" +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Galat: iface mesti dinyatakan." -#: ../gnome/applet/wso-wep-ascii.c:138 -msgid "WEP 64/128-bit ASCII" -msgstr "WEP ASCII 64/128-bit" +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Galat: 'dev wifi': %s" -#: ../gnome/applet/wso-wep-hex.c:135 -msgid "WEP 64/128-bit Hex" -msgstr "WEP Hex 64/128-bit" +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Galat: 'dev wifi': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/wso-wep-passphrase.c:135 -msgid "WEP 128-bit Passphrase" -msgstr "Frasa-kunci WEP 128-bit" +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Daftar pindai WiFi" -#: ../gnome/applet/wso-wpa-eap.c:237 -msgid "PEAP" -msgstr "PEAP" +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Galat: Access point dengan hwaddr '%s' tak ditemukan." -#: ../gnome/applet/wso-wpa-eap.c:238 -msgid "TLS" -msgstr "TLS" +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Galat: Perangkat '%s' bukan perangkat WiFi." -#: ../gnome/applet/wso-wpa-eap.c:239 -msgid "TTLS" -msgstr "TTLS" +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Galat: 'dev wifi' perintah '%s' tak valid." -#: ../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" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Galat: 'dev' perintah '%s' tak valid." + +#: ../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 "" +"Cara pakai: nmcli nm { PERINTAH | help }\n" +"\n" +" PERINTAH := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" -#: ../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" +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "mengantuk" -#: ../gnome/applet/wso-wpa-psk.c:178 -msgid "WPA2 Personal" -msgstr "WPA2 Personal" +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "menyambung" -#: ../gnome/applet/wso-wpa-psk.c:180 -msgid "WPA Personal" -msgstr "WPA Personal" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Galat: 'nm status': %s" -#: ../gnome/applet/eggtrayicon.c:134 -msgid "Orientation" -msgstr "Orientasi" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Galat: 'nm status': %s; ruas yang diijinkan: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Status 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 "diaktifkan" + +#: ../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 "dimatikan" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "berjalan" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "tak berjalan" + +#: ../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 "Galat: nilai '--fields' '%s' tak valid disini; ruas yang diijinkan: %s" -#: ../gnome/applet/eggtrayicon.c:135 -msgid "The orientation of the tray." -msgstr "Orientasi dari tray" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi diaktifkan" -#: ../gnome/applet/menu-items.c:88 +#: ../cli/src/network-manager.c:220 #, c-format -msgid "Wired Network (%s)" -msgstr "Jaringan Berkabel (%s)" +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Galat: parameter 'wifi' tak valid: '%s'." -#: ../gnome/applet/menu-items.c:91 -msgid "_Wired Network" -msgstr "Jaringan Berkabel" +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN diaktifkan" -#: ../gnome/applet/menu-items.c:162 +#: ../cli/src/network-manager.c:252 #, c-format -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "Jaringan Nirkabel (%s)" +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Galat: parameter 'wwan' tak valid: '%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)" +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Galat: 'nm' perintah '%s' tak valid." -#: ../gnome/applet/other-network-dialog.c:352 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" -"By default, the wireless network's name is set to your computer's name, %s, " -"with no encryption enabled" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] <field1,field2,...>|all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -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 "" -"Secara default, nama jaringan nirkabel disamakan dengan nama komputer anda, " -"%s, tanpa enkripsi" +"Cara pakai: %s [OPSI] OBJEK { PERINTAH | help }\n" +"\n" +"OPSI\n" +" -t[erse] keluaran terinci\n" +" -p[retty] keluaran rapi\n" +" -m[ode] tabular|multiline mode keluaran\n" +" -f[ields] <field1,field2,...>|all|common nyatakan ruas yang ditampilkan\n" +" -e[scape] yes|no pemisah kolom escape di nilai\n" +" -v[ersion] tampilkan versi program\n" +" -h[elp] cetak bantuan ini\n" +"\n" +"OBJEK\n" +" nm status NetworkManager\n" +" con sambungan NetworkManager\n" +" dev perangkat yang dikelola oleh NetworkManager\n" +"\n" -#: ../gnome/applet/other-network-dialog.c:358 -msgid "Create new wireless network" -msgstr "Buat jaringan nirkabel baru" +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Galat: Objek '%s' tak dikenal, coba 'nmcli help'." -#: ../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." +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Galat: Opsi '--terse' dinyatakan kedua kali." -#: ../gnome/applet/other-network-dialog.c:363 -msgid "Create New Wireless Network" -msgstr "Buat Jaringan Nirkabel Baru" +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Galat: Opsi '--terse' eksklusif mutual dengan '--pretty'." -#: ../gnome/applet/other-network-dialog.c:368 -msgid "Existing wireless network" -msgstr "Jaringan nirkabel yang telah ada" +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Galat: Opsi '--pretty' dinyatakan kedua kali." -#: ../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." +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Galat: Opsi '--pretty' eksklusif mutual dengan '--terse'." -#: ../gnome/applet/other-network-dialog.c:371 -msgid "Connect to Other Wireless Network" -msgstr "Menyambung ke Jaringan Nirkabel Lain" +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Galat: argumen hilang bagi opsi '%s'." -#: ../gnome/applet/passphrase-dialog.c:215 -msgid "Error connecting to wireless network" -msgstr "Kesalahan menyambung ke jaringan nirkabel" +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Galat: '%s' bukan argumen yang valid bagi opsi '%s'." -#: ../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." +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Galat: ruas bagi opsi '%s' hilang." -#: ../gnome/applet/vpn-password-dialog.c:151 -#: ../gnome/applet/vpn-password-dialog.c:188 +#: ../cli/src/nmcli.c:209 #, c-format -msgid "Cannot start VPN connection '%s'" -msgstr "Tidak dapat memulai sambungan VPN '%s'" +msgid "nmcli tool, version %s\n" +msgstr "alat nmcli, versi %s\n" -#: ../gnome/applet/vpn-password-dialog.c:154 +#: ../cli/src/nmcli.c:215 #, 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." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Galat: Opsi '%s' tak dikenal, coba 'nmcli -help'." -#: ../gnome/applet/vpn-password-dialog.c:191 +#: ../cli/src/nmcli.c:234 #, 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." +msgid "Caught signal %d, shutting down..." +msgstr "Menangkap sinyal %d, sedang mematikan..." -#: ../gnome/applet/applet.glade.h:1 -msgid " " -msgstr " " +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Galat: Tak bisa menyambung ke NetworkManager." -#: ../gnome/applet/applet.glade.h:2 -msgid "" -"<span weight=\"bold\" size=\"larger\">Active Connection Information</span>" -msgstr "" -"<span weight=\"bold\" size=\"larger\">Informasi Sambungan Aktif</span>" +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Sukses" -#: ../gnome/applet/applet.glade.h:4 -#, no-c-format -msgid "" -"<span weight=\"bold\" size=\"larger\">Passphrase Required by Wireless " -"Network</span>\n" -"\n" -"A passphrase or encryption key is required to access the wireless network " -"'%s'." -msgstr "" -"<span weight=\"bold\" size=\"larger\">Frasa-kunci Diperlukan oleh Jaringan " -"Nirkabel</span>" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (kunci-hex-ascii)" -#: ../gnome/applet/applet.glade.h:8 -#, no-c-format -msgid "" -"<span weight=\"bold\" size=\"larger\">Reduced Network Functionality</span>\n" -"\n" -"%s It will not be completely functional." -msgstr "" -"<span weight=\"bold\" size=\"larger\">Fungsionalitas Jaringan yang " -"Dikurangi</span>\n" -"\n" -"%s Ini tidak akan fungsional secara lengkap." +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit frasa sandi)" -#: ../gnome/applet/applet.glade.h:12 -#, no-c-format -msgid "" -"<span weight=\"bold\" size=\"larger\">Wireless Network Login " -"Confirmation</span>\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 "" -"<span weight=\"bold\" size=\"larger\">Konfirmasi Login Jaringan " -"Nirkabel</span>\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." +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (tak dikenal)" -#: ../gnome/applet/applet.glade.h:15 -msgid "Anonymous Identity:" -msgstr "Identitas Anonim:" +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (tak dikenal)" -#: ../gnome/applet/applet.glade.h:16 -msgid "Authentication:" -msgstr "Autentikasi:" +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "sebarang, " -#: ../gnome/applet/applet.glade.h:17 -msgid "Broadcast Address:" -msgstr "Alamat Broadcast:" +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " -#: ../gnome/applet/applet.glade.h:18 -msgid "CA Certificate File:" -msgstr "Berkas Sertifikat CA:" +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " -#: ../gnome/applet/applet.glade.h:19 -msgid "C_onnect" -msgstr "Sambung" +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " -#: ../gnome/applet/applet.glade.h:20 -msgid "Client Certificate File:" -msgstr "Berkas Sertifikat Klien:" +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " -#: ../gnome/applet/applet.glade.h:21 -msgid "Connection Information" -msgstr "Informasi Koneksi" +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../gnome/applet/applet.glade.h:22 -msgid "Default Route:" -msgstr "Route Default:" +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../gnome/applet/applet.glade.h:23 -msgid "Destination Address:" -msgstr "Alamat Tujuan:" +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../gnome/applet/applet.glade.h:24 -msgid "Driver:" -msgstr "Driver:" +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../gnome/applet/applet.glade.h:25 -msgid "EAP Method:" -msgstr "Metoda EAP:" +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../gnome/applet/applet.glade.h:26 -msgid "Hardware Address:" -msgstr "Alamat Perangkat Keras:" +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../gnome/applet/applet.glade.h:27 -msgid "IP Address:" -msgstr "Alamat IP:" +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../gnome/applet/applet.glade.h:28 -msgid "Identity:" -msgstr "Identitas:" +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "otomatis" -#: ../gnome/applet/applet.glade.h:29 -msgid "Interface:" -msgstr "Antarmuka:" +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "tak ditata" -#: ../gnome/applet/applet.glade.h:30 -msgid "Key Type:" -msgstr "Tipe Kunci:" +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ruas '%s' mesti sendiri" -#: ../gnome/applet/applet.glade.h:31 -msgid "Key:" -msgstr "Kunci:" +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ruas tak valid '%s'" -#: ../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" +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opsi '--terse' memerlukan penyataan '--fields'" -#: ../gnome/applet/applet.glade.h:37 -msgid "" -"Open System\n" -"Shared Key" -msgstr "" -"Sistem Terbuka\n" -"Kunci Bersama" +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opsi '--terse' memerlukan nilai opsi '--fields' spesifik, bukan '%s'" -#: ../gnome/applet/applet.glade.h:39 -msgid "Other Wireless Network..." -msgstr "Jaringan Nirkabel Lain..." +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Berkas kunci PEM tak memiliki tag akhir '%s'." -#: ../gnome/applet/applet.glade.h:40 -msgid "Passphrase:" -msgstr "Frasa-kunci:" +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Tak seperti sebuah berkas kunci privat PEM." -#: ../gnome/applet/applet.glade.h:41 -msgid "Password:" -msgstr "Kata sandi:" +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Tak cukup memori untuk menyimpan data berkas PEM." -#: ../gnome/applet/applet.glade.h:42 -msgid "Primary DNS:" -msgstr "DNS Utama:" +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Berkas PEM rusak: Proc-Type bukan tag pertama." -#: ../gnome/applet/applet.glade.h:43 -msgid "Private Key File:" -msgstr "Berkas Kunci Privat:" +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Berkas PEM rusak: tag Proc-Type tak dikenal '%s'." -#: ../gnome/applet/applet.glade.h:44 -msgid "Private Key Password:" -msgstr "Kata sandi Kunci Privat:" +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Berkas PEM rusak: DEK-Info bukan tag kedua." -#: ../gnome/applet/applet.glade.h:45 -msgid "Secondary DNS:" -msgstr "DNS Sekunder" +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Berkas PEM rusak: tak ditemukan IV di tag DEK-Info." -#: ../gnome/applet/applet.glade.h:46 -msgid "Select the CA Certificate File" -msgstr "Pilih Berkas Sertifikat CA" +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Berkas PEM rusak: bentuk IV tak valid di tag DEK-Info." -#: ../gnome/applet/applet.glade.h:47 -msgid "Select the Client Certificate File" -msgstr "Pilih Berkas Sertifikat Klien" +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Berkas PEM rusak: cipher kunci privat '%s' tak dikenal." -#: ../gnome/applet/applet.glade.h:48 -msgid "Select the Private Key File" -msgstr "Pilih Berkas Kunci Privat" +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Tak bisa mengawa kode (decode) kunci privat." -#: ../gnome/applet/applet.glade.h:49 -msgid "Show key" -msgstr "Tampilkan Kunci" +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Sertifikat PEM '%s' tak memiliki tag akhir '%s'." -#: ../gnome/applet/applet.glade.h:50 -msgid "Show passphrase" -msgstr "Tampilkan frasa-kunci" +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Gagal mengawa kode (decode) sertifikat." -#: ../gnome/applet/applet.glade.h:51 -msgid "Show password" -msgstr "Tampilkan kata sandi" +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Tak cukup memori untuk menyimpan data sertifikat." -#: ../gnome/applet/applet.glade.h:52 -msgid "Show passwords" -msgstr "Tampilkan kata sandi" +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Tak cukup memori untuk menyimpan data berkas." -#: ../gnome/applet/applet.glade.h:53 -msgid "Speed:" -msgstr "Kecepatan:" +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Panjang IV dalam byte mesti merupakan bilangan genap." -#: ../gnome/applet/applet.glade.h:54 -msgid "Subnet Mask:" -msgstr "Mask Subnet:" +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Tak cukup memori untuk menyimpan IV." -#: ../gnome/applet/applet.glade.h:55 -msgid "Type:" -msgstr "Tipe:" +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV memuat digit bukan heksadesimal." -#: ../gnome/applet/applet.glade.h:56 -msgid "User Name:" -msgstr "Nama Pemakai:" +#: ../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 kunci privat '%s' tak dikenal." -#: ../gnome/applet/applet.glade.h:57 -msgid "Wireless Network Key Required" -msgstr "Kunci Jaringan Nirkabel Dibutuhkan" +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Tak cukup memori untuk mengawa sandi (decrypt) kunci privat." -#: ../gnome/applet/applet.glade.h:58 -msgid "Wireless _adapter:" -msgstr "Adaptor Nirkabel:" +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Tak bisa menentukan jenis kunci privat." -#: ../gnome/applet/applet.glade.h:59 -msgid "_Always Trust this Wireless Network" -msgstr "Selalu Percayai Jaringan Nirkabel ini" +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" +"Tak cukup memori untuk menyimpan kunci privat terawa sandi (decrypted)." -#: ../gnome/applet/applet.glade.h:60 -msgid "_Don't remind me again" -msgstr "Jangan mengingatkan saya lagi" +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Gagal menginisialisasi mesin kripto." -#: ../gnome/applet/applet.glade.h:61 -msgid "_Login to Network" -msgstr "_Login ke Jaringan" +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Gagal menginisialisasi mesin MD5: %s / %s." -#: ../gnome/applet/applet.glade.h:62 -msgid "_Network Name:" -msgstr "_Nama Jarigan:" +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Panjang IV tak valid (mesti paling tidak %zd)." -#: ../gnome/applet/applet.glade.h:63 -msgid "_Wireless Security:" -msgstr "Keamanan Nirkabel:" +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Tak cukup memori untuk penyangga kunci terawa sandi (decrypted)." -#: ../gnome/vpn-properties/nm-vpn-properties.c:383 -msgid "Cannot add VPN connection" -msgstr "Tidak dapat menambah koneksi VPN" +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" +"Gagal menginisialisasi konteks cipher pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:385 -msgid "" -"No suitable VPN software was found on your system. Contact your system " -"administrator." +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" -"Tidak ada perangkat lunak VPN yang sesuai yang dapat ditemukan di sistem " -"anda. Hubungi administrator sistem anda." +"Gagal menata kunci simetrik untuk pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:437 -msgid "Cannot import VPN connection" -msgstr "Tidak dapat meng-impor koneksi VPN" +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Gagal menata IV untuk pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:439 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format -msgid "" -"Cannot find suitable software for VPN connection type '%s' to import the " -"file '%s'. Contact your system administrator." +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Gagal mengawa sandi (decrypt) kunci privat: %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 "" -"Tidak dapat menemukan perangkat lunak untuk koneksi VPN tipe '%s' untuk meng-" -"impor berkas '%s'. Hubungi administrator sistem anda." +"Gagal mengawa sandi (decrypt) kunci privat: panjang padding tak diharapkan." -#: ../gnome/vpn-properties/nm-vpn-properties.c:579 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format -msgid "Error retrieving VPN connection '%s'" -msgstr "Kesalahan dalam mengambil koneksi VPN '%s'" +msgid "Failed to decrypt the private key." +msgstr "Gagal mengawa sandi (decrypt) kunci privat." -#: ../gnome/vpn-properties/nm-vpn-properties.c:582 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, 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." +msgid "Could not allocate memory for encrypting." +msgstr "Tak bisa mengalokasikan memori untuk menyandi." -#: ../gnome/vpn-properties/nm-vpn-properties.c:739 +#: ../libnm-util/crypto_gnutls.c:294 #, c-format -msgid "Delete VPN connection \"%s\"?" -msgstr "Hapus koneksi VPN \"%s\"?" +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Gagal menginisialisasi konteks cipher penyandian: %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:742 +#: ../libnm-util/crypto_gnutls.c:303 #, 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." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Gagal menata kunci simetrik untuk penyandian: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Gagal menata IV untuk penyandian: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Gagal menyandi data: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Gagal menginisialisasi data sertifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Tak bisa mengawa kode (decode) sertifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Tak bisa menginisialisasi pengawa kode (decoder) PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Tak bisa mengawa kode (decode) berkas PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Tak bisa memeriksa berkas PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Gagal menginisialisasi mesin kripto: %d" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Gagal menginisialisasi konteks MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Panjang IV tak valid (mesti paling tidak %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Gagal menginisialisasi slot cipher pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Gagal menata kunci simetrik untuk pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Gagal menata IV untuk pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Gagal menginisialisasi konteks pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Gagal mengawa sandi (decrypt) kunci privat: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." msgstr "" -"Semua informasi tentang koneksi VPN \"%s\" akan hilang dan anda mungkin " -"memerlukan administrator sistem anda untuk mendapatkan informasi untuk " -"membuat koneksi baru." +"Gagal mengawa sandi (decrypt) kunci privat: data terawa sandi terlalu besar." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Gagal memfinalisasi pengawasandian (decryption) kunci privat: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Gagal menginisialisasi slot cipher penyandian." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Gagal menata kunci simetrik untuk penyandian." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Gagal menata IV untuk penyandian." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Gagal menginisialisasi konteks penyandian." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Gagal mengawasandi: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Banyaknya data tak terduga setelah penyandian." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Tak bisa mengawa kode (decode) sertifikat: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Tak bisa mengubah kata sandi ke UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Tak bisa menginisialisasi pengawa kode (decoder) PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Tak bisa mengawa kode (decode) berkas PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Tak bisa memeriksa berkas PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Tak bisa menjangkitkan data acak." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Tak cukup memori untuk membuat kunci penyandian." + +#: ../libnm-util/nm-utils.c:2085 +msgid "Could not allocate memory for PEM file creation." +msgstr "Tak bisa mengalokasikan memori bagi pembuatan berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:959 -msgid "Unable to load" -msgstr "Tidak dapat memuat" +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Tak bisa mengalokasikan memori untuk menulis IV ke berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:961 -msgid "Cannot find some needed resources (the glade file)!" +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"Tidak dapat menemukan beberapa sumberdaya yang diperlukan (berkas glade)!" +"Tak bisa mengalokasikan memori untuk menulis kunci tersandi ke berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:1071 -msgid "Edit VPN Connection" -msgstr "Sunting Koneksi VPN" +#: ../libnm-util/nm-utils.c:2128 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Tak bisa mengalokasikan memori bagi data berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 -msgid "Add a new VPN connection" -msgstr "Tambah koneksi VPN baru" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Berbagi koneksi melalui jaringan WiFi terlindung." -#: ../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" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Berbagi koneksi melalui jaringan WiFi terbuka" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 -msgid "Connect to:" -msgstr "Menyambung ke:" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Ubah nama host sistem yang persisten" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 -msgid "Create VPN Connection" -msgstr "Buat Koneksi VPN" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Ubah koneksi sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 -msgid "Create VPN Connection - 1 of 2" -msgstr "Buat Koneksi VPN - 1 dari 2" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Kebijakan sistem mencegah pengubahan tatanan sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 -msgid "Create VPN Connection - 2 of 2" -msgstr "Buat Koneksi VPN - 2 dari 2" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Kebijakan sistem mencegah pengubahan nama host yang persisten" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 -msgid "Delete the selected VPN connection" -msgstr "Hapus koneksi VPN yang dipilih" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Kebijakan sistem mencegah berbagi sambungan melalui jaringan WiFi terlindung" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 -msgid "E_xport" -msgstr "Ekspor" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Kebijakan sistem mencegah berbagi sambungan melalui jaringan WiFi terbuka" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 -msgid "Edit the selected VPN connection" -msgstr "Sunting koneksi VPN yang dipilih" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Ijinkan pengendalian sambungan jaringan" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 -msgid "Export the VPN settings to a file" -msgstr "Ekspor pengaturan VPN ke sebuah berkas" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Ijinkan penggunaan sambungan spesifik-pengguna" -#: ../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" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Aktifkan atau matikan perangkat WiFi" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 -msgid "Finish Creating VPN Connection" -msgstr "Mengakhiri Pembuatan Koneksi VPN" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Aktifkan atau matikan perangkat broadband bergerak" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 -msgid "Manage Virtual Private Network Connections" -msgstr "Kelola Koneksi Virtual Private Network" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Aktifkan atau matikan jejaring sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 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." +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" 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." +"Tidurkan NetworkManager atau bangunkan (mestinya hanya dipakai oleh " +"manajemen daya sistem)" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 -msgid "VPN Connections" -msgstr "Koneksi VPN" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Kebijakan sistem mencegah pengendalian sambungan jaringan" -#: ../src/nm-ap-security-wep.c:52 -msgid "40-bit WEP" -msgstr "WEP 40-bit" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Kebijakan sistem mencegah mengaktifkan atau mematikan perangkat WiFi" -#: ../src/nm-ap-security-wep.c:54 -msgid "104-bit WEP" -msgstr "WEP 104-bit" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Kebijakan sistem mencegah mengaktifkan atau mematikan perangkat broadband " +"bergerak" -#: ../src/nm-ap-security-wpa-psk.c:50 -msgid "WPA TKIP" -msgstr "WPA TKIP" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Kebijakan sistem mencegah mengaktifkan atau mematikan jejaring sistem" -#: ../src/nm-ap-security-wpa-psk.c:52 -msgid "WPA CCMP" -msgstr "WPA CCMP" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Kebijakan sistem mencegah menidurkan NetworkManager atau membangunkannya" -#: ../src/nm-ap-security-wpa-psk.c:54 -msgid "WPA Automatic" -msgstr "WPA Otomatis" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Kebijakan sistem mencegah penggunaan sambungan spesifik-pengguna" -#: ../src/nm-ap-security-wpa-psk.c:59 -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" +#: ../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 "galat memroses pesan netlink: %s" -#: ../src/nm-ap-security-wpa-psk.c:61 -msgid "WPA2 CCMP" -msgstr "WPA2 CCMP" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "galat terjadi ketika menunggu data pada soket" -#: ../src/nm-ap-security-wpa-psk.c:63 -msgid "WPA2 Automatic" -msgstr "WPA2 Otomatis" +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "tak bisa menyambung ke netlink untuk pemantauan status sambungan: %s" -#: ../src/nm-ap-security.c:321 -msgid "none" -msgstr "tidak ada" +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "tak bisa mengaktifkan penyampaian kredensial handle netlink: %s" -#: ../src/nm-netlink-monitor.c:163 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, 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 "" -"tidak dapat membuat soket netlink untuk mengamati perangkat ethernet - %s" +"tak bisa mengalokasikan handle netlink untuk pemantauan status sambungan: %s" -#: ../src/nm-netlink-monitor.c:181 +#: ../src/nm-netlink-monitor.c:376 #, c-format -msgid "" -"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" -"tidak dapat mem-bind ke soket netlink untuk mengamati perangkat ethernet - %s" +"tak bisa mengalokasikan singgahan sambungan netlink untuk pemantauan status " +"sambungan: %s" -#: ../src/nm-netlink-monitor.c:414 -msgid "operation took too long" -msgstr "operasi memakan waktu terlalu lama" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "tak bisa bergabung dengan grup netlink: %s" -#: ../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:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "galat memperbarui singgahan sambungan: %s" -#: ../src/nm-netlink-monitor.c:524 -msgid "received data from unexpected sender" -msgstr "menerima data dari pengirim yang tak diharapkan" +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opsi tak valid. Silakan pakai --help untuk melihat daftar opsi yang valid.\n" -#: ../src/nm-netlink-monitor.c:655 -msgid "too much data was sent over socket and some of it was lost" +#: ../src/main.c:573 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Silakan pakai --help untuk melihat daftar opsi yang valid.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +msgid "# Created by NetworkManager\n" +msgstr "# Dibuat oleh NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" msgstr "" -"terlalu banyak data yang telah dikirim lewat soket dan sebagian diantaranya " -"hilang" +"# Digabung dari %s\n" +"\n" -#: ../src/nm-netlink-monitor.c:744 -msgid "error occurred while waiting for data on socket" -msgstr "kesalahan terjadi ketika menunggu data pada soket" +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "tak menemukan klien DHCP yang dapat dipakai." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "'dhclient' dapat ditemukan." -#: ../gnome/applet/applet-dbus-devices.c:898 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "'dhcpd' dapat ditemukan." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Klien DHCP '%s' yang tak didukung" + +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "You are now connected to the Ad-Hoc wireless network '%s'." -msgstr "Anda sekarang terhubung ke jaringan nirkabel Ad-Hoc `%s'." +msgid "Unknown log level '%s'" +msgstr "Aras log tak dikenal '%s'" -#: ../gnome/applet/applet-dbus-devices.c:903 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "You are now connected to the wireless network '%s'." -msgstr "Anda sekarang terhubung ke jaringan nirkabel '%s'." +msgid "Unknown log domain '%s'" +msgstr "Ranah log tak dikenal '%s'" -#: ../gnome/applet/applet-dbus-devices.c:910 -msgid "You are now connected to the wired network." -msgstr "Anda sekarang tersambung ke jaringan berkabel." +#: ../src/named-manager/nm-named-manager.c:384 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "CATATAN: resolver libc mungkin tak mendukung lebih dari 3 nameserver." -#: ../gnome/applet/applet-dbus-devices.c:916 -msgid "Connection Established" -msgstr "Sambungan Terjalin" +#: ../src/named-manager/nm-named-manager.c:386 +msgid "The nameservers listed below may not be recognized." +msgstr "Nameserver yang terdaftar di bawah mungkin tak dikenali." -#: ../gnome/applet/applet-dbus-devices.c:959 -msgid "Disconnected" -msgstr "Terputus" +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Otomatis %s" -#: ../gnome/applet/applet-dbus-devices.c:960 -msgid "The network connection has been disconnected." -msgstr "Koneksi jaringan telah diputus." +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +msgid "System" +msgstr "Sistem" @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.master.or\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-29 15:38+0530\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-10 12:47+0530\n" "Last-Translator: Manoj Kumar Giri <mgiri@redhat.com>\n" "Language-Team: Oriya <Translation-team-or@lists.sourceforge.net>\n" "MIME-Version: 1.0\n" @@ -21,76 +21,76 @@ msgstr "" "\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 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "NAME" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "DEVICES" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "SCOPE" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "DEFAULT" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS-SERVICE" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC-OBJECT" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TYPE" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "TIMESTAMP" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "TIMESTAMP-REAL" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOCONNECT" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "READONLY" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -111,40 +111,40 @@ msgstr "" "<timeout>]\n" " down id <id> | uuid <id>\n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "ତàରàଟି: 'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "ତàରàଟି: 'con list': %s; ଅନàମତିପàରାପàତ କàଷà‡à¬¤àର: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "ସଂଯà‹à¬— ବିବରଣà€" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "ତନàତàର" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "ଚାଳକ" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 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:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 @@ -160,11 +160,11 @@ msgstr "କଦାପି ନàହà¬" 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:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 @@ -180,445 +180,457 @@ msgstr "ହà¬" msgid "no" msgstr "ନାà¬" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "ତନàତàର ସଂଯà‹à¬—ଗàଡ଼ିକ" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 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 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "ତàରàଟି: %s ସàà±à¬¤à¬¨àତàରଚର ଅନàପସàଥିତ ଅଛି।" -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, 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 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "ଅଜଣା ପàରାଚଳ: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, 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 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "ତàରàଟି: %s." -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "ତàରàଟି: 'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "ତàରàଟି: 'con status': %s; ଅନàମତିପàରାପàତ କàଷà‡à¬¤àର: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "ସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬—ଗàଡ଼ିକ" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "ଉପକରଣ '%s' à¬°à‡ à¬•àŒà¬£à¬¸à¬¿ ସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬— ନାହିà¬" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "କàŒà¬£à¬¸à¬¿ ସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬— କିମàବା ଉପକରଣ ନାହିà¬" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "ଉପକରଣ '%s' ସଂଯà‹à¬— '%s' ସହିତ ସàସଙàଗତ ନàହà¬" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "ସଂଯà‹à¬— '%s' ପାଇଠକàŒà¬£à¬¸à¬¿ ଉପକରଣ ମିଳିଲା ନାହିà¬" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "ସକàà¬°à¬¿àŸ à¬•à¬°àଅଛି" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 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/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 #: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ଅଜଣା" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN ସଂଯà‹à¬— କରàଅଛି (ପàରସàତàତ)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN ସଂଯà‹à¬— କରàଅଛି (ବàˆà¬§à¬¿à¬•à¬°à¬£ ଆବଶààŸà¬•)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN ସଂଯà‹à¬— କରàଅଛି" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ସଂଯà‹à¬— କରàଅଛି (IP ସଂରଚନା ଗàରହଣ କରàଅଛି)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN ସଂଯàକàତ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN ସଂଯà‹à¬— ବିଫଳ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN ସଂଯà‹à¬— ବିଚàଛିନàନ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "ଅଜଣା କାରଣ" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "କିଛି ନàହà‡à¬" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "ଚାଳକଟି ସଂଯà‹à¬— ବିଚàଛିନàନ ହà‹à¬‡à¬¥à¬¿à¬²à¬¾" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "ମà‚ଳ ନà‡à¬Ÿà±à¬°àକ ସଂଯà‹à¬—ଟି ବାଧାପàରାପàତ ହà‹à¬‡à¬¥à¬¿à¬²à¬¾" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN ସରàà¬à¬¿à¬¸ ଅପàରତààŸà¬¾à¬¶à¬¿à¬¤ à¬à¬¾à¬¬à¬°à‡ ବନàଦ ହà‹à¬‡à¬¯à¬¾à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN ସରàà¬à¬¿à¬¸ ଅବàˆà¬§ ସଂରଚନା ଫà‡à¬°à¬¾à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "ସଂଯà‹à¬— à¬¸à¬®àŸ à¬¸à¬®à¬¾à¬ªàତ ପାଇଠଚà‡à¬·àଟାକରିଛି" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN ସରàà¬à¬¿à¬¸ ଠିକ ସମàŸà¬°à‡ ଆରମàଠହà‹à¬‡à¬¨à¬¥à¬¿à¬²à¬¾" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN ସରàà¬à¬¿à¬¸ ଆରମàଠହà‡à¬¬à¬¾à¬°à‡ ବିଫଳ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "କàŒà¬£à¬¸à¬¿ ବàˆà¬§ VPN ଗàପàତ ତଥààŸ à¬¨à¬¾à¬¹à¬¿à¬" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "ଅବàˆà¬§ VPN ଗàପàତ ତଥààŸà¬—àଡ଼ିକ" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "ସଂଯà‹à¬—କà କଢ଼ାଯାଇଛି" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "ଅବସàଥା: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "ସଂଯà‹à¬— ସକàà¬°à¬¿àŸ à¬¹à‹à¬‡à¬›à¬¿\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "ତàରàଟି: ସଂଯà‹à¬— ସକàରିàŸà¬£ ବିଫଳ ହà‹à¬‡à¬›à¬¿à¥¤" -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "ଅବସàଥା: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ତàରàଟି: ସଂଯà‹à¬— ସକàରିàŸà¬£ ବିଫଳ ହà‹à¬‡à¬›à¬¿: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ତàରàଟି: à¬¸à¬®àŸ à¬¸à¬®à¬¾à¬ªàତ %d ସà‡à¬•à¬£àଡ ବିତିଯାଇଛି।" -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ତàରàଟି: ସଂଯà‹à¬— ସକàରିàŸà¬£ ବିଫଳ ହà‹à¬‡à¬›à¬¿: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "ତàରàଟି: '%s' ପାଇଠସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬— ଧାରଣ à¬•à¬°à¬¿à¬¬à¬¾à¬°à‡ à¬¬à¬¿à¬«à¬³ ହà‹à¬‡à¬›à¬¿à¥¤" -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "ସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬— ଅବସàଥା: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "ସକàà¬°à¬¿àŸ à¬¸à¬‚à¬¯à‹à¬— ପଥ: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "ତàରàଟି: ଅଜଣା ସଂଯà‹à¬—: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ତàରàଟି: à¬¸à¬®àŸ à¬¸à¬®à¬¾à¬ªàତ ମà‚ଲààŸ '%s' ଟି ବàˆà¬§ ନàହà¬à¥¤" -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ତàରàଟି: id କିମàବା uuid କà ଉଲàଲà‡à¬– କରିବା ଉଚିତ।" -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "ତàରàଟି: କàŒà¬£à¬¸à¬¿ ଉପଯàକàତ ଉପକରଣ ମିଳିଲାନାହିà¬: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "ତàରàଟି: କàŒà¬£à¬¸à¬¿ ଉପଯàକàତ ଉପକରଣ ମିଳିଲାନାହିà¬à¥¤" -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "ଚà‡à¬¤à¬¾à¬¬à¬¨à€: ସଂଯà‹à¬— ସକàà¬°à¬¿àŸ à¬¨àହà¬\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ତàରàଟି: 'con' ନିରàଦàଦà‡à¬¶ '%s' ଟି ବàˆà¬§ ନàହà¬à¥¤" -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ତàରàଟି: D-Bus ସହିତ ସଂଯàକàତ ହà‹à¬‡à¬ªà¬¾à¬°à¬¿à¬²à¬¾ ନାହିà¬à¥¤" -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "ତàରàଟି: ତନàତàର ସଂରଚନା ପାଇଲା ନାହିà¬à¥¤" -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "ତàରàଟି: ଚାଳକ ସଂରଚନା ପାଇଲା ନାହିà¬à¥¤" -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, 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 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "DEVICE" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "STATE" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "GENERAL" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "CAPABILITIES" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "WIFI-PROPERTIES" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "WIRED-PROPERTIES" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4-SETTINGS" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "DRIVER" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "HWADDR" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "CARRIER-DETECT" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "SPEED" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "CARRIER" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "ADDRESS" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "PREFIX" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "GATEWAY" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "MODE" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREQ" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "RATE" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "SIGNAL" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "SECURITY" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-FLAGS" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-FLAGS" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "ACTIVE" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -641,204 +653,205 @@ msgstr "" " wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "ଅପରିଚାଳିତ" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "ଅନàପଲବàଧ" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "ସଂଯà‹à¬— ବିଚàଛିନàନ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "ସଂଯà‹à¬— କରàଅଛି (ପàରସàତàତ)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "ସଂଯà‹à¬— କରàଅଛି (ବିନààŸà¬¾à¬¸ କରàଅଛି)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "ସଂଯà‹à¬— କରàଅଛି (ବàˆà¬§à¬¿à¬•à¬°à¬£ ଆବଶààŸà¬•)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "ସଂଯà‹à¬— କରàଅଛି (IP ସଂରଚନା ଗàରହଣ କରàଅଛି)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "ସଂଯà‹à¬— ସàଥାପିତ ହà‡à¬²à¬¾" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "ସଂଯà‹à¬— ବିଫଳ ହà‹à¬‡à¬›à¬¿" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "ଅଜଣା" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(କିଛି ନାହିà¬)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ଠିକଣା 0x%X କà ପରିବରàତàତନ à¬•à¬°à¬¿à¬¬à¬¾à¬°à‡ à¬¤àରàଟି" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "ସଂଗàପàତ: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP " -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA " -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2 " -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "ବାଣିଜààŸà¬¿à¬•" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "à¬à¬¡-ହà‹à¬•" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "ଅବସଂରଚନା" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "ତàରàଟି: 'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "ତàରàଟି: 'dev list': %s; ଅନàମତିପàରାପàତ କàଷà‡à¬¤àରଗàଡ଼ିକ: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "ଉପକରଣ ବିବରଣà€" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(ଅଜଣା)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "ଅଜଣା)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "ଚାଲà" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "ବନàଦ" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "ତàରàଟି: 'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "ତàରàଟି: 'dev status': %s; ଅନàମତିପàରାପàତ କàଷà‡à¬¤àରଗàଡ଼ିକ: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "ଉପକରଣର ସàଥିତି" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, 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 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "ତàରàଟି: ଉପକରଣ '%s' ମିଳିଲା ନାହିà¬à¥¤" -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "ସଫଳ: ଉପକରଣ '%s' ସଫଳତାର ସହିତ ସଂଯà‹à¬— ବିଚàଛିନàନ ହà‹à¬‡à¬›à¬¿à¥¤" -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "ତàରàଟି: ଉପକରଣ '%s' (%s) ସଂଯà‹à¬— ବିଚàଛିନàନ ବିଫଳ ହà‹à¬‡à¬›à¬¿: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "ଉପକରଣ ସàଥିତି: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "ତàରàଟି: iface କà ଉଲàଲà‡à¬– କରାଯିବା ଉଚିତ।" -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "ତàରàଟି: 'dev wifi': %s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "ତàରàଟି: 'dev wifi': %s; ଅନàମତିପàରାପàତ କàଷà‡à¬¤àରଗàଡ଼ିକ: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "WiFi କàରମବà€à¬•àଷଣ ତାଲିକା" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "ତàରàଟି: hwaddr '%s' ସହିତ ଅà¬à¬¿à¬—ମààŸà¬¤à¬¾ ବିନàଦà ମିଳିଲା ନାହିà¬à¥¤" -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "ତàରàଟି: ଉପକରଣ '%s' ଟି ଗà‹à¬Ÿà¬¿à¬ WiFi ଉପକରଣ ନàହà¬à¥¤" -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ତàରàଟି: 'dev wifi' ନିରàଦàଦà‡à¬¶ '%s' ଟି ବàˆà¬§ ନàହà¬à¥¤" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ତàରàଟି: 'dev' ନିରàଦàଦà‡à¬¶ '%s' ଟି ବàˆà¬§ ନàହà¬à¥¤" @@ -1477,26 +1490,26 @@ msgstr "PKCS#12 ଫାଇଲକà ଯାଞàଚ କରିହà‡à¬²à¬¾à¬¨à¬¾à¬ msgid "Could not generate random data." msgstr "ମନଇଚàଛା ତଥààŸà¬•à ଅବସଂକà‡à¬¤ କରିହà‡à¬²à¬¾ ନାହିà¬à¥¤" -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "ବିକà‹à¬¡à¬¼à¬¨ କି କà ନିରàମାଣ କରିବା ପାଇଠଯଥà‡à¬·àଟ ସàମàƒà¬¤à¬¿ ସàଥାନ ନାହିà¬à¥¤" -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ଫାଇଲ ନିରàମାଣ ପାଇଠସàମàƒà¬¤à¬¿ ସàଥାନ ବଣàଟନ କରିପାରିଲା ନାହିà¬à¥¤" -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM à¬«à¬¾à¬‡à¬²à¬°à‡ IV ଲà‡à¬–ିବା ପାଇଠସàମàƒà¬¤à¬¿ ସàଥାନ ବଣàଟନ କରିପାରିଲା ନାହିà¬à¥¤" -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM à¬«à¬¾à¬‡à¬²à¬°à‡ à¬¸à¬‚à¬—àପàତ କି ଲà‡à¬–ିବା ପାଇଠସàମàƒà¬¤à¬¿ ସàଥାନ ବଣàଟନ କରିପାରିଲା ନାହିà¬à¥¤" -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ଫାଇଲ ତଥààŸà¬•à ବଣàଟନ କରିପାରିଲା ନାହିà¬à¥¤" @@ -1558,16 +1571,14 @@ msgid "" "Put NetworkManager to sleep or wake it up (should only be used by system " "power management)" msgstr "" -"NetworkManager କà ସàପàତ କିମàବା ଜାଗàରତ ରଖନàତà (କà‡à¬¬à¬³ ତନàତàର ଶକàତି ପରିଚାଳନା " -"ଦàà±à¬¾à¬°à¬¾ ବààŸà¬¬à¬¹à¬¾à¬° ହà‡à¬¬à¬¾ ଉଚିତ)" +"NetworkManager କà ସàପàତ କିମàବା ଜାଗàରତ ରଖନàତà (କà‡à¬¬à¬³ ତନàତàର ଶକàତି ପରିଚାଳନା ଦàà±à¬¾à¬°à¬¾ ବààŸà¬¬à¬¹à¬¾à¬° " +"ହà‡à¬¬à¬¾ ଉଚିତ)" #: ../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 "ତନàତàର à¬¨à¬¿à¬¤à€ à¬¨à‡à¬Ÿà±à¬°àକ ସଂଯà‹à¬—ଗàଡ଼ିକର ନିàŸà¬¨àତàରଣକà ବାରଣ କରିଥାà¬" #: ../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 "ତନàତàର à¬¨à¬¿à¬¤à€ WiFi ଉପକରଣଗàଡ଼ିକà ସକàà¬°à¬¿àŸ à¬•à¬¿à¬®àବା ନିଷàକàà¬°à¬¿àŸ à¬¹à‡à¬¬à¬¾à¬°à ବାରଣ କରିଥାà¬" @@ -1576,7 +1587,6 @@ msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "ତନàତàର à¬¨à¬¿à¬¤à€ à¬®à‹à¬¬à¬¾à¬‡à¬² ବàରà‹à¬¡à¬¬ààŸà¬¾à¬£àଡ ଉପକରଣଗàଡ଼ିକà ସକàà¬°à¬¿àŸ à¬•à¬¿à¬®àବା ନିଷàକàà¬°à¬¿àŸ à¬¹à‡à¬¬à¬¾à¬°à ବାରଣ କରିଥାà¬" #: ../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 "ତନàତàର à¬¨à¬¿à¬¤à€ à¬¤à¬¨àତàର ନà‡à¬Ÿà±à¬°àକିଙàଗକà ସକàà¬°à¬¿àŸ à¬•à¬¿à¬®àବା ନିଷàକàà¬°à¬¿àŸ à¬¹à‡à¬¬à¬¾à¬°à ବାରଣ କରିଥାà¬" @@ -1585,7 +1595,6 @@ msgid "System policy prevents putting NetworkManager to sleep or waking it up" msgstr "ତନàତàର à¬¨à¬¿à¬¤à€ NetworkManager କà ସàପàତ କିମàବା ଜାଗàରତ ରହିବାରà ବାରଣ କରିଥାà¬" #: ../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 "ତନàତàର à¬¨à¬¿à¬¤à€ à¬¤à¬¨àତàର-ନିରàଦàଦିଷàଟ ସଂଯà‹à¬—ଗàଡ଼ିକà ବାରଣ କରିଥାà¬" @@ -1634,16 +1643,16 @@ msgstr "ସଂଯà‹à¬— କààŸà¬¾à¬¶à‡ ଅଦààŸà¬¤à¬¨ କରିବାର msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ଅବàˆà¬§ ବିକଳàପ. ବàˆà¬§ ବିକଳàପର ତାଲିକା ଦà‡à¬–ିବା ପାଇଠଦàŸà¬¾à¬•à¬°à¬¿ --ସହାàŸà¬¤à¬¾ ବààŸà¬¬à¬¹à¬¾à¬° କରନàତà.\n" -#: ../src/main.c:568 +#: ../src/main.c:573 #, 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 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager ଦàà±à¬¾à¬°à¬¾ ନିରàମିତ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1652,19 +1661,19 @@ msgstr "" "# %s ରà ମିଶàରିତ\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "କàŒà¬£à¬¸à¬¿ ଉପଯà‹à¬—à€ DHCP କàଲାà¬à¬£àଟ ମିଳିଲା ନାହିà¬à¥¤" -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "'dhclient' ମିଳି ପାରିଲା।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "'dhcpcd' ମିଳିପାରିଲା।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "ଅସମରàଥିତ DHCP କàଲାà¬à¬£àଟ '%s'" @@ -1679,11 +1688,11 @@ msgstr "ଅଜàଞାତ ଲଗ ସàତର '%s'" msgid "Unknown log domain '%s'" msgstr "ଅଜàଞାତ ଲଗ ଡମà‡à¬¨ '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ଟିପàପଣà€: libc resolver 3 ରà ଅଧିକ nameserverଗàଡ଼ିକà ସମରàଥନ କରିନପାରà‡." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "ନିମàà¬¨à¬°à‡ à¬¤à¬¾à¬²à¬¿à¬•à¬¾à¬àକàତ nameserverଗàଡ଼ିକà ଚିହàନି ହà‹à¬‡à¬¨à¬ªà¬¾à¬°à‡." @@ -1692,7 +1701,7 @@ msgstr "ନିମàà¬¨à¬°à‡ à¬¤à¬¾à¬²à¬¿à¬•à¬¾à¬àକàତ nameserverଗà msgid "Auto %s" msgstr "ସàà±àŸà¬‚ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "ତନàତàର" @@ -9,8 +9,8 @@ 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" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-12 01:57+0100\n" "Last-Translator: Daniel Nylander <po@danielnylander.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "MIME-Version: 1.0\n" @@ -18,7 +18,87 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:60 +#: ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:165 +#: ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAMN" + +#. 0 +#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "ENHETER" + +#. 2 +#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "OMFÃ…NG" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "STANDARD" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-TJÄNST" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 +#: ../cli/src/devices.c:62 +#: ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "TIDSSTÄMPEL" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SKRIVSKYDDAD" + +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -37,371 +117,618 @@ msgstr "" " up id <id> | uuid <id> [iface <gränssnitt>] [ap <hwaddr>] [--nowait] [--timeout <tidsgräns>]\n" " down id <id> | uuid <id>\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:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Fel: \"con list\": %s" + +#: ../cli/src/connections.c:200 +#: ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Fel: \"con list\": %s; tillÃ¥tna fält: %s" + +#: ../cli/src/connections.c:208 +#| msgid "Connections" +msgid "Connection details" +msgstr "Anslutningsdetaljer" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +#| msgid "System" +msgid "system" +msgstr "system" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +msgid "user" +msgstr "användare" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "aldrig" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../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 "ja" -#: ../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:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../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 "nej" -#: ../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 +#: ../cli/src/connections.c:458 +#: ../cli/src/connections.c:501 +#| msgid "System connections:\n" +msgid "System connections" +msgstr "systemanslutningar" + +#: ../cli/src/connections.c:463 +#: ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Användaranslutningar" + +#: ../cli/src/connections.c:475 +#: ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 +#: ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 +#: ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 +#: ../cli/src/devices.c:972 +#: ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Fel: %s-argument saknas." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:488 #, 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 +#: ../cli/src/connections.c:520 +#: ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 +#: ../cli/src/devices.c:986 +#: ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Okänd parameter: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:529 #, 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:544 +#: ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 +#: ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Fel: %s." -#: ../cli/src/connections.c:268 -#: ../cli/src/devices.c:304 -msgid "no" -msgstr "nej" +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Fel: \"con status\": %s" + +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Fel: \"con status\": %s; tillÃ¥tna fält: %s" -#: ../cli/src/connections.c:297 -#| msgid "Modify system connections" +#: ../cli/src/connections.c:659 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 +#: ../cli/src/connections.c:1027 #, 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 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "ingen aktiv anslutning eller enhet" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "enheten \"%s\" är inte kompatibel med anslutningen \"%s\"" + +#: ../cli/src/connections.c:1087 +#, c-format +#| msgid "no active connection on device '%s'" +msgid "no device found for connection '%s'" +msgstr "ingen enhet hittades för anslutningen \"%s\"" + +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "aktiverar" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1100 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)" +#: ../cli/src/connections.c:1103 +#: ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 +#: ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 +#: ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 +#: ../cli/src/settings.c:473 msgid "unknown" msgstr "okänt" -#: ../cli/src/connections.c:744 -#| msgid "VPN connecting to '%s'" +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN ansluter (förbereder)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN ansluter (behöver autentisering)" -#: ../cli/src/connections.c:748 -#| msgid "_VPN Connections" +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN ansluter" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ansluter (hämtar IP-konfiguration)" -#: ../cli/src/connections.c:752 -#| msgid "_VPN Connections" +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN ansluten" -#: ../cli/src/connections.c:754 -#| msgid "VPN Connect Failure" +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN-anslutning misslyckades" -#: ../cli/src/connections.c:756 -#| msgid "VPN Connect Failure" +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN frÃ¥nkopplad" -#: ../cli/src/connections.c:767 -#| msgid "(unknown)" +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "okänd anledning" -#: ../cli/src/connections.c:769 -#| msgid "None" +#: ../cli/src/connections.c:1137 msgid "none" msgstr "ingen" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "användaren kopplades frÃ¥n" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "basnätverksanslutningen avbröts" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN-tjänsten stoppades oväntat" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN-tjänsten returnerade en ogiltig konfiguration" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "anslutningsförsöket översteg tidsgränsen" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN-tjänsten startade inte i tid" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN-tjänsten misslyckades med att starta" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "inga giltiga VPN-hemligheter" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "ogiltiga VPN-hemligheter" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "anslutningen togs bort" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "tillstÃ¥nd: %s\n" -#: ../cli/src/connections.c:806 -#: ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1174 +#: ../cli/src/connections.c:1200 #, c-format -#| msgid "Connection _Information" msgid "Connection activated\n" msgstr "Anslutning aktiverad\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1177 #, 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 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "tillstÃ¥nd: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1206 #, 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 +#: ../cli/src/connections.c:1223 +#: ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Fel: Tidsgränsen %d sekunder gick ut." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Fel: Aktivering av anslutning misslyckades: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1280 #, 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 +#: ../cli/src/connections.c:1289 #, 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 +#: ../cli/src/connections.c:1290 #, 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 +#: ../cli/src/connections.c:1344 +#: ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "Fel: Okänd anslutning: %s." -#: ../cli/src/connections.c:1011 -#: ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1379 +#: ../cli/src/devices.c:980 #, 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 +#: ../cli/src/connections.c:1392 +#: ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Fel: id eller uuid mÃ¥ste anges." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "Fel: Ingen lämplig enhet hittades: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "Fel: Ingen lämplig enhet hittades." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "Varning: Anslutningen är inte aktiv\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Fel: \"con\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Fel: kunde inte ansluta till D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "Fel: Kunde inte fÃ¥ systeminställningar." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "Fel: Kunde inte fÃ¥ användarinställningar." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1627 #, 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." +#. 0 +#. 9 +#: ../cli/src/devices.c:61 +#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "ENHET" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 +#: ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "TILLSTÃ…ND" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ALLMÄNT" + +#. 0 #: ../cli/src/devices.c:73 -#, c-format +msgid "CAPABILITIES" +msgstr "FÖRMÃ…GOR" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-EGENSKAPER" + +#. 2 +#: ../cli/src/devices.c:75 +#| msgid "PEAP" +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "TRÃ…DADE-EGENSKAPER" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-INSTÄLLNINGAR" + +#. 5 +#: ../cli/src/devices.c:78 +#| msgid "DNS" +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-INSTÄLLNINGAR" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "DRIVRUTIN" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "HASTIGHET" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "BÄRARE" + +#. 0 +#: ../cli/src/devices.c:122 +#| msgid " WEP" +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +#| msgid " WPA" +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +#| msgid " WPA2" +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +#| msgid "AES-CCMP" +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 +#: ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRESS" + +#. 1 +#: ../cli/src/devices.c:136 +#: ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:137 +#: ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +#| msgid "SSID:" +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +#| msgid "BSSID:" +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "LÄGE" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREK" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "FREKVENS" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SÄKERHET" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGGOR" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGGOR" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTIV" + +#: ../cli/src/devices.c:208 +#, c-format +#| msgid "" +#| "Usage: nmcli dev { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | list | disconnect | wifi }\n" +#| "\n" +#| " status\n" +#| " list [iface <iface>]\n" +#| " disconnect iface <iface> [--nowait] [--timeout <timeout>]\n" +#| " wifi [list [iface <iface>] | apinfo iface <iface> hwaddr <hwaddr>]\n" +#| "\n" msgid "" "Usage: nmcli dev { COMMAND | help }\n" "\n" @@ -410,7 +737,7 @@ msgid "" " status\n" " list [iface <iface>]\n" " disconnect iface <iface> [--nowait] [--timeout <timeout>]\n" -" wifi [list [iface <iface>] | apinfo iface <iface> hwaddr <hwaddr>]\n" +" wifi [list [iface <iface>] [hwaddr <hwaddr>]]\n" "\n" msgstr "" "Användning: nmcli dev { KOMMANDO | help }\n" @@ -420,371 +747,253 @@ msgstr "" " status\n" " list [iface <gränssnitt>]\n" " disconnect iface <gränssnitt> [--nowait] [--timeout <tidsgräns>]\n" -" wifi [list [iface <gränssnitt>] | apinfo iface <gränssnitt> hwaddr <hwaddr>]\n" +" wifi [list [iface <gränssnitt>] [hwaddr <maskinvaruadress>]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "ohanterad" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "otillgänglig" -#: ../cli/src/devices.c:97 -#: ../cli/src/network-manager.c:73 -#| msgid "_Disconnect VPN..." +#: ../cli/src/devices.c:232 +#: ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "frÃ¥nkopplad" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "ansluter (förbereder)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "ansluter (konfigurerar)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "ansluter (behöver autentisering)" -#: ../cli/src/devices.c:105 -#| msgid "Connection _Information" +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "ansluter (hämtar IP-konfiguration)" -#: ../cli/src/devices.c:107 -#: ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 +#: ../cli/src/network-manager.c:87 msgid "connected" msgstr "ansluten" -#: ../cli/src/devices.c:109 -#| msgid "Connection _Information" +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "anslutningen misslyckades" -#: ../cli/src/devices.c:132 -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 +#: ../cli/src/devices.c:424 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)" +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(ingen)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, 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 +#: ../cli/src/devices.c:393 #, 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" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "Device" -msgstr "Enhet" +#: ../cli/src/devices.c:403 +#| msgid ", Encrypted: " +msgid "Encrypted: " +msgstr "Krypterad: " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Drivrutin" +#: ../cli/src/devices.c:408 +#| msgid " WEP" +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:299 -#: ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(okänt)" +#: ../cli/src/devices.c:410 +#| msgid " WPA" +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:300 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "State" -msgstr "TillstÃ¥nd" +#: ../cli/src/devices.c:412 +#| msgid " WPA2" +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HÃ¥rdvaruadress" +#: ../cli/src/devices.c:415 +#| msgid " Enterprise" +msgid "Enterprise " +msgstr "Företag" -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" FörmÃ¥gor:\n" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Bärardetektering" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktur" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -#| msgid "%d Mb/s" -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Hastighet" +msgid "Error: 'dev list': %s" +msgstr "Fel: \"dev list\": %s" -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, 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" +#| msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Fel: \"dev list\": %s; tillÃ¥tna fält: %s" -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA-kryptering" +#: ../cli/src/devices.c:497 +#| msgid "Devices" +msgid "Device details" +msgstr "Enhetsdetaljer" -#: ../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:527 +#: ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(okänt)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = aktuell AP)" +#: ../cli/src/devices.c:528 +#| msgid "(unknown)" +msgid "unknown)" +msgstr "okänt)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, 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" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 -#| msgid "None" +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" msgstr "pÃ¥" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" msgstr "av" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, 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" +msgid "Error: 'dev status': %s" +msgstr "Fel: \"dev status\": %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Gateway" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Fel: \"dev status\": %s; tillÃ¥tna fält: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Status för enheter" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, 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 +#: ../cli/src/devices.c:874 +#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Fel: Enheten \"%s\" hittades inte." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Lyckades: Enheten \"%s\" kopplades frÃ¥n." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, 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 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "EnhetstillstÃ¥nd: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, 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 +#: ../cli/src/devices.c:1112 #, 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:" +#| msgid "Error: 'dev wifi' command '%s' is not valid." +msgid "Error: 'dev wifi': %s" +msgstr "Fel: \"dev wifi\": %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Fel: hwaddr mÃ¥ste anges." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Fel: \"dev wifi\": %s; tillÃ¥tna fält: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "WiFi-avsökningslista" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1156 +#: ../cli/src/devices.c:1210 #, 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 +#: ../cli/src/devices.c:1173 #, 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:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fel: Enheten \"%s\" är inte en WiFi-enhet." -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1237 #, 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 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Fel: \"dev\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "KÖR" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-MASKINVARA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-MASKINVARA" + +#. 4 +#: ../cli/src/network-manager.c:40 +#| msgid "NM WWAN:" +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -809,99 +1018,114 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "sover" -#: ../cli/src/network-manager.c:69 -#| msgid "VPN connecting to '%s'" +#: ../cli/src/network-manager.c:85 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:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Fel: \"nm status\": %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Fel: \"nm status\": %s; tillÃ¥tna fält: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Status för Nätverkshanterare" + +#. 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:160 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 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:140 +#: ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 #: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:160 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 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 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "kör" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 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:" +#: ../cli/src/network-manager.c:201 +#: ../cli/src/network-manager.c:233 +#, c-format +#| msgid "Error: timeout value '%s' is not valid." +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Fel: värdet \"%s\" för \"--fields\" är inte giltigt här; tillÃ¥tna fält: %s" -#. 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:209 +#| msgid "enabled" +msgid "WiFi enabled" +msgstr "WiFi aktiverat" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Fel: ogiltig \"wifi\"-parameter: \"%s\"." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +#| msgid "enabled" +msgid "WWAN enabled" +msgstr "WWAN aktiverat" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Fel: ogiltig \"wwan\"-parameter: \"%s\"." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, 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 +#: ../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" +#| " -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" 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" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] <field1,field2,...>|all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -912,10 +1136,13 @@ 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" +" -t[erse] kort utdata\n" +" -p[retty] vackert utdata\n" +" -m[ode] tabular|multiline utdataläge\n" +" -f[ields] <field1,field2,...>|all|common ange fält för utdata\n" +" -e[scape] yes|no escape för kolumnavgränsare i värden\n" +" -v[ersion] visa programversion\n" +" -h[elp] skriv ut denna hjälp\n" "\n" "OBJEKT\n" " nm status för Nätverkshanterare\n" @@ -923,35 +1150,179 @@ msgstr "" " dev enheter hanterade av Nätverkshanterare\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +#| msgid "Object '%s' is unknown, try 'nmcli help'." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Fel: Objektet \"%s\" är okänt, prova \"nmcli help\"." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Fel: Flaggan \"--terse\" har angivits en andra gÃ¥ng." + +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Objektet \"%s\" är okänt, prova \"nmcli help\"." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Fel: Flaggan \"--terse\" är ömsesidigt uteslutande med \"--pretty\"." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Fel: Flaggan \"--pretty\" har angivits en andra gÃ¥ng." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Fel: Flaggan \"--pretty\" är ömsesidigt uteslutande med \"--terse\"." + +#: ../cli/src/nmcli.c:171 +#: ../cli/src/nmcli.c:187 +#, c-format +#| msgid "Error: %s argument is missing." +msgid "Error: missing argument for '%s' option." +msgstr "Fel: argument för flaggan \"%s\" saknas." + +#: ../cli/src/nmcli.c:180 +#: ../cli/src/nmcli.c:196 +#, c-format +#| msgid "Error: '%s' argument is missing." +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Fel: \"%s\" är inte ett giltigt argument för flaggan \"%s\"." + +#: ../cli/src/nmcli.c:203 +#, c-format +#| msgid "Error: '%s' argument is missing." +msgid "Error: fields for '%s' options are missing." +msgstr "Fel: fält för \"%s\"-flaggor saknas." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli-verktyg, version %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Flagan \"%s\" är okänd, prova \"nmcli -help\"." +#| msgid "Option '%s' is unknown, try 'nmcli -help'." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Fel: Flaggan \"%s\" är okänd, prova \"nmcli -help\"." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "FÃ¥ngade signal %d, stänger av..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Fel: Kunde inte ansluta till Nätverkshanterare." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Lyckades" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-nyckel)" + +#: ../cli/src/settings.c:413 +#, c-format +#| msgid "WEP 128-bit Passphrase" +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bitars lösenfras)" + +#: ../cli/src/settings.c:416 +#, c-format +#| msgid "(unknown)" +msgid "%d (unknown)" +msgstr "%d (okänt)" + +#: ../cli/src/settings.c:442 +#| msgid "(unknown)" +msgid "0 (unknown)" +msgstr "0 (okänt)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "valfri, " + +#: ../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 "inte inställd" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "fältet \"%s\" mÃ¥ste vara ensamt" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ogiltigt fält \"%s\"" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Flaggan \"--terse\" kräver att \"--fields\" anges" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Flaggan \"--terse\" kräver specifika värden för \"--fields\"-flagga , inte \"%s\"" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1104,7 +1475,6 @@ 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." @@ -1122,25 +1492,21 @@ 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." @@ -1211,7 +1577,6 @@ 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." @@ -1222,31 +1587,26 @@ msgstr "Misslyckades med att färdigställa dekryptering av den privata nyckeln: #: ../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." @@ -1281,86 +1641,179 @@ 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 +#: ../libnm-util/nm-utils.c:1975 #, 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." +#: ../libnm-util/nm-utils.c:2085 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 +#: ../libnm-util/nm-utils.c:2097 #, 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 +#: ../libnm-util/nm-utils.c:2109 #, 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 +#: ../libnm-util/nm-utils.c:2128 #, 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 +#: ../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" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +#| msgid "Wired network connection" +msgid "Allow control of network connections" +msgstr "TillÃ¥t kontroll av nätverksanslutningar" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "TillÃ¥t användning av användarspecifika anslutningar" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Aktivera eller inaktivera WiFi-enheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Aktivera eller inaktivera mobila bredbandsenheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +#| msgid "Enable _Networking" +msgid "Enable or disable system networking" +msgstr "Aktivera eller inaktivera systemnätverk" + +#: ../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 "Försätt Nätverkshanterare i vänteläge eller Ã¥terställ efter det (bör endast användas av systemets strömhantering)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "Systemets policy förhindrar kontroll av nätverksanslutningar" + +#: ../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 "Systemets policy förhindrar aktivering eller inaktivering av WiFi-enheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "Systemets policy förhindrar aktivering eller inaktivering av mobila bredbandsenheter" + +#: ../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 "Systemets policy förhindrar aktivering eller inaktivering av systemnätverk" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Systemets policy förhindrar att Nätverkshanterare försätts i vänteläge eller Ã¥terställs efter det" + +#: ../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 "Systemets policy förhindrar användning av användarspecifika anslutningar" + +#: ../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 "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:214 +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:270 +#: ../src/nm-netlink-monitor.c:254 #, 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 +#: ../src/nm-netlink-monitor.c:265 +#, c-format +#| msgid "unable to allocate netlink handle: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "kunde inte aktivera behörighetshantering för netlink-handtag: %s" + +#: ../src/nm-netlink-monitor.c:291 +#: ../src/nm-netlink-monitor.c:353 #, 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" +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:286 +#: ../src/nm-netlink-monitor.c:376 #, 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:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "kan inte gÃ¥ med i netlink-grupp: %s" -#: ../src/nm-netlink-monitor.c:558 -#: ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:629 +#: ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "fel vid uppdatering av länkcache: %s" -#: ../src/NetworkManager.c:494 +#: ../src/main.c:502 #, 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 +#: ../src/main.c:573 +#, 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. Använd --help för att se en lista över giltiga flaggor.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# Skapad av Nätverkshanterare\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1369,29 +1822,38 @@ msgstr "" "# Sammanfogad frÃ¥n %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "ingen användbar DHCP-klient hittades." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "\"dhclient\" kunde inte hittas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "\"dhcpcd\" kunde inte hittas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, 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" +msgid "unsupported DHCP client '%s'" +msgstr "DHCP-klienten \"%s\" stöds inte" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, 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" +msgid "Unknown log level '%s'" +msgstr "Okänd loggnivÃ¥ \"%s\"" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, 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" +msgid "Unknown log domain '%s'" +msgstr "Okänd loggdomän \"%s\"" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/named-manager/nm-named-manager.c:384 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 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." @@ -1400,203 +1862,12 @@ msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." msgid "Auto %s" msgstr "Automatisk %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 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" +#~ msgid "Type" +#~ msgstr "Typ" +#~ msgid "Name" +#~ msgstr "Namn" diff --git a/po/zh_CN.po b/po/zh_CN.po index d1e17ae850..ccd64cd937 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,92 +4,94 @@ # This file is distributed under the same license as the NetworkManager package. # # Funda Wang <fundawang@linux.net.cn>, 2004. -# Aron Xu <happyaron.xu@gmail.com>, 2009. # Leah Liu <lliu@redhat.com>, 2010. +# Aron Xu <happyaron.xu@gmail.com>, 2009, 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 <lliu@redhat.com>\n" -"Language-Team: Wei Liu\n" +"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-08-11 03:24+0000\n" +"PO-Revision-Date: 2010-08-11 21:16+0800\n" +"Last-Translator: Aron Xu <happyaron.xu@gmail.com>\n" +"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\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 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "å称" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "设备" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "范围" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "默认" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS æœåŠ¡" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC 对象" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "类型" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "时间戳" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "真实时间戳" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "自动连接" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "åªè¯»" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -101,8 +103,8 @@ msgid "" "<timeout>]\n" " down id <id> | uuid <id>\n" msgstr "" -"用法:nmcli con { COMMAND | help }\n" -" COMMAND := { list | status | up | down }\n" +"用法:nmcli con { 命令 | help }\n" +" 命令 := { list | status | up | down }\n" "\n" " list [id <id> | uuid <id> | system | user]\n" " status\n" @@ -110,514 +112,524 @@ msgstr "" "<timeout>]\n" " down id <id> | uuid <id>\n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "错误:'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "错误:'con list': %sï¼›å…许的å—段:%s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "连接详情" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "系统" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "用户" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 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 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "是" -#: ../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 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../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 "å¦" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "系统连接" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 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 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "错误:缺少 %s å‚数。" -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, 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 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "未知å‚数:%s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, 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 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "错误:%s。" -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "错误:'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "错误:'con status': %sï¼›å…许的å—段:%s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "活跃连接" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "设备 '%s' ä¸æ²¡æœ‰æ´»è·ƒè¿žæŽ¥" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "没有活跃连接或者设备" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "设备 '%s' ä¸å…¼å®¹è¿žæŽ¥ '%s'" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "没有找到å¯ç”¨äºŽè¿žæŽ¥ '%s' 的设备" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "激活ä¸" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 msgid "activated" -msgstr "激活的" +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 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "未知" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" -msgstr "VPN 连接(准备)" +msgstr "VPN 连接(准备)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" -msgstr "VPN 连接ä¸ï¼ˆéœ€è¦éªŒè¯ï¼‰" +msgstr "VPN 连接ä¸(需è¦éªŒè¯)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN 连接ä¸" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" -msgstr "VPN 连接ä¸ï¼ˆèŽ·å– IP é…置)" +msgstr "VPN 连接ä¸(èŽ·å– IP é…ç½®)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" -msgstr "VNP 连接" +msgstr "VPN 连接" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN 连接失败" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "æ–å¼€ VPN 连接" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "æœªçŸ¥åŽŸå› " -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "æ— " -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" -msgstr "æ–开连接的用户" +msgstr "用户已æ–开连接" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "基点网络连接ä¸æ–" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN æœåŠ¡æ„外åœæ¢" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN æœåŠ¡è¿”å›žæ— æ•ˆé…ç½®" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "连接å°è¯•è¶…æ—¶" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN 连接没有按时å¯åŠ¨" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN æœåŠ¡å¯åŠ¨å¤±è´¥" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" -msgstr "没有有效 VPN secret" +msgstr "没有有效的 VPN åŠ å¯†" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" -msgstr "æ— æ•ˆ VPN secret" +msgstr "æ— æ•ˆ VPN åŠ å¯†" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "è¿žæŽ¥è¢«åˆ é™¤" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "状æ€ï¼š%s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" -msgstr "连接被激活\n" +msgstr "连接已激活\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "错误:激活连接失败。" -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "状æ€ï¼š%s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "错误:激活连接失败:%s。" -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "错误:超时 %d 秒过期。" -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "错误:激活连接失败:%s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "é”™è¯¯ï¼šèŽ·å– '%s' 的活跃连接失败。" -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "活跃连接状æ€ï¼š%s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "活跃连接路径:%s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "错误:未知连接:%s" -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "错误:超时值 '%s' æ— æ•ˆã€‚" -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "错误:必须指定 id 或者 uuid。" +msgstr "错误:必须指定 ID 或者 UUID。" -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "错误:没有找到åˆé€‚的设备:%s。" -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "错误:没有找到åˆé€‚的设备。" -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "è¦å‘Šï¼šè¿žæŽ¥æ²¡æœ‰æ¿€æ´»\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "错误:'con' 命令 '%s' æ— æ•ˆã€‚" -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "é”™è¯¯ï¼šæ— æ³•è¿žæŽ¥åˆ° D-Bus。" -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "é”™è¯¯ï¼šæ— æ³•èŽ·å¾—ç³»ç»Ÿè®¾ç½®ã€‚" -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "é”™è¯¯ï¼šæ— æ³•èŽ·å¾—ç”¨æˆ·è®¾ç½®ã€‚" -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, 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 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "设备" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "状æ€" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "常规" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "功能" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "WIFI 属性" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "有线连接属性" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4 设置" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6 设置" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "驱动程åº" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "硬盘" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "容器探测" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "速度" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "容器" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "地å€" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "å‰ç¼€" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "网关" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "åž‹å·" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREQ" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "频率" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "ä¿¡å·" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "安全性" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-æ ‡å¿—" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-æ ‡å¿—" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "活跃" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -640,204 +652,205 @@ msgstr "" " wifi [list [iface <iface>] | apinfo iface <iface> hwaddr <hwaddr>]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" -msgstr "未管ç†çš„" +msgstr "未管ç†" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" -msgstr "ä¸å¯ç”¨çš„" +msgstr "ä¸å¯ç”¨" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" -msgstr "æ–开连接" +msgstr "å·²æ–å¼€" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" -msgstr "连接ä¸ï¼ˆå‡†å¤‡ï¼‰" +msgstr "连接ä¸(准备)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" -msgstr "连接ä¸ï¼ˆé…ç½®ä¸ï¼‰" +msgstr "连接ä¸(é…ç½®)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" -msgstr "连接ä¸ï¼ˆéœ€è¦éªŒè¯ï¼‰" +msgstr "连接ä¸(需è¦éªŒè¯)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" -msgstr "连接ä¸ï¼ˆèŽ·å¾— IP é…置)" +msgstr "连接ä¸(获得 IP é…ç½®)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "连接的" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "连接失败" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "未知" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" -msgstr "ï¼ˆæ— ï¼‰" +msgstr "(æ— )" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%sï¼šè½¬æ¢ IP4 åœ°å€ 0x%X 出错" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " -msgstr "åŠ å¯†çš„ï¼š" +msgstr "åŠ å¯†ï¼š" -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP" -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA" -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2" -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "ä¼ä¸šçº§" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "Ad-Hoc" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "基础构架" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "错误:'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "错误:'dev list': %sï¼›å…许的å—段:%s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "设备详情" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" -msgstr "(未知)" +msgstr "(未知)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" -msgstr "未知)" +msgstr "未知)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "å¼€" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "å…³" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "错误:'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "错误:'dev status': %sï¼›å…许的å—段:%s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "设备状æ€" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, 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 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "错误:没有找到设备 '%s'。" -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "æˆåŠŸï¼šæˆåŠŸæ–开设备 '%s'。" -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "错误:æ–开设备 '%s'(%s)失败:%s" +msgstr "错误:æ–开设备 '%s'(%s)失败:%s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "设备状æ€ï¼š%d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "错误:没有指定 iface。" -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "错误:'dev wifi':%s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "错误:'dev wifi': %sï¼›å…许的å—段:%s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "WiFi 扫æ列表" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "错误:没有找到使用 hwaddr '%s' 的访问点。" +msgstr "é”™è¯¯ï¼šæ²¡æœ‰æ‰¾åˆ°ä½¿ç”¨ç¡¬ä»¶åœ°å€ '%s' 的访问点。" -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "错误:设备 '%s' ä¸æ˜¯ WiFi 设备。" -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "错误:'dev wifi' 命令 '%s' æ— æ•ˆã€‚" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "错误:'dev' 命令 '%s' æ— æ•ˆã€‚" @@ -893,7 +906,7 @@ msgstr "" #: ../cli/src/network-manager.c:83 msgid "asleep" -msgstr "asleep" +msgstr "ç¡çœ " #: ../cli/src/network-manager.c:85 msgid "connecting" @@ -918,13 +931,13 @@ msgstr "网络管ç†å™¨çŠ¶æ€" #: ../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 "å¯ç”¨çš„" +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 "ç¦ç”¨çš„" +msgstr "å·²ç¦ç”¨" #: ../cli/src/network-manager.c:148 msgid "running" @@ -932,7 +945,7 @@ msgstr "è¿è¡Œä¸" #: ../cli/src/network-manager.c:148 msgid "not running" -msgstr "没有è¿è¡Œ" +msgstr "未è¿è¡Œ" #: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 #, c-format @@ -941,7 +954,7 @@ msgstr "错误:'--fields' 值 '%s' 在æ¤æ— 效;å…许的å—段:%s" #: ../cli/src/network-manager.c:209 msgid "WiFi enabled" -msgstr "å¯ç”¨ WiFi" +msgstr "å·²å¯ç”¨ WiFi" #: ../cli/src/network-manager.c:220 #, c-format @@ -950,7 +963,7 @@ msgstr "é”™è¯¯ï¼šæ— æ•ˆ 'wifi' å‚数:'%s'。" #: ../cli/src/network-manager.c:241 msgid "WWAN enabled" -msgstr "å¯ç”¨ WWAN" +msgstr "å·²å¯ç”¨ WWAN" #: ../cli/src/network-manager.c:252 #, c-format @@ -983,18 +996,18 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"用法:%s [OPTIONS] OBJECT { COMMAND | help }\n" +"用法:%s [选项] 对象 { 命令 | 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" +" -t[erse] 简æ´è¾“出\n" +" -p[retty] 美观输出\n" +" -v[ersion] 显示程åºç‰ˆæœ¬\n" +" -h[elp] 显示æ¤å¸®åŠ©\n" "\n" -"OBJECT\n" -" nm NetworkManager status\n" -" con NetworkManager connections\n" -" dev devices managed by NetworkManager\n" +"对象\n" +" nm NetworkManager 状æ€\n" +" con NetworkManager 连接\n" +" dev NetworkManager 管ç†çš„设备\n" "\n" #: ../cli/src/nmcli.c:113 @@ -1005,7 +1018,7 @@ msgstr "错误:对象 '%s' 未知,å°è¯• 'nmcli help'。" #: ../cli/src/nmcli.c:143 #, c-format msgid "Error: Option '--terse' is specified the second time." -msgstr "错误:第二æ¤æŒ‡å®šé€‰é¡¹ '--terse'。" +msgstr "错误:第二次指定选项 '--terse'。" #: ../cli/src/nmcli.c:148 #, c-format @@ -1050,7 +1063,7 @@ msgstr "错误:选项 '%s' 未知,å°è¯• 'nmcli -help'。" #: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "æ•èŽ·ä¿¡å· %d,关é—ä¸......" +msgstr "æ•èŽ·ä¿¡å· %d,关é—..." #: ../cli/src/nmcli.c:259 #, c-format @@ -1061,78 +1074,79 @@ msgstr "é”™è¯¯ï¼šæ— æ³•è¿žæŽ¥åˆ°ç½‘ç»œç®¡ç†å™¨ã€‚" msgid "Success" msgstr "æˆåŠŸ" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" -msgstr "%d(104/128 ä½å¯†ç çŸè¯ï¼‰" +msgstr "%d (104/128 ä½å¯†ç çŸè¯)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" -msgstr "%d(未知)" +msgstr "%d (未知)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" -msgstr "0(未知)" +msgstr "0 (未知)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "ä»»æ„," -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz," -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz," -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz," -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz," -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz," -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz," -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz," -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz," -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz," -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz," -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz," -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "自动" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "未设置" @@ -1229,7 +1243,7 @@ msgstr "没有足够的空间储å˜æ–‡ä»¶æ•°æ®ã€‚" #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "IV 长度必须是å¶æ•°å—节。" +msgstr "åˆå§‹å‘é‡é•¿åº¦å¿…须是å¶æ•°å—节。" #: ../libnm-util/crypto.c:333 #, c-format @@ -1275,7 +1289,7 @@ msgstr "åˆå§‹åŒ– MD5 引擎失败:%s / %s。" #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "æ— æ•ˆ IV 长度(必须至少为 %zd)。" +msgstr "æ— æ•ˆåˆå§‹å‘é‡é•¿åº¦(至少为为 %zd)。" #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format @@ -1330,7 +1344,7 @@ msgstr "ä¸ºåŠ å¯†è®¾ç½®å¯¹ç§°å¯†é’¥å¤±è´¥ï¼š%s / %s。" #: ../libnm-util/crypto_gnutls.c:313 #, c-format msgid "Failed to set IV for encryption: %s / %s." -msgstr "ä¸ºåŠ å¯†è®¾ç½® IV 失败:%s / %s。" +msgstr "ä¸ºåŠ å¯†è®¾ç½®åˆå§‹å‘é‡å¤±è´¥ï¼š%s / %s。" #: ../libnm-util/crypto_gnutls.c:322 #, c-format @@ -1375,7 +1389,7 @@ msgstr "åˆå§‹åŒ– MD5 环境失败:%d。" #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "æ— æ•ˆ IV 长度(必须至少 %d)。" +msgstr "æ— æ•ˆçš„åˆå§‹å‘é‡é•¿åº¦(至少为 %d)。" #: ../libnm-util/crypto_nss.c:196 #, c-format @@ -1471,30 +1485,113 @@ msgstr "æ— æ³•æ ¡éªŒ PKCS#12 文件:%d" msgid "Could not generate random data." msgstr "æ— æ³•ç”Ÿæˆéšæœºæ•°æ®ã€‚" -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "没有足够的空间生æˆåŠ 密密钥。" -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "æ— æ³•ä¸ºåˆ›å»º PEM 文件分é…内å˜ã€‚" -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "æ— æ³•ä¸ºåœ¨ PEM 文件ä¸å†™å…¥ IV 分é…内å˜ã€‚" -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "æ— æ³•ä¸ºåœ¨ PEM 文件ä¸å†™å…¥åŠ 密密钥分é…内å˜ã€‚" -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "æ— æ³•ä¸º PEM 文件数æ®åˆ†é…内å˜ã€‚" +#: ../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 网络共享连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "å…许控制网络连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "å…许用户连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "å¯ç”¨æˆ–ç¦ç”¨ WiFi 设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "å¯ç”¨æˆ–ç¦ç”¨ç§»åŠ¨å®½å¸¦è®¾å¤‡" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "å¯ç”¨æˆ–ç¦ç”¨ç³»ç»Ÿç½‘络" + +#: ../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 "" +"挂起或唤醒 NetworkManager (应仅用于系统电æºç®¡ç†)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "系统ç–略阻æ¢æ›´æ”¹ç½‘络连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "系统ç–略阻æ¢å¯ç”¨æˆ–ç¦ç”¨ WiFi 设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "系统ç–略阻æ¢å¯ç”¨æˆ–ç¦ç”¨ç§»åŠ¨å®½å¸¦è®¾å¤‡" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "系统ç–略阻æ¢å¯ç”¨æˆ–ç¦ç”¨ç³»ç»Ÿç½‘络" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "系统ç–略阻æ¢æŒ‚起或唤醒 NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "系统ç–略阻æ¢ä½¿ç”¨ç”¨æˆ·è¿žæŽ¥" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1540,16 +1637,16 @@ msgstr "更新链接缓å˜å‡ºé”™ï¼š%s" msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "æ— æ•ˆé€‰é¡¹ã€‚è¯·ä½¿ç”¨ --help 查看有效选项列表。\n" -#: ../src/main.c:562 +#: ../src/main.c:573 #, 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 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# ç”± NetworkManger 创建\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1558,19 +1655,19 @@ msgstr "" "# åˆå¹¶è‡ª %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "æ‰¾åˆ°æ— æ³•ä½¿ç”¨çš„ DHCP 客户端。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "找到 'dhclient'。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "找到 'dhcpcd'。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "ä¸æ”¯æŒçš„ DHCP 客户端 '%s'" @@ -1585,11 +1682,11 @@ msgstr "未知日志ç‰çº§ '%s'" msgid "Unknown log domain '%s'" msgstr "未知日志域 '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注æ„:libc 解æžå™¨å¯èƒ½ä¸æ”¯æŒè¶…过三个åå—æœåŠ¡å™¨ã€‚" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "以下列出的åå—æœåŠ¡å™¨å¯èƒ½æ— 法被识别。" @@ -1598,39 +1695,6 @@ msgstr "以下列出的åå—æœåŠ¡å™¨å¯èƒ½æ— 法被识别。" msgid "Auto %s" msgstr "自动 %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 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/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index f75e6b3d07..4c5408701e 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -29,6 +29,7 @@ libdhcp_manager_la_CPPFLAGS = \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCLIENT_V$(DHCLIENT_VERSION) \ -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" libdhcp_manager_la_LIBADD = \ diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index cae7df22c3..13caa028f9 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -45,7 +45,11 @@ 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) +#if defined(DHCLIENT_V3) +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3" +#else #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" +#endif #else #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" #endif @@ -437,7 +441,11 @@ create_dhclient_config (const char *iface, #if defined(TARGET_SUSE) orig = g_strdup (SYSCONFDIR "/dhclient.conf"); #elif defined(TARGET_DEBIAN) || defined(TARGET_GENTOO) +#if defined(DHCLIENT_V3) + orig = g_strdup (SYSCONFDIR "/dhcp3/dhclient.conf"); +#else orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); +#endif #else orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface); #endif @@ -499,12 +507,20 @@ dhclient_start (NMDHCPClient *client, 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); +#if defined(DHCLIENT_V3) + if (ipv6) { + nm_log_warn (log_domain, "(%s): ISC dhcp3 does not support IPv6", iface); + return -1; + } +#else + g_return_val_if_fail (ip_opt != NULL, -1); +#endif + log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", @@ -536,10 +552,11 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-d"); +#if !defined(DHCLIENT_V3) g_ptr_array_add (argv, (gpointer) ip_opt); - if (mode_opt) g_ptr_array_add (argv, (gpointer) mode_opt); +#endif g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 9d1905da08..5b5622fd70 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -209,6 +209,12 @@ nm_logging_domains_to_string (void) return g_string_free (str, FALSE); } +gboolean +nm_logging_level_enabled (guint32 level) +{ + return !!(log_level & level); +} + void _nm_log (const char *loc, const char *func, guint32 domain, diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 2eedf5ff14..e4abcf75ca 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -90,6 +90,7 @@ void _nm_log (const char *loc, const char *func, const char *nm_logging_level_to_string (void); char *nm_logging_domains_to_string (void); +gboolean nm_logging_level_enabled (guint32 level); /* Undefine the nm-utils.h logging stuff to ensure errors */ #undef nm_print_backtrace diff --git a/src/main.c b/src/main.c index c2fb58be77..aea2eef233 100644 --- a/src/main.c +++ b/src/main.c @@ -19,10 +19,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - +#include <config.h> #include <glib.h> #include <dbus/dbus.h> #include <dbus/dbus-glib-lowlevel.h> @@ -627,6 +624,17 @@ main (int argc, char *argv[]) g_thread_init (NULL); dbus_g_thread_init (); +#ifndef HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS +#error HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS not defined +#endif + +#if HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS + /* Ensure that non-exported properties don't leak out, and that the + * introspection 'access' permissions are respected. + */ + dbus_glib_global_set_disable_legacy_property_access (); +#endif + setup_signals (); nm_logging_start (become_daemon); diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index b851ea12d5..393b921c65 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -785,6 +785,39 @@ real_is_available (NMDevice *dev) return TRUE; } +static gboolean +match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const GPtrArray *subchans; + int i; + + *try_mac = TRUE; + + subchans = nm_setting_wired_get_s390_subchannels (s_wired); + if (!subchans) + return TRUE; + + /* connection requires subchannels but the device has none */ + if (!priv->subchannels) + return FALSE; + + /* Make sure each subchannel in the connection is a subchannel of this device */ + for (i = 0; i < subchans->len; i++) { + const char *candidate = g_ptr_array_index (subchans, i); + + if ( (priv->subchan1 && !strcmp (priv->subchan1, candidate)) + || (priv->subchan2 && !strcmp (priv->subchan2, candidate)) + || (priv->subchan3 && !strcmp (priv->subchan3, candidate))) + continue; + + return FALSE; /* a subchannel was not found */ + } + + *try_mac = FALSE; + return TRUE; +} + static NMConnection * real_get_best_auto_connection (NMDevice *dev, GSList *connections, @@ -820,9 +853,13 @@ real_get_best_auto_connection (NMDevice *dev, if (s_wired) { const GByteArray *mac; + gboolean try_mac = TRUE; + + if (!match_subchans (self, s_wired, &try_mac)) + continue; mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) + if (try_mac && mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) continue; } @@ -1703,41 +1740,6 @@ real_deactivate_quickly (NMDevice *device) } static gboolean -match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) -{ - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - const GPtrArray *subchans; - int i; - - *try_mac = TRUE; - - subchans = nm_setting_wired_get_s390_subchannels (s_wired); - if (!subchans) - return TRUE; - - /* connection requires subchannels but the device has none */ - if (!priv->subchannels) - return FALSE; - - /* Make sure each subchannel in the connection is a subchannel of this device */ - for (i = 0; i < subchans->len; i++) { - const char *candidate = g_ptr_array_index (subchans, i); - gboolean found = FALSE; - - if ( (priv->subchan1 && !strcmp (priv->subchan1, candidate)) - || (priv->subchan2 && !strcmp (priv->subchan2, candidate)) - || (priv->subchan3 && !strcmp (priv->subchan3, candidate))) - found = TRUE; - - if (!found) - return FALSE; - } - - *try_mac = FALSE; - return TRUE; -} - -static gboolean real_check_connection_compatible (NMDevice *device, NMConnection *connection, GError **error) diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index a0b9877bcc..eb0e009e20 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -398,11 +398,13 @@ nm_device_interface_connection_match_config (NMDeviceInterface *device, } gboolean -nm_device_interface_can_assume_connection (NMDeviceInterface *device) +nm_device_interface_can_assume_connections (NMDeviceInterface *device) { g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); - return !!NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config; + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->can_assume_connections) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->can_assume_connections (device); + return FALSE; } void diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 0d8772dfce..f39e8459db 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -109,6 +109,8 @@ struct _NMDeviceInterface { NMConnection * (*connection_match_config) (NMDeviceInterface *device, const GSList *specs); + gboolean (*can_assume_connections) (NMDeviceInterface *device); + void (*set_enabled) (NMDeviceInterface *device, gboolean enabled); gboolean (*get_enabled) (NMDeviceInterface *device); @@ -145,7 +147,7 @@ gboolean nm_device_interface_spec_match_list (NMDeviceInterface *device, 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_can_assume_connections (NMDeviceInterface *device); gboolean nm_device_interface_get_enabled (NMDeviceInterface *device); diff --git a/src/nm-device.c b/src/nm-device.c index 728ba154f1..df845d9711 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -159,6 +159,7 @@ static void nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason 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 gboolean can_assume_connections (NMDeviceInterface *device); static void nm_device_activate_schedule_stage5_ip_config_commit (NMDevice *self, int family); @@ -196,6 +197,7 @@ device_interface_init (NMDeviceInterface *device_interface_class) device_interface_class->disconnect = device_disconnect; device_interface_class->spec_match_list = spec_match_list; device_interface_class->connection_match_config = connection_match_config; + device_interface_class->can_assume_connections = can_assume_connections; } @@ -1237,7 +1239,7 @@ static gboolean aipd_exec (NMDevice *self, GError **error) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - char *argv[5]; + char *argv[6], *cmdline; gboolean success = FALSE; const char **aipd_binary = NULL; static const char *aipd_paths[] = { @@ -1245,6 +1247,7 @@ aipd_exec (NMDevice *self, GError **error) "/usr/local/sbin/avahi-autoipd", NULL }; + int i = 0; aipd_cleanup (self); @@ -1261,11 +1264,17 @@ aipd_exec (NMDevice *self, GError **error) 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; + argv[i++] = (char *) (*aipd_binary); + argv[i++] = "--script"; + argv[i++] = LIBEXECDIR "/nm-avahi-autoipd.action"; + if (nm_logging_level_enabled (LOGL_DEBUG)) + argv[i++] = "--debug"; + argv[i++] = (char *) nm_device_get_ip_iface (self); + argv[i++] = NULL; + + cmdline = g_strjoinv (" ", argv); + nm_log_dbg(LOGD_AUTOIP4, "running: %s", cmdline); + g_free (cmdline); success = g_spawn_async ("/", argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &aipd_child_setup, NULL, &(priv->aipd_pid), error); @@ -1572,6 +1581,8 @@ dhcp6_start (NMDevice *self, NMSettingConnection *s_con; const char *uuid; const char *ip_iface; + const struct in6_addr dest = { { { 0xFF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; + int err; if (!connection) { NMActRequest *req; @@ -1592,6 +1603,18 @@ dhcp6_start (NMDevice *self, g_object_unref (priv->dhcp6_config); priv->dhcp6_config = nm_dhcp6_config_new (); + /* DHCPv6 communicates with the DHCPv6 server via two multicast addresses, + * ff02::1:2 (link-scope) and ff05::1:3 (site-scope). Make sure we have + * a multicast route (ff00::/8) for client <-> server communication. + */ + err = nm_system_set_ip6_route (priv->ip_iface ? priv->ip_ifindex : priv->ifindex, + &dest, 8, NULL, 256, 0, RTPROT_BOOT, RT_TABLE_LOCAL, NULL); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to add IPv6 multicast route: %s", + priv->ip_iface ? priv->ip_iface : priv->iface, nl_geterror ()); + } + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); g_assert (s_con); uuid = nm_setting_connection_get_uuid (s_con); @@ -3289,7 +3312,7 @@ dispose (GObject *object) /* 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)) + if ( nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (self)) && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) { NMConnection *connection; NMSettingIP4Config *s_ip4; @@ -3352,7 +3375,8 @@ finalize (GObject *object) NMDevice *self = NM_DEVICE (object); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - g_object_unref (priv->dhcp_manager); + if (priv->dhcp_manager) + g_object_unref (priv->dhcp_manager); g_free (priv->udi); g_free (priv->iface); @@ -3844,6 +3868,14 @@ connection_match_config (NMDeviceInterface *device, const GSList *connections) return NULL; } +static gboolean +can_assume_connections (NMDeviceInterface *device) +{ + g_return_val_if_fail (device != NULL, FALSE); + + return !!NM_DEVICE_GET_CLASS (device)->connection_match_config; +} + void nm_device_set_dhcp_timeout (NMDevice *device, guint32 timeout) { diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 7c33d46695..566fc80a67 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -73,16 +73,17 @@ default_call_func (NMAuthChain *chain, nm_auth_chain_set_data (chain, permission, GUINT_TO_POINTER (result), NULL); } -NMAuthChain * -nm_auth_chain_new (PolkitAuthority *authority, - DBusGMethodInvocation *context, - DBusGProxy *proxy, - NMAuthChainResultFunc done_func, - gpointer user_data) +static NMAuthChain * +_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + DBusGProxy *proxy, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data) { NMAuthChain *self; - g_return_val_if_fail (context || proxy, NULL); + g_return_val_if_fail (context || proxy || message, NULL); self = g_malloc0 (sizeof (NMAuthChain)); self->refcount = 1; @@ -97,6 +98,8 @@ nm_auth_chain_new (PolkitAuthority *authority, self->owner = g_strdup (dbus_g_proxy_get_bus_name (proxy)); else if (context) self->owner = dbus_g_method_get_sender (context); + else if (message) + self->owner = g_strdup (dbus_message_get_sender (message)); if (!self->owner) { /* Need an owner */ @@ -108,6 +111,25 @@ nm_auth_chain_new (PolkitAuthority *authority, return self; } +NMAuthChain * +nm_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + DBusGProxy *proxy, + NMAuthChainResultFunc done_func, + gpointer user_data) +{ + return _auth_chain_new (authority, context, proxy, NULL, done_func, user_data); +} + +NMAuthChain * +nm_auth_chain_new_raw_message (PolkitAuthority *authority, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data) +{ + return _auth_chain_new (authority, NULL, NULL, message, done_func, user_data); +} + gpointer nm_auth_chain_get_data (NMAuthChain *self, const char *tag) { diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index e944d20685..13489f39db 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -60,6 +60,11 @@ NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, NMAuthChainResultFunc done_func, gpointer user_data); +NMAuthChain *nm_auth_chain_new_raw_message (PolkitAuthority *authority, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data); + gpointer nm_auth_chain_get_data (NMAuthChain *chain, const char *tag); void nm_auth_chain_set_data (NMAuthChain *chain, diff --git a/src/nm-manager.c b/src/nm-manager.c index 5a4d3cd259..5cef1fe6f0 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -19,6 +19,8 @@ * Copyright (C) 2007 - 2010 Red Hat, Inc. */ +#include <config.h> + #include <netinet/ether.h> #include <string.h> #include <dbus/dbus-glib-lowlevel.h> @@ -133,11 +135,24 @@ 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); + gboolean quitting); static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +static inline PolkitAuthority * +polkit_authority_get_sync (GCancellable *cancellable, GError **error) +{ + PolkitAuthority *authority; + + authority = polkit_authority_get (); + if (!authority) + g_set_error (error, 0, 0, "failed to get the PolicyKit authority"); + return authority; +} +#endif + #define SSD_POKE_INTERVAL 120 #define ORIGDEV_TAG "originating-device" @@ -350,8 +365,7 @@ modem_added (NMModemManager *modem_manager, priv->devices = remove_one_device (NM_MANAGER (user_data), priv->devices, replace_device, - FALSE, - TRUE); + FALSE); } /* Give Bluetooth DUN devices first chance to claim the modem */ @@ -450,20 +464,22 @@ static GSList * remove_one_device (NMManager *manager, GSList *list, NMDevice *device, - gboolean quitting, - gboolean force_unmanage) + gboolean quitting) { 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; + /* When quitting, we want to leave up interfaces & connections + * that can be taken over again (ie, "assumed") when NM restarts + * so that '/etc/init.d/NetworkManager restart' will not distrupt + * networking for interfaces that support connection assumption. + * All other devices get unmanaged when NM quits so that their + * connections get torn down and the interface is deactivated. + */ - if (unmanage || force_unmanage) + if ( !nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (device)) + || (nm_device_get_state (device) != NM_DEVICE_STATE_ACTIVATED) + || !quitting) nm_device_set_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED); } @@ -497,7 +513,7 @@ modem_removed (NMModemManager *modem_manager, /* 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); + priv->devices = remove_one_device (self, priv->devices, found, FALSE); } static void @@ -822,6 +838,7 @@ system_internal_new_connection (NMManager *manager, path = nm_connection_get_path (NM_CONNECTION (connection)); g_hash_table_insert (priv->system_connections, g_strdup (path), g_object_ref (connection)); + g_signal_emit (manager, signals[CONNECTION_ADDED], 0, connection); } static void @@ -1414,7 +1431,7 @@ add_device (NMManager *self, NMDevice *device) /* 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))) { + if (nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (device))) { GSList *connections = NULL; g_hash_table_iter_init (&iter, priv->system_connections); @@ -1572,7 +1589,7 @@ bluez_manager_resync_devices (NMManager *self) priv->devices = keep; while (g_slist_length (gone)) - gone = remove_one_device (self, gone, NM_DEVICE (gone->data), FALSE, TRUE); + gone = remove_one_device (self, gone, NM_DEVICE (gone->data), FALSE); } else { g_slist_free (keep); g_slist_free (gone); @@ -1641,7 +1658,7 @@ bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, 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); + priv->devices = remove_one_device (self, priv->devices, device, FALSE); break; } } @@ -1710,7 +1727,7 @@ udev_device_removed_cb (NMUdevManager *manager, 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); + priv->devices = remove_one_device (self, priv->devices, device, FALSE); } static void @@ -2015,7 +2032,7 @@ nm_manager_activate_connection (NMManager *manager, NMDevice *device = NULL; NMSettingConnection *s_con; NMVPNConnection *vpn_connection; - const char *path; + const char *path = NULL; g_return_val_if_fail (manager != NULL, NULL); g_return_val_if_fail (connection != NULL, NULL); @@ -2072,11 +2089,13 @@ nm_manager_activate_connection (NMManager *manager, 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); + if (vpn_connection) { + 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; @@ -2972,6 +2991,159 @@ firmware_dir_changed (GFileMonitor *monitor, } } +#define PERM_DENIED_ERROR "org.freedesktop.NetworkManager.PermissionDenied" + +static void +prop_set_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusGConnection *bus; + DBusConnection *dbus_connection; + NMAuthCallResult result; + DBusMessage *reply, *request; + const char *permission, *prop; + gboolean set_enabled = TRUE; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + request = nm_auth_chain_get_data (chain, "message"); + permission = nm_auth_chain_get_data (chain, "permission"); + prop = nm_auth_chain_get_data (chain, "prop"); + set_enabled = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enabled")); + + if (error) { + reply = dbus_message_new_error (request, PERM_DENIED_ERROR, + "Not authorized to perform this operation"); + } else { + /* Caller has had a chance to obtain authorization, so we only need to + * check for 'yes' here. + */ + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, permission)); + if (result != NM_AUTH_CALL_RESULT_YES) { + reply = dbus_message_new_error (request, PERM_DENIED_ERROR, + "Not authorized to perform this operation"); + } else { + g_object_set (self, prop, set_enabled, NULL); + reply = dbus_message_new_method_return (request); + } + } + + if (reply) { + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + + dbus_connection_send (dbus_connection, reply, NULL); + dbus_message_unref (reply); + } + nm_auth_chain_unref (chain); +} + +static DBusHandlerResult +prop_filter (DBusConnection *connection, + DBusMessage *message, + void *user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusMessageIter iter; + DBusMessageIter sub; + const char *propiface = NULL; + const char *propname = NULL; + const char *sender = NULL; + const char *glib_propname = NULL, *permission = NULL; + DBusError dbus_error; + gulong uid = G_MAXULONG; + DBusMessage *reply = NULL; + gboolean set_enabled = FALSE; + NMAuthChain *chain; + + /* The sole purpose of this function is to validate property accesses + * on the NMManager object since dbus-glib doesn't yet give us this + * functionality. + */ + + if (!dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set")) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + dbus_message_iter_init (message, &iter); + + /* Get the D-Bus interface of the property to set */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&iter, &propiface); + if (!propiface || strcmp (propiface, NM_DBUS_INTERFACE)) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_next (&iter); + + /* Get the property name that's going to be set */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&iter, &propname); + dbus_message_iter_next (&iter); + + if (!strcmp (propname, "WirelessEnabled")) { + glib_propname = NM_MANAGER_WIRELESS_ENABLED; + permission = NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI; + } else if (!strcmp (propname, "WwanEnabled")) { + glib_propname = NM_MANAGER_WWAN_ENABLED; + permission = NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN; + } else + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + /* Get the new value for the property */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_VARIANT) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_recurse (&iter, &sub); + if (dbus_message_iter_get_arg_type (&sub) != DBUS_TYPE_BOOLEAN) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&sub, &set_enabled); + + sender = dbus_message_get_sender (message); + if (!sender) { + reply = dbus_message_new_error (message, PERM_DENIED_ERROR, + "Could not determine D-Bus requestor"); + goto out; + } + + dbus_error_init (&dbus_error); + uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); + if (dbus_error_is_set (&dbus_error)) { + reply = dbus_message_new_error (message, PERM_DENIED_ERROR, + "Could not determine the user ID of the requestor"); + dbus_error_free (&dbus_error); + goto out; + } + + if (uid > 0) { + /* Otherwise validate the user request */ + chain = nm_auth_chain_new_raw_message (priv->authority, message, prop_set_auth_done_cb, self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + nm_auth_chain_set_data (chain, "prop", g_strdup (glib_propname), g_free); + nm_auth_chain_set_data (chain, "permission", g_strdup (permission), g_free); + nm_auth_chain_set_data (chain, "enabled", GUINT_TO_POINTER (set_enabled), NULL); + nm_auth_chain_set_data (chain, "message", dbus_message_ref (message), (GDestroyNotify) dbus_message_unref); + nm_auth_chain_add_call (chain, permission, TRUE); + } else { + /* Yay for root */ + g_object_set (self, glib_propname, set_enabled, NULL); + reply = dbus_message_new_method_return (message); + } + +out: + if (reply) { + dbus_connection_send (connection, reply, NULL); + dbus_message_unref (reply); + } + return DBUS_HANDLER_RESULT_HANDLED; +} + NMManager * nm_manager_get (const char *config_file, const char *plugins, @@ -2983,6 +3155,8 @@ nm_manager_get (const char *config_file, { static NMManager *singleton = NULL; NMManagerPrivate *priv; + DBusGConnection *bus; + DBusConnection *dbus_connection; if (singleton) return g_object_ref (singleton); @@ -2992,6 +3166,17 @@ nm_manager_get (const char *config_file, priv = NM_MANAGER_GET_PRIVATE (singleton); + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + + if (!dbus_connection_add_filter (dbus_connection, prop_filter, singleton, NULL)) { + nm_log_err (LOGD_CORE, "failed to register DBus connection filter"); + g_object_unref (singleton); + return NULL; + } + priv->sys_settings = nm_sysconfig_settings_new (config_file, plugins, error); if (!priv->sys_settings) { g_object_unref (singleton); @@ -3052,6 +3237,8 @@ dispose (GObject *object) { NMManager *manager = NM_MANAGER (object); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + DBusGConnection *bus; + DBusConnection *dbus_connection; if (priv->disposed) { G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); @@ -3070,8 +3257,7 @@ dispose (GObject *object) priv->devices = remove_one_device (manager, priv->devices, NM_DEVICE (priv->devices->data), - TRUE, - FALSE); + TRUE); } g_hash_table_foreach (priv->system_connections, emit_removed, manager); @@ -3103,7 +3289,14 @@ dispose (GObject *object) } g_object_unref (priv->modem_manager); + /* Unregister property filter */ + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + dbus_connection_remove_filter (dbus_connection, prop_filter, manager); g_object_unref (priv->dbus_mgr); + if (priv->bluez_mgr) g_object_unref (priv->bluez_mgr); @@ -3198,6 +3391,7 @@ nm_manager_init (NMManager *manager) DBusGConnection *g_connection; guint id, i; GFile *file; + GError *error = NULL; /* Initialize rfkill structures and states */ memset (priv->radio_states, 0, sizeof (priv->radio_states)); @@ -3275,14 +3469,18 @@ nm_manager_init (NMManager *manager) } else nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (NULL, &error); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, "changed", G_CALLBACK (pk_authority_changed_cb), manager); - } else - nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority."); + } else { + nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } /* Monitor the firmware directory */ if (strlen (KERNEL_FIRMWARE_DIR)) { diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 138b0fecd3..0403b03725 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -133,6 +133,7 @@ nm_policy_get_etc_hosts (const char **lines, gboolean hostname6_is_fallback; gboolean host4_before = FALSE; gboolean host6_before = FALSE; + char *short_hostname = NULL; g_return_val_if_fail (lines != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE); @@ -206,6 +207,24 @@ nm_policy_get_etc_hosts (const char **lines, return NULL; } + /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to + * make sure that the entries we add for this host also include the short + * hostname too so that if the resolver does not answer queries for the + * machine's actual hostname/domain, that stuff like 'ping foo' still works. + */ + if (!hostname4_is_fallback || !hostname6_is_fallback) { + char *dot; + + short_hostname = g_strdup (hostname); + dot = strchr (short_hostname, '.'); + if (dot && *(dot+1)) + *dot = '\0'; + else { + g_free (short_hostname); + short_hostname = NULL; + } + } + /* Construct the new hosts file; replace any 127.0.0.1/::1 entry that is * at the beginning of the file or right after initial comments and contains * the string 'localhost' (for IPv4) or 'localhost6' (for IPv6). If there @@ -229,21 +248,35 @@ nm_policy_get_etc_hosts (const char **lines, */ /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr && !found_user_host4) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); - if (!hostname6_is_fallback && ip6_addr && !found_user_host6) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + if (!hostname4_is_fallback && ip4_addr && !found_user_host4) { + g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } + if (!hostname6_is_fallback && ip6_addr && !found_user_host6) { + g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } /* IPv4 localhost line */ g_string_append (contents, "127.0.0.1"); - if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) + if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) { g_string_append_printf (contents, "\t%s", hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + } g_string_append_printf (contents, "\t%s\tlocalhost\n", fallback_hostname4); /* IPv6 localhost line */ g_string_append (contents, "::1"); - if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) + if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) { g_string_append_printf (contents, "\t%s", hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + } g_string_append_printf (contents, "\t%s\tlocalhost6\n", fallback_hostname6); added = TRUE; @@ -277,15 +310,24 @@ nm_policy_get_etc_hosts (const char **lines, g_string_append (contents, "# that require network functionality will fail.\n"); /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); - if (!hostname6_is_fallback && ip6_addr) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + if (!hostname4_is_fallback && ip4_addr) { + g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } + if (!hostname6_is_fallback && ip6_addr) { + g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); } + g_free (short_hostname); return contents; } diff --git a/src/nm-policy.c b/src/nm-policy.c index 3944448fd1..50c57c1628 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -138,7 +138,8 @@ get_best_ip4_device (NMManager *manager, NMActRequest **out_req) continue; /* 'never-default' devices can't ever be the default */ - if (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + if ( (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + || nm_ip4_config_get_never_default (ip4_config)) continue; prio = nm_device_get_priority (dev); @@ -482,6 +483,13 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) /* If it's marked 'never-default', don't make it default */ vpn_connection = nm_vpn_connection_get_connection (candidate); g_assert (vpn_connection); + + /* Check the active IP4 config from the VPN service daemon */ + ip4_config = nm_vpn_connection_get_ip4_config (candidate); + if (ip4_config && nm_ip4_config_get_never_default (ip4_config)) + can_default = FALSE; + + /* Check the user's preference from the NMConnection */ 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; @@ -493,7 +501,6 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) 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); @@ -1205,6 +1212,7 @@ nm_policy_destroy (NMPolicy *policy) g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_activated_id); g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_deactivated_id); + g_object_unref (policy->vpn_manager); for (iter = policy->signal_ids; iter; iter = g_slist_next (iter)) g_signal_handler_disconnect (policy->manager, (gulong) iter->data); diff --git a/src/nm-system.c b/src/nm-system.c index 87e83a571b..24c31c2772 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -481,32 +481,34 @@ nm_system_apply_ip4_config (const char *iface, 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) +int +nm_system_set_ip6_route (int ifindex, + const struct in6_addr *ip6_dest, + guint32 ip6_prefix, + const struct in6_addr *ip6_gateway, + guint32 metric, + int mss, + int protocol, + int table, + struct rtnl_route **out_route) { struct nl_handle *nlh; struct rtnl_route *route; struct nl_addr *dest_addr; struct nl_addr *gw_addr = NULL; - int err, iface_idx; + int err = 0; - nlh = nm_netlink_get_default_handle (); - g_return_val_if_fail (nlh != NULL, NULL); + g_return_val_if_fail (ifindex >= 0, -1); - iface_idx = nm_netlink_iface_to_index (iface); - g_return_val_if_fail (iface_idx >= 0, NULL); + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, -1); - route = create_route (iface_idx, mss); - g_return_val_if_fail (route != NULL, NULL); + route = create_route (ifindex, mss); + g_return_val_if_fail (route != NULL, -1); /* 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); + g_return_val_if_fail (dest_addr != NULL, -1); nl_addr_set_prefixlen (dest_addr, (int) ip6_prefix); rtnl_route_set_dst (route, dest_addr); @@ -521,7 +523,7 @@ nm_system_device_set_ip6_route (const char *iface, } else { nm_log_warn (LOGD_DEVICE | LOGD_IP6, "Invalid gateway"); rtnl_route_put (route); - return NULL; + return -1; } } @@ -529,13 +531,19 @@ nm_system_device_set_ip6_route (const char *iface, if (metric) rtnl_route_set_prio (route, metric); + if (protocol) + rtnl_route_set_protocol (route, protocol); + + if (table) + rtnl_route_set_table (route, table); + /* 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); + route2 = create_route (ifindex, mss); if (route2) { /* Add route to gateway over bridge */ rtnl_route_set_dst (route2, gw_addr); @@ -553,15 +561,12 @@ nm_system_device_set_ip6_route (const char *iface, 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 ()); + if (out_route) + *out_route = route; + else rtnl_route_put (route); - route = NULL; - } - return route; + return err; } static gboolean @@ -618,24 +623,33 @@ nm_system_apply_ip6_config (const char *iface, } if (flags & NM_IP6_COMPARE_FLAG_ROUTES) { + int ifindex = nm_netlink_iface_to_index (iface); + 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; + int err; /* 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))) + && 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); + err = nm_system_set_ip6_route (ifindex, + 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), + RTPROT_UNSPEC, + RT_TABLE_UNSPEC, + NULL); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 route: %s", + iface, nl_geterror ()); + } } } @@ -1225,6 +1239,45 @@ foreach_route (void (*callback)(struct nl_object *, gpointer), nl_cache_free (route_cache); } +static void +dump_route (struct rtnl_route *route) +{ + char buf6[INET6_ADDRSTRLEN]; + char buf4[INET_ADDRSTRLEN]; + struct nl_addr *nl; + struct in6_addr *addr6 = NULL; + struct in_addr *addr4 = NULL; + int prefixlen = 0; + const char *sf = "UNSPEC"; + int family = rtnl_route_get_family (route); + + memset (buf6, 0, sizeof (buf6)); + memset (buf4, 0, sizeof (buf4)); + nl = rtnl_route_get_dst (route); + if (nl) { + if (rtnl_route_get_family (route) == AF_INET) { + addr4 = nl_addr_get_binary_addr (nl); + if (addr4) + inet_ntop (AF_INET, addr4, &buf4[0], sizeof (buf4)); + } else if (rtnl_route_get_family (route) == AF_INET6) { + addr6 = nl_addr_get_binary_addr (nl); + if (addr6) + inet_ntop (AF_INET6, addr6, &buf6[0], sizeof (buf6)); + } + prefixlen = nl_addr_get_prefixlen (nl); + } + + if (family == AF_INET) + sf = "INET"; + else if (family == AF_INET6) + sf = "INET6"; + + nm_log_dbg (LOGD_IP4 | LOGD_IP6, " route idx %d family %s (%d) addr %s/%d", + rtnl_route_get_oif (route), + sf, family, + strlen (buf4) ? buf4 : (strlen (buf6) ? buf6 : "<unknown>"), + prefixlen); +} typedef struct { const char *iface; @@ -1238,6 +1291,10 @@ 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; + guint32 log_level = LOGD_IP4 | LOGD_IP6; + + if (nm_logging_level_enabled (LOGL_DEBUG)) + dump_route (route); /* Delete all routes from this interface */ if (rtnl_route_get_oif (route) != data->iface_idx) @@ -1259,11 +1316,19 @@ check_one_route (struct nl_object *object, void *user_data) addr = nl_addr_get_binary_addr (nl); if (addr) { - if (IN6_IS_ADDR_LINKLOCAL (addr) || IN6_IS_ADDR_MC_LINKLOCAL (addr)) + if ( IN6_IS_ADDR_LINKLOCAL (addr) + || IN6_IS_ADDR_MC_LINKLOCAL (addr) + || (IN6_IS_ADDR_MULTICAST (addr) && (nl_addr_get_prefixlen (nl) == 8))) return; } } + if (data->family == AF_INET) + log_level = LOGD_IP4; + else if (data->family == AF_INET6) + log_level = LOGD_IP6; + nm_log_dbg (log_level, " deleting route"); + err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); if (err < 0 && (err != -ERANGE)) { nm_log_err (LOGD_DEVICE, @@ -1275,6 +1340,8 @@ check_one_route (struct nl_object *object, void *user_data) static void flush_routes (int ifindex, const char *iface, int family) { RouteCheckData check_data; + guint32 log_level = LOGD_IP4 | LOGD_IP6; + const char *sf = "UNSPEC"; g_return_if_fail (iface != NULL); @@ -1286,6 +1353,16 @@ static void flush_routes (int ifindex, const char *iface, int family) } } + if (family == AF_INET) { + log_level = LOGD_IP4; + sf = "INET"; + } else if (family == AF_INET6) { + log_level = LOGD_IP6; + sf = "INET6"; + } + nm_log_dbg (log_level, "(%s): flushing routes ifindex %d family %s (%d)", + iface, ifindex, sf, family); + memset (&check_data, 0, sizeof (check_data)); check_data.iface = iface; check_data.iface_idx = ifindex; diff --git a/src/nm-system.h b/src/nm-system.h index 29455cb4bf..8cb22d747a 100644 --- a/src/nm-system.h +++ b/src/nm-system.h @@ -66,6 +66,16 @@ gboolean nm_system_apply_ip4_config (const char *iface, int priority, NMIP4ConfigCompareFlags flags); +int nm_system_set_ip6_route (int ifindex, + const struct in6_addr *ip6_dest, + guint32 ip6_prefix, + const struct in6_addr *ip6_gateway, + guint32 metric, + int mss, + int protocol, + int table, + struct rtnl_route **out_route); + gboolean nm_system_apply_ip6_config (const char *iface, NMIP6Config *config, int priority, diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index 8a7e4e84d1..7770b8bc42 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -153,6 +153,8 @@ set_property (GObject *object, guint prop_id, case PROP_STRENGTH: nm_ap_set_strength (ap, g_value_get_char (value)); break; + case PROP_HW_ADDRESS: + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -242,7 +244,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_FLAGS_NONE, NM_802_11_AP_FLAGS_PRIVACY, NM_802_11_AP_FLAGS_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_WPA_FLAGS, @@ -252,7 +254,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_SEC_NONE, all_sec_flags, NM_802_11_AP_SEC_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_RSN_FLAGS, @@ -262,7 +264,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_SEC_NONE, all_sec_flags, NM_802_11_AP_SEC_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_SSID, @@ -270,7 +272,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "SSID", "SSID", DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_FREQUENCY, @@ -278,7 +280,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Frequency", "Frequency", 0, 10000, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_HW_ADDRESS, @@ -286,7 +288,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "MAC Address", "Hardware MAC address", NULL, - G_PARAM_READABLE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_MODE, @@ -294,7 +296,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Mode", "Mode", NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_MAX_BITRATE, @@ -302,7 +304,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Max Bitrate", "Max Bitrate", 0, G_MAXUINT16, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_STRENGTH, @@ -310,7 +312,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Strength", "Strength", G_MININT8, G_MAXINT8, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /* Signals */ signals[PROPERTIES_CHANGED] = diff --git a/src/system-settings/nm-polkit-helpers.h b/src/system-settings/nm-polkit-helpers.h index 0ca3ca0f88..48841486c2 100644 --- a/src/system-settings/nm-polkit-helpers.h +++ b/src/system-settings/nm-polkit-helpers.h @@ -16,12 +16,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2008 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #ifndef NM_POLKIT_HELPERS_H #define NM_POLKIT_HELPERS_H +#include <config.h> #include <polkit/polkit.h> #define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.NetworkManager.settings.modify" @@ -29,4 +30,18 @@ #define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.settings.wifi.share.open" #define NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY "org.freedesktop.NetworkManager.settings.hostname.modify" +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +static inline PolkitAuthority * +polkit_authority_get_sync (GCancellable *cancellable, GError **error) +{ + PolkitAuthority *authority; + + authority = polkit_authority_get (); + if (!authority) + g_set_error (error, 0, 0, "failed to get the PolicyKit authority"); + return authority; +} +#endif + #endif /* NM_POLKIT_HELPERS_H */ diff --git a/src/system-settings/nm-session-manager.c b/src/system-settings/nm-session-manager.c index e089cf6a0a..3b36a08c08 100644 --- a/src/system-settings/nm-session-manager.c +++ b/src/system-settings/nm-session-manager.c @@ -162,7 +162,7 @@ get_unix_user_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data guint user_id; struct passwd *pw_info = NULL; int ngroups; - guint group_ids_size; + guint group_ids_size = 0; gid_t *group_ids = NULL; GSList *group_names = NULL; NMSessionInfo *session = NULL; @@ -196,7 +196,7 @@ get_unix_user_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data // Get the list of group IDs // FIXME what happens if the group list changes in the window between the // two getgrouplist calls? - group_ids_size = ngroups * sizeof(gid_t); + group_ids_size = ngroups * sizeof (gid_t); group_ids = g_slice_alloc (group_ids_size); if (getgrouplist (pw_info->pw_name, pw_info->pw_gid, group_ids, &ngroups) == -1) { error = g_error_new (NM_SESSION_MANAGER_ERROR, diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c index e5fa90fe9a..62e776ee12 100644 --- a/src/system-settings/nm-sysconfig-connection.c +++ b/src/system-settings/nm-sysconfig-connection.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2008 - 2009 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #include <NetworkManager.h> @@ -1004,10 +1004,14 @@ nm_sysconfig_connection_init (NMSysconfigConnection *self) NMSessionManager *session_manager; static guint32 dbus_counter = 0; char *dbus_path; + GError *error = NULL; - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (NULL, NULL); if (!priv->authority) { - nm_log_err (LOGD_SYS_SET, "%s:error creating PolicyKit authority"); + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } dbus_path = g_strdup_printf ("%s/%u", NM_DBUS_PATH_SETTINGS, dbus_counter++); diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 7b8ec9057d..67355258d8 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -1601,17 +1601,22 @@ static void nm_sysconfig_settings_init (NMSysconfigSettings *self) { NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GError *error = NULL; priv->visible_connections = g_hash_table_new (g_direct_hash, g_direct_equal); priv->all_connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (NULL, &error); 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."); + } else { + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } } diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index e3401fe6b4..e6775f35e8 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -375,6 +375,24 @@ test_hosts_named46_non127 (void) /*******************************************/ +static const char *named46_non127_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\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space comet\n" + "3001:abba::3234 comet.space comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_long (void) +{ + test_generic (named46_non127_long_before, NULL, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_other4_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -404,6 +422,35 @@ test_hosts_named46_non127_other4 (void) /*******************************************/ +static const char *named46_non127_other4_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\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet.space\n" + "3001:abba::3234 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other4_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "192.168.1.2 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet.space\n" + "3001:abba::3234 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other4_long (void) +{ + test_generic (named46_non127_other4_long_before, named46_non127_other4_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_other6_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -433,6 +480,35 @@ test_hosts_named46_non127_other6 (void) /*******************************************/ +static const char *named46_non127_other6_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\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space\n" + "3001:abba::9675 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other6_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "3001:abba::3234 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space\n" + "3001:abba::9675 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other6_long (void) +{ + test_generic (named46_non127_other6_long_before, named46_non127_other6_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *unnamed46_non127_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -459,6 +535,32 @@ test_hosts_unnamed46_non127 (void) /*******************************************/ +static const char *unnamed46_non127_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\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *unnamed46_non127_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "192.168.1.2 comet.space comet # Added by NetworkManager\n" + "3001:abba::3234 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_unnamed46_non127_long (void) +{ + test_generic (unnamed46_non127_long_before, unnamed46_non127_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_wrong_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -569,7 +671,11 @@ test_find_token (void) } } +#if GLIB_CHECK_VERSION(2,25,12) +typedef GTestFixtureFunc TCFunc; +#else typedef void (*TCFunc)(void); +#endif #define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) @@ -592,10 +698,14 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127_more, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127_more, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_wrong, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127_long, 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)); diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index bda021992d..51f3257294 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -381,6 +381,9 @@ print_vpn_config (NMIP4Config *config, ip_address_to_string (nm_ip4_route_get_next_hop (route))); } + nm_log_info (LOGD_VPN, "Forbid Default Route: %s", + nm_ip4_config_get_never_default (config) ? "yes" : "no"); + num = nm_ip4_config_get_num_nameservers (config); for (i = 0; i < num; i++) { nm_log_info (LOGD_VPN, "Internal IP4 DNS: %s", @@ -526,6 +529,10 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, g_slist_free (routes); } + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT); + if (val && G_VALUE_HOLDS_BOOLEAN (val)) + nm_ip4_config_set_never_default (config, g_value_get_boolean (val)); + print_vpn_config (config, priv->ip4_internal_gw, priv->ip_iface, priv->banner); /* Merge in user overrides from the NMConnection's IPv4 setting */ diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c index 309331aede..4b58be0d48 100644 --- a/src/vpn-manager/nm-vpn-manager.c +++ b/src/vpn-manager/nm-vpn-manager.c @@ -15,11 +15,12 @@ * 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 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ #include <string.h> +#include <gio/gio.h> #include "nm-vpn-manager.h" #include "nm-vpn-service.h" @@ -28,13 +29,18 @@ #include "nm-dbus-manager.h" #include "NetworkManagerVPN.h" #include "nm-marshal.h" +#include "nm-logging.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; + gboolean disposed; + + GHashTable *services; + GFileMonitor *monitor; + guint monitor_id; } NMVPNManagerPrivate; enum { @@ -81,53 +87,42 @@ nm_vpn_manager_error_get_type (void) } - static NMVPNService * -nm_vpn_manager_get_service (NMVPNManager *manager, const char *service_name) +get_service_by_namefile (NMVPNManager *self, const char *namefile) { - GSList *iter; + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GHashTableIter iter; + gpointer data; - for (iter = NM_VPN_MANAGER_GET_PRIVATE (manager)->services; iter; iter = iter->next) { - NMVPNService *service = NM_VPN_SERVICE (iter->data); + g_return_val_if_fail (namefile, NULL); + g_return_val_if_fail (g_path_is_absolute (namefile), NULL); - if (!strcmp (service_name, nm_vpn_service_get_name (service))) - return g_object_ref (service); - } + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + NMVPNService *candidate = NM_VPN_SERVICE (data); + const char *service_namefile; + service_namefile = nm_vpn_service_get_name_file (candidate); + if (!strcmp (namefile, service_namefile)) + return candidate; + } 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) +find_active_vpn_connection_by_connection (NMVPNManager *self, NMConnection *connection) { - NMVPNManagerPrivate *priv; - GSList *iter; + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GHashTableIter iter; + gpointer data; + GSList *connections, *elt; - g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + g_return_val_if_fail (connection, 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)); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = connections; elt; elt = g_slist_next (elt)) { NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); @@ -169,7 +164,7 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager, NMSettingVPN *vpn_setting; NMVPNService *service; NMVPNConnection *vpn = NULL; - const char *service_type; + const char *service_name; g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -199,78 +194,78 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager, vpn = NULL; } - service_type = nm_setting_vpn_get_service_type (vpn_setting); - service = nm_vpn_manager_get_service (manager, service_type); + service_name = nm_setting_vpn_get_service_type (vpn_setting); + g_assert (service_name); + service = g_hash_table_lookup (NM_VPN_MANAGER_GET_PRIVATE (manager)->services, service_name); 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."); + "The VPN service '%s' was not installed.", + service_name); + return NULL; + } + + 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); } return vpn; } gboolean -nm_vpn_manager_deactivate_connection (NMVPNManager *manager, +nm_vpn_manager_deactivate_connection (NMVPNManager *self, const char *path, NMVPNConnectionStateReason reason) { NMVPNManagerPrivate *priv; - GSList *iter; - gboolean found = FALSE; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; - g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), FALSE); + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (NM_IS_VPN_MANAGER (self), 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)) { + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); + for (elt = active; 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 TRUE; } } } - return found ? TRUE : FALSE; + return FALSE; } void -nm_vpn_manager_add_active_connections (NMVPNManager *manager, +nm_vpn_manager_add_active_connections (NMVPNManager *self, NMConnection *filter, GPtrArray *array) { NMVPNManagerPrivate *priv; - GSList *iter; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; - g_return_if_fail (NM_IS_VPN_MANAGER (manager)); + g_return_if_fail (self); + g_return_if_fail (NM_IS_VPN_MANAGER (self)); 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)); + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) { NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); const char *path; @@ -284,23 +279,23 @@ nm_vpn_manager_add_active_connections (NMVPNManager *manager, } GSList * -nm_vpn_manager_get_active_connections (NMVPNManager *manager) +nm_vpn_manager_get_active_connections (NMVPNManager *self) { NMVPNManagerPrivate *priv; - GSList *iter; - GSList *list = NULL; + GHashTableIter iter; + gpointer data; + GSList *list = NULL, *active, *elt; - 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; + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_VPN_MANAGER (self), NULL); - active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) - list = g_slist_append (list, g_object_ref (NM_VPN_CONNECTION (elt->data))); + list = g_slist_append (list, g_object_ref (G_OBJECT (elt->data))); } - return list; } @@ -309,28 +304,130 @@ nm_vpn_manager_get_connection_for_active (NMVPNManager *manager, const char *active_path) { NMVPNManagerPrivate *priv; - GSList *iter; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; 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)); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) { - NMVPNConnection *candidate = NM_VPN_CONNECTION (elt->data); + NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); const char *ac_path; - ac_path = nm_vpn_connection_get_active_connection_path (candidate); + ac_path = nm_vpn_connection_get_active_connection_path (vpn); if (ac_path && !strcmp (ac_path, active_path)) - return nm_vpn_connection_get_connection (candidate); + return nm_vpn_connection_get_connection (vpn); } } return NULL; } +static char * +service_name_from_file (const char *path) +{ + GKeyFile *kf = NULL; + char *service_name = NULL; + + g_return_val_if_fail (g_path_is_absolute (path), NULL); + + if (!g_str_has_suffix (path, ".name")) + return NULL; + + kf = g_key_file_new (); + if (g_key_file_load_from_file (kf, path, G_KEY_FILE_NONE, NULL)) + service_name = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "service", NULL); + + g_key_file_free (kf); + return service_name; +} + +static void +try_add_service (NMVPNManager *self, const char *namefile) +{ + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + NMVPNService *service = NULL; + GError *error = NULL; + const char *service_name; + char *tmp; + + g_return_if_fail (g_path_is_absolute (namefile)); + + /* Make sure we don't add dupes */ + tmp = service_name_from_file (namefile); + if (tmp) + service = g_hash_table_lookup (priv->services, tmp); + g_free (tmp); + if (service) + return; + + /* New service, add it */ + service = nm_vpn_service_new (namefile, &error); + if (!service) { + nm_log_warn (LOGD_VPN, "failed to load VPN service file %s: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + return; + } + + service_name = nm_vpn_service_get_dbus_service (service); + g_hash_table_insert (priv->services, (char *) service_name, service); + nm_log_info (LOGD_VPN, "VPN: loaded %s", service_name, service); +} + +static void +vpn_dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + NMVPNManager *self = NM_VPN_MANAGER (user_data); + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + NMVPNService *service; + char *path; + + path = g_file_get_path (file); + if (!g_str_has_suffix (path, ".name")) { + g_free (path); + return; + } + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + nm_log_dbg (LOGD_VPN, "service file %s deleted", path); + + service = get_service_by_namefile (self, path); + if (service) { + const char *service_name = nm_vpn_service_get_dbus_service (service); + + /* Stop active VPN connections and destroy the service */ + nm_vpn_service_connections_stop (service, TRUE, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); + nm_log_info (LOGD_VPN, "VPN: unloaded %s", service_name, service); + g_hash_table_remove (priv->services, service_name); + } + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + nm_log_dbg (LOGD_VPN, "service file %s created or modified", path); + try_add_service (self, path); + break; + default: + nm_log_dbg (LOGD_VPN, "service file %s change event %d", path, event_type); + break; + } + + g_free (path); +} + +/******************************************************************************/ + NMVPNManager * nm_vpn_manager_get (void) { @@ -345,21 +442,61 @@ nm_vpn_manager_get (void) return singleton; } -/******************************************************************************/ - static void -nm_vpn_manager_init (NMVPNManager *manager) +nm_vpn_manager_init (NMVPNManager *self) { + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GFile *file; + GDir *dir; + const char *fn; + char *path; + + priv->services = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, g_object_unref); + + /* Watch the VPN directory for changes */ + file = g_file_new_for_path (VPN_NAME_FILES_DIR "/"); + priv->monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + if (priv->monitor) { + priv->monitor_id = g_signal_connect (priv->monitor, "changed", + G_CALLBACK (vpn_dir_changed), self); + } + + /* Load VPN service files */ + dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL); + if (dir) { + while ((fn = g_dir_read_name (dir))) { + /* only parse filenames that end with .name */ + if (g_str_has_suffix (fn, ".name")) { + path = g_build_filename (VPN_NAME_FILES_DIR, fn, NULL); + try_add_service (self, path); + g_free (path); + } + } + g_dir_close (dir); + } } static void -finalize (GObject *object) +dispose (GObject *object) { NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (object); - g_slist_foreach (priv->services, (GFunc) g_object_unref, NULL); + if (!priv->disposed) { + 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); + } + + g_hash_table_destroy (priv->services); + } - G_OBJECT_CLASS (nm_vpn_manager_parent_class)->finalize (object); + G_OBJECT_CLASS (nm_vpn_manager_parent_class)->dispose (object); } static void @@ -370,7 +507,7 @@ nm_vpn_manager_class_init (NMVPNManagerClass *manager_class) g_type_class_add_private (manager_class, sizeof (NMVPNManagerPrivate)); /* virtual methods */ - object_class->finalize = finalize; + object_class->dispose = dispose; /* signals */ signals[CONNECTION_ACTIVATED] = diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c index bdbb3774a0..37bd75d4eb 100644 --- a/src/vpn-manager/nm-vpn-service.c +++ b/src/vpn-manager/nm-vpn-service.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -36,125 +36,94 @@ G_DEFINE_TYPE (NMVPNService, nm_vpn_service, G_TYPE_OBJECT) typedef struct { + gboolean disposed; + NMDBusManager *dbus_mgr; char *name; char *dbus_service; char *program; + char *namefile; GPid pid; GSList *connections; - guint service_start_timeout; - guint service_child_watch; + guint start_timeout; + guint quit_timeout; + guint 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) +nm_vpn_service_new (const char *namefile, GError **error) { - GKeyFile *key_file; - NMVPNService *service = NULL; - NMVPNServicePrivate *priv; - char *dbus_service = NULL; - char *program = NULL; - gboolean success = FALSE; + NMVPNService *self = NULL; + GKeyFile *kf; + char *dbus_service = NULL, *program = NULL, *name = NULL; - g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (namefile != NULL, NULL); + g_return_val_if_fail (g_path_is_absolute (namefile), NULL); - key_file = find_service_file (name); - if (!key_file) + kf = g_key_file_new (); + if (!g_key_file_load_from_file (kf, namefile, G_KEY_FILE_NONE, error)) { + g_key_file_free (kf); return NULL; + } - dbus_service = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "service", NULL); - if (!dbus_service) + dbus_service = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "service", NULL); + if (!dbus_service) { + g_set_error (error, 0, 0, "VPN service file %s had no 'service' key", namefile); goto out; + } - program = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "program", NULL); - if (!program) + program = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "program", NULL); + if (!program) { + g_set_error (error, 0, 0, "VPN service file %s had no 'program' key", namefile); goto out; + } - service = (NMVPNService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL); - if (!service) + name = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "name", NULL); + if (!name) { + g_set_error (error, 0, 0, "VPN service file %s had no 'name' key", namefile); goto out; + } - priv = NM_VPN_SERVICE_GET_PRIVATE (service); - - priv->name = g_strdup (name); - priv->dbus_service = dbus_service; - priv->program = program; + self = (NMVPNService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL); + if (!self) { + g_set_error (error, 0, 0, "out of memory creating VPN service object"); + goto out; + } - success = TRUE; + NM_VPN_SERVICE_GET_PRIVATE (self)->name = g_strdup (name); + NM_VPN_SERVICE_GET_PRIVATE (self)->dbus_service = g_strdup (dbus_service); + NM_VPN_SERVICE_GET_PRIVATE (self)->program = g_strdup (program); + NM_VPN_SERVICE_GET_PRIVATE (self)->namefile = g_strdup (namefile); out: - g_key_file_free (key_file); + g_key_file_free (kf); + g_free (dbus_service); + g_free (program); + g_free (name); + return self; +} - if (!success) { - g_free (dbus_service); - g_free (program); - } +const char * +nm_vpn_service_get_dbus_service (NMVPNService *service) +{ + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); - return service; + return NM_VPN_SERVICE_GET_PRIVATE (service)->dbus_service; } const char * -nm_vpn_service_get_name (NMVPNService *service) +nm_vpn_service_get_name_file (NMVPNService *service) { g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); - return NM_VPN_SERVICE_GET_PRIVATE (service)->name; + return NM_VPN_SERVICE_GET_PRIVATE (service)->namefile; } -static void +void nm_vpn_service_connections_stop (NMVPNService *service, gboolean fail, NMVPNConnectionStateReason reason) @@ -175,6 +144,17 @@ nm_vpn_service_connections_stop (NMVPNService *service, g_slist_free (copy); } +static void +clear_quit_timeout (NMVPNService *self) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); + + if (priv->quit_timeout) { + g_source_remove (priv->quit_timeout); + priv->quit_timeout = 0; + } +} + /* * nm_vpn_service_child_setup * @@ -200,21 +180,22 @@ vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) if (err != 0) { nm_log_warn (LOGD_VPN, "VPN service '%s' exited with error: %d", - nm_vpn_service_get_name (service), WSTOPSIG (status)); + priv->name, 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)); + priv->name, 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)); + priv->name, WTERMSIG (status)); } else { nm_log_warn (LOGD_VPN, "VPN service '%s' died from an unknown cause", - nm_vpn_service_get_name (service)); + priv->name); } priv->pid = 0; - priv->service_child_watch = 0; + priv->child_watch = 0; + clear_quit_timeout (service); nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); } @@ -222,14 +203,12 @@ vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) 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); + NMVPNService *self = NM_VPN_SERVICE (data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); + nm_log_warn (LOGD_VPN, "VPN service '%s' start timed out", priv->name); + priv->start_timeout = 0; + nm_vpn_service_connections_stop (self, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT); return FALSE; } @@ -253,13 +232,15 @@ nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) &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->name, 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); + priv->child_watch = g_child_watch_add (priv->pid, vpn_service_watch_cb, service); + priv->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); + priv->name, + spawn_error ? spawn_error->code : -1, + spawn_error && spawn_error->message ? spawn_error->message : "(unknown)"); g_set_error (error, NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, @@ -274,9 +255,40 @@ nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) } static gboolean -destroy_service (gpointer data) +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 gboolean +service_quit (gpointer user_data) { - g_object_unref (data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (user_data); + + 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; + } + priv->quit_timeout = 0; return FALSE; } @@ -297,8 +309,9 @@ connection_vpn_state_changed (NMVPNConnection *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); + /* Tell the service to quit in a few seconds */ + if (!priv->quit_timeout) + priv->quit_timeout = g_timeout_add_seconds (5, service_quit, user_data); } break; default: @@ -325,6 +338,8 @@ nm_vpn_service_activate (NMVPNService *service, priv = NM_VPN_SERVICE_GET_PRIVATE (service); + clear_quit_timeout (service); + vpn = nm_vpn_connection_new (connection, act_request, device); g_signal_connect (vpn, "vpn-state-changed", G_CALLBACK (connection_vpn_state_changed), @@ -335,9 +350,8 @@ nm_vpn_service_activate (NMVPNService *service, 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)); + } else if (priv->start_timeout == 0) { + nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", priv->name); if (!nm_vpn_service_daemon_exec (service, error)) vpn = NULL; } @@ -364,14 +378,15 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); gboolean old_owner_good; gboolean new_owner_good; + GSList *iter; 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; + if (priv->start_timeout) { + g_source_remove (priv->start_timeout); + priv->start_timeout = 0; } old_owner_good = (old && (strlen (old) > 0)); @@ -379,18 +394,14 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, 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)); + nm_log_info (LOGD_VPN, "VPN service '%s' appeared; activating connections", priv->name); + clear_quit_timeout (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_log_info (LOGD_VPN, "VPN service '%s' disappeared", priv->name); nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); } } @@ -398,40 +409,28 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, /******************************************************************************/ static void -nm_vpn_service_init (NMVPNService *service) +nm_vpn_service_init (NMVPNService *self) { - NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); 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; + G_CALLBACK (nm_vpn_service_name_owner_changed), + self); } static void -finalize (GObject *object) +dispose (GObject *object) { - NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (object); + NMVPNService *self = NM_VPN_SERVICE (object); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); - if (priv->service_start_timeout) - g_source_remove (priv->service_start_timeout); + if (priv->disposed) + goto out; + priv->disposed = TRUE; + + if (priv->start_timeout) + g_source_remove (priv->start_timeout); nm_vpn_service_connections_stop (NM_VPN_SERVICE (object), FALSE, @@ -439,31 +438,21 @@ finalize (GObject *object) 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->child_watch) + g_source_remove (priv->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; - } + clear_quit_timeout (self); + service_quit (self); g_object_unref (priv->dbus_mgr); g_free (priv->name); g_free (priv->dbus_service); g_free (priv->program); + g_free (priv->namefile); - G_OBJECT_CLASS (nm_vpn_service_parent_class)->finalize (object); +out: + G_OBJECT_CLASS (nm_vpn_service_parent_class)->dispose (object); } static void @@ -474,5 +463,5 @@ nm_vpn_service_class_init (NMVPNServiceClass *service_class) g_type_class_add_private (service_class, sizeof (NMVPNServicePrivate)); /* virtual methods */ - object_class->finalize = finalize; + object_class->dispose = dispose; } diff --git a/src/vpn-manager/nm-vpn-service.h b/src/vpn-manager/nm-vpn-service.h index 9c5e0eefc9..c7c1b0366a 100644 --- a/src/vpn-manager/nm-vpn-service.h +++ b/src/vpn-manager/nm-vpn-service.h @@ -35,6 +35,8 @@ #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)) +#define VPN_CONNECTION_GROUP "VPN Connection" + typedef struct { GObject parent; } NMVPNService; @@ -45,9 +47,13 @@ typedef struct { GType nm_vpn_service_get_type (void); -NMVPNService * nm_vpn_service_new (const char *service_name); +NMVPNService * nm_vpn_service_new (const char *namefile, GError **error); + +/* Returns the VPN service's D-Bus service name */ +const char *nm_vpn_service_get_dbus_service (NMVPNService *service); -const char * nm_vpn_service_get_name (NMVPNService *service); +/* Returns the path of the VPN service's .name file */ +const char *nm_vpn_service_get_name_file (NMVPNService *service); NMVPNConnection * nm_vpn_service_activate (NMVPNService *service, NMConnection *connection, @@ -57,4 +63,8 @@ NMVPNConnection * nm_vpn_service_activate (NMVPNService *service, GSList * nm_vpn_service_get_active_connections (NMVPNService *service); +void nm_vpn_service_connections_stop (NMVPNService *service, + gboolean fail, + NMVPNConnectionStateReason reason); + #endif /* NM_VPN_VPN_SERVICE_H */ diff --git a/system-settings/plugins/Makefile.am b/system-settings/plugins/Makefile.am index 94f75600d1..5df57d5ea7 100644 --- a/system-settings/plugins/Makefile.am +++ b/system-settings/plugins/Makefile.am @@ -15,3 +15,7 @@ endif if TARGET_DEBIAN SUBDIRS+=ifupdown endif + +if TARGET_GENTOO +SUBDIRS+=ifnet +endif diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index 921f7f73df..e7cd93e908 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -33,6 +33,8 @@ #define ORIG_TAG ".orig" #define REJ_TAG ".rej" #define RPMNEW_TAG ".rpmnew" +#define AUGNEW_TAG ".augnew" +#define AUGTMP_TAG ".augtmp" #define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts" diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index c328a33367..5bd57a030b 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -165,7 +165,7 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " error: %s", (error && error->message) ? error->message : "(unknown)"); } - g_error_free (error); + g_clear_error (&error); } return connection; @@ -341,25 +341,25 @@ dir_changed (GFileMonitor *monitor, 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 */ + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); + if (connection) + handle_connection_remove_or_new (plugin, name, connection, TRUE, FALSE); + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + /* Update */ + if (!connection) + do_new = TRUE; + else 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); + handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new); + break; + default: + break; + } g_free (name); } @@ -551,7 +551,7 @@ impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, } connection = g_hash_table_lookup (priv->connections, in_ifcfg); - if (!connection) { + if (!connection || nm_ifcfg_connection_get_unmanaged_spec (connection)) { g_set_error (error, NM_SYSCONFIG_SETTINGS_ERROR, NM_SYSCONFIG_SETTINGS_ERROR_INVALID_CONNECTION, diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a8ce149467..f1bf540e0b 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3183,6 +3183,12 @@ is_wireless_device (const char *iface) return is_wireless; } +enum { + IGNORE_REASON_NONE = 0x00, + IGNORE_REASON_BRIDGE = 0x01, + IGNORE_REASON_VLAN = 0x02, +}; + NMConnection * connection_from_file (const char *filename, const char *network_file, /* for unit tests only */ @@ -3203,7 +3209,7 @@ connection_from_file (const char *filename, gboolean nm_controlled = TRUE; gboolean ip6_used = FALSE; GError *error = NULL; - gboolean ignore_connection = FALSE; + guint32 ignore_reason = IGNORE_REASON_NONE; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (unmanaged != NULL, NULL); @@ -3293,7 +3299,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; - ignore_connection = TRUE; + ignore_reason = IGNORE_REASON_BRIDGE; } if (nm_controlled) { @@ -3301,7 +3307,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; - ignore_connection = TRUE; + ignore_reason = IGNORE_REASON_VLAN; } } @@ -3325,14 +3331,22 @@ connection_from_file (const char *filename, g_free (type); - /* Don't bother reading the connection fully if it's unmanaged. As a - * special-case, BRIDGE= and VLAN= connections are completely ignored so - * that ifup gets an error when it tries to ask NM about them. - */ - if (!connection || *unmanaged || ignore_connection) { - if (connection && ignore_connection) { - g_object_unref (connection); - connection = NULL; + /* Don't bother reading the connection fully if it's unmanaged or ignored */ + if (!connection || *unmanaged || ignore_reason) { + if (connection && !*unmanaged) { + /* However,BRIDGE and VLAN connections that don't have HWADDR won't + * be unmanaged because the unmanaged state is keyed off HWADDR. + * They willl still be tagged 'ignore' from code that checks BRIDGE + * and VLAN above. Since they aren't marked unmanaged, kill them + * completely. + */ + if (ignore_reason) { + g_object_unref (connection); + connection = NULL; + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, + "%s connections are not yet supported", + ignore_reason == IGNORE_REASON_BRIDGE ? "Bridge" : "VLAN"); + } } goto done; } diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am index 6ca6b6b320..28cfb98f3f 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -4,6 +4,7 @@ EXTRA_DIST = \ ifcfg-test-wired-static \ ifcfg-test-wired-static-bootproto \ ifcfg-test-wired-dhcp \ + ifcfg-test-wired-dhcp6-only \ ifcfg-test-wired-global-gateway \ network-test-wired-global-gateway \ ifcfg-test-wired-never-default \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface index 6af42768bc..6c841855ed 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface @@ -1,5 +1,4 @@ DEVICE=eth1.43 -HWADDR=00:22:15:59:62:97 VLAN=yes ONBOOT=yes BOOTPROTO=none diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only new file mode 100644 index 0000000000..de03e04480 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only @@ -0,0 +1,11 @@ +DEVICE="eth0" +ONBOOT=no +TYPE=Ethernet +DEFROUTE=yes +PEERDNS=yes +PEERROUTES=yes +IPV6INIT=yes +IPV6_AUTOCONF=no +DHCPV6C=yes +HWADDR=00:13:20:F5:F5:E4 + 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 index cf2a7c03de..a6c54fd3d8 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c @@ -153,6 +153,8 @@ int main (int argc, char **argv) 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); + test_ignored ("ignored-augnew", "ifcfg-FooBar" AUGNEW_TAG, TRUE); + test_ignored ("ignored-augtmp", "ifcfg-FooBar" AUGTMP_TAG, TRUE); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index e4a42f77bf..bca9af123d 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -2319,6 +2319,111 @@ test_read_wired_ipv6_only (void) g_object_unref (connection); } +#define TEST_IFCFG_WIRED_DHCP6_ONLY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp6-only" + +static void +test_read_wired_dhcp6_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-dhcp6-only"; + const char *method; + + connection = connection_from_file (TEST_IFCFG_WIRED_DHCP6_ONLY, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-dhcp6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); + + ASSERT (unmanaged == FALSE, + "wired-dhcp6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DHCP6_ONLY); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-dhcp6-only-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-dhcp6-only-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-dhcp6-only-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + 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-dhcp6-only-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + 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-dhcp6-only-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + 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-dhcp6-only-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-dhcp6-only-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0, + "wired-dhcp6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + 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 @@ -9334,10 +9439,15 @@ test_read_bridge_component (void) &ignore_error); ASSERT (connection != NULL, "bridge-component-read", "unexpected failure reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (unmanaged != NULL, - "bridge-component-read", "unexpected managed device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); - ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, - "bridge-component-read", "expected unmanaged device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + "bridge-component-read", "missing unmanaged spec from %s", TEST_IFCFG_BRIDGE_COMPONENT); + + ASSERT (g_strcmp0 (unmanaged, "mac:00:22:15:59:62:97") == 0, + "bridge-component-read", "unexpected unmanaged spec from %s", TEST_IFCFG_BRIDGE_COMPONENT); + + g_object_unref (connection); + g_free (unmanaged); } #define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" @@ -9363,14 +9473,8 @@ test_read_vlan_interface (void) &route6file, &error, &ignore_error); - ASSERT (connection != NULL, - "vlan-interface-read", "unexpected failure reading %s", TEST_IFCFG_VLAN_INTERFACE); - ASSERT (unmanaged != NULL, - "vlan-interface-read", "unexpected managed device reading %s", TEST_IFCFG_VLAN_INTERFACE); - ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, - "vlan-interface-read", "expected unmanaged device reading %s", TEST_IFCFG_VLAN_INTERFACE); - - g_object_unref (connection); + ASSERT (connection == NULL, + "vlan-interface-read", "unexpected success reading %s", TEST_IFCFG_VLAN_INTERFACE); } #define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex" @@ -9412,6 +9516,7 @@ int main (int argc, char **argv) test_read_wired_static_routes_legacy (); test_read_wired_ipv6_manual (); test_read_wired_ipv6_only (); + test_read_wired_dhcp6_only (); test_read_onboot_no (); test_read_wired_8021x_peap_mschapv2 (); test_read_wifi_open (); diff --git a/system-settings/plugins/ifcfg-rh/utils.c b/system-settings/plugins/ifcfg-rh/utils.c index 211458bec8..9e79ce0b42 100644 --- a/system-settings/plugins/ifcfg-rh/utils.c +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -160,7 +160,9 @@ utils_should_ignore_file (const char *filename, gboolean only_ifcfg) && !check_suffix (base, TILDE_TAG) && !check_suffix (base, ORIG_TAG) && !check_suffix (base, REJ_TAG) - && !check_suffix (base, RPMNEW_TAG)) + && !check_suffix (base, RPMNEW_TAG) + && !check_suffix (base, AUGNEW_TAG) + && !check_suffix (base, AUGTMP_TAG)) ignore = FALSE; g_free (base); diff --git a/system-settings/plugins/ifnet/Makefile.am b/system-settings/plugins/ifnet/Makefile.am new file mode 100644 index 0000000000..f63f8ca710 --- /dev/null +++ b/system-settings/plugins/ifnet/Makefile.am @@ -0,0 +1,61 @@ +SUBDIRS = . tests +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-ifnet.la + +noinst_LTLIBRARIES = lib-ifnet-io.la + +libnm_settings_plugin_ifnet_la_SOURCES = \ + nm-ifnet-connection.c \ + nm-ifnet-connection.h \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifnet_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GUDEV_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\"\ + -g + + +libnm_settings_plugin_ifnet_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifnet_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + lib-ifnet-io.la\ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GUDEV_LIBS) \ + $(GIO_LIBS) + +lib_ifnet_io_la_SOURCES = \ + net_parser.c\ + net_parser.h\ + connection_parser.c \ + connection_parser.h \ + net_utils.h\ + net_utils.c\ + wpa_parser.h\ + wpa_parser.c + +lib_ifnet_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DSBINDIR=\"$(sbindir)\"\ + -g + +lib_ifnet_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS)\ + $(GIO_LIBS) + + diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c new file mode 100644 index 0000000000..f9fae51f35 --- /dev/null +++ b/system-settings/plugins/ifnet/connection_parser.c @@ -0,0 +1,2997 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <string.h> +#include <arpa/inet.h> +#include <stdlib.h> +#include <netinet/ether.h> +#include <errno.h> +#include <ctype.h> +#include <glib/gi18n.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-8021x.h> +#include <nm-system-config-interface.h> +#include <nm-utils.h> + +#include "net_utils.h" +#include "wpa_parser.h" +#include "connection_parser.h" +#include "nm-ifnet-connection.h" + +static const char * +get_prefix (void) +{ + return _("System"); +} + +static void +update_connection_id (NMConnection * connection, gchar * conn_name) +{ + gchar *idstr = NULL; + gchar *uuid_base = NULL; + gchar *uuid = NULL; + NMSettingConnection *setting; + + idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name); + uuid_base = idstr; + uuid = nm_utils_uuid_generate_from_string (uuid_base); + setting = + (NMSettingConnection *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_CONNECTION); + g_object_set (setting, NM_SETTING_CONNECTION_ID, idstr, + NM_SETTING_CONNECTION_UUID, uuid, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "update_connection_setting_from_config_block: name:%s, id:%s, uuid: %s", + conn_name, idstr, uuid); + + g_free (uuid); + g_free (idstr); +} + +static gboolean +eap_simple_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error); +static gboolean eap_tls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +static gboolean eap_peap_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +static gboolean eap_ttls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +typedef struct { + const char *method; + gboolean (*reader) (const char *eap_method, gchar * ssid, + 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} +}; + +/* reading identity and password */ +static gboolean +eap_simple_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *value; + + /* identity */ + value = wpa_get_value (ssid, "identity"); + if (!value) { + g_set_error (error, ifnet_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); + + /* password */ + value = wpa_get_value (ssid, "password"); + if (!value) { + g_set_error (error, ifnet_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); + + return TRUE; +} + +static gboolean +eap_tls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *value; + char *ca_cert = 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; + + /* identity */ + value = wpa_get_value (ssid, "identity"); + if (!value) { + g_set_error (error, ifnet_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); + + /* ca cert */ + ca_cert = wpa_get_value (ssid, phase2 ? "ca_cert2" : "ca_cert"); + if (ca_cert) { + if (phase2) { + if (!nm_setting_802_1x_set_phase2_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } + } else { + PLUGIN_WARN (IFNET_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 = wpa_get_value (ssid, + phase2 ? "private_key_passwd2" : + "private_key_passwd"); + + if (!privkey_password) { + g_set_error (error, ifnet_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 = wpa_get_value (ssid, phase2 ? "private_key2" : "private_key"); + if (!privkey) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : + "IEEE_8021X_PRIVATE_KEY", eap_method); + goto done; + } + + if (phase2) { + if (!nm_setting_802_1x_set_phase2_private_key (s_8021x, + privkey, + 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, + privkey, + 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 = wpa_get_value (ssid, + phase2 ? "client_cert2" : + "client_cert"); + if (!client_cert) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : + "IEEE_8021X_CLIENT_CERT", eap_method); + goto done; + } + + if (phase2) { + if (!nm_setting_802_1x_set_phase2_client_cert (s_8021x, + client_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_client_cert (s_8021x, + client_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } + } + + success = TRUE; + + done: + return success; +} + +static gboolean +eap_peap_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *ca_cert = NULL; + char *inner_auth = NULL; + char *peapver = NULL; + char *lower; + char **list = NULL, **iter; + gboolean success = FALSE; + + ca_cert = wpa_get_value (ssid, "ca_cert"); + if (ca_cert) { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", eap_method); + } + + peapver = wpa_get_value (ssid, "phase1"); + /* peap version, default is automatic */ + if (peapver && strstr (peapver, "peapver")) { + if (strstr (peapver, "peapver=0")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, + "0", NULL); + else if (strstr (peapver, "peapver=1")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, + "1", NULL); + else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_PEAP_VERSION value '%s'", + peapver); + goto done; + } + } + + /* peaplabel */ + if (peapver && strstr (peapver, "peaplabel=1")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPLABEL, "1", + NULL); + + inner_auth = wpa_get_value (ssid, "phase2"); + if (!inner_auth) { + g_set_error (error, ifnet_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++) { + gchar *pos = NULL; + + if (!strlen (*iter)) + continue; + + if (!(pos = strstr (*iter, "MSCHAPV2")) + || !(pos = strstr (*iter, "MD5")) + || !(pos = strstr (*iter, "GTC"))) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) + goto done; + } else if (!(pos = strstr (*iter, "TLS"))) { + if (!eap_tls_reader (pos, ssid, s_8021x, TRUE, error)) + goto done; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + + pos = strchr (*iter, '='); + pos++; + lower = g_ascii_strdown (pos, -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, ifnet_plugin_error_quark (), 0, + "No valid IEEE_8021X_INNER_AUTH_METHODS found."); + goto done; + } + + success = TRUE; + + done: + if (list) + g_strfreev (list); + return success; +} + +static gboolean +eap_ttls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + gboolean success = FALSE; + char *anon_ident = NULL; + char *ca_cert = NULL; + char *tmp; + char **list = NULL, **iter; + char *inner_auth = NULL; + + /* ca cert */ + ca_cert = wpa_get_value (ssid, "ca_cert"); + if (ca_cert) { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", eap_method); + } + + /* anonymous indentity for tls */ + anon_ident = wpa_get_value (ssid, "anonymous_identity"); + if (anon_ident && strlen (anon_ident)) + g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, + anon_ident, NULL); + + tmp = wpa_get_value (ssid, "phase2"); + if (!tmp) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_INNER_AUTH_METHODS."); + goto done; + } + + /* Handle options for the inner auth method */ + inner_auth = g_ascii_strdown (tmp, -1); + list = g_strsplit (inner_auth, " ", 0); + for (iter = list; iter && *iter; iter++) { + gchar *pos = NULL; + + if (!strlen (*iter)) + continue; + if ((pos = strstr (*iter, "mschapv2")) != NULL + || (pos = strstr (*iter, "mschap")) != NULL + || (pos = strstr (*iter, "pap")) != NULL + || (pos = strstr (*iter, "chap")) != NULL) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, + pos, NULL); + } else if ((pos = strstr (*iter, "tls")) != NULL) { + if (!eap_tls_reader (pos, ssid, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, + "tls", NULL); + } else if ((pos = strstr (*iter, "mschapv2")) != NULL + || (pos = strstr (*iter, "md5")) != NULL) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "SIMPLE ERROR"); + goto done; + } + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, + pos, NULL); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + break; + } + + success = TRUE; + done: + if (list) + g_strfreev (list); + if (inner_auth) + g_free (inner_auth); + return success; +} + +/* type is already decided by net_parser, this function is just used to + * doing tansformation*/ +static const gchar * +guess_connection_type (gchar * conn_name) +{ + const gchar *type = ifnet_get_data (conn_name, "type"); + const gchar *name = conn_name; + const gchar *ret_type = NULL; + + if (name && !strcmp ("ppp", type)) + ret_type = NM_SETTING_PPPOE_SETTING_NAME; + + if (name && !strcmp ("wireless", type)) + ret_type = NM_SETTING_WIRELESS_SETTING_NAME; + + if (!ret_type) + ret_type = NM_SETTING_WIRED_SETTING_NAME; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "guessed connection type (%s) = %s", name, ret_type); + return ret_type; +} + +/* Reading mac address for setting connection option. + * Unmanaged device mac address is required by NetworkManager*/ +static gboolean +read_mac_address (gchar * conn_name, GByteArray ** array, GError ** error) +{ + gchar *value = ifnet_get_data (conn_name, "mac"); + struct ether_addr *mac; + + if (!value || !strlen (value)) { + return TRUE; + } + + mac = ether_aton (value); + if (!mac) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "The MAC address '%s' was invalid.", value); + return FALSE; + } + + *array = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (*array, (guint8 *) mac->ether_addr_octet, + ETH_ALEN); + return TRUE; +} + +static void +make_wired_connection_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + GByteArray *mac = NULL; + NMSettingWired *s_wired = NULL; + gchar *value = NULL; + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + + /* mtu_xxx */ + value = ifnet_get_data (conn_name, "mtu"); + if (value) { + long int mtu; + + errno = 0; + mtu = strtol (value, NULL, 10); + if (errno || mtu < 0 || mtu > 65535) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: invalid MTU '%s' for %s", + value, conn_name); + } else + g_object_set (s_wired, NM_SETTING_WIRED_MTU, + (guint32) mtu, NULL); + } + + if (read_mac_address (conn_name, &mac, error)) { + if (mac) { + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, + mac, NULL); + g_byte_array_free (mac, TRUE); + } + } else { + g_object_unref (s_wired); + s_wired = NULL; + } + if (s_wired) + nm_connection_add_setting (connection, NM_SETTING (s_wired)); +} + +/* add NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + * NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID in future*/ +static void +make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) +{ + + NMSettingIP4Config *ip4_setting = + NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + gchar *value; + gboolean is_static_block = is_static_ip4 (conn_name); + ip_block *iblock = NULL; + + /* set dhcp options (dhcp_xxx) */ + value = ifnet_get_data (conn_name, "dhcp"); + g_object_set (ip4_setting, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, value + && strstr (value, "nodns") ? TRUE : FALSE, + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, value + && strstr (value, "nogateway") ? TRUE : FALSE, NULL); + + if (!is_static_block) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using DHCP for %s", + conn_name); + } else { + iblock = convert_ip4_config_block (conn_name); + if (!iblock) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ifnet plugin: can't aquire ip configuration for %s", + conn_name); + g_object_unref (ip4_setting); + return; + } + /************** add all ip settings to the connection**********/ + while (iblock) { + ip_block *current_iblock; + NMIP4Address *ip4_addr = nm_ip4_address_new (); + + nm_ip4_address_set_address (ip4_addr, iblock->ip); + nm_ip4_address_set_prefix (ip4_addr, + nm_utils_ip4_netmask_to_prefix + (iblock->netmask)); + /* currently all the IPs has the same gateway */ + nm_ip4_address_set_gateway (ip4_addr, iblock->gateway); + if (iblock->gateway) + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, + TRUE, NULL); + if (nm_setting_ip4_config_add_address + (ip4_setting, ip4_addr)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "new address: %d", iblock->ip); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "ipv4 addresses count: %d", + nm_setting_ip4_config_get_num_addresses + (ip4_setting)); + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignoring duplicate IP4 address"); + } + nm_ip4_address_unref (ip4_addr); + current_iblock = iblock; + iblock = iblock->next; + destroy_ip_block (current_iblock); + + } + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, + !has_default_ip4_route (conn_name), NULL); + } + + /* add dhcp hostname and client id */ + if (!is_static_block) { + gchar *dhcp_hostname, *client_id; + + get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id); + if (dhcp_hostname) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + dhcp_hostname, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "DHCP hostname: %s", + dhcp_hostname); + g_free (dhcp_hostname); + } + if (client_id) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, + client_id, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "DHCP client id: %s", + client_id); + g_free (client_id); + } + } + + /* add all IPv4 dns servers, IPv6 servers will be ignored */ + set_ip4_dns_servers (ip4_setting, conn_name); + + /* DNS searches */ + value = (gchar *) ifnet_get_data (conn_name, "dns_search"); + if (value) { + char **searches = NULL; + + strip_string (value, '"'); + + 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 (ip4_setting, *item)) + PLUGIN_WARN + (IFNET_PLUGIN_NAME, + " warning: duplicate DNS domain '%s'", + *item); + } + } + g_strfreev (searches); + } + } + + /* static routes */ + iblock = convert_ip4_routes_block (conn_name); + while (iblock) { + ip_block *current_iblock = iblock; + gchar *metric_str; + long int metric; + NMIP4Route *route = nm_ip4_route_new (); + + nm_ip4_route_set_dest (route, iblock->ip); + nm_ip4_route_set_next_hop (route, iblock->gateway); + nm_ip4_route_set_prefix (route, + nm_utils_ip4_netmask_to_prefix + (iblock->netmask)); + if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { + metric = strtol (metric_str, NULL, 10); + nm_ip4_route_set_metric (route, (guint32) metric); + } else { + metric_str = ifnet_get_global_data ("metric"); + if (metric_str) { + metric = strtol (metric_str, NULL, 10); + nm_ip4_route_set_metric (route, + (guint32) metric); + g_free (metric_str); + } + } + + if (!nm_setting_ip4_config_add_route (ip4_setting, route)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate IP4 route"); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "new IP4 route:%d\n", iblock->ip); + + nm_ip4_route_unref (route); + + current_iblock = iblock; + iblock = iblock->next; + destroy_ip_block (current_iblock); + } + + /* Finally add setting to connection */ + nm_connection_add_setting (connection, NM_SETTING (ip4_setting)); +} + +static void +make_ip6_setting (NMConnection * connection, gchar * conn_name, GError ** error) +{ + NMSettingIP6Config *s_ip6 = NULL; + gboolean is_static_block = is_static_ip6 (conn_name); + + // used to disable IPv6 + gboolean ipv6_enabled = FALSE; + gchar *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + gchar *value; + ip6_block *iblock; + gboolean never_default = !has_default_ip6_route (conn_name); + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + if (!s_ip6) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Could not allocate IP6 setting"); + return; + } + + value = ifnet_get_data (conn_name, "enable_ipv6"); + if (value && is_true (value)) + ipv6_enabled = TRUE; + + //FIXME Handle other methods that NM supports in future + // Currently only Manual and DHCP are supported + if (!ipv6_enabled) { + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + goto done; + } else if (!is_static_block) { + // config_eth* contains "dhcp6" + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + never_default = FALSE; + } + // else if (!has_ip6_address(conn_name)) + // doesn't have "dhcp6" && doesn't have any ipv6 address + // method = NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL; + else + // doesn't have "dhcp6" && has at least one ipv6 address + method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "IPv6 for %s enabled, using %s", + conn_name, method); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, method, + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, FALSE, + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, FALSE, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default, NULL); + + /* Make manual settings */ + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + ip6_block *current_iblock; + + iblock = convert_ip6_config_block (conn_name); + if (!iblock) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ifnet plugin: can't aquire ip6 configuration for %s", + conn_name); + goto error; + } + /* add all IPv6 addresses */ + while (iblock) { + NMIP6Address *ip6_addr = nm_ip6_address_new (); + + nm_ip6_address_set_address (ip6_addr, iblock->ip); + nm_ip6_address_set_prefix (ip6_addr, iblock->prefix); + if (nm_setting_ip6_config_add_address (s_ip6, ip6_addr)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "ipv6 addresses count: %d", + nm_setting_ip6_config_get_num_addresses + (s_ip6)); + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignoring duplicate IP4 address"); + } + nm_ip6_address_unref (ip6_addr); + current_iblock = iblock; + iblock = iblock->next; + destroy_ip6_block (current_iblock); + } + + } else if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + /* - autoconf or DHCPv6 stuff goes here */ + } + // DNS Servers, set NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS TRUE here + set_ip6_dns_servers (s_ip6, conn_name); + + /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */ + + // Add routes + iblock = convert_ip6_routes_block (conn_name); + if (iblock) + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, + TRUE, NULL); + /* Add all IPv6 routes */ + while (iblock) { + ip6_block *current_iblock = iblock; + gchar *metric_str; + long int metric = 1; + NMIP6Route *route = nm_ip6_route_new (); + + nm_ip6_route_set_dest (route, iblock->ip); + nm_ip6_route_set_next_hop (route, iblock->next_hop); + nm_ip6_route_set_prefix (route, iblock->prefix); + /* metric is not per routes configuration right now + * global metric is also supported (metric="x") */ + if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { + metric = strtol (metric_str, NULL, 10); + nm_ip6_route_set_metric (route, (guint32) metric); + } else { + metric_str = ifnet_get_global_data ("metric"); + if (metric_str) { + metric = strtol (metric_str, NULL, 10); + nm_ip6_route_set_metric (route, + (guint32) metric); + g_free (metric_str); + } else + nm_ip6_route_set_metric (route, (guint32) 1); + } + + if (!nm_setting_ip6_config_add_route (s_ip6, route)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: duplicate IP6 route"); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, " info: new IP6 route"); + nm_ip6_route_unref (route); + + current_iblock = iblock; + iblock = iblock->next; + destroy_ip6_block (current_iblock); + } + + done: + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + return; + + error: + g_object_unref (s_ip6); + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: Ignore IPv6 for %s", + conn_name); + return; +} + +static NMSetting * +make_wireless_connection_setting (gchar * conn_name, + NMSetting8021x ** s_8021x, GError ** error) +{ + GByteArray *array, *mac = NULL; + NMSettingWireless *wireless_setting = NULL; + gboolean adhoc = FALSE; + gchar *value; + gchar *type; + + /* PPP over WIFI is not supported */ + g_return_val_if_fail (conn_name != NULL + && strcmp (ifnet_get_data (conn_name, "type"), + "ppp") != 0, NULL); + type = ifnet_get_data (conn_name, "type"); + if (strcmp (type, "ppp") == 0) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "PPP over WIFI is not supported yet"); + return NULL; + } + + wireless_setting = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + if (read_mac_address (conn_name, &mac, error)) { + if (mac) { + g_object_set (wireless_setting, + NM_SETTING_WIRELESS_MAC_ADDRESS, mac, + NULL); + g_byte_array_free (mac, TRUE); + + } + } else { + g_object_unref (wireless_setting); + return NULL; + } + + /* handle ssid (hex and ascii) */ + if (conn_name) { + gsize ssid_len = 0, value_len = strlen (conn_name); + char *p = conn_name, *tmp; + char buf[33]; + + ssid_len = value_len; + if ((value_len > 2) && (g_str_has_prefix (conn_name, "0x"))) { + /* Hex representation */ + if (value_len % 2) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, + "Invalid SSID '%s' size (looks like hex but length not multiple of 2)", + conn_name); + goto error; + } + // ignore "0x" + p = conn_name + 2; + if (!is_hex (p)) { + g_set_error (error, + ifnet_plugin_error_quark (), + 0, + "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)", + conn_name, *p); + goto error; + + } + tmp = utils_hexstr2bin (conn_name + 2, value_len - 2); + ssid_len = (value_len - 2) / 2; + memcpy (buf, tmp, ssid_len); + g_free (tmp); + p = &buf[0]; + } + + if (ssid_len > 32 || ssid_len == 0) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)", + conn_name, ssid_len); + goto error; + } + array = g_byte_array_sized_new (ssid_len); + g_byte_array_append (array, (const guint8 *) p, ssid_len); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, array, + NULL); + g_byte_array_free (array, TRUE); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing SSID"); + goto error; + } + + /* mode=0: infrastructure + * mode=1: adhoc */ + value = wpa_get_value (conn_name, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + if (exist_ssid (conn_name)) { + const char *mode = adhoc ? "adhoc" : "infrastructure"; + + g_object_set (wireless_setting, NM_SETTING_WIRELESS_MODE, mode, + NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using mode: %s", mode); + } + + /* BSSID setting */ + value = wpa_get_value (conn_name, "bssid"); + if (value) { + struct ether_addr *eth; + GByteArray *bssid; + + eth = ether_aton (value); + if (!eth) { + g_set_error (error, ifnet_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 (wireless_setting, NM_SETTING_WIRELESS_BSSID, + bssid, NULL); + g_byte_array_free (bssid, TRUE); + + } + + /* mtu_ssid="xx" */ + value = ifnet_get_data (conn_name, "mtu"); + if (value) { + long int mtu; + + errno = 0; + mtu = strtol (value, NULL, 10); + if (errno || mtu < 0 || mtu > 50000) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: invalid MTU '%s' for %s", + value, conn_name); + } else + g_object_set (wireless_setting, NM_SETTING_WIRELESS_MTU, + (guint32) mtu, NULL); + + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "wireless_setting added for %s", + conn_name); + return NM_SETTING (wireless_setting); + error: + if (wireless_setting) + g_object_unref (wireless_setting); + return NULL; + +} + +static NMSettingWirelessSecurity * +make_leap_setting (gchar * ssid, GError ** error) +{ + NMSettingWirelessSecurity *wsec; + char *value; + + wsec = + NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + value = wpa_get_value (ssid, "key_mgmt"); + if (!value || strcmp (value, "IEEE8021X")) + goto error; /* Not LEAP */ + + value = wpa_get_value (ssid, "eap"); + if (!value || strcasecmp (value, "LEAP")) + goto error; /* Not LEAP */ + + value = wpa_get_value (ssid, "password"); + if (value && strlen (value)) + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, + value, NULL); + + value = wpa_get_value (ssid, "identity"); + if (!value || !strlen (value)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing LEAP identity"); + goto error; + } + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, value, + NULL); + + g_object_set (wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", NULL); + + return wsec; + error: + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static gboolean +add_one_wep_key (gchar * ssid, gchar * key, int key_idx, + NMSettingWirelessSecurity * s_wsec, GError ** error) +{ + gchar *value; + gboolean success = FALSE; + + g_return_val_if_fail (ssid != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key_idx >= 0 && key_idx <= 3, FALSE); + g_return_val_if_fail (s_wsec != NULL, FALSE); + value = wpa_get_value (ssid, key); + if (!value) + return TRUE; + key = NULL; + /* Validate keys */ + if (strlen (value) == 10 || strlen (value) == 26) { + /* Hexadecimal WEP key */ + char *p = value; + + if (!is_hex (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, "Invalid hexadecimal WEP key."); + goto out; + } + key = g_strdup (value); + } else if (value[0] == '"' + && (strlen (value) == 7 || strlen (value) == 15)) { + /* ASCII passphrase */ + char *tmp = g_strdup (value); + char *p = strip_string (tmp, '"'); + + if (!is_ascii (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, "Invalid ASCII WEP passphrase."); + g_free (tmp); + goto out; + + } + + key = utils_bin2hexstr (tmp, strlen (tmp), strlen (tmp) * 2); + g_free (tmp); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WEP key length. Key: %s", value); + goto out; + } + + if (key) { + nm_setting_wireless_security_set_wep_key (s_wsec, key_idx, key); + g_free (key); + success = TRUE; + } + + out: + return success; + +} + +static gboolean +add_wep_keys (gchar * ssid, NMSettingWirelessSecurity * s_wsec, GError ** error) +{ + if (!add_one_wep_key (ssid, "wep_key0", 0, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key1", 1, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key2", 2, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key3", 3, s_wsec, error)) + return FALSE; + return TRUE; + +} + +static NMSettingWirelessSecurity * +make_wep_setting (gchar * ssid, GError ** error) +{ + gchar *auth_alg; + int default_key_idx = 0; + gchar *value; + NMSettingWirelessSecurity *s_wireless_sec; + + 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); + + /* default key index */ + value = wpa_get_value (ssid, "wep_tx_keyidx"); + if (value) { + default_key_idx = atoi (value); + if (default_key_idx >= 0 && default_key_idx <= 3) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, + default_key_idx, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Default key index: %d", default_key_idx); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid default WEP key '%s'", value); + goto error; + } + } + + if (!add_wep_keys (ssid, s_wireless_sec, error)) + goto error; + + /* 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, ifnet_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, ifnet_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, ifnet_plugin_error_quark (), 0, + "Default WEP key index was 4, but no valid KEY4 exists."); + goto error; + } + + /* authentication algorithms */ + auth_alg = wpa_get_value (ssid, "auth_alg"); + if (auth_alg) { + if (strcmp (auth_alg, "OPEN") == 0) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, + "open", NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "WEP: Use open system authentication"); + } else if (strcmp (auth_alg, "SHARED") == 0) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, + "shared", NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "WEP: Use shared system authentication"); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WEP authentication algorithm '%s'", + auth_alg); + goto error; + } + + } + + 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)) { + if (auth_alg && !strcmp (auth_alg, "shared")) { + g_set_error (error, ifnet_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 s_wireless_sec; + + error: + if (s_wireless_sec) + g_object_unref (s_wireless_sec); + return NULL; +} + +static char * +parse_wpa_psk (gchar * psk, GError ** error) +{ + gchar *p, *hashed = NULL; + gboolean quoted = FALSE; + + if (!psk) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing WPA_PSK for WPA-PSK key management"); + return NULL; + } + + /* 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. + */ + + p = psk; + if (p[0] == '"' && psk[strlen (psk) - 1] == '"') + quoted = TRUE; + if (!quoted && (strlen (psk) == 64)) { + /* Verify the hex PSK; 64 digits */ + if (!is_hex (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, + "Invalid WPA_PSK (contains non-hexadecimal characters)"); + goto out; + } + hashed = g_strdup (psk); + } else { + strip_string (p, '"'); + + /* Length check */ + if (strlen (p) < 8 || strlen (p) > 63) { + g_set_error (error, ifnet_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, ifnet_plugin_error_quark (), 0, + "Invalid WPA_PSK (doesn't look like a passphrase or hex key)"); + goto out; + } + + out: + return hashed; +} + +static gboolean +fill_wpa_ciphers (gchar * ssid, + NMSettingWirelessSecurity * wsec, + gboolean group, gboolean adhoc) +{ + char *value = NULL, *p; + char **list = NULL, **iter; + int i = 0; + + p = value = wpa_get_value (ssid, group ? "group" : "pairwise"); + if (!value) + return TRUE; + + 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 (IFNET_PLUGIN_NAME, + " warning: ignoring group cipher '%s' (only one group cipher allowed in Ad-Hoc mode)", + *iter); + continue; + } else if (!group) { + PLUGIN_WARN (IFNET_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 (IFNET_PLUGIN_NAME, + " warning: ignoring invalid %s cipher '%s'", + group ? "CIPHER_GROUP" : "CIPHER_PAIRWISE", + *iter); + } + } + + if (list) + g_strfreev (list); + return TRUE; +} + +static NMSetting8021x * +fill_8021x (gchar * ssid, gchar * key_mgmt, gboolean wifi, GError ** error) +{ + NMSetting8021x *s_8021x; + char *value; + char **list, **iter; + + value = wpa_get_value (ssid, "eap"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_EAP_METHODS for key management '%s'", + key_mgmt); + return NULL; + } + + list = g_strsplit (value, " ", 0); + + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + /* 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 (IFNET_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, ssid, 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 (IFNET_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, ifnet_plugin_error_quark (), 0, + "No valid EAP methods found in IEEE_8021X_EAP_METHODS."); + goto error; + } + + return s_8021x; + + error: + g_object_unref (s_8021x); + return NULL; +} + +static NMSettingWirelessSecurity * +make_wpa_setting (gchar * ssid, NMSetting8021x ** s_8021x, GError ** error) +{ + NMSettingWirelessSecurity *wsec; + char *value, *lower; + gboolean adhoc = FALSE; + + if (!exist_ssid (ssid)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "No security info found for ssid: %s", ssid); + return NULL; + } + + wsec = + NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + /* mode=1: adhoc + * mode=0: infrastructure */ + value = wpa_get_value (ssid, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + value = wpa_get_value (ssid, "key_mgmt"); + /* Not WPA or Dynamic WEP */ + if (!value) + goto error; + if (strcmp (value, "WPA-PSK") && strcmp (value, "WPA-EAP")) + goto error; + /* Pairwise and Group ciphers */ + fill_wpa_ciphers (ssid, wsec, FALSE, adhoc); + fill_wpa_ciphers (ssid, 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 { + nm_setting_wireless_security_add_proto (wsec, "wpa"); + nm_setting_wireless_security_add_proto (wsec, "rsn"); + + } + + if (!strcmp (value, "WPA-PSK")) { + gchar *psk = parse_wpa_psk (wpa_get_value (ssid, "psk"), 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")) { + if (adhoc) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ad-Hoc mode cannot be used with KEY_MGMT type '%s'", + value); + goto error; + } + *s_8021x = fill_8021x (ssid, 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, ifnet_plugin_error_quark (), 0, + "Unknown wireless KEY_MGMT type '%s'", value); + goto error; + } + return wsec; + error: + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static NMSettingWirelessSecurity * +make_wireless_security_setting (gchar * + conn_name, + NMSetting8021x ** s_8021x, GError ** error) +{ + NMSettingWirelessSecurity *wsec = NULL; + gchar *ssid; + gboolean adhoc = FALSE; + gchar *value; + + g_return_val_if_fail (conn_name != NULL + && strcmp (ifnet_get_data (conn_name, "type"), + "ppp") != 0, NULL); + if (!wpa_get_value (conn_name, "ssid")) + return NULL; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "updating wireless security settings (%s).", conn_name); + + ssid = conn_name; + value = wpa_get_value (ssid, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + if (!adhoc) { + wsec = make_leap_setting (ssid, error); + if (error && *error) + goto error; + } + if (!wsec) { + wsec = make_wpa_setting (ssid, s_8021x, error); + if (error && *error) + goto error; + } + if (!wsec) { + wsec = make_wep_setting (ssid, error); + if (error && *error) + goto error; + } + + if (!wsec) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't handle security information for ssid: %s", + conn_name); + } + + return wsec; + error: + return NULL; +} + +/* Currently only support username and password */ +static void +make_pppoe_connection_setting (NMConnection * connection, + gchar * conn_name, GError ** error) +{ + NMSettingPPPOE *s_pppoe; + NMSettingPPP *s_ppp; + gchar *value; + + s_pppoe = NM_SETTING_PPPOE (nm_setting_pppoe_new ()); + + /* username */ + value = ifnet_get_data (conn_name, "username"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "ppp requires at lease a username"); + return; + } + g_object_set (s_pppoe, NM_SETTING_PPPOE_USERNAME, value, NULL); + + /* password */ + value = ifnet_get_data (conn_name, "password"); + if (!value) { + value = ""; + } + + g_object_set (s_pppoe, NM_SETTING_PPPOE_PASSWORD, value, NULL); + nm_connection_add_setting (connection, NM_SETTING (s_pppoe)); + + /* PPP setting */ + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); +} + +NMConnection * +ifnet_update_connection_from_config_block (gchar * conn_name, GError ** error) +{ + const gchar *type = NULL; + NMConnection *connection = NULL; + NMSettingConnection *setting = NULL; + NMSetting8021x *s_8021x = NULL; + NMSettingWirelessSecurity *wsec = NULL; + gboolean auto_conn = TRUE; + gchar *value = NULL; + gboolean success = FALSE; + + connection = nm_connection_new (); + if (!connection) + return NULL; + setting = + (NMSettingConnection *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_CONNECTION); + if (!setting) { + setting = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + g_assert (setting); + nm_connection_add_setting (connection, NM_SETTING (setting)); + } + + type = guess_connection_type (conn_name); + value = ifnet_get_data (conn_name, "auto"); + if (value && !strcmp (value, "false")) + auto_conn = FALSE; + update_connection_id (connection, conn_name); + g_object_set (setting, NM_SETTING_CONNECTION_TYPE, type, + NM_SETTING_CONNECTION_READ_ONLY, FALSE, + NM_SETTING_CONNECTION_AUTOCONNECT, auto_conn, NULL); + + if (!strcmp (NM_SETTING_WIRED_SETTING_NAME, type) + || !strcmp (NM_SETTING_PPPOE_SETTING_NAME, type)) { + /* wired setting */ + make_wired_connection_setting (connection, conn_name, error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + /* pppoe setting */ + if (!strcmp (NM_SETTING_PPPOE_SETTING_NAME, type)) + make_pppoe_connection_setting (connection, conn_name, + error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + } else if (!strcmp (NM_SETTING_WIRELESS_SETTING_NAME, type)) { + /* wireless setting */ + NMSetting *wireless_setting = + make_wireless_connection_setting (conn_name, + &s_8021x, + error); + + if (!wireless_setting) { + goto error; + } + nm_connection_add_setting (connection, wireless_setting); + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + + /* wireless security setting */ + wsec = + make_wireless_security_setting (conn_name, &s_8021x, error); + if (wsec) { + nm_connection_add_setting (connection, + NM_SETTING (wsec)); + 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); + } + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + + } else + goto error; + + /* IPv4 setting */ + make_ip4_setting (connection, conn_name, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + + /* IPv6 setting */ + make_ip6_setting (connection, conn_name, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + + success = nm_connection_verify (connection, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Connection verified %s:%d", conn_name, + success); + if (!success) + goto error; + return connection; + error: + g_object_unref (setting); + g_object_unref (connection); + return NULL; +} + +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 *conn_name_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, + "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, + "ca_cert2", + "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, + "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, + "client_cert2", + "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, + "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, + "private_key2", + "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, + "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, + "private_key2", + "inner-private-key.p12" +}; + +static gboolean +write_object (NMSetting8021x * s_8021x, + gchar * conn_name, + const GByteArray * override_data, + const ObjectType * objtype, GError ** error) +{ + NMSetting8021xCKScheme scheme; + const char *path = NULL; + const GByteArray *blob = NULL; + + g_return_val_if_fail (conn_name != 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 the object path was specified, prefer that over any raw cert data that + * may have been sent. + */ + if (path) { + wpa_set_data (conn_name, (gchar *) objtype->conn_name_key, + (gchar *) path); + return TRUE; + } + + /* does not support writing encryption data now */ + if (blob) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: Currently we do not support certs writing."); + } + + return TRUE; +} + +static gboolean +write_8021x_certs (NMSetting8021x * s_8021x, + gboolean phase2, gchar * conn_name, GError ** error) +{ + char *password = NULL; + const ObjectType *otype = NULL; + gboolean is_pkcs12 = FALSE, success = FALSE; + const GByteArray *blob = NULL; + GByteArray *enc_key = NULL; + gchar *generated_pw = NULL; + + /* CA certificate */ + if (phase2) + otype = &phase2_ca_type; + else + otype = &ca_type; + + if (!write_object (s_8021x, conn_name, 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 = (char *) + 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 = (char *) + 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, conn_name, enc_key ? enc_key : blob, otype, error)) + goto out; + + if (phase2) + wpa_set_data (conn_name, "private_key_passwd2", password); + else + wpa_set_data (conn_name, "private_key_passwd", password); + + /* Client certificate */ + if (is_pkcs12) { + wpa_set_data (conn_name, + phase2 ? "client_cert2" : "client_cert", NULL); + } else { + if (phase2) + otype = &phase2_client_type; + else + otype = &client_type; + + /* Save the client certificate */ + if (!write_object (s_8021x, conn_name, 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, + gchar * conn_name, gboolean wired, GError ** error) +{ + NMSetting8021x *s_8021x; + const char *value; + char *tmp = NULL; + gboolean success = FALSE; + GString *phase2_auth; + GString *phase1; + + s_8021x = + (NMSetting8021x *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_802_1X); + + if (!s_8021x) { + return TRUE; + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding 8021x setting for %s", + conn_name); + + /* If wired, write KEY_MGMT */ + if (wired) + wpa_set_data (conn_name, "key_mgmt", "IEEE8021X"); + + /* 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); + } + wpa_set_data (conn_name, "eap", tmp ? tmp : NULL); + g_free (tmp); + + wpa_set_data (conn_name, "identity", + (gchar *) nm_setting_802_1x_get_identity (s_8021x)); + + wpa_set_data (conn_name, "anonymous_identity", (gchar *) + nm_setting_802_1x_get_anonymous_identity (s_8021x)); + + wpa_set_data (conn_name, "password", + (gchar *) nm_setting_802_1x_get_password (s_8021x)); + + phase1 = g_string_new (NULL); + + /* PEAP version */ + wpa_set_data (conn_name, "phase1", NULL); + value = nm_setting_802_1x_get_phase1_peapver (s_8021x); + if (value && (!strcmp (value, "0") || !strcmp (value, "1"))) + g_string_append_printf (phase1, "peapver=%s ", value); + + /* PEAP label */ + value = nm_setting_802_1x_get_phase1_peaplabel (s_8021x); + if (value && !strcmp (value, "1")) + g_string_append_printf (phase1, "peaplabel=%s ", value); + if (phase1->len) { + tmp = g_strstrip (g_strdup (phase1->str)); + wpa_set_data (conn_name, "phase1", tmp); + g_free (tmp); + } + + /* Phase2 auth methods */ + wpa_set_data (conn_name, "phase2", NULL); + 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_printf (phase2_auth, "auth=%s ", tmp); + g_free (tmp); + } + + /* Phase2 auth heap */ + value = nm_setting_802_1x_get_phase2_autheap (s_8021x); + if (value) { + tmp = g_ascii_strup (value, -1); + g_string_append_printf (phase2_auth, "autheap=%s ", tmp); + g_free (tmp); + } + tmp = g_strstrip (g_strdup (phase2_auth->str)); + wpa_set_data (conn_name, "phase2", phase2_auth->len ? tmp : NULL); + g_free (tmp); + + g_string_free (phase2_auth, TRUE); + g_string_free (phase1, TRUE); + + success = write_8021x_certs (s_8021x, FALSE, conn_name, error); + if (success) { + /* phase2/inner certs */ + success = write_8021x_certs (s_8021x, TRUE, conn_name, error); + } + + return success; +} + +static gboolean +write_wireless_security_setting (NMConnection * connection, + gchar * conn_name, + gboolean adhoc, + gboolean * no_8021x, GError ** error) +{ + NMSettingWirelessSecurity *s_wsec; + const char *key_mgmt, *auth_alg, *key, *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, ifnet_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); + + if (!strcmp (key_mgmt, "none")) { + wpa_set_data (conn_name, "key_mgmt", "NONE"); + wep = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "wpa-none") + || !strcmp (key_mgmt, "wpa-psk")) { + wpa_set_data (conn_name, "key_mgmt", "WPA-PSK"); + wpa = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "ieee8021x")) { + wpa_set_data (conn_name, "key_mgmt", "IEEE8021X"); + } else if (!strcmp (key_mgmt, "wpa-eap")) { + wpa_set_data (conn_name, "key_mgmt", "WPA-EAP"); + wpa = TRUE; + } + + if (auth_alg) { + if (!strcmp (auth_alg, "shared")) + wpa_set_data (conn_name, "auth_alg", "SHARED"); + else if (!strcmp (auth_alg, "open")) + wpa_set_data (conn_name, "auth_alg", "OPEN"); + else if (!strcmp (auth_alg, "leap")) { + wpa_set_data (conn_name, "auth_alg", "LEAP"); + wpa_set_data (conn_name, "eap", "LEAP"); + wpa_set_data (conn_name, "identity", (gchar *) + nm_setting_wireless_security_get_leap_username + (s_wsec)); + wpa_set_data (conn_name, "password", (gchar *) + nm_setting_wireless_security_get_leap_password + (s_wsec)); + *no_8021x = TRUE; + } + } else + wpa_set_data (conn_name, "auth_alg", NULL); + + /* Default WEP TX key index */ + wpa_set_data (conn_name, "wep_tx_keyidx", NULL); + if (wep) { + tmp = + g_strdup_printf ("%d", + nm_setting_wireless_security_get_wep_tx_keyidx + (s_wsec)); + wpa_set_data (conn_name, "wep_tx_keyidx", tmp); + g_free (tmp); + } + + /* WEP keys */ + for (i = 0; i < 4; i++) { + int length; + + key = nm_setting_wireless_security_get_wep_key (s_wsec, i); + if (!key) + continue; + tmp = g_strdup_printf ("wep_key%d", i); + length = strlen (key); + if (length == 10 || length == 26 || length == 58) + wpa_set_data (conn_name, tmp, (gchar *) key); + else { + gchar *tmp_key = g_strdup_printf ("\"%s\"", key); + + wpa_set_data (conn_name, tmp, tmp_key); + g_free (tmp_key); + } + g_free (tmp); + } + + /* WPA Pairwise ciphers */ + wpa_set_data (conn_name, "pairwise", NULL); + 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)) + wpa_set_data (conn_name, "pairwise", str->str); + g_string_free (str, TRUE); + + /* WPA Group ciphers */ + wpa_set_data (conn_name, "group", NULL); + 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)) + wpa_set_data (conn_name, "group", str->str); + 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)) { + quoted = g_string_sized_new (strlen (psk) + 2); + g_string_append_c (quoted, '"'); + g_string_append (quoted, psk); + g_string_append_c (quoted, '"'); + } + wpa_set_data (conn_name, "psk", + quoted ? quoted->str : (gchar *) psk); + if (quoted) + g_string_free (quoted, TRUE); + } else + wpa_set_data (conn_name, "psk", NULL); + + return TRUE; +} + +/* remove old ssid and add new one*/ +static void +update_wireless_ssid (NMConnection * connection, gchar * conn_name, + gchar * ssid, gboolean hex) +{ + ifnet_delete_network (conn_name); + ifnet_add_connection (ssid, "wireless"); + + wpa_delete_security (conn_name); + wpa_add_security (ssid); +} + +static gboolean +write_wireless_setting (NMConnection * connection, + gchar ** conn_name_ptr, gboolean * no_8021x, + GError ** error) +{ + NMSettingWireless *s_wireless; + const GByteArray *ssid, *mac, *bssid; + const char *mode; + char buf[33]; + guint32 mtu, i; + gboolean adhoc = FALSE, hex_ssid = FALSE; + gchar *ssid_str, *tmp; + gchar *conn_name = *conn_name_ptr; + + s_wireless = + (NMSettingWireless *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + ssid = nm_setting_wireless_get_ssid (s_wireless); + if (!ssid) { + g_set_error (error, ifnet_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, ifnet_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]); + update_wireless_ssid (connection, conn_name, str->str, + hex_ssid); + ssid_str = g_strdup (str->str); + g_string_free (str, TRUE); + } else { + /* Printable SSIDs get quoted */ + memset (buf, 0, sizeof (buf)); + memcpy (buf, ssid->data, ssid->len); + g_strstrip (buf); + update_wireless_ssid (connection, conn_name, buf, hex_ssid); + ssid_str = g_strdup (buf); + } + + ifnet_set_data (ssid_str, "mac", NULL); + 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]); + ifnet_set_data (ssid_str, "mac", tmp); + g_free (tmp); + } + + ifnet_set_data (ssid_str, "mtu", NULL); + mtu = nm_setting_wireless_get_mtu (s_wireless); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + ifnet_set_data (ssid_str, "mtu", tmp); + g_free (tmp); + } + + ifnet_set_data (ssid_str, "mode", NULL); + mode = nm_setting_wireless_get_mode (s_wireless); + if (!mode || !strcmp (mode, "infrastructure")) { + wpa_set_data (ssid_str, "mode", "0"); + } else if (!strcmp (mode, "adhoc")) { + wpa_set_data (ssid_str, "mode", "1"); + adhoc = TRUE; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Invalid mode '%s' in '%s' setting", + mode, NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + wpa_set_data (ssid_str, "bssid", NULL); + 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]); + wpa_set_data (ssid_str, "bssid", tmp); + g_free (tmp); + } + + if (nm_setting_wireless_get_security (s_wireless)) { + if (!write_wireless_security_setting + (connection, ssid_str, adhoc, no_8021x, error)) + return FALSE; + } else + wpa_delete_security (ssid_str); + *conn_name_ptr = ifnet_get_data (ssid_str, "name"); + g_free (ssid_str); + return TRUE; +} + +static gboolean +write_wired_setting (NMConnection * connection, gchar * conn_name, + 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, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_WIRED_SETTING_NAME); + return FALSE; + } + + ifnet_set_data (conn_name, "mac", NULL); + 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]); + ifnet_set_data (conn_name, "mac", tmp); + g_free (tmp); + } + + ifnet_set_data (conn_name, "mtu", NULL); + mtu = nm_setting_wired_get_mtu (s_wired); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + ifnet_set_data (conn_name, "mtu", tmp); + g_free (tmp); + } + //FIXME may add connection type in future + //ifnet_set_data (conn_name, "TYPE", TYPE_ETHERNET); + + return TRUE; +} + +static void +write_connection_setting (NMSettingConnection * s_con, gchar * conn_name) +{ + ifnet_set_data (conn_name, "auto", + nm_setting_connection_get_autoconnect (s_con) ? "true" : + "false"); +} + +static gboolean +write_ip4_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + NMSettingIP4Config *s_ip4; + const char *value; + char *tmp; + guint32 i, num; + GString *searches; + GString *ips; + GString *routes; + GString *dns; + gboolean has_def_route = FALSE; + gboolean success = FALSE; + + s_ip4 = + (NMSettingIP4Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP4_CONFIG); + if (!s_ip4) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + return FALSE; + } + routes = g_string_new (NULL); + + value = nm_setting_ip4_config_get_method (s_ip4); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + ips = g_string_new (NULL); + /* IPv4 addresses */ + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + NMIP4Address *addr; + guint32 ip; + + addr = nm_setting_ip4_config_get_address (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_address (addr); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (ips, "\"%s", &buf[0]); + + tmp = + g_strdup_printf ("%u", + nm_ip4_address_get_prefix (addr)); + g_string_append_printf (ips, "/%s\" ", tmp); + g_free (tmp); + + /* only the first gateway will be written */ + if (!has_def_route && nm_ip4_address_get_gateway (addr)) { + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_gateway (addr); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, + "\"default via %s\" ", + &buf[0]); + has_def_route = TRUE; + } + } + ifnet_set_data (conn_name, "config", ips->str); + g_string_free (ips, TRUE); + } else + ifnet_set_data (conn_name, "config", "dhcp"); + + /* DNS Servers */ + ifnet_set_data (conn_name, "dns_servers", NULL); + num = nm_setting_ip4_config_get_num_dns (s_ip4); + if (num > 0) { + dns = g_string_new (NULL); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + 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[0], + sizeof (buf)); + g_string_append_printf (dns, " %s", buf); + } + ifnet_set_data (conn_name, "dns_servers", dns->str); + g_string_free (dns, TRUE); + } else + ifnet_set_data (conn_name, "dns_servers", NULL); + + /* DNS Searches */ + 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)); + } + ifnet_set_data (conn_name, "dns_search", searches->str); + g_string_free (searches, TRUE); + } else + ifnet_set_data (conn_name, "dns_search", NULL); + /* FIXME Will be implemented when configuration supports it + if (!strcmp(value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + value = nm_setting_ip4_config_get_dhcp_hostname(s_ip4); + if (value) + ifnet_set_data(conn_name, "DHCP_HOSTNAME", value, + FALSE); + + value = nm_setting_ip4_config_get_dhcp_client_id(s_ip4); + if (value) + ifnet_set_data(conn_name, "DHCP_CLIENT_ID", value, + FALSE); + } + */ + + /* Static routes */ + num = nm_setting_ip4_config_get_num_routes (s_ip4); + if (num > 0) { + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + NMIP4Route *route; + guint32 ip; + + route = nm_setting_ip4_config_get_route (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_dest (route); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, "\"%s", buf); + + tmp = + g_strdup_printf ("%u", + nm_ip4_route_get_prefix (route)); + g_string_append_printf (routes, "/%s via ", tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, "%s\" ", buf); + } + } + if (routes->len > 0) + ifnet_set_data (conn_name, "routes", routes->str); + else + ifnet_set_data (conn_name, "routes", NULL); + g_string_free (routes, TRUE); + + success = TRUE; + + return success; +} + +static gboolean +write_route6_file (NMSettingIP6Config * s_ip6, gchar * conn_name, + GError ** error) +{ + char dest[INET6_ADDRSTRLEN + 1]; + char next_hop[INET6_ADDRSTRLEN + 1]; + NMIP6Route *route; + const struct in6_addr *ip; + guint32 prefix; + guint32 i, num; + GString *routes_string; + gchar *old_routes; + + g_return_val_if_fail (s_ip6 != NULL, FALSE); + num = nm_setting_ip6_config_get_num_routes (s_ip6); + if (num == 0) { + return TRUE; + } + + old_routes = ifnet_get_data (conn_name, "routes"); + routes_string = g_string_new (old_routes); + if (old_routes) + g_string_append (routes_string, "\" "); + for (i = 0; i < num; i++) { + route = nm_setting_ip6_config_get_route (s_ip6, i); + + memset (dest, 0, sizeof (dest)); + ip = nm_ip6_route_get_dest (route); + inet_ntop (AF_INET6, (const void *) ip, &dest[0], + sizeof (dest)); + + 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)); + + g_string_append_printf (routes_string, "\"%s/%u via %s\" ", + dest, prefix, next_hop); + } + if (num > 0) + ifnet_set_data (conn_name, "routes", routes_string->str); + g_string_free (routes_string, TRUE); + + return TRUE; +} + +static gboolean +write_ip6_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + NMSettingIP6Config *s_ip6; + const char *value; + char *prefix; + guint32 i, num; + GString *searches; + char buf[INET6_ADDRSTRLEN + 1]; + NMIP6Address *addr; + const struct in6_addr *ip; + + s_ip6 = + (NMSettingIP6Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP6_CONFIG); + if (!s_ip6) { + g_set_error (error, ifnet_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)) { + ifnet_set_data (conn_name, "enable_ipv6", "false"); + return TRUE; + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* nothing to do now */ + } else { + // if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + gchar *config = ifnet_get_data (conn_name, "config"); + gchar *tmp; + + if (!config) + tmp = g_strdup_printf ("dhcp6"); + else + tmp = g_strdup_printf ("%s\" \"dhcp6\"", config); + ifnet_set_data (conn_name, "config", tmp); + g_free (tmp); + } + /* else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + } else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + } else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { + } */ + + /* Remember to set IPv6 enabled */ + ifnet_set_data (conn_name, "enable_ipv6", "true"); + + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + gchar *config = ifnet_get_data (conn_name, "config"); + gchar *tmp; + GString *ip_str; + + if (!config) + config = ""; + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + + /* IPv6 addresses */ + ip_str = g_string_new (NULL); + for (i = 0; i < num; i++) { + addr = nm_setting_ip6_config_get_address (s_ip6, i); + ip = nm_ip6_address_get_address (addr); + prefix = + g_strdup_printf ("%u", + nm_ip6_address_get_prefix (addr)); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, + sizeof (buf)); + g_string_append_printf (ip_str, "\"%s/", buf); + g_string_append_printf (ip_str, "%s\" ", prefix); + g_free (prefix); + } + tmp = g_strdup_printf ("%s\" %s", config, ip_str->str); + ifnet_set_data (conn_name, "config", tmp); + g_free (tmp); + g_string_free (ip_str, TRUE); + } + + /* DNS Servers */ + num = nm_setting_ip6_config_get_num_dns (s_ip6); + if (num > 0) { + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar *tmp; + GString *dns_string = g_string_new (NULL); + + if (!dns_servers) + dns_servers = ""; + for (i = 0; i < num; i++) { + 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 (!strstr (dns_servers, buf)) + g_string_append_printf (dns_string, "%s ", buf); + } + tmp = g_strdup_printf ("%s %s", dns_servers, dns_string->str); + ifnet_set_data (conn_name, "dns_servers", tmp); + g_free (tmp); + g_string_free (dns_string, TRUE); + + } else + /* DNS Searches */ + num = nm_setting_ip6_config_get_num_dns_searches (s_ip6); + if (num > 0) { + char *ip4_domains; + + ip4_domains = ifnet_get_data (conn_name, "dns_search"); + if (!ip4_domains) + ip4_domains = ""; + searches = g_string_new (ip4_domains); + for (i = 0; i < num; i++) { + const gchar *search = NULL; + + search = + nm_setting_ip6_config_get_dns_search (s_ip6, i); + if (search && !strstr (searches->str, search)) { + if (searches->len > 0) + g_string_append_c (searches, ' '); + g_string_append (searches, search); + } + } + ifnet_set_data (conn_name, "dns_search", searches->str); + g_string_free (searches, TRUE); + } + + write_route6_file (s_ip6, conn_name, error); + if (error && *error) + return FALSE; + return TRUE; +} + +static gboolean +write_pppoe_setting (gchar * conn_name, NMSettingPPPOE * s_pppoe) +{ + const gchar *value; + + value = nm_setting_pppoe_get_username (s_pppoe); + if (!value) { + return FALSE; + } + ifnet_set_data (conn_name, "username", (gchar *) value); + + value = nm_setting_pppoe_get_password (s_pppoe); + /* password could be NULL here */ + if (value) { + ifnet_set_data (conn_name, "password", (gchar *) value); + } + return TRUE; +} + +gboolean +ifnet_update_parsers_by_connection (NMConnection * connection, + gchar * conn_name, + gchar ** nm_conn_name, + gchar * config_file, + gchar * wpa_file, GError ** error) +{ + NMSettingConnection *s_con; + NMSettingIP6Config *s_ip6; + gboolean success = FALSE; + const char *type; + gboolean no_8021x = FALSE; + gboolean wired = FALSE, pppoe = TRUE; + + s_con = + NM_SETTING_CONNECTION (nm_connection_get_setting + (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_CONNECTION_SETTING_NAME); + return FALSE; + } + + type = nm_setting_connection_get_connection_type (s_con); + if (!type) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing connection type!"); + goto out; + } + + if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { + /* Writing wired setting */ + if (!write_wired_setting (connection, conn_name, error)) + goto out; + wired = TRUE; + no_8021x = TRUE; + } else if (!strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME)) { + /* Writing wireless setting */ + if (!write_wireless_setting + (connection, &conn_name, &no_8021x, error)) + goto out; + } else if (!strcmp (type, NM_SETTING_PPPOE_SETTING_NAME)) { + /* Writing pppoe setting */ + if (! + (write_pppoe_setting + (conn_name, + NM_SETTING_PPPOE (nm_connection_get_setting + (connection, NM_TYPE_SETTING_PPPOE))))) + goto out; + pppoe = TRUE; + wired = TRUE; + no_8021x = TRUE; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't write connection type '%s'", type); + goto out; + } + + //FIXME wired connection doesn't support 8021x now + if (!no_8021x) { + if (!write_8021x_setting (connection, conn_name, wired, error)) + goto out; + } + + /* IPv4 Setting */ + if (!write_ip4_setting (connection, conn_name, error)) + goto out; + + s_ip6 = + (NMSettingIP6Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) { + /* IPv6 Setting */ + if (!write_ip6_setting (connection, conn_name, error)) + goto out; + } + + /* Connection Setting */ + write_connection_setting (s_con, conn_name); + + /* connection id will be displayed in nm-applet */ + update_connection_id (connection, conn_name); + + if (nm_conn_name) + *nm_conn_name = g_strdup (conn_name); + success = ifnet_flush_to_file (config_file); + if (success) + wpa_flush_to_file (wpa_file); + + out: + return success; +} + +gboolean +ifnet_delete_connection_in_parsers (gchar * conn_name, + gchar * config_file, gchar * wpa_file) +{ + gboolean result = FALSE; + + ifnet_delete_network (conn_name); + result = ifnet_flush_to_file (config_file); + if (result) { + /* connection may not have security information + * so simply ignore the return value*/ + wpa_delete_security (conn_name); + wpa_flush_to_file (wpa_file); + } + + return result; +} + +/* get the available wired name(eth*). */ +static gchar * +get_wired_name () +{ + int i = 0; + + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("eth%d", i); + + if (!ifnet_has_connection (conn_name)) { + return conn_name; + } else + g_free (conn_name); + } + return NULL; +} + +/* get the available pppoe name(ppp*). */ +static gchar * +get_ppp_name () +{ + int i = 0; + + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("ppp%d", i); + + if (!ifnet_has_connection (conn_name)) { + return conn_name; + } else + g_free (conn_name); + } + return NULL; +} + +/* get wireless ssid */ +static gchar * +get_wireless_name (NMConnection * connection) +{ + NMSettingWireless *s_wireless; + const GByteArray *ssid; + gboolean hex_ssid = FALSE; + gchar *result = NULL; + char buf[33]; + int i = 0; + + s_wireless = + (NMSettingWireless *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) + return NULL; + + ssid = nm_setting_wireless_get_ssid (s_wireless); + if (!ssid->len || ssid->len > 32) { + return NULL; + } + + for (i = 0; i < ssid->len; i++) { + if (!isprint (ssid->data[i])) { + hex_ssid = TRUE; + break; + } + } + + if (hex_ssid) { + GString *str; + + 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]); + result = g_strdup (str->str); + g_string_free (str, TRUE); + } else { + memset (buf, 0, sizeof (buf)); + memcpy (buf, ssid->data, ssid->len); + result = g_strdup_printf ("%s", buf); + g_strstrip (result); + } + + return result; +} + +gboolean +ifnet_add_new_connection (NMConnection * connection, + gchar * config_file, gchar * wpa_file, + GError ** error) +{ + NMSettingConnection *s_con; + gboolean success = FALSE; + const char *type; + gchar *new_type, *new_name = NULL; + + s_con = + NM_SETTING_CONNECTION (nm_connection_get_setting + (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_CONNECTION_SETTING_NAME); + return FALSE; + } + + type = nm_setting_connection_get_connection_type (s_con); + if (!type) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing connection type!"); + goto out; + } + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding %s connection", type); + + /* get name and type + * Wireless type: wireless + * Wired type: wired + * PPPoE type: ppp*/ + if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { + new_name = get_wired_name (); + if (!new_name) + goto out; + new_type = "wired"; + } else if (!strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME)) { + new_name = get_wireless_name (connection); + new_type = "wireless"; + } else if (!strcmp (type, NM_SETTING_PPPOE_SETTING_NAME)) { + new_name = get_ppp_name (); + if (!new_name) + goto out; + new_type = "ppp"; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't write connection type '%s'", type); + goto out; + } + + if (ifnet_add_connection (new_name, new_type)) + success = + ifnet_update_parsers_by_connection (connection, new_name, + NULL, config_file, + wpa_file, error); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Added new connection: %s, result: %s", + new_name, success ? "success" : "fail"); + + out: + if (new_name) + g_free (new_name); + return success; +} diff --git a/system-settings/plugins/ifnet/connection_parser.h b/system-settings/plugins/ifnet/connection_parser.h new file mode 100644 index 0000000000..b006954cc8 --- /dev/null +++ b/system-settings/plugins/ifnet/connection_parser.h @@ -0,0 +1,43 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _CONNECTION_PARSER_H +#define _CONNECTION_PARSER_H +#include <nm-connection.h> +#include "net_parser.h" + +NMConnection *ifnet_update_connection_from_config_block (gchar * conn_name, + GError ** error); + +/* nm_conn_name is used to update nm_ifnet_connection's priv data */ +gboolean ifnet_update_parsers_by_connection (NMConnection * connection, + gchar * conn_name, + gchar ** nm_conn_name, + gchar * config_file, + gchar * wpa_file, GError ** error); + +gboolean ifnet_delete_connection_in_parsers (gchar * conn_name, + gchar * config_file, + gchar * wpa_file); +gboolean ifnet_add_new_connection (NMConnection * connection, + gchar * config_file, gchar * wpa_file, + GError ** error); +#endif diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c new file mode 100644 index 0000000000..b4a381dee8 --- /dev/null +++ b/system-settings/plugins/ifnet/net_parser.c @@ -0,0 +1,635 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <string.h> +#include <nm-system-config-interface.h> +#include <stdio.h> +#include "net_parser.h" +#include "net_utils.h" + +/* Save all the connection information */ +static GHashTable *conn_table; + +/* Save global settings which are used for writing*/ +static GHashTable *global_settings_table; + +/* Save functions */ +static GList *functions_list; + +/* Used to decide whether to write changes to file*/ +static gboolean net_parser_data_changed = FALSE; + +static GHashTable * +add_new_connection_config (const gchar * type, const gchar * name) +{ + GHashTable *new_conn; + gchar *new_name; + + if (!name) + return NULL; + + /* Return existing connection */ + if ((new_conn = g_hash_table_lookup (conn_table, name)) != NULL) + return new_conn; + new_conn = g_hash_table_new (g_str_hash, g_str_equal); + new_name = g_strdup (name); + g_hash_table_insert (new_conn, g_strdup ("name"), new_name); + g_hash_table_insert (new_conn, g_strdup ("type"), g_strdup (type)); + g_hash_table_insert (conn_table, new_name, new_conn); + return new_conn; +} + +gboolean +ifnet_add_connection (gchar * name, gchar * type) +{ + if (add_new_connection_config (type, name)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name); + net_parser_data_changed = TRUE; + return TRUE; + } else + return FALSE; +} + +gboolean +ifnet_has_connection (gchar * conn_name) +{ + return g_hash_table_lookup (conn_table, conn_name) != NULL; +} + +static GHashTable * +get_connection_config (gchar * name) +{ + return g_hash_table_lookup (conn_table, name); +} + +/* Ignored name won't be treated as wireless ssid */ +static gchar *ignore_name[] = { + "vlan", "bond", "atm", "ath", "ippp", "vpn", "tap", "tun", "1", + "br", "nas", "6to4", "timeout", "kvm", "force", NULL +}; + +static gboolean +ignore_connection_name (gchar * name) +{ + gboolean result = FALSE; + guint i = 0; + + /* check ignore_name list */ + while (ignore_name[i] != NULL) { + if (g_ascii_strncasecmp + (name, ignore_name[i], strlen (ignore_name[i])) == 0) { + return TRUE; + } + i++; + } + /* Ignore mac address based configuration */ + if (strlen (name) == 12 && is_hex (name)) + result = TRUE; + return result; + +} + +static gboolean +is_global_setting (char *key) +{ + static gchar *global_settings[] = { "wpa_supplicant_", NULL }; + int i; + + for (i = 0; global_settings[i] != NULL; i++) { + if (strstr (key, global_settings[i])) + return 1; + } + return 0; +} + +/* Parse a complete line */ +/* Connection type is determined here */ +static void +init_block_by_line (gchar * buf) +{ + gchar **key_value; + gchar *pos; + gchar *data; + gchar *tmp; + GHashTable *conn; + + key_value = g_strsplit (buf, "=", 2); + if (g_strv_length (key_value) != 2) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle this line: %s\n", + buf); + g_strfreev (key_value); + return; + } + pos = g_strrstr (key_value[0], "_"); + if (pos == NULL || is_global_setting (key_value[0])) { + /* global data */ + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "global:%s-%s\n", key_value[0], + key_value[1]); + g_hash_table_insert (global_settings_table, + g_strdup (key_value[0]), + g_strdup (key_value[1])); + g_strfreev (key_value); + return; + } + *pos++ = '\0'; + if ((conn = get_connection_config (pos)) == NULL) { + if (g_ascii_strncasecmp (pos, "eth", 3) == 0 + && strlen (pos) == 4) + /* wired connection */ + conn = add_new_connection_config ("wired", pos); + else if (g_ascii_strncasecmp (pos, "ppp", 3) == 0 + && strlen (pos) == 4) + /* pppoe connection */ + conn = add_new_connection_config ("ppp", pos); + else if (ignore_connection_name (pos)) { + /* ignored connection */ + conn = add_new_connection_config ("ignore", pos); + } else + /* wireless connection */ + conn = add_new_connection_config ("wireless", pos); + } + data = g_strdup (key_value[1]); + tmp = strip_string (data, '('); + tmp = strip_string (tmp, ')'); + strip_string (tmp, '"'); + strip_string (tmp, '\''); + if (conn) + g_hash_table_insert (conn, g_strdup (key_value[0]), + g_strdup (tmp)); + g_free (data); + g_strfreev (key_value); +} + +static void +destroy_connection_config (GHashTable * conn) +{ + gpointer key, value; + GHashTableIter iter; + + g_hash_table_iter_init (&iter, conn); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (conn); +} + +// read settings from /etc/NetworkManager/nm-system-settings.conf +gchar * +ifnet_get_global_setting (gchar * group, gchar * key) +{ + GError *error = NULL; + GKeyFile *keyfile = g_key_file_new (); + gchar *result = NULL; + + if (!g_key_file_load_from_file (keyfile, + IFNET_SYSTEM_SETTINGS_KEY_FILE, + G_KEY_FILE_NONE, &error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "loading system config file (%s) caused error: (%d) %s", + IFNET_SYSTEM_SETTINGS_KEY_FILE, + error ? error->code : -1, error + && error->message ? error->message : "(unknown)"); + } else { + result = g_key_file_get_string (keyfile, group, key, &error); + } + g_key_file_free (keyfile); + return result; +} + +static void +strip_function (GIOChannel * channel, gchar * line) +{ + + int counter = 0; + gchar *p, *tmp; + gboolean begin = FALSE; + GString *function_str = g_string_new (line); + + g_string_append (function_str, "\n"); + while (1) { + p = line; + while (*p != '\0') { + if (*p == '{') { + counter++; + begin = TRUE; + } else if (*p == '}') + counter--; + p++; + } + if (begin && counter == 0) { + g_free (line); + goto done; + } + while (1) { + g_free (line); + if (g_io_channel_read_line + (channel, &line, NULL, NULL, + NULL) == G_IO_STATUS_EOF) + goto done; + g_string_append (function_str, line); + tmp = g_strdup (line); + g_strstrip (tmp); + if (tmp[0] != '#' && tmp[0] != '\0') { + g_free (tmp); + break; + } else + g_free (tmp); + } + } + done: + functions_list = + g_list_append (functions_list, g_strdup (function_str->str)); + g_string_free (function_str, TRUE); +} + +static gboolean +is_function (gchar * line) +{ + static gchar *func_names[] = + { "preup", "predown", "postup", "postdown", "failup", "faildown", + NULL, + }; + int i; + + for (i = 0; func_names[i]; i++) { + if (g_str_has_prefix (line, func_names[i])) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Ignoring function: %s", func_names[i]); + return TRUE; + } + } + return FALSE; +} + +gboolean +ifnet_init (gchar * config_file) +{ + GIOChannel *channel = NULL; + gchar *line; + + /* Handle multiple lines with brackets */ + gboolean complete = TRUE; + + /* line buffer */ + GString *buf; + + net_parser_data_changed = FALSE; + + conn_table = g_hash_table_new (g_str_hash, g_str_equal); + global_settings_table = g_hash_table_new (g_str_hash, g_str_equal); + functions_list = NULL; + + if (g_file_test (config_file, G_FILE_TEST_IS_REGULAR)) + channel = g_io_channel_new_file (config_file, "r", NULL); + if (channel == NULL) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Error: Can't open %s\n", config_file); + return FALSE; + } + + buf = g_string_new (NULL); + while (g_io_channel_read_line + (channel, &line, NULL, NULL, NULL) != G_IO_STATUS_EOF) { + g_strstrip (line); + /* convert multiple lines to a complete line and + * pass it to init_block_by_line() */ + if (is_function (line)) { + strip_function (channel, line); + continue; + } + if (line[0] != '#' && line[0] != '\0') { + gchar *pos = NULL; + + if (!complete) { + complete = + g_strrstr (line, + ")") == NULL ? FALSE : TRUE; + if ((pos = strchr (line, '#')) != NULL) + *pos = '\0'; + g_strstrip (line); + if (line[0] != '\0') { + g_string_append_printf (buf, + " %s", line); + } + g_free (line); + if (!complete) + continue; + } else { + complete = + (g_strrstr (line, "(") != NULL + && g_strrstr (line, ")") != NULL) + || g_strrstr (line, "(") == NULL; + if ((pos = strchr (line, '#')) != NULL) + *pos = '\0'; + g_strstrip (line); + if (line[0] != '\0') + g_string_append (buf, line); + g_free (line); + if (!complete) + continue; + } + init_block_by_line (buf->str); + g_string_free (buf, TRUE); + buf = g_string_new (NULL); + } else + /* Blank line or comment line */ + g_free (line); + } + + g_string_free (buf, TRUE); + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return TRUE; +} + +gchar * +ifnet_get_data (gchar * conn_name, const gchar * key) +{ + GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); + + if (conn) + return g_hash_table_lookup (conn, key); + return NULL; +} + +void +ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) +{ + gpointer orin_key = NULL, orin_value = NULL; + GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); + + if (!conn) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "%s does not exsit!", conn_name); + return; + } + /* Remove existing key value pair */ + if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) { + g_hash_table_remove (conn, orin_key); + g_free (orin_key); + g_free (orin_value); + } + if (value) + g_hash_table_insert (conn, g_strdup (key), + strip_string (g_strdup (value), '"')); + net_parser_data_changed = TRUE; +} + +// Remember to free return value +gchar * +ifnet_get_global_data (const gchar * key) +{ + gchar *result = g_hash_table_lookup (global_settings_table, key); + + if (result) + result = g_strdup (result); + else + return NULL; + strip_string (result, '"'); + return result; +} + +// Return names of legal connections +GList * +ifnet_get_connection_names () +{ + GList *names = g_hash_table_get_keys (conn_table); + GList *result = NULL; + + while (names) { + if (!ignore_connection_name (names->data)) + result = g_list_append (result, names->data); + names = names->next; + } + return result; +} + +/* format IP and route for writing */ +static void +format_ips (gchar * value, gchar ** out_line, gchar * key, gchar * name) +{ + gchar **ipset; + guint length, i; + GString *formated_string = g_string_new (NULL); + + strip_string (value, '"'); + ipset = g_strsplit (value, "\" \"", 0); + length = g_strv_length (ipset); + + //only one line + if (length < 2) { + *out_line = + g_strdup_printf ("%s_%s=( \"%s\" )\n", key, name, value); + goto done; + } + // Multiple lines + g_string_append_printf (formated_string, "%s_%s=(\n", key, name); + for (i = 0; i < length; i++) + g_string_append_printf (formated_string, + "\t\"%s\"\n", ipset[i]); + g_string_append (formated_string, ")\n"); + *out_line = g_strdup (formated_string->str); + done: + g_string_free (formated_string, TRUE); + g_strfreev (ipset); +} + +gboolean +ifnet_flush_to_file (gchar * config_file) +{ + GIOChannel *channel; + GError **error = NULL; + gpointer key, value, name, network; + GHashTableIter iter, iter_network; + GList *list_iter; + gchar *out_line; + gsize bytes_written; + gboolean result = FALSE; + + if (!net_parser_data_changed) + return FALSE; + if (!conn_table || !global_settings_table) + return FALSE; + + channel = g_io_channel_new_file (config_file, "w", NULL); + if (!channel) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open file %s for writing", config_file); + return FALSE; + } + g_hash_table_iter_init (&iter, global_settings_table); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Writing to %s", config_file); + g_io_channel_write_chars (channel, + "#Generated by NetworkManager\n" + "###### Global Configuration ######\n", + -1, &bytes_written, error); + /* Writing global data */ + while (g_hash_table_iter_next (&iter, &key, &value)) { + out_line = + g_strdup_printf ("%s=%s\n", (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + + /* Writing connection data */ + g_io_channel_write_chars (channel, + "\n###### Connection Configuration ######\n", + -1, &bytes_written, error); + g_hash_table_iter_init (&iter, conn_table); + while (g_hash_table_iter_next (&iter, &name, &network)) { + g_hash_table_iter_init (&iter_network, (GHashTable *) network); + g_io_channel_write_chars (channel, + "#----------------------------------\n", + -1, &bytes_written, error); + + while (g_hash_table_iter_next (&iter_network, &key, &value)) { + if (!g_str_has_prefix ((gchar *) key, "name") + && !g_str_has_prefix ((gchar *) key, "type")) { + /* These keys contain brackets */ + if (strcmp + ((gchar *) key, + "config") == 0 + || strcmp ((gchar *) key, + "routes") == 0 + || strcmp ((gchar *) key, + "pppd") == 0 + || strcmp ((gchar *) key, "chat") == 0) + format_ips (value, &out_line, (gchar *) + key, (gchar *) + name); + else + out_line = + g_strdup_printf + ("%s_%s=\"%s\"\n", + (gchar *) key, + (gchar *) name, (gchar *) value); + g_io_channel_write_chars + (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + } + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + + /* Writing reserved functions */ + if (functions_list) { + g_io_channel_write_chars (channel, + "\n###### Reserved Functions ######\n", + -1, &bytes_written, error); + /* Writing functions */ + for (list_iter = functions_list; list_iter; + list_iter = g_list_next (list_iter)) { + out_line = + g_strdup_printf ("%s\n", (gchar *) list_iter->data); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + } + + g_io_channel_flush (channel, error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + result = TRUE; + net_parser_data_changed = FALSE; + done: + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return result; +} + +gboolean +ifnet_delete_network (gchar * conn_name) +{ + GHashTable *network = NULL; + + g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); + network = g_hash_table_lookup (conn_table, conn_name); + if (!network) + return FALSE; + g_hash_table_remove (conn_table, conn_name); + destroy_connection_config (network); + net_parser_data_changed = TRUE; + return TRUE; +} + +void +ifnet_destroy (void) +{ + GHashTableIter iter; + gpointer key; + gpointer value; + GList *list_iter; + + /* Destroy connection setting */ + if (conn_table) { + g_hash_table_iter_init (&iter, conn_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + destroy_connection_config ((GHashTable *) + value); + } + g_hash_table_destroy (conn_table); + conn_table = NULL; + } + + /* Destroy global data */ + if (global_settings_table) { + g_hash_table_iter_init (&iter, global_settings_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + g_hash_table_destroy (global_settings_table); + global_settings_table = NULL; + } + for (list_iter = functions_list; list_iter; + list_iter = g_list_next (list_iter)) + g_free (list_iter->data); + g_list_free (functions_list); +} diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h new file mode 100644 index 0000000000..73a44c857d --- /dev/null +++ b/system-settings/plugins/ifnet/net_parser.h @@ -0,0 +1,46 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _NET_PARSER_H +#define _NET_PARSER_H + +#include <glib.h> + +#define CONF_NET_FILE "/etc/conf.d/net" +#define IFNET_SYSTEM_SETTINGS_KEY_FILE "/etc/NetworkManager/nm-system-settings.conf" +#define IFNET_KEY_FILE_GROUP "ifnet" + +gboolean ifnet_init (gchar * config_file); +void ifnet_destroy (void); + +/* Reader functions */ +GList *ifnet_get_connection_names (void); +gchar *ifnet_get_data (gchar * conn_name, const gchar * key); +gchar *ifnet_get_global_data (const gchar * key); +gchar *ifnet_get_global_setting (gchar * group, gchar * key); +gboolean ifnet_has_connection (gchar * conn_name); + +/* Writer functions */ +gboolean ifnet_flush_to_file (gchar * config_file); +void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value); +gboolean ifnet_add_connection (gchar * name, gchar * type); +gboolean ifnet_delete_network (gchar * conn_name); +#endif diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c new file mode 100644 index 0000000000..8f1b81b0b3 --- /dev/null +++ b/system-settings/plugins/ifnet/net_utils.c @@ -0,0 +1,931 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <errno.h> +#include <nm-utils.h> +#include <nm-system-config-interface.h> +#include "net_utils.h" +#include "wpa_parser.h" +#include "net_parser.h" + +/* emit heading and tailing blank space, tab, character t */ +gchar * +strip_string (gchar * str, gchar t) +{ + gchar *ret = str; + gint length = 0; + guint i = 0; + + while (ret[i] != '\0' + && (ret[i] == '\t' || ret[i] == ' ' || ret[i] == t)) { + length++; + i++; + } + i = 0; + while (ret[i + length] != '\0') { + ret[i] = ret[i + length]; + i++; + } + ret[i] = '\0'; + length = strlen (ret); + while ((length - 1) >= 0 + && (ret[length - 1] == ' ' || ret[length - 1] == '\n' + || ret[length - 1] == '\t' || ret[length - 1] == t)) + length--; + ret[length] = '\0'; + return ret; +} + +gboolean +is_hex (gchar * value) +{ + gchar *p; + + if (!value) + return FALSE; + p = value; + while (*p) { + if (!isxdigit (*p)) { + return FALSE; + } + p++; + } + return TRUE; +} + +gboolean +is_ascii (gchar * value) +{ + gchar *p; + + p = value; + while (*p) { + if (!isascii (*p)) { + return FALSE; + } + p++; + } + return TRUE; + +} + +gboolean +is_true (char *str) +{ + if (!g_ascii_strcasecmp (str, "yes") + || !g_ascii_strcasecmp (str, "true")) + return TRUE; + return FALSE; +} + +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; +} + +/* free return value by caller */ +gchar * +utils_hexstr2bin (const gchar * hex, size_t len) +{ + size_t i; + int a; + const gchar *ipos = hex; + gchar *buf = NULL; + gchar *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; +} + +/* free return value by caller */ +gchar * +utils_bin2hexstr (const gchar * bytes, int len, int final_len) +{ + static gchar hex_digits[] = "0123456789abcdef"; + gchar *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; +} + +GQuark +ifnet_plugin_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = + g_quark_from_static_string ("ifnet-plugin-error-quark"); + return error_quark; +} + +gboolean +reload_parsers () +{ + ifnet_destroy (); + wpa_parser_destroy (); + if (!ifnet_init (CONF_NET_FILE)) + return FALSE; + wpa_parser_init (WPA_SUPPLICANT_CONF); + return TRUE; +} + +gchar * +read_hostname (gchar * path) +{ + gchar *contents = NULL, *result = NULL, *tmp; + gchar **all_lines = NULL; + guint line_num, i; + + if (!g_file_get_contents (path, &contents, NULL, NULL)) + return NULL; + all_lines = g_strsplit (contents, "\n", 0); + line_num = g_strv_length (all_lines); + for (i = 0; i < line_num; i++) { + g_strstrip (all_lines[i]); + if (all_lines[i][0] == '#' || all_lines[i][0] == '\0') + continue; + if (g_str_has_prefix (all_lines[i], "hostname")) { + tmp = strstr (all_lines[i], "="); + tmp++; + tmp = strip_string (tmp, '"'); + result = g_strdup (tmp); + break; + } + + } + g_strfreev (all_lines); + g_free (contents); + return result; +} + +gboolean +write_hostname (const gchar * hostname, gchar * path) +{ + gchar *contents = g_strdup_printf ("#Generated by NetworkManager\n" + "hostname=\"%s\"\n", hostname); + gboolean result = g_file_set_contents (path, contents, -1, NULL); + + g_free (contents); + return result; +} + +gboolean +is_static_ip4 (gchar * conn_name) +{ + gchar *data = ifnet_get_data (conn_name, "config"); + gchar *dhcp6; + + if (!data) + return FALSE; + dhcp6 = strstr (data, "dhcp6"); + if (dhcp6) { + gchar *dhcp4; + + if (strstr (data, "dhcp ")) + return FALSE; + dhcp4 = strstr (data, "dhcp"); + if (!dhcp4) + return TRUE; + if (dhcp4[4] == '\0') + return FALSE; + return TRUE; + } + return strstr (data, "dhcp") == NULL ? TRUE : FALSE; +} + +gboolean +is_static_ip6 (gchar * conn_name) +{ + gchar *data = ifnet_get_data (conn_name, "config"); + + if (!data) + return TRUE; + return strstr (data, "dhcp6") == NULL ? TRUE : FALSE; +} + +gboolean +is_ip4_address (gchar * in_address) +{ + gchar *pattern = + "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.((\\{\\d{1,3}\\.\\.\\d{1,3}\\})|\\d{1,3})$"; + gchar *address = g_strdup (in_address); + gboolean result = FALSE; + gchar *tmp; + GRegex *regex = g_regex_new (pattern, 0, 0, NULL); + GMatchInfo *match_info; + + if (!address) + goto done; + g_strstrip (address); + if ((tmp = strstr (address, "/")) != NULL) + *tmp = '\0'; + if ((tmp = strstr (address, " ")) != NULL) + *tmp = '\0'; + g_regex_match (regex, address, 0, &match_info); + result = g_match_info_matches (match_info); + done: + if (match_info) + g_match_info_free (match_info); + g_regex_unref (regex); + g_free (address); + return result; +} + +gboolean +is_ip6_address (gchar * in_address) +{ + struct in6_addr tmp_ip6_addr; + gchar *tmp; + gchar *address = g_strdup (in_address); + gboolean result = FALSE; + + if (!address) { + g_free (address); + return FALSE; + } + g_strstrip (address); + if ((tmp = strchr (address, '/')) != NULL) + *tmp = '\0'; + if (inet_pton (AF_INET6, address, &tmp_ip6_addr)) + result = TRUE; + g_free (address); + return result; + +} + +gboolean +has_ip6_address (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + + g_return_val_if_fail (conn_name != NULL, FALSE); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + if (!is_ip6_address (ipset[i])) + continue; + else { + g_strfreev (ipset); + return TRUE; + } + + } + g_strfreev (ipset); + return FALSE; +} + +gboolean +has_default_route (gchar * conn_name, gboolean (*check_fn) (gchar *)) +{ + gchar *routes = NULL, *tmp, *end; + + g_return_val_if_fail (conn_name != NULL, FALSE); + tmp = ifnet_get_data (conn_name, "routes"); + if (!tmp) + return FALSE; + routes = g_strdup (tmp); + tmp = strstr (routes, "default via "); + if (!tmp) { + goto error; + } + tmp += strlen ("default via "); + g_strstrip (tmp); + if ((end = strstr (tmp, "\"")) != NULL) + *end = '\0'; + if (check_fn (tmp)) { + g_free (routes); + return TRUE; + } + error: + g_free (routes); + return FALSE; +} + +static ip_block * +create_ip4_block (gchar * ip) +{ + ip_block *iblock = g_slice_new0 (ip_block); + struct in_addr tmp_ip4_addr; + int i; + guint length; + gchar **ip_mask; + + /* prefix format */ + if (strstr (ip, "/")) { + gchar *prefix; + + ip_mask = g_strsplit (ip, "/", 0); + length = g_strv_length (ip_mask); + if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr)) + goto error; + iblock->ip = tmp_ip4_addr.s_addr; + prefix = ip_mask[1]; + i = 0; + while (i < length && isdigit (prefix[i])) + i++; + prefix[i] = '\0'; + iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32) + atoi (ip_mask + [1])); + } else if (strstr (ip, "netmask")) { + ip_mask = g_strsplit (ip, " ", 0); + length = g_strv_length (ip_mask); + if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr)) + goto error; + iblock->ip = tmp_ip4_addr.s_addr; + i = 0; + while (i < length && !strstr (ip_mask[++i], "netmask")) ; + while (i < length && ip_mask[++i][0] == '\0') ; + if (i >= length) + goto error; + if (!inet_pton (AF_INET, ip_mask[i], &tmp_ip4_addr)) + goto error; + iblock->netmask = tmp_ip4_addr.s_addr; + } else { + g_slice_free (ip_block, iblock); + if (!is_ip6_address (ip) && !strstr (ip, "dhcp")) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't handle ipv4 address: %s, missing netmask or prefix", + ip); + return NULL; + } + g_strfreev (ip_mask); + return iblock; + error: + if (!is_ip6_address (ip)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv4 address: %s", + ip); + g_strfreev (ip_mask); + g_slice_free (ip_block, iblock); + return NULL; +} + +static ip6_block * +create_ip6_block (gchar * ip) +{ + ip6_block *iblock = g_slice_new0 (ip6_block); + gchar *dup_ip = g_strdup (ip); + struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr); + gchar *prefix = NULL; + + if ((prefix = strstr (dup_ip, "/")) != NULL) { + *prefix = '\0'; + prefix++; + } + if (!inet_pton (AF_INET6, dup_ip, tmp_ip6_addr)) { + goto error; + } + iblock->ip = tmp_ip6_addr; + if (prefix) { + errno = 0; + iblock->prefix = strtol (prefix, NULL, 10); + if (errno || iblock->prefix <= 0 || iblock->prefix > 128) { + goto error; + } + } else + iblock->prefix = 64; + g_free (dup_ip); + return iblock; + error: + if (!is_ip4_address (ip)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv6 address: %s", + ip); + g_slice_free (ip6_block, iblock); + g_slice_free (struct in6_addr, tmp_ip6_addr); + + g_free (dup_ip); + return NULL; +} + +static guint32 +get_ip4_gateway (gchar * gateway) +{ + gchar *tmp, *split; + struct in_addr tmp_ip4_addr; + + if (!gateway) + return 0; + tmp = strstr (gateway, "via "); + tmp = g_strdup (tmp + strlen ("via ")); + strip_string (tmp, ' '); + strip_string (tmp, '"'); + if ((split = strstr (tmp, "\"")) != NULL) + *split = '\0'; + if (!inet_pton (AF_INET, tmp, &tmp_ip4_addr)) + goto error; + g_free (tmp); + return tmp_ip4_addr.s_addr; + error: + if (!is_ip6_address (tmp)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv4 gateway: %s", + tmp); + g_free (tmp); + return 0; +} + +static struct in6_addr * +get_ip6_next_hop (gchar * next_hop) +{ + gchar *tmp; + struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr); + + if (!next_hop) + return 0; + tmp = strstr (next_hop, "via "); + tmp = g_strdup (tmp + strlen ("via ")); + strip_string (tmp, ' '); + strip_string (tmp, '"'); + g_strstrip (tmp); + if (!inet_pton (AF_INET6, tmp, tmp_ip6_addr)) + goto error; + g_free (tmp); + return tmp_ip6_addr; + error: + if (!is_ip4_address (tmp)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't handle IPv6 next_hop: %s", tmp); + g_free (tmp); + g_slice_free (struct in6_addr, tmp_ip6_addr); + + return NULL; +} + +ip_block * +convert_ip4_config_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + guint32 def_gateway; + gchar *routes; + gchar *pos; + ip_block *start = NULL, *current = NULL, *iblock = NULL; + gchar *pattern = + "((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.)\\{(\\d{1,3})\\.\\.(\\d{1,3})\\}(/\\d{1,2}))"; + GRegex *regex = g_regex_new (pattern, 0, 0, NULL); + + g_return_val_if_fail (conn_name != NULL, NULL); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + routes = ifnet_get_data (conn_name, "routes"); + if (routes) + def_gateway = get_ip4_gateway (strstr (routes, "default")); + else + def_gateway = 0; + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + //Handle ip like 192.168.4.{1..3} + if ((pos = strchr (ip, '{')) != NULL) { + gchar *ip_start, *ip_prefix; + gchar *begin_str, *end_str; + int begin, end, j; + GMatchInfo *match_info; + + g_regex_match (regex, ip, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + continue; + } + begin_str = g_match_info_fetch (match_info, 3); + end_str = g_match_info_fetch (match_info, 4); + begin = atoi (begin_str); + end = atoi (end_str); + ip_start = g_match_info_fetch (match_info, 2); + ip_prefix = g_match_info_fetch (match_info, 5); + if (end < begin || begin < 1 || end > 254) { + g_match_info_free (match_info); + continue; + } + + for (j = begin; j <= end; j++) { + char suf[4]; + gchar *newip; + + sprintf (suf, "%d", j); + newip = + g_strconcat (ip_start, suf, ip_prefix, + NULL); + iblock = create_ip4_block (newip); + if (iblock == NULL) { + g_free (newip); + continue; + } + if (!iblock->gateway && def_gateway != 0) + iblock->gateway = def_gateway; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + g_free (newip); + } + g_free (begin_str); + g_free (end_str); + g_free (ip_start); + g_free (ip_prefix); + g_match_info_free (match_info); + } else { + iblock = create_ip4_block (ip); + if (iblock == NULL) + continue; + if (!iblock->gateway && def_gateway != 0) + iblock->gateway = def_gateway; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + } + g_strfreev (ipset); + g_regex_unref (regex); + return start; +} + +ip6_block * +convert_ip6_config_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + ip6_block *start = NULL, *current = NULL, *iblock = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + iblock = create_ip6_block (ip); + if (iblock == NULL) + continue; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +ip_block * +convert_ip4_routes_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + gchar *routes; + ip_block *start = NULL, *current = NULL, *iblock = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + routes = ifnet_get_data (conn_name, "routes"); + if (!routes) + return NULL; + ipset = g_strsplit (routes, "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + if (strstr (ip, "default via ") || strstr (ip, "::") + || !strstr (ip, "via")) + continue; + ip = strip_string (ip, '"'); + iblock = create_ip4_block (ip); + if (iblock == NULL) + continue; + iblock->gateway = get_ip4_gateway (ip); + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +ip6_block * +convert_ip6_routes_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip, *tmp_addr; + gchar *routes; + ip6_block *start = NULL, *current = NULL, *iblock = NULL; + struct in6_addr *tmp_ip6_addr; + + g_return_val_if_fail (conn_name != NULL, NULL); + routes = ifnet_get_data (conn_name, "routes"); + if (!routes) + return NULL; + ipset = g_strsplit (routes, "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + if (ip[0] == '\0') + continue; + printf ("ip:%s\n", ip); + if ((tmp_addr = strstr (ip, "default via ")) != NULL) { + tmp_addr += strlen ("default via "); + if (!is_ip6_address (tmp_addr)) + continue; + else { + tmp_ip6_addr = g_slice_new0 (struct in6_addr); + + if (inet_pton (AF_INET6, "::", tmp_ip6_addr)) { + iblock = g_slice_new0 (ip6_block); + iblock->ip = tmp_ip6_addr; + iblock->prefix = 128; + } else { + g_slice_free (struct in6_addr, + tmp_ip6_addr); + continue; + } + } + } else + iblock = create_ip6_block (ip); + if (iblock == NULL) + continue; + iblock->next_hop = get_ip6_next_hop (ip); + if (iblock->next_hop == NULL) { + destroy_ip6_block (iblock); + continue; + } + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +void +destroy_ip_block (ip_block * iblock) +{ + g_slice_free (ip_block, iblock); +} + +void +destroy_ip6_block (ip6_block * iblock) +{ + g_slice_free (struct in6_addr, iblock->ip); + g_slice_free (struct in6_addr, iblock->next_hop); + + g_slice_free (ip6_block, iblock); +} + +void +set_ip4_dns_servers (NMSettingIP4Config * s_ip4, gchar * conn_name) +{ + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar **server_list; + guint length, i; + struct in_addr tmp_ip4_addr; + guint32 new_dns; + + if (!dns_servers) + return; + strip_string (dns_servers, '"'); + server_list = g_strsplit (dns_servers, " ", 0); + length = g_strv_length (server_list); + if (length) + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, + TRUE, NULL); + for (i = 0; i < length; i++) { + g_strstrip (server_list[i]); + if (server_list[i][0] == '\0') + continue; + if (!inet_pton (AF_INET, server_list[i], &tmp_ip4_addr)) { + if (!is_ip6_address (server_list[i])) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignored dns: %s\n", + server_list[i]); + continue; + } + new_dns = tmp_ip4_addr.s_addr; + if (new_dns && !nm_setting_ip4_config_add_dns (s_ip4, new_dns)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate DNS server %s", + server_list[i]); + } + g_strfreev (server_list); +} + +void +set_ip6_dns_servers (NMSettingIP6Config * s_ip6, gchar * conn_name) +{ + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar **server_list; + guint length, i; + struct in6_addr tmp_ip6_addr; + + if (!dns_servers) + return; + strip_string (dns_servers, '"'); + server_list = g_strsplit (dns_servers, " ", 0); + length = g_strv_length (server_list); + if (length) + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, + TRUE, NULL); + for (i = 0; i < length; i++) { + g_strstrip (server_list[i]); + if (server_list[i][0] == '\0') + continue; + if (!inet_pton (AF_INET6, server_list[i], &tmp_ip6_addr)) { + if (is_ip6_address (server_list[i])) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignored dns: %s\n", + server_list[i]); + continue; + } + if (!IN6_IS_ADDR_UNSPECIFIED (&tmp_ip6_addr) + && !nm_setting_ip6_config_add_dns (s_ip6, &tmp_ip6_addr)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate DNS server %s", + server_list[i]); + } + g_strfreev (server_list); +} + +gboolean +is_managed (gchar * conn_name) +{ + gchar *config; + + g_return_val_if_fail (conn_name != NULL, FALSE); + config = (gchar *) ifnet_get_data (conn_name, "managed"); + if (!config) + return TRUE; + if (strcmp (config, "false") == 0) + return FALSE; + return TRUE; +} + +void +get_dhcp_hostname_and_client_id (char **hostname, char **client_id) +{ + gchar *dhcp_client = ifnet_get_global_setting ("main", "dhcp"); + const gchar *dhcpcd_conf = "/etc/dhcpcd.conf"; + const gchar *dhclient_conf = "/etc/dhcp/dhclient.conf"; + gchar *line = NULL, *tmp = NULL, *contents = NULL; + gchar **all_lines; + guint line_num, i; + + *hostname = NULL; + *client_id = NULL; + if (dhcp_client) { + if (!strcmp (dhcp_client, "dhclient")) + g_file_get_contents (dhclient_conf, &contents, NULL, + NULL); + else if (!strcmp (dhcp_client, "dhcpcd")) + g_file_get_contents (dhcpcd_conf, &contents, NULL, + NULL); + } else { + if (g_file_test (dhclient_conf, G_FILE_TEST_IS_REGULAR)) + g_file_get_contents (dhclient_conf, &contents, NULL, + NULL); + else if (g_file_test (dhcpcd_conf, G_FILE_TEST_IS_REGULAR)) + g_file_get_contents (dhcpcd_conf, &contents, NULL, + NULL); + } + if (!contents) + return; + all_lines = g_strsplit (contents, "\n", 0); + line_num = g_strv_length (all_lines); + for (i = 0; i < line_num; i++) { + line = all_lines[i]; + // dhcpcd.conf + g_strstrip (line); + if (g_str_has_prefix (line, "hostname")) { + tmp = line + strlen ("hostname"); + g_strstrip (tmp); + if (tmp[0] != '\0') + *hostname = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhcpcd hostname not defined, ignoring"); + } else if (g_str_has_prefix (line, "clientid")) { + tmp = line + strlen ("clientid"); + g_strstrip (tmp); + if (tmp[0] != '\0') + *client_id = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhcpcd clientid not defined, ignoring"); + } + // dhclient.conf + else if ((tmp = strstr (line, "send host-name")) != NULL) { + tmp += strlen ("send host-name"); + g_strstrip (tmp); + strip_string (tmp, '"'); + strip_string (tmp, ';'); + if (tmp[0] != '\0') + *hostname = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhclient hostname not defined, ignoring"); + } else if ((tmp = strstr (line, "send dhcp-client-identifier")) + != NULL) { + tmp += strlen ("send dhcp-client-identifier"); + g_strstrip (tmp); + strip_string (tmp, ';'); + if (tmp[0] != '\0') + *client_id = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhclient clientid not defined, ignoring"); + } + } + g_strfreev (all_lines); + g_free (contents); +} diff --git a/system-settings/plugins/ifnet/net_utils.h b/system-settings/plugins/ifnet/net_utils.h new file mode 100644 index 0000000000..ba7af39c27 --- /dev/null +++ b/system-settings/plugins/ifnet/net_utils.h @@ -0,0 +1,80 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _IFNET_UTILS_H +#define _IFNET_UTILS_H +#define IFNET_PLUGIN_NAME "SCPlugin-Ifnet" +#include <glib.h> +#include <arpa/inet.h> +#include <nm-setting-ip6-config.h> +#include <nm-setting-ip4-config.h> +#include "net_parser.h" +#define has_default_ip4_route(conn_name) has_default_route((conn_name),&is_ip4_address) +#define has_default_ip6_route(conn_name) has_default_route((conn_name),&is_ip6_address) + +typedef struct _ip_block { + guint32 ip; + guint32 netmask; + guint32 gateway; + struct _ip_block *next; +} ip_block; + +typedef struct _ip6_block { + struct in6_addr *ip; + long int prefix; + struct in6_addr *next_hop; + struct _ip6_block *next; +} ip6_block; + +gchar *read_hostname (gchar * path); +gboolean write_hostname (const gchar * hostname, gchar * path); +gboolean is_static_ip4 (gchar * conn_name); +gboolean is_static_ip6 (gchar * conn_name); +gboolean is_ip4_address (gchar * in_address); +gboolean is_ip6_address (gchar * in_address); +gboolean has_ip6_address (gchar * conn_name); +gboolean has_default_route (gchar * conn_name, gboolean (*check_fn) (gchar *)); +gboolean reload_parsers (void); + +ip_block *convert_ip4_config_block (gchar * conn_name); +ip6_block *convert_ip6_config_block (gchar * conn_name); +ip_block *convert_ip4_routes_block (gchar * conn_name); +ip6_block *convert_ip6_routes_block (gchar * conn_name); +void destroy_ip_block (ip_block * iblock); +void destroy_ip6_block (ip6_block * iblock); + +void set_ip4_dns_servers (NMSettingIP4Config * s_ip4, gchar * conn_name); +void set_ip6_dns_servers (NMSettingIP6Config * s_ip6, gchar * conn_name); + +gchar *strip_string (gchar * str, gchar t); +gboolean is_managed (gchar * conn_name); + +GQuark ifnet_plugin_error_quark (void); +gchar *utils_hexstr2bin (const gchar * hex, size_t len); +gchar *utils_bin2hexstr (const gchar * bytes, int len, int final_len); + +gboolean is_hex (gchar * value); +gboolean is_ascii (gchar * value); +gboolean is_true (gchar * str); + +void get_dhcp_hostname_and_client_id (char **hostname, char **client_id); + +#endif diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.c b/system-settings/plugins/ifnet/nm-ifnet-connection.c new file mode 100644 index 0000000000..e47495cfbe --- /dev/null +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.c @@ -0,0 +1,251 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <string.h> +#include <glib/gstdio.h> +#include <NetworkManager.h> +#include <nm-utils.h> +#include <nm-setting-wireless-security.h> +#include <nm-sysconfig-connection.h> +#include <nm-system-config-interface.h> +#include <nm-system-config-error.h> +#include "nm-ifnet-connection.h" +#include "connection_parser.h" +#include "net_parser.h" +#include "net_utils.h" +#include "wpa_parser.h" +#include "plugin.h" + +static NMSettingsConnectionInterface *parent_settings_connection_iface; + +static void settings_connection_interface_init (NMSettingsConnectionInterface * + klass); + +G_DEFINE_TYPE_EXTENDED (NMIfnetConnection, nm_ifnet_connection, + NM_TYPE_SYSCONFIG_CONNECTION, 0, + G_IMPLEMENT_INTERFACE + (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) +// G_DEFINE_TYPE(NMIfnetConnection, nm_ifnet_connection, +// NM_TYPE_SYSCONFIG_CONNECTION) +#define NM_IFNET_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionPrivate)) +enum { + PROP_ZERO, + PROP_CONN_NAME, + _PROP_END, +}; + +enum { + IFNET_SETUP_MONITORS, + IFNET_CANCEL_MONITORS, + IFNET_LAST_SIGNAL +}; + +static guint signals[IFNET_LAST_SIGNAL] = { 0 }; + +typedef struct { + gchar *conn_name; + NMSystemConfigInterface *config; +} NMIfnetConnectionPrivate; + +NMIfnetConnection * +nm_ifnet_connection_new (gchar * conn_name) +{ + NMConnection *tmp; + GObject *object; + GError **error = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + tmp = ifnet_update_connection_from_config_block (conn_name, error); + if (!tmp) + return NULL; + object = (GObject *) g_object_new (NM_TYPE_IFNET_CONNECTION, + NM_IFNET_CONNECTION_CONN_NAME, + conn_name, NULL); + if (!object) { + g_object_unref (tmp); + return NULL; + } + nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, + FALSE, NULL); + g_object_unref (tmp); + return NM_IFNET_CONNECTION (object); +} + +static void +nm_ifnet_connection_init (NMIfnetConnection * connection) +{ +} + +static gboolean +update (NMSettingsConnectionInterface * connection, + NMSettingsConnectionInterfaceUpdateFunc callback, gpointer user_data) +{ + GError *error = NULL; + gchar *new_conn_name = NULL; + gboolean result; + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (connection); + g_signal_emit (connection, signals[IFNET_CANCEL_MONITORS], 0); + if (!ifnet_update_parsers_by_connection + (NM_CONNECTION (connection), priv->conn_name, &new_conn_name, + CONF_NET_FILE, WPA_SUPPLICANT_CONF, &error)) { + if (new_conn_name) + g_free (new_conn_name); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Failed to update %s", + priv->conn_name); + reload_parsers (); + callback (connection, error, user_data); + g_error_free (error); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return FALSE; + } + + g_free (priv->conn_name); + priv->conn_name = new_conn_name; + result = + parent_settings_connection_iface->update (connection, callback, + user_data); + if (result) + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully updated %s", + priv->conn_name); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return result; +} + +static gboolean +do_delete (NMSettingsConnectionInterface * connection, + NMSettingsConnectionInterfaceDeleteFunc callback, gpointer user_data) +{ + GError *error = NULL; + gboolean result; + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (connection); + g_signal_emit (connection, signals[IFNET_CANCEL_MONITORS], 0); + if (!ifnet_delete_connection_in_parsers + (priv->conn_name, CONF_NET_FILE, WPA_SUPPLICANT_CONF)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Failed to delete %s", + priv->conn_name); + reload_parsers (); + callback (connection, error, user_data); + g_error_free (error); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return FALSE; + } + result = + parent_settings_connection_iface->delete (connection, callback, + user_data); + if (result) + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully deleted %s", + priv->conn_name); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return result; +} + +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 +set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_CONN_NAME: + if (priv->conn_name) + g_free (priv->conn_name); + priv->conn_name = g_strdup (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) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_CONN_NAME: + g_value_set_pointer (value, priv->conn_name); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject * object) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + if (priv->conn_name) + g_free (priv->conn_name); + G_OBJECT_CLASS (nm_ifnet_connection_parent_class)->finalize (object); +} + +static void +nm_ifnet_connection_class_init (NMIfnetConnectionClass * ifnet_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ifnet_connection_class); + + g_type_class_add_private (ifnet_connection_class, + sizeof (NMIfnetConnectionPrivate)); + + 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_CONN_NAME, + g_param_spec_pointer (NM_IFNET_CONNECTION_CONN_NAME, + "config_block", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + signals[IFNET_SETUP_MONITORS] = + g_signal_new ("ifnet_setup_monitors", + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + signals[IFNET_CANCEL_MONITORS] = + g_signal_new ("ifnet_cancel_monitors", + 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/ifnet/nm-ifnet-connection.h b/system-settings/plugins/ifnet/nm-ifnet-connection.h new file mode 100644 index 0000000000..8b3d495f0b --- /dev/null +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.h @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef NM_IFNET_CONNECTION_H +#define NM_IFNET_CONNECTION_H + +#include <nm-sysconfig-connection.h> +#include "net_parser.h" + +G_BEGIN_DECLS +#define NM_TYPE_IFNET_CONNECTION (nm_ifnet_connection_get_type ()) +#define NM_IFNET_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnection)) +#define NM_IFNET_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) +#define NM_IS_IFNET_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IFNET_CONNECTION)) +#define NM_IS_IFNET_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IFNET_CONNECTION)) +#define NM_IFNET_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) +#define NM_IFNET_CONNECTION_CONN_NAME "connection_name" + typedef struct { + NMSysconfigConnection parent; +} NMIfnetConnection; + +typedef struct { + NMSysconfigConnectionClass parent; +} NMIfnetConnectionClass; + +GType nm_ifnet_connection_get_type (void); + +NMIfnetConnection *nm_ifnet_connection_new (gchar * conn_name); + +G_END_DECLS +#endif /* NM_IFNET_CONNECTION_H */ diff --git a/system-settings/plugins/ifnet/plugin.c b/system-settings/plugins/ifnet/plugin.c new file mode 100644 index 0000000000..51d560246d --- /dev/null +++ b/system-settings/plugins/ifnet/plugin.c @@ -0,0 +1,585 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <string.h> + +#include <gmodule.h> +#include <glib.h> +#include <gio/gio.h> + +#include <nm-utils.h> +#include <nm-setting-connection.h> + +#include "NetworkManager.h" +#include "nm-system-config-interface.h" +#include "nm-ifnet-connection.h" + +#include "plugin.h" +#include "net_utils.h" +#include "net_parser.h" +#include "wpa_parser.h" +#include "connection_parser.h" + +#define IFNET_PLUGIN_NAME_PRINT "ifnet" +#define IFNET_PLUGIN_INFO "(C) 1999-2010 Gentoo Foundation, Inc. To report bugs please use bugs.gentoo.org with [networkmanager] or [dagger] prefix." +#define IFNET_SYSTEM_HOSTNAME_FILE "/etc/conf.d/hostname" +#define IFNET_MANAGE_WELL_KNOWN_DEFAULT TRUE +#define IFNET_KEY_FILE_KEY_MANAGED "managed" + +typedef struct { + GHashTable *config_connections; + gchar *hostname; + gboolean unmanaged_well_known; + + GFileMonitor *hostname_monitor; + GFileMonitor *net_monitor; + GFileMonitor *wpa_monitor; + +} SCPluginIfnetPrivate; + +typedef void (*FileChangedFn) (gpointer user_data); + +typedef struct { + FileChangedFn callback; + gpointer user_data; +} FileMonitorInfo; + +static void system_config_interface_init (NMSystemConfigInterface * + system_config_interface_class); + +static void + reload_connections (gpointer config); + +G_DEFINE_TYPE_EXTENDED (SCPluginIfnet, sc_plugin_ifnet, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) +#define SC_PLUGIN_IFNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetPrivate)) +/* +static void +ignore_cb(NMSettingsConnectionInterface * connection, + GError * error, gpointer user_data) +{ +} +*/ +static const char * +get_hostname (NMSystemConfigInterface * config) +{ + return SC_PLUGIN_IFNET_GET_PRIVATE (config)->hostname; +} + +static void +update_system_hostname (gpointer config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Updating hostname"); + + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = read_hostname (IFNET_SYSTEM_HOSTNAME_FILE); + + g_object_notify (G_OBJECT (config), + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Hostname updated to: %s", + priv->hostname); +} + +static void +write_system_hostname (NMSystemConfigInterface * config, + const gchar * newhostname) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + + g_return_if_fail (newhostname); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Write system hostname: %s", + newhostname); + if (write_hostname (newhostname, IFNET_SYSTEM_HOSTNAME_FILE)) { + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = g_strdup (newhostname); + g_object_notify (G_OBJECT (config), + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + } else + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Write system hostname: %s failed", newhostname); +} + +static gboolean +is_managed_plugin () +{ + gchar *result = NULL; + + result = + ifnet_get_global_setting (IFNET_KEY_FILE_GROUP, + IFNET_KEY_FILE_KEY_MANAGED); + if (result) { + if (is_true (result)) { + g_free (result); + return TRUE; + } else { + g_free (result); + return FALSE; + } + } + return IFNET_MANAGE_WELL_KNOWN_DEFAULT; +} + +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: + 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; + GError **error = NULL; + + if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR)) + return NULL; + file = g_file_new_for_path (filename); + monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, error); + 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); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Monitoring %s", filename); + + } else + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Monitoring %s failed, error: %s", filename, + error == NULL ? "nothing" : (*error)->message); + + return monitor; +} + +static void +update_old_connection (gchar * conn_name, + NMIfnetConnection * old_conn, + NMIfnetConnection * new_conn, + SCPluginIfnetPrivate * priv) +{ + GError **error = NULL; + + if (!nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (old_conn), + NM_CONNECTION (new_conn), TRUE, + error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "error updating: %s", + (error + && (*error)) ? (*error)->message : "(unknown)"); + } else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Connection %s updated", + conn_name); + g_object_unref (new_conn); +} + +static void +setup_monitors (NMIfnetConnection * connection, gpointer user_data) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (user_data); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + priv->hostname_monitor = + monitor_file_changes (IFNET_SYSTEM_HOSTNAME_FILE, + update_system_hostname, user_data); + priv->net_monitor = + monitor_file_changes (CONF_NET_FILE, reload_connections, user_data); + priv->wpa_monitor = + monitor_file_changes (WPA_SUPPLICANT_CONF, reload_connections, + user_data); +} + +static void +cancel_monitors (NMIfnetConnection * connection, gpointer user_data) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (user_data); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + if (priv->hostname_monitor) { + g_file_monitor_cancel (priv->hostname_monitor); + g_object_unref (priv->hostname_monitor); + } + if (priv->net_monitor) { + g_file_monitor_cancel (priv->net_monitor); + g_object_unref (priv->net_monitor); + } + if (priv->wpa_monitor) { + g_file_monitor_cancel (priv->wpa_monitor); + g_object_unref (priv->wpa_monitor); + } +} + +static void +reload_connections (gpointer config) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (config); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + GList *conn_names = NULL, *n_iter = NULL; + + /* save names for removing unused connections */ + GHashTable *new_conn_names = NULL; + GHashTableIter iter; + gpointer key; + gpointer value; + + if (priv->unmanaged_well_known) + return; + + if (!reload_parsers ()) + return; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Loading connections"); + conn_names = ifnet_get_connection_names (); + new_conn_names = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + for (n_iter = conn_names; n_iter; n_iter = g_list_next (n_iter)) { + NMIfnetConnection *exported; + NMIfnetConnection *old; + gchar *conn_name = g_strdup (n_iter->data); + + /* add the new connection */ + exported = nm_ifnet_connection_new (conn_name); + if (!exported) { + g_free (conn_name); + continue; + } + g_signal_connect (G_OBJECT (exported), "ifnet_setup_monitors", + G_CALLBACK (setup_monitors), config); + g_signal_connect (G_OBJECT (exported), "ifnet_cancel_monitors", + G_CALLBACK (cancel_monitors), config); + old = g_hash_table_lookup (priv->config_connections, conn_name); + if (old && exported) { + gchar *auto_refresh = + ifnet_get_global_setting (IFNET_KEY_FILE_GROUP, + "auto_refresh"); + + if (auto_refresh && is_true (auto_refresh)) { + if (!nm_connection_compare (NM_CONNECTION (old), + NM_CONNECTION + (exported), + NM_SETTING_COMPARE_FLAG_EXACT)) + { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Auto refreshing %s", + conn_name); + g_signal_emit_by_name (old, + NM_SETTINGS_CONNECTION_INTERFACE_REMOVED); + g_hash_table_remove + (priv->config_connections, + conn_name); + g_hash_table_insert + (priv->config_connections, + g_strdup (conn_name), exported); + if (is_managed (conn_name)) + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + exported); + } + } else + update_old_connection (conn_name, old, + exported, priv); + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + } else if (exported) { + g_hash_table_insert (priv->config_connections, + g_strdup (conn_name), exported); + if (is_managed (conn_name)) + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + exported); + } + g_hash_table_insert (new_conn_names, conn_name, conn_name); + } + /* remove unused connections */ + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) { + if (!g_hash_table_lookup (new_conn_names, key)) { + g_signal_emit_by_name (value, + NM_SETTINGS_CONNECTION_INTERFACE_REMOVED); + g_hash_table_remove (priv->config_connections, key); + } + } + g_hash_table_remove_all (new_conn_names); + g_hash_table_destroy (new_conn_names); + g_list_free (conn_names); +} + +static gboolean +add_connection (NMSystemConfigInterface * config, + NMConnection * connection, GError ** error) +{ + gboolean result; + + result = ifnet_add_new_connection (connection, CONF_NET_FILE, + WPA_SUPPLICANT_CONF, error); + reload_connections (config); + return result; +} + +static void +check_unmanaged (gpointer key, gpointer data, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + gchar *conn_name = (gchar *) key; + const char *unmanaged_spec; + GSList *iter; + + if (is_managed (conn_name)) + return; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Checking unmanaged: %s", conn_name); + unmanaged_spec = ifnet_get_data (conn_name, "mac"); + 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; + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Add unmanaged: %s", unmanaged_spec); + *list = + g_slist_prepend (*list, g_strdup_printf ("mac:%s", unmanaged_spec)); +} + +static GSList * +get_unmanaged_specs (NMSystemConfigInterface * config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + GSList *list = NULL; + + g_return_val_if_fail (priv->config_connections != NULL, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "getting unmanaged specs..."); + g_hash_table_foreach (priv->config_connections, check_unmanaged, &list); + return list; +} + +static void +SCPluginIfnet_init (NMSystemConfigInterface * config) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (config); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Initializing!"); + if (!priv->config_connections) + priv->config_connections = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + g_object_unref); + priv->unmanaged_well_known = !is_managed_plugin (); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "management mode: %s", + priv->unmanaged_well_known ? "unmanaged" : "managed"); + // GFileMonitor setup + setup_monitors (NULL, config); + reload_connections (config); + /* Now if we're running in managed mode, let NM know there are new connections */ + if (!priv->unmanaged_well_known) { + GHashTableIter iter; + gpointer key; + gpointer value; + + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) { + if (is_managed ((gchar *) key)) + g_signal_emit_by_name + (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + NM_EXPORTED_CONNECTION (value)); + } + } + /* Read hostname */ + update_system_hostname (self); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Initialzation complete!"); +} + +static GSList * +SCPluginIfnet_get_connections (NMSystemConfigInterface * config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + GSList *connections = NULL; + GHashTableIter iter; + gpointer key, value; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "(%d) ... get_connections.", + GPOINTER_TO_UINT (config)); + if (priv->unmanaged_well_known) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "(%d) ... get_connections (managed=false): return empty list.", + GPOINTER_TO_UINT (config)); + return NULL; + } + + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) + if (is_managed ((gchar *) key)) + connections = g_slist_prepend (connections, value); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "(%d) connections count: %d", + GPOINTER_TO_UINT (config), g_slist_length (connections)); + return connections; +} + +static void +system_config_interface_init (NMSystemConfigInterface * + system_config_interface_class) +{ + system_config_interface_class->init = SCPluginIfnet_init; + system_config_interface_class->get_connections = + SCPluginIfnet_get_connections; + system_config_interface_class->get_unmanaged_specs = + get_unmanaged_specs; + system_config_interface_class->add_connection = add_connection; +} + +static void +sc_plugin_ifnet_init (SCPluginIfnet * plugin) +{ +} + +static void +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, IFNET_PLUGIN_NAME_PRINT); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, IFNET_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, get_hostname (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) +{ + 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 +dispose (GObject * object) +{ + SCPluginIfnet *plugin = SC_PLUGIN_IFNET (object); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (plugin); + + cancel_monitors (NULL, object); + if (priv->config_connections) { + g_hash_table_remove_all (priv->config_connections); + g_hash_table_destroy (priv->config_connections); + } + + if (priv->hostname) + g_free (priv->hostname); + ifnet_destroy (); + wpa_parser_destroy (); + G_OBJECT_CLASS (sc_plugin_ifnet_parent_class)->dispose (object); +} + +static void +sc_plugin_ifnet_class_init (SCPluginIfnetClass * req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginIfnetPrivate)); + + 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); +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginIfnet *singleton = NULL; + + if (!singleton) + singleton + = + SC_PLUGIN_IFNET (g_object_new (SC_TYPE_PLUGIN_IFNET, NULL)); + else + g_object_ref (singleton); + return G_OBJECT (singleton); +} diff --git a/system-settings/plugins/ifnet/plugin.h b/system-settings/plugins/ifnet/plugin.h new file mode 100644 index 0000000000..83099b63a0 --- /dev/null +++ b/system-settings/plugins/ifnet/plugin.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include <glib-object.h> + +#define SC_TYPE_PLUGIN_IFNET (sc_plugin_ifnet_get_type ()) +#define SC_PLUGIN_IFNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFNET, SCPluginIfnet)) +#define SC_PLUGIN_IFNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetClass)) +#define SC_IS_PLUGIN_IFNET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFNET)) +#define SC_IS_PLUGIN_IFNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFNET)) +#define SC_PLUGIN_IFNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetClass)) + +typedef struct _SCPluginIfnet SCPluginIfnet; +typedef struct _SCPluginIfnetClass SCPluginIfnetClass; + +struct _SCPluginIfnet { + GObject parent; +}; + +struct _SCPluginIfnetClass { + GObjectClass parent; +}; + +GType sc_plugin_ifnet_get_type (void); +#endif diff --git a/system-settings/plugins/ifnet/tests/Makefile.am b/system-settings/plugins/ifnet/tests/Makefile.am new file mode 100644 index 0000000000..ead3f1fc4f --- /dev/null +++ b/system-settings/plugins/ifnet/tests/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES=-I$(top_srcdir)/system-settings/plugins/ifnet\ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/system-settings +TESTS = check_ifnet +check_PROGRAMS = check_ifnet +check_ifnet_SOURCES = test_all.c +check_ifnet_LDFLAGS = -g +check_ifnet_CPPFLAGS = $(CHECK_CFLAGS) $(GLIB_CFLAGS) -g +check_ifnet_LDADD = $(top_srcdir)/libnm-util/libnm-util.la\ + $(top_srcdir)/system-settings/plugins/ifnet/lib-ifnet-io.la\ + $(CHECK_LIBS)\ + $(GLIB_LIBS) diff --git a/system-settings/plugins/ifnet/tests/hostname b/system-settings/plugins/ifnet/tests/hostname new file mode 100644 index 0000000000..25c761655a --- /dev/null +++ b/system-settings/plugins/ifnet/tests/hostname @@ -0,0 +1,2 @@ +#Generated by NetworkManager +hostname="gentoo" diff --git a/system-settings/plugins/ifnet/tests/net b/system-settings/plugins/ifnet/tests/net new file mode 100644 index 0000000000..e755000238 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/net @@ -0,0 +1,147 @@ +# This blank configuration will automatically use DHCP for any net.* +# scripts in /etc/init.d. To create a more complete configuration, +# please review /etc/conf.d/net.example and save your configuration +# in /etc/conf.d/net (this file :]!). + +config_eth0=( +"202.117.16.121 netmask 255.255.255.0 brd 202.117.16.255" +"192.168.4.121/24" +"dhcp6" +) +routes_eth0=( "default via 202.117.16.1" + "192.168.4.0/24 via 192.168.4.1") +dns_servers_eth0="202.117.0.20 202.117.0.21" +dns_search_eth0="p12.edu.cn p13.edu.cn" + +config_eth1=( + "dhcp" +) +enable_ipv6_eth1="true" +routes_eth1=( "default via 202.117.16.1" ) +dns_servers_eth1="202.117.0.20 202.117.0.21" +config_eth2=( +"202.117.16.1211 netmask 255.255.255.0 brd 202.117.16.255" +"192.168.4.121/24" +"4321:0:1:2:3:4:567:89ab/64" +) +routes_eth2=("default via 4321:0:1:2:3:4:567:89ab") +enable_ipv6_eth2="true" +config_eth3=("nufjlsjlll") +managed_eth4=("false") +routes_eth4=("default via 4321:0:1:2:3:4:567:89ab") +config_eth5=("dhcp") +config_eth6=("192.168.4.{1..101}/24") + +config_eth7=( "dhcp" ) +auto_eth7="true" + + +config_myxjtu2=("202.117.16.121/24 brd 202.117.16.255") +routes_myxjtu2=("default via 202.117.16.1") +dns_servers_myxjtu2="202.117.0.20 202.117.0.21" +#key_myxjtu2="[1] s:xjtud key [1] enc restricted" +#key_eth6="[1] aaaa-4444-3d [2] s:xjtudlc key [1] enc open" + + +username_ppp0='user' +password_ppp0='password' + +config_qiaomuf=("dhcp") + +config_1xtest=("dhcp") + +config_0xab3ace=("dhcp") + +modules=( "iproute2" ) + config_kvm0=( "null" ) + config_kvm1=( "null" ) + + tuntap_kvm0="tap" + tuntap_kvm1="tap" + tunctl_kvm0="-u user" + tunctl_kvm1="-u user" + +bridge_br0="eth0 kvm0 kvm1" +config_br0=( "192.168.1.10/24" ) + brctl_br0=( "setfd 0") + dhcp_eth1="nosendhost nontp -I" + +predown() { + # The default in the script is to test for NFS root and disallow + # downing interfaces in that case. Note that if you specify a + # predown() function you will override that logic. Here it is, in + # case you still want it... + if is_net_fs /; then + eerror "root filesystem is network mounted -- can't stop ${IFACE}" + return 1 + fi + + # Remember to return 0 on success + return 0 +} + +postup() { + # This function could be used, for example, to register with a + # dynamic DNS service. Another possibility would be to + # send/receive mail once the interface is brought up. + + # Here is an example that allows the use of iproute rules + # which have been configured using the rules_eth0 variable. + #rules_eth0=" \ + # 'from 24.80.102.112/32 to 192.168.1.0/24 table localnet priority 100' \ + # 'from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100' \ + #" + eval set -- \$rules_${IFVAR} + if [ $# != 0 ]; then + einfo "Adding IP policy routing rules" + eindent + # Ensure that the kernel supports policy routing + if ! ip rule list | grep -q "^"; then + eerror "You need to enable IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES)" + eerror "in your kernel to use ip rules" + else + for x; do + ebegin "${x}" + ip rule add ${x} + eend $? + done + fi + eoutdent + # Flush the cache + ip route flush cache dev "${IFACE}" + fi + +} + +postdown() { + # Enable Wake-On-LAN for every interface except for lo + # Probably a good idea to set ifdown="no" in /etc/conf.d/net + # as well ;) + [ "${IFACE}" != "lo" ] && ethtool -s "${IFACE}" wol g + + Automatically erase any ip rules created in the example postup above + if interface_exists "${IFACE}"; then + # Remove any rules for this interface + local rule + ip rule list | grep " iif ${IFACE}[ ]*" | { + while read rule; do + rule="${rule#*:}" + ip rule del ${rule} + done + } + # Flush the route cache + ip route flush cache dev "${IFACE}" + fi + + # Return 0 always + return 0 +} + +failup() { + # This function is mostly here for completeness... I haven't + # thought of anything nifty to do with it yet ;-) +} + +faildown() +{} + diff --git a/system-settings/plugins/ifnet/tests/net.all b/system-settings/plugins/ifnet/tests/net.all new file mode 100644 index 0000000000..a30a1b95e6 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/net.all @@ -0,0 +1,864 @@ +############################################################################## +# QUICK-START +# +# The quickest start is if you want to use DHCP. +# In that case, everything should work out of the box, no configuration +# necessary, though the startup script will warn you that you haven't +# specified anything. + +# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6 +# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have +# the relevant kernel option enabled. So if you don't have an IPv6 enabled +# kernel then remove the IPv6 address from your config. + +# If you want to use a static address or use DHCP explicitly, jump +# down to the section labelled INTERFACE HANDLERS. +# +# If you want to do anything more fancy, you should take the time to +# read through the rest of this file. + +############################################################################## +# MODULES +# +# We now support modular networking scripts which means we can easily +# add support for new interface types and modules while keeping +# compatability with existing ones. +# +# Modules load by default if the package they need is installed. If +# you specify a module here that doesn't have it's package installed +# then you get an error stating which package you need to install. +# Ideally, you only use the modules setting when you have two or more +# packages installed that supply the same service. +# +# In other words, you probably should DO NOTHING HERE... + +# Prefer ifconfig over iproute2 +modules=( "ifconfig" ) + +# You can also specify other modules for an interface +# In this case we prefer udhcpc over dhcpcd +modules_eth0=( "udhcpc" ) + +# You can also specify which modules not to use - for example you may be +# using a supplicant or linux-wlan-ng to control wireless configuration but +# you still want to configure network settings per ESSID associated with. +modules=( "!iwconfig" "!wpa_supplicant" ) +# IMPORTANT: If you need the above, please disable modules in that order + + +############################################################################## +# INTERFACE HANDLERS +# +# We provide two interface handlers presently: ifconfig and iproute2. +# You need one of these to do any kind of network configuration. +# For ifconfig support, emerge sys-apps/net-tools +# For iproute2 support, emerge sys-apps/iproute2 + +# If you don't specify an interface then we prefer iproute2 if it's installed +# To prefer ifconfig over iproute2 +modules=( "ifconfig" ) + +# For a static configuration, use something like this +# (They all do exactly the same thing btw) +config_eth0=( "192.168.0.2/24" ) +config_eth0=( "192.168.0.2 netmask 255.255.255.0" ) + +# We can also specify a broadcast +config_eth0=( "192.168.0.2/24 brd 192.168.0.255" ) +config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" ) + +# If you need more than one address, you can use something like this +# NOTE: ifconfig creates an aliased device for each extra IPv4 address +# (eth0:1, eth0:2, etc) +# iproute2 does not do this as there is no need to +config_eth0=( + "192.168.0.2/24" + "192.168.0.3/24" + "192.168.0.4/24" +) +# Or you can use sequence expressions +config_eth0=( "192.168.0.{2..4}/24" ) +# which does the same as above. Be careful though as if you use this and +# fallbacks, you have to ensure that both end up with the same number of +# values otherwise your fallback won't work correctly. + +# You can also use IPv6 addresses +# (you should always specify a prefix length with IPv6 here) +config_eth0=( + "192.168.0.2/24" + "4321:0:1:2:3:4:567:89ab/64" + "4321:0:1:2:3:4:567:89ac/64" +) + +# If you wish to keep existing addresses + routing and the interface is up, +# you can specify a noop (no operation). If the interface is down or there +# are no addresses assigned, then we move onto the next step (default dhcp) +# This is useful when configuring your interface with a kernel command line +# or similar +config_eth0=( "noop" "192.168.0.2/24" ) + +# If you don't want ANY address (only useful when calling for advanced stuff) +config_eth0=( "null" ) + +# Here's how to do routing if you need it +routes_eth0=( + "default via 192.168.0.1" # IPv4 default route + "10.0.0.0/8 via 192.168.0.1" # IPv4 subnet route + "::/0" # IPv6 unicast +) + +# If a specified module fails (like dhcp - see below), you can specify a +# fallback like so +fallback_eth0=( "192.168.0.2 netmask 255.255.255.0" ) +fallback_route_eth0=( "default via 192.168.0.1" ) + +# NOTE: fallback entry must match the entry location in config_eth0 +# As such you can only have one fallback route. + +# Some users may need to alter the MTU - here's how +mtu_eth0="1500" + +# Each module described below can set a default base metric, lower is +# preferred over higher. This is so we can prefer a wired route over a +# wireless route automaticaly. You can override this by setting +metric_eth0="100" +# or on a global basis +metric="100" +# The only downside of the global setting is that you have to ensure that +# there are no conflicting routes yourself. For users with large routing +# tables you may have to set a global metric as the due to a simple read of +# the routing table taking over a minute at a time. + +############################################################################## +# OPTIONAL MODULES + +# INTERFACE RENAMING +# There is no consistent device renaming scheme for Linux. +# The preferred way of naming devices is via the kernel module directly or +# by using udev (http://www.reactivated.net/udevrules.php) + +# If you are unable to write udev rules, then we do provide a way of renaming +# the interface based on it's MAC address, but it is not optimal. +# Here is how to rename an interface whose MAC address is 00:11:22:33:44:55 +# to foo1 +rename_001122334455="foo1" + +# You can also do this based on current device name - although this is not +# recommended. Here we rename eth1 to foo2. +rename_eth1="foo2" + +#----------------------------------------------------------------------------- +# WIRELESS (802.11 support) +# Wireless can be provided by iwconfig or wpa_supplicant + +# iwconfig +# emerge net-wireless/wireless-tools +# Wireless options are held in /etc/conf.d/wireless - but could be here too +# Consult the sample file /etc/conf.d/wireless.example for instructions +# iwconfig is the default + +# wpa_supplicant +# emerge net-wireless/wpa-supplicant +# Wireless options are held in /etc/wpa_supplicant.conf +# Consult the sample file /etc/wpa_supplicant.conf.example for instructions +# To choose wpa_supplicant over iwconfig +modules=( "wpa_supplicant" ) +# To configure wpa_supplicant +wpa_supplicant_eth0="-Dwext" # For generic wireless +wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards +# Consult wpa_supplicant for more drivers +# By default don't wait for wpa_suppliant to associate and authenticate. +# If you would like to, so can specify how long in seconds +associate_timeout_eth0=60 +# A value of 0 means wait forever. + +# GENERIC WIRELESS OPTIONS +# PLEASE READ THE INSTRUCTIONS IN /etc/conf.d/wireless.example FOR +# HOW TO USE THIS ESSID VARIABLE +# You can also override any settings found here per ESSID - which is very +# handy if you use different networks a lot +config_ESSID=( "dhcp" ) +dhcpcd_ESSID="-t 5" + +# Setting name/domain server causes /etc/resolv.conf to be overwritten +# Note that if DHCP is used, and you want this to take precedence then + set dhcp_ESSID="nodns" +dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" ) +dns_domain_ESSID="some.domain" +dns_search_ESSID="search.this.domain search.that.domain" +# Please check the man page for resolv.conf for more information +# as domain and search are mutually exclusive. + +# You can also override any settings found here per MAC address of the AP +# in case you use Access Points with the same ESSID but need different +# networking configs. Below is an example - of course you use the same +# method with other variables +mac_config_001122334455=( "dhcp" ) +mac_dhcpcd_001122334455="-t 10" +mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" ) + +# When an interface has been associated with an Access Point, a global +# variable called ESSID is set to the Access Point's ESSID for use in the +# pre/post user functions below (although it's not available in preup as you +# won't have associated then) + +# If you're using anything else to configure wireless on your interface AND +# you have installed any of the above packages, you need to disable them +modules=( "!iwconfig" "!wpa_supplicant" ) + +#----------------------------------------------------------------------------- +# DHCP +# DHCP can be provided by dhclient, dhcpcd, pump or udhcpc. +# +# dhclient: emerge net-misc/dhcp +# dhcpcd: emerge net-misc/dhcpcd +# pump: emerge net-misc/pump +# udhcpc: emerge net-misc/udhcp + +# If you have more than one DHCP client installed, you need to specify which +# one to use - otherwise we default to dhcpcd if available. +modules=( "dhclient" ) # to select dhclient over dhcpcd +# +# Notes: +# - All clients send the current hostname to the DHCP server by default +# - dhcpcd does not daemonize when the lease time is infinite +# - udhcp-0.9.3-r3 and earlier do not support getting NTP servers +# - pump does not support getting NIS servers +# - DHCP tends to erase any existing device information - so add +# static addresses after dhcp if you need them +# - dhclient and udhcpc can set other resolv.conf options such as "option" +# and "sortlist"- see the System module for more details + +# Regardless of which DHCP client you prefer, you configure them the +# same way using one of following depending on which interface modules +# you're using. +config_eth0=( "dhcp" ) + +# For passing custom options to dhcpcd use something like the following. This +# example reduces the timeout for retrieving an address from 60 seconds (the +# default) to 10 seconds. +dhcpcd_eth0="-t 10" + +# dhclient, udhcpc and pump don't have many runtime options +# You can pass options to them in a similar manner to dhcpcd though +dhclient_eth0="..." +udhcpc_eth0="..." +pump_eth0="..." + +# GENERIC DHCP OPTIONS +# Set generic DHCP options like so +dhcp_eth0="release nodns nontp nonis nogateway nosendhost" + +# This tells the dhcp client to release it's lease when it stops, not to +# overwrite dns, ntp and nis settings, not to set a default route and not to +# send the current hostname to the dhcp server and when it starts. +# You can use any combination of the above options - the default is not to +# use any of them. + +#----------------------------------------------------------------------------- +# For APIPA support, emerge net-misc/iputils or net-analyzer/arping + +# APIPA is a module that tries to find a free address in the range +# 169.254.0.0-169.254.255.255 by arping a random address in that range on the +# interface. If no reply is found then we assign that address to the interface + +# This is only useful for LANs where there is no DHCP server and you don't +# connect directly to the internet. +config_eth0=( "dhcp" ) +fallback_eth0=( "apipa" ) + +#----------------------------------------------------------------------------- +# ARPING Gateway configuration +# and +# Automatic Private IP Addressing (APIPA) +# For arpingnet / apipa support, emerge net-misc/iputils or net-analyzer/arping +# +# This is a module that tries to find a gateway IP. If it exists then we use +# that gateways configuration for our own. For the configuration variables +# simply ensure that each octet is zero padded and the dots are removed. +# Below is an example. +# +gateways_eth0="192.168.0.1 10.0.0.1" +config_192168000001=( "192.168.0.2/24" ) +routes_192168000001=( "default via 192.168.0.1" ) +dns_servers_192168000001=( "192.168.0.1" ) +config_010000000001=( "10.0.0.254/8" ) +routes_010000000001=( "default via 10.0.0.1" ) +dns_servers_010000000001=( "10.0.0.1" ) + +# We can also specify a specific MAC address for each gateway if different +# networks have the same gateway. +gateways_eth0="192.168.0.1,00:11:22:AA:BB:CC 10.0.0.1,33:44:55:DD:EE:FF" +config_192168000001_001122AABBCC=( "192.168.0.2/24" ) +routes_192168000001_001122AABBCC=( "default via 192.168.0.1" ) +dns_servers_192168000001_001122AABBCC=( "192.168.0.1" ) +config_010000000001_334455DDEEFF=( "10.0.0.254/8" ) +routes_010000000001_334455DDEEFF=( "default via 10.0.0.1" ) +dns_servers_010000000001_334455DDEEFF=( "10.0.0.1" ) + +# If we don't find any gateways (or there are none configured) then we try and +# use APIPA to find a free address in the range 169.254.0.0-169.254.255.255 +# by arping a random address in that range on the interface. If no reply is +# found then we assign that address to the interface. + +# This is only useful for LANs where there is no DHCP server. +config_eth0=( "arping" ) + +# or if no DHCP server can be found +config_eth0=( "dhcp" ) +fallback_eth0=( "arping" ) + +# NOTE: We default to sleeping for 1 second the first time we attempt an +# arping to give the interface time to settle on the LAN. This appears to +# be a good default for most instances, but if not you can alter it here. +arping_sleep=5 +arping_sleep_lan=7 + +# NOTE: We default to waiting 3 seconds to get an arping response. You can +# change the default wait like so. +arping_wait=3 +arping_wait_lan=2 + +#----------------------------------------------------------------------------- +# VLAN (802.1q support) +# For VLAN support, emerge net-misc/vconfig + +# Specify the VLAN numbers for the interface like so +# Please ensure your VLAN IDs are NOT zero-padded +vlans_eth0="1 2" + +# You may not want to assign an IP the the physical interface, but we still +# need it up. +config_eth0=( "null" ) + +# You can also configure the VLAN - see for vconfig man page for more details +vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" ) +vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" ) +config_vlan1=( "172.16.3.1 netmask 255.255.254.0" ) +config_vlan2=( "172.16.2.1 netmask 255.255.254.0" ) + +# NOTE: Vlans can be configured with a . in their interface names +# When configuring vlans with this name type, you need to replace . with a _ +config_eth0.1=( "dhcp" ) - does not work +config_eth0_1=( "dhcp" ) - does work + +# NOTE: Vlans are controlled by their physical interface and not per vlan +# This means you do not need to create init scripts in /etc/init.d for each +# vlan, you must need to create one for the physical interface. +# If you wish to control the configuration of each vlan through a separate +# script, or wish to rename the vlan interface to something that vconfig +# cannot then you need to do this. +vlan_start_eth0="no" + +# If you do the above then you may want to depend on eth0 like so + RC_NEED_vlan1="net.eth0" +# NOTE: depend functions only work in /etc/conf.d/net +# and not in profile configs such as /etc/conf.d/net.foo + +#----------------------------------------------------------------------------- +# Bonding +# For link bonding/trunking emerge net-misc/ifenslave + +# To bond interfaces together +slaves_bond0="eth0 eth1 eth2" +config_bond0=( "null" ) # You may not want to assign an IP the the bond + +# If any of the slaves require extra configuration - for example wireless or +# ppp devices - we need to depend function on the bonded interfaces +RC_NEED_bond0="net.eth0 net.eth1" + + +#----------------------------------------------------------------------------- +# Classical IP over ATM +# For CLIP support emerge net-dialup/linux-atm + +# Ensure that you have /etc/atmsigd.conf setup correctly +# Now setup each clip interface like so +clip_atm0=( "peer_ip [if.]vpi.vci [opts]" ... ) +# where "peer_ip" is the IP address of a PVC peer (in case of an ATM connection +# with your ISP, your only peer is usually the ISP gateway closest to you), +# "if" is the number of the ATM interface which will carry the PVC, "vpi.vci" +# is the ATM VC address, and "opts" may optionally specify VC parameters like +# qos, pcr, and the like (see "atmarp -s" for further reference). Please also +# note quoting: it is meant to distinguish the VCs you want to create. You may, +# in example, create an atm0 interface to more peers, like this: +clip_atm0=( "1.1.1.254 0.8.35" "1.1.1.253 1.8.35" ) + +# By default, the PVC will use the LLC/SNAP encapsulation. If you rather need a +# null encapsulation (aka "VC mode"), please add the keyword "null" to opts. + + +#----------------------------------------------------------------------------- +# PPP +# For PPP support, emerge net-dialup/ppp +# PPP is used for most dialup connections, including ADSL. +# The older ADSL module is documented below, but you are encouraged to try +# this module first. +# +# You need to create the PPP net script yourself. Make it like so +#ln -s net.lo /etc/init.d/net.ppp0 +# +# We have to instruct ppp0 to actually use ppp +config_ppp0=( "ppp" ) +# +# Each PPP interface requires an interface to use as a "Link" +link_ppp0="/dev/ttyS0" # Most PPP links will use a serial port +link_ppp0="eth0" # PPPoE requires an ethernet interface +link_ppp0="[itf.]vpi.vci" # PPPoA requires the ATM VC's address +link_ppp0="/dev/null" # ISDN links should have this +link_ppp0="pty 'your_link_command'" # PPP links over ssh, rsh, etc +# +# Here you should specify what pppd plugins you want to use +# Available plugins are: pppoe, pppoa, capi, dhcpc, minconn, radius, +# radattr, radrealms and winbind +plugins_ppp0=( + "pppoe" # Required plugin for PPPoE + "pppoa vc-encaps" # Required plugin for PPPoA with an option + "capi" # Required plugin for ISDN +) +# +# PPP requires at least a username. You can optionally set a password here too +# If you don't, then it will use the password specified in /etc/ppp/*-secrets +# against the specified username +username_ppp0='user' +password_ppp0='password' +# NOTE: You can set a blank password like so +password_ppp0= +# +# The PPP daemon has many options you can specify - although there are many +# and may seem daunting, it is recommended that you read the pppd man page +# before enabling any of them +pppd_ppp0=( + "maxfail 0" # WARNING: It's not recommended you use this + # if you don't specify maxfail then we assume 0 + "updetach" # If not set, "/etc/init.d/net.ppp0 start" will return + # immediately, without waiting the link to come up + # for the first time. + # Do not use it for dial-on-demand links! + "debug" # Enables syslog debugging + "noauth" # Do not require the peer to authenticate itself + "defaultroute" # Make this PPP interface the default route + "usepeerdns" # Use the DNS settings provided by PPP + +# On demand options + "demand" # Enable dial on demand + "idle 30" # Link goes down after 30 seconds of inactivity + "10.112.112.112:10.112.112.113" # Phony IP addresses + "ipcp-accept-remote" # Accept the peers idea of remote address + "ipcp-accept-local" # Accept the peers idea of local address + "holdoff 3" # Wait 3 seconds after link dies before re-starting + +# Dead peer detection + "lcp-echo-interval 15" # Send a LCP echo every 15 seconds + "lcp-echo-failure 3" # Make peer dead after 3 consective + # echo-requests + +# Compression options - use these to completely disable compression +# noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp + +# Dial-up settings + "lock" # Lock serial port + "115200" # Set the serial port baud rate + "modem crtscts" # Enable hardware flow control + "192.168.0.1:192.168.0.2" # Local and remote IP addresses +) +# +# Dial-up PPP users need to specify at least one telephone number +phone_number_ppp0=( "12345689" ) # Maximum 2 phone numbers are supported +# They will also need a chat script - here's a good one +chat_ppp0=( +# 'ABORT' 'BUSY' +# 'ABORT' 'ERROR' +# 'ABORT' 'NO ANSWER' +# 'ABORT' 'NO CARRIER' +# 'ABORT' 'NO DIALTONE' +# 'ABORT' 'Invalid Login' +# 'ABORT' 'Login incorrect' +# 'TIMEOUT' '5' +# '' 'ATZ' +# 'OK' 'AT' # Put your modem initialization string here +# 'OK' 'ATDT\T' +# 'TIMEOUT' '60' +# 'CONNECT' '' +# 'TIMEOUT' '5' +# '~--' '' +) + +# If the link require extra configuration - for example wireless or +# RFC 268 bridge - we need to depend on the bridge so they get +# configured correctly. +RC_NEED_ppp0="net.nas0" + +#WARNING: if MTU of the PPP interface is less than 1500 and you use this +#machine as a router, you should add the following rule to your firewall +# +#iptables -I FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + +#----------------------------------------------------------------------------- +# ADSL +# For ADSL support, emerge net-dialup/rp-pppoe +# WARNING: This ADSL module is being deprecated in favour of the PPP module +# above. +# You should make the following settings and also put your +# username/password information in /etc/ppp/pap-secrets + +# Configure the interface to use ADSL +config_eth0=( "adsl" ) + +# You probably won't need to edit /etc/ppp/pppoe.conf if you set this +adsl_user_eth0="my-adsl-username" + +#----------------------------------------------------------------------------- +# ISDN +# For ISDN support, emerge net-dialup/isdn4k-utils +# You should make the following settings and also put your +# username/password information in /etc/ppp/pap-secrets + +# Configure the interface to use ISDN +config_ippp0=( "dhcp" ) +# It's important to specify dhcp if you need it! +config_ippp0=( "192.168.0.1/24" ) +# Otherwise, you can use a static IP + +# NOTE: The interface name must be either ippp or isdn followed by a number + +# You may need this option to set the default route +ipppd_eth0="defaultroute" + +#----------------------------------------------------------------------------- +# MAC changer +# To set a specific MAC address +mac_eth0="00:11:22:33:44:55" + +# For changing MAC addresses using the below, emerge net-analyzer/macchanger +# - to randomize the last 3 bytes only +mac_eth0="random-ending" +# - to randomize between the same physical type of connection (e.g. fibre, +# copper, wireless) , all vendors +mac_eth0="random-samekind" +# - to randomize between any physical type of connection (e.g. fibre, copper, +# wireless) , all vendors +mac_eth0="random-anykind" +# - full randomization - WARNING: some MAC addresses generated by this may NOT +# act as expected +mac_eth0="random-full" +# custom - passes all parameters directly to net-analyzer/macchanger +mac_eth0="some custom set of parameters" + +# You can also set other options based on the MAC address of your network card +# Handy if you use different docking stations with laptops +config_001122334455=( "dhcp" ) + +#----------------------------------------------------------------------------- +# TUN/TAP +# For TUN/TAP support emerge net-misc/openvpn or sys-apps/usermode-utilities +# +# You must specify if we're a tun or tap device. Then you can give it any +# name you like - such as vpn +tuntap_vpn="tun" +config_vpn=( "192.168.0.1/24") + +# Or stick wit the generic names - like tap0 +tuntap_tap0="tap" +config_tap0=( "192.168.0.1/24") + +# For passing custom options to tunctl use something like the following. This +# example sets the owner to adm +tunctl_tun1="-u adm" +# When using openvpn, there are no options + +#----------------------------------------------------------------------------- +# Bridging (802.1d) +# For bridging support emerge net-misc/bridge-utils + +# To add ports to bridge br0 +bridge_br0="eth0 eth1" +# or dynamically add them when the interface comes up +bridge_add_eth0="br0" +bridge_add_eth1="br0" + +# You need to configure the ports to null values so dhcp does not get started +config_eth0=( "null" ) +config_eth1=( "null" ) + +# Finally give the bridge an address - dhcp or a static IP +config_br0=( "dhcp" ) # may not work when adding ports dynamically +config_br0=( "192.168.0.1/24" ) + +# If any of the ports require extra configuration - for example wireless or +# ppp devices - we need to depend on them like so. +RC_NEED_br0="net.eth0 net.eth1" + +# Below is an example of configuring the bridge +# Consult "man brctl" for more details +brctl_br0=( "setfd 0" "sethello 0" "stp off" ) + +#----------------------------------------------------------------------------- +# RFC 2684 Bridge Support +# For RFC 2684 bridge support emerge net-misc/br2684ctl + +# Interface names have to be of the form nas0, nas1, nas2, etc. +# You have to specify a VPI and VCI for the interface like so +br2684ctl_nas0="-a 0.38" # UK VPI and VCI + +# You may want to configure the encapsulation method as well by adding the -e +# option to the command above (may need to be before the -a command) +# -e 0 # LLC (default) +# -e 1 # VC mux + +# Then you can configure the interface as normal +config_nas0=( "192.168.0.1/24" ) + +#----------------------------------------------------------------------------- +# Tunnelling +# WARNING: For tunnelling it is highly recommended that you +# emerge sys-apps/iproute2 +# +# For GRE tunnels +iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255" + +# For IPIP tunnels +iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255" + +# To configure the interface +config_vpn0=( "192.168.0.2 pointopoint 192.168.1.2" ) # ifconfig style +config_vpn0=( "192.168.0.2 peer 192.168.1.1" ) # iproute2 style + +# 6to4 Tunnels allow IPv6 to work over IPv4 addresses, provided you +# have a non-private address configured on an interface. + link_6to4="eth0" # Interface to base it's addresses on + config_6to4=( "ip6to4" ) +# You may want to depend on eth0 like so +RC_NEED_6to4="net.eth0" +# To ensure that eth0 is configured before 6to4. Of course, the tunnel could be +# any name and this also works for any configured interface. +# NOTE: If you're not using iproute2 then your 6to4 tunnel has to be called +# sit0 - otherwise use a different name like 6to4 in the example above. + + +#----------------------------------------------------------------------------- +# System +# For configuring system specifics such as domain, dns, ntp and nis servers +# It's rare that you would need todo this, but you can anyway. +# This is most benefit to wireless users who don't use DHCP so they can change +# their configs based on ESSID. See wireless.example for more details + +# To use dns settings such as these, dns_servers_eth0 must be set! +# If you omit the _eth0 suffix, then it applies to all interfaces unless +# overridden by the interface suffix. +dns_domain_eth0="your.domain" +dns_servers_eth0="192.168.0.2 192.168.0.3" +dns_search_eth0="this.domain that.domain" +dns_options_eth0=( "timeout 1" "rotate" ) +dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0" +# See the man page for resolv.conf for details about the options and sortlist +# directives + +ntp_servers_eth0="192.168.0.2 192.168.0.3" + +nis_domain_eth0="domain" +nis_servers_eth0="192.168.0.2 192.168.0.3" + +# NOTE: Setting any of these will stamp on the files in question. So if you +# don't specify dns_servers but you do specify dns_domain then no nameservers +# will be listed in /etc/resolv.conf even if there were any there to start +# with. +# If this is an issue for you then maybe you should look into a resolv.conf +# manager like resolvconf-gentoo to manage this file for you. All packages +# that baselayout supports use resolvconf-gentoo if installed. + +#----------------------------------------------------------------------------- +# Cable in/out detection +# Sometimes the cable is in, others it's out. Obviously you don't want to +# restart net.eth0 every time when you plug it in either. +# +# netplug is a package that detects this and requires no extra configuration +# on your part. +# emerge sys-apps/netplug +# or +# emerge sys-apps/ifplugd +# and you're done :) + +# By default we don't wait for netplug/ifplugd to configure the interface. +# If you would like it to wait so that other services now that network is up +# then you can specify a timeout here. +plug_timeout="10" +# A value of 0 means wait forever. + +# If you don't want to use netplug on a specific interface but you have it +# installed, you can disable it for that interface via the modules statement +modules_eth0=( "!netplug" ) +# You can do the same for ifplugd +# +# You can disable them both with the generic plug +modules_eth0=( "!plug" ) + +# To use specific ifplugd options, fex specifying wireless mode +ifplugd_eth0="--api-mode=wlan" +# man ifplugd for more options + +############################################################################## +# ADVANCED CONFIGURATION +# +# Four functions can be defined which will be called surrounding the +# start/stop operations. The functions are called with the interface +# name first so that one function can control multiple adapters. An extra two +# functions can be defined when an interface fails to start or stop. +# +# The return values for the preup and predown functions should be 0 +# (success) to indicate that configuration or deconfiguration of the +# interface can continue. If preup returns a non-zero value, then +# interface configuration will be aborted. If predown returns a +# non-zero value, then the interface will not be allowed to continue +# deconfiguration. +# +# The return values for the postup, postdown, failup and faildown functions are +# ignored since there's nothing to do if they indicate failure. +# +# ${IFACE} is set to the interface being brought up/down +# ${IFVAR} is ${IFACE} converted to variable name bash allows + +#preup() { +# # Test for link on the interface prior to bringing it up. This +# # only works on some network adapters and requires the mii-diag +# # package to be installed. +# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then +# ewarn "No link on ${IFACE}, aborting configuration" +# return 1 +# fi +# +# # Test for link on the interface prior to bringing it up. This +# # only works on some network adapters and requires the ethtool +# # package to be installed. +# if ethtool "${IFACE}" | grep -q 'Link detected: no'; then +# ewarn "No link on ${IFACE}, aborting configuration" +# return 1 +# fi +# +# +# # Remember to return 0 on success +# return 0 +#} + +#predown() { +# # The default in the script is to test for NFS root and disallow +# # downing interfaces in that case. Note that if you specify a +# # predown() function you will override that logic. Here it is, in +# # case you still want it... +# if is_net_fs /; then +# eerror "root filesystem is network mounted -- can't stop ${IFACE}" +# return 1 +# fi +# +# # Remember to return 0 on success +# return 0 +#} + +#postup() { +# # This function could be used, for example, to register with a +# # dynamic DNS service. Another possibility would be to +# # send/receive mail once the interface is brought up. + +# # Here is an example that allows the use of iproute rules +# # which have been configured using the rules_eth0 variable. +# #rules_eth0=( +# # "from 24.80.102.112/32 to 192.168.1.0/24 table localnet priority 100" +# # "from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100" +# #) +# local x="rules_${IFVAR}[@]" +# local -a rules=( "${!x}" ) +# if [[ -n ${rules} ]] ; then +# einfo "Adding IP policy routing rules" +# eindent +# # Ensure that the kernel supports policy routing +# if ! ip rule list | grep -q "^" ; then +# eerror "You need to enable IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES)" +# eerror "in your kernel to use ip rules" +# else +# for x in "${rules[@]}" ; do +# ebegin "${x}" +# ip rule add ${x} dev "${IFACE}" +# eend $? +# done +# fi +# eoutdent +# # Flush the cache +# ip route flush cache dev "${IFACE}" +# fi + +#} + +#postdown() { +# # Enable Wake-On-LAN for every interface except for lo +# # Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc +# # as well ;) +# [[ ${IFACE} != "lo" ]] && ethtool -s "${IFACE}" wol g + +# Automatically erase any ip rules created in the example postup above +# if interface_exists "${IFACE}" ; then +# # Remove any rules for this interface +# local rule +# ip rule list | grep " iif ${IFACE}[ ]*" | { +# while read rule ; do +# rule="${rule#*:}" +# ip rule del ${rule} +# done +# } +# # Flush the route cache +# ip route flush cache dev "${IFACE}" +# fi + +# # Return 0 always +# return 0 +#} + +#failup() { +# # This function is mostly here for completeness... I haven't +# # thought of anything nifty to do with it yet ;-) +#} + +#faildown() { +# # This function is mostly here for completeness... I haven't +# # thought of anything nifty to do with it yet ;-) +#} + +############################################################################## +# FORCING MODULES +# The Big Fat Warning :- If you use module forcing do not complain to us or +# file bugs about it not working! +# +# Loading modules is a slow affair - we have to check each one for the following +# 1) Code sanity +# 2) Has the required package been emerged? +# 3) Has it modified anything? +# 4) Have all the dependant modules been loaded? + +# Then we have to strip out the conflicting modules based on user preference +# and default configuration and sort them into the correct order. +# Finally we check the end result for dependencies. + +# This, of course, takes valuable CPU time so we provide module forcing as a +# means to speed things up. We still do *some* checking but not much. + +# It is essential that you force modules in the correct order and supply all +# the modules you need. You must always supply an interface module - we +# supply ifconfig or iproute2. + +# The Big Fat Warning :- If you use module forcing do not complain to us or +# file bugs about it not working! + +# Now that we've warned you twice, here's how to do it +modules_force=( "ifconfig" ) +modules_force=( "iproute2" "dhcpcd" ) + +# We can also apply this to a specific interface +modules_force_eth1=( "iproute2" ) + +# The below will not work +modules_force=( "dhcpcd" ) +# No interface (ifconfig/iproute2) +modules_force=( "ifconfig" "essidnet" "iwconfig" ) +# Although it will not crash, essidnet will not work as it has to come after +# iwconfig +modules_force=( "iproute2" "ifconfig" ) +# The interface will be setup twice which will cause problems diff --git a/system-settings/plugins/ifnet/tests/nm-system-settings.conf b/system-settings/plugins/ifnet/tests/nm-system-settings.conf new file mode 100644 index 0000000000..39bc87b8be --- /dev/null +++ b/system-settings/plugins/ifnet/tests/nm-system-settings.conf @@ -0,0 +1,5 @@ +[main] +plugins=ifnet,keyfile + +[ifnet] +managed=false diff --git a/system-settings/plugins/ifnet/tests/test_all.c b/system-settings/plugins/ifnet/tests/test_all.c new file mode 100644 index 0000000000..ba98397616 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/test_all.c @@ -0,0 +1,379 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <stdio.h> +#include <string.h> +#include <glib.h> +#include <arpa/inet.h> +#include <stdlib.h> +#include <nm-utils.h> + +#include "net_parser.h" +#include "nm-test-helpers.h" +#include "net_utils.h" +#include "wpa_parser.h" +#include "connection_parser.h" + +static void +test_getdata () +{ + ASSERT (ifnet_get_data ("eth1", "config") + && strcmp (ifnet_get_data ("eth1", "config"), "dhcp") == 0, + "get data", "config_eth1 is not correct"); + ASSERT (ifnet_get_data ("ppp0", "username") + && strcmp (ifnet_get_data ("ppp0", "username"), "user") == 0, + "get data", "config_ppp0 username is not correctly read"); + ASSERT (ifnet_get_data ("ppp0", "password") + && strcmp (ifnet_get_data ("ppp0", "password"), + "password") == 0, "get data", + "config_ppp0 password is not correctly read"); +} + +static void +test_read_hostname () +{ + gchar *hostname = read_hostname ("hostname"); + + ASSERT (hostname != NULL, "get hostname", "hostname is NULL"); + ASSERT (strcmp ("gentoo", hostname) == 0, + "get hostname", + "hostname is not correctly read, read:%s, expected: gentoo", + hostname); +} + +static void +test_write_hostname () +{ + gchar *hostname = read_hostname ("hostname"); + + write_hostname ("gentoo-nm", "hostname"); + ASSERT (strcmp (read_hostname ("hostname"), "gentoo-nm") == 0, + "write hostname", "write hostname error"); + write_hostname (hostname, "hostname"); +} + +static void +test_is_static () +{ + ASSERT (is_static_ip4 ("eth1") == FALSE, "is static", + "a dhcp interface is recognized as static"); + ASSERT (is_static_ip4 ("eth0") == TRUE, "is static", + "a static interface is recognized as dhcp"); + ASSERT (!is_static_ip6 ("eth0") == TRUE, "is static", + "a static interface is recognized as dhcp"); +} + +static void +test_has_default_route () +{ + ASSERT (has_default_ip4_route ("eth0"), "has default route", + "eth0 should have a default ipv4 route"); + ASSERT (has_default_ip6_route ("eth4"), "has default route", + "eth4 should have a default ipv6 route"); + + ASSERT (!has_default_ip4_route ("eth5") + && !has_default_ip6_route ("eth5"), "has default route", + "eth5 shouldn't have a default route"); +} + +static void +test_has_ip6_address () +{ + ASSERT (has_ip6_address ("eth2"), "has ip6 address", + "eth2 should have a ipv6 address"); + ASSERT (!has_ip6_address ("eth0"), "has ip6 address", + "eth0 shouldn't have a ipv6 address") + +} + +static void +test_is_ip4_address () +{ + gchar *address1 = "192.168.4.232/24"; + gchar *address2 = "192.168.100.{1..254}/24"; + gchar *address3 = "192.168.4.2555/24"; + + ASSERT (is_ip4_address (address1), "is ip4 address", + "%s should be a valid address", address1); + ASSERT (is_ip4_address (address2), "is ip4 address", + "%s should be a valid address", address2); + ASSERT (!is_ip4_address (address3), "is ip4 address", + "%s should be an invalid address", address3); +} + +static void +test_is_ip6_address () +{ + gchar *address1 = "4321:0:1:2:3:4:567:89ac/24"; + + ASSERT (is_ip6_address (address1), "is ip6 address", + "%s should be a valid address", address1); +} + +static void +check_ip_block (ip_block * iblock, gchar * ip, gchar * netmask, gchar * gateway) +{ + char *str; + struct in_addr tmp_ip4_addr; + + str = malloc (INET_ADDRSTRLEN); + tmp_ip4_addr.s_addr = iblock->ip; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (ip, str) == 0, "check ip", "ip expected:%s, find:%s", + ip, str); + tmp_ip4_addr.s_addr = iblock->netmask; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (netmask, str) == 0, "check netmask", + "netmask expected:%s, find:%s", netmask, str); + tmp_ip4_addr.s_addr = iblock->gateway; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (gateway, str) == 0, "check gateway", + "gateway expected:%s, find:%s", gateway, str); + free (str); +} + +static void +test_convert_ipv4_config_block () +{ + ip_block *iblock = convert_ip4_config_block ("eth0"); + ip_block *tmp = iblock; + + ASSERT (iblock != NULL, "convert ipv4 block", + "block eth0 should not be NULL"); + check_ip_block (iblock, "202.117.16.121", "255.255.255.0", + "202.117.16.1"); + iblock = iblock->next; + destroy_ip_block (tmp); + ASSERT (iblock != NULL, "convert ipv4 block", + "block eth0 should have a second IP address"); + check_ip_block (iblock, "192.168.4.121", "255.255.255.0", + "202.117.16.1"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth2"); + ASSERT (iblock != NULL + && iblock->next == NULL, "convert error IPv4 address", + "should only get one address"); + check_ip_block (iblock, "192.168.4.121", "255.255.255.0", "0.0.0.0"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth3"); + ASSERT (iblock == NULL, "convert config_block", + "convert error configuration"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth6"); + ASSERT (iblock != NULL, "convert config_block", + "convert error configuration"); + destroy_ip_block (iblock); + +} + +static void +test_convert_ipv4_routes_block () +{ + ip_block *iblock = convert_ip4_routes_block ("eth0"); + ip_block *tmp = iblock; + + ASSERT (iblock != NULL, "convert ip4 routes", "should get one route"); + check_ip_block (iblock, "192.168.4.0", "255.255.255.0", "192.168.4.1"); + iblock = iblock->next; + destroy_ip_block (tmp); + ASSERT (iblock == NULL, "convert ip4 routes", + "should only get one route"); +} + +static void +test_wpa_parser () +{ + gchar *value; + + ASSERT (exist_ssid ("example"), "get wsec", + "ssid myxjtu2 is not found"); + ASSERT (exist_ssid ("static-wep-test"), "exist_ssid", + "ssid static-wep-test is not found"); + value = wpa_get_value ("static-wep-test", "key_mgmt"); + ASSERT (value && strcmp (value, "NONE") == 0, "get wpa data", + "key_mgmt of static-wep-test should be NONE, find %s", value); + value = wpa_get_value ("static-wep-test", "wep_key0"); + ASSERT (value && strcmp (value, "\"abcde\"") == 0, "get wpa data", + "wep_key0 of static-wep-test should be abcde, find %s", value); + ASSERT (exist_ssid ("leap-example"), "get wsec", + "ssid leap-example is not found"); +} + +static void +test_strip_string () +{ + gchar *str = "( \"default via 202.117.16.1\" )"; + gchar *result = g_strdup (str); + gchar *result_b = result; + + result = strip_string (result, '('); + result = strip_string (result, ')'); + result = strip_string (result, '"'); + ASSERT (strcmp (result, "default via 202.117.16.1") == 0, + "strip_string", "string isn't stripped, result is: %s", result); + g_free (result_b); +} + +static void +test_is_unmanaged () +{ + ASSERT (is_managed ("eth0"), "test_is_unmanaged", + "eth0 should be managed"); + ASSERT (!is_managed ("eth4"), "test_is_unmanaged", + "eth4 should be unmanaged"); +} + +static void +test_new_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth2", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", + error == NULL ? "None" : (*error)->message); + g_object_unref (connection); + connection = + ifnet_update_connection_from_config_block ("qiaomuf", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", error + && (*error) ? (*error)->message : "NONE"); + g_object_unref (connection); + connection = + ifnet_update_connection_from_config_block ("myxjtu2", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", error + && (*error) ? (*error)->message : "NONE"); + g_object_unref (connection); + +} + +static void +test_update_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth0", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_update_parsers_by_connection + (connection, "eth0", NULL, "net.generate", + "wpa_supplicant.conf.generate", error), "update connection", + "update connection failed %s", "eth0"); + connection = + ifnet_update_connection_from_config_block ("0xab3ace", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_update_parsers_by_connection + (connection, "0xab3ace", NULL, "net.generate", + "wpa_supplicant.conf.generate", error), "update connection", + "update connection failed %s", "0xab3ace"); +} + +static void +test_add_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth0", error); + ASSERT (ifnet_add_new_connection + (connection, "net.generate", "wpa_supplicant.conf.generate", + error), "add connection", "add connection failed: %s", "eth0"); + connection = + ifnet_update_connection_from_config_block ("myxjtu2", error); + ASSERT (ifnet_add_new_connection + (connection, "net.generate", "wpa_supplicant.conf.generate", + error), "add connection", "add connection failed: %s", + "myxjtu2"); +} + +static void +test_delete_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth7", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_delete_connection_in_parsers + ("eth7", "net.generate", "wpa_supplicant.conf.generate"), + "delete connection", "delete connection failed: %s", "eth7"); + connection = + ifnet_update_connection_from_config_block ("qiaomuf", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_delete_connection_in_parsers + ("qiaomuf", "net.generate", "wpa_supplicant.conf.generate"), + "delete connection", "delete connection failed: %s", "qiaomuf"); +} + +static void +run_all (gboolean run) +{ + if (run) { + test_strip_string (); + test_is_static (); + test_has_ip6_address (); + test_has_default_route (); + test_getdata (); + test_read_hostname (); + test_write_hostname (); + test_is_ip4_address (); + test_is_ip6_address (); + test_convert_ipv4_config_block (); + test_convert_ipv4_routes_block (); + test_is_unmanaged (); + test_wpa_parser (); + test_convert_ipv4_routes_block (); + test_new_connection (); + test_update_connection (); + test_add_connection (); + test_delete_connection (); + } +} + +int +main (void) +{ +// g_mem_set_vtable(glib_mem_profiler_table); +// g_atexit(g_mem_profile); + g_type_init (); + ifnet_destroy (); + wpa_parser_destroy (); + ifnet_init ("net"); + wpa_parser_init ("wpa_supplicant.conf"); + printf("Initialization complete\n"); + + run_all (TRUE); + + ifnet_destroy (); + wpa_parser_destroy (); + return 0; +} diff --git a/system-settings/plugins/ifnet/tests/wpa_supplicant.conf b/system-settings/plugins/ifnet/tests/wpa_supplicant.conf new file mode 100644 index 0000000000..7763d2155f --- /dev/null +++ b/system-settings/plugins/ifnet/tests/wpa_supplicant.conf @@ -0,0 +1,876 @@ +##### Example wpa_supplicant configuration file ############################### +# +# This file describes configuration file format and lists all available option. +# Please also take a look at simpler configuration examples in 'examples' +# subdirectory. +# +# Empty lines and lines starting with # are ignored + +# NOTE! This file may contain password information and should probably be made +# readable only by root user on multiuser systems. + +# Note: All file paths in this configuration file should use full (absolute, +# not relative to working directory) path in order to allow working directory +# to be changed. This can happen if wpa_supplicant is run in the background. + +# Whether to allow wpa_supplicant to update (overwrite) configuration +# +# This option can be used to allow wpa_supplicant to overwrite configuration +# file whenever configuration is changed (e.g., new network block is added with +# wpa_cli or wpa_gui, or a password is changed). This is required for +# wpa_cli/wpa_gui to be able to store the configuration changes permanently. +# Please note that overwriting configuration file will remove the comments from +# it. +#update_config=1 + +# global configuration (shared by all network blocks) +# +# Parameters for the control interface. If this is specified, wpa_supplicant +# will open a control interface that is available for external programs to +# manage wpa_supplicant. The meaning of this string depends on which control +# interface mechanism is used. For all cases, the existance of this parameter +# in configuration is used to determine whether the control interface is +# enabled. +# +# For UNIX domain sockets (default on Linux and BSD): This is a directory that +# will be created for UNIX domain sockets for listening to requests from +# external programs (CLI/GUI, etc.) for status information and configuration. +# The socket file will be named based on the interface name, so multiple +# wpa_supplicant processes can be run at the same time if more than one +# interface is used. +# /var/run/wpa_supplicant is the recommended directory for sockets and by +# default, wpa_cli will use it when trying to connect with wpa_supplicant. +# +# Access control for the control interface can be configured by setting the +# directory to allow only members of a group to use sockets. This way, it is +# possible to run wpa_supplicant as root (since it needs to change network +# configuration and open raw sockets) and still allow GUI/CLI components to be +# run as non-root users. However, since the control interface can be used to +# change the network configuration, this access needs to be protected in many +# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you +# want to allow non-root users to use the control interface, add a new group +# and change this value to match with that group. Add users that should have +# control interface access to this group. If this variable is commented out or +# not included in the configuration file, group will not be changed from the +# value it got by default when the directory or socket was created. +# +# When configuring both the directory and group, use following format: +# DIR=/var/run/wpa_supplicant GROUP=wheel +# DIR=/var/run/wpa_supplicant GROUP=0 +# (group can be either group name or gid) +# +# For UDP connections (default on Windows): The value will be ignored. This +# variable is just used to select that the control interface is to be created. +# The value can be set to, e.g., udp (ctrl_interface=udp) +# +# For Windows Named Pipe: This value can be used to set the security descriptor +# for controlling access to the control interface. Security descriptor can be +# set using Security Descriptor String Format (see http://msdn.microsoft.com/ +# library/default.asp?url=/library/en-us/secauthz/security/ +# security_descriptor_string_format.asp). The descriptor string needs to be +# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty +# DACL (which will reject all connections). See README-Windows.txt for more +# information about SDDL string format. +# +ctrl_interface=/var/run/wpa_supplicant + +# IEEE 802.1X/EAPOL version +# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines +# EAPOL version 2. However, there are many APs that do not handle the new +# version number correctly (they seem to drop the frames completely). In order +# to make wpa_supplicant interoperate with these APs, the version number is set +# to 1 by default. This configuration value can be used to set it to the new +# version (2). +eapol_version=1 + +# AP scanning/selection +# By default, wpa_supplicant requests driver to perform AP scanning and then +# uses the scan results to select a suitable AP. Another alternative is to +# allow the driver to take care of AP scanning and selection and use +# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association +# information from the driver. +# 1: wpa_supplicant initiates scanning and AP selection +# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association +# parameters (e.g., WPA IE generation); this mode can also be used with +# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with +# APs (i.e., external program needs to control association). This mode must +# also be used when using wired Ethernet drivers. +# 2: like 0, but associate with APs using security policy and SSID (but not +# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to +# enable operation with hidden SSIDs and optimized roaming; in this mode, +# the network blocks in the configuration file are tried one by one until +# the driver reports successful association; each network block should have +# explicit security policy (i.e., only one option in the lists) for +# key_mgmt, pairwise, group, proto variables +ap_scan=1 + +# EAP fast re-authentication +# By default, fast re-authentication is enabled for all EAP methods that +# support it. This variable can be used to disable fast re-authentication. +# Normally, there is no need to disable this. +fast_reauth=1 + +# OpenSSL Engine support +# These options can be used to load OpenSSL engines. +# The two engines that are supported currently are shown below: +# They are both from the opensc project (http://www.opensc.org/) +# By default no engines are loaded. +# make the opensc engine available +#opensc_engine_path=/usr/lib64/engine_opensc.so +# make the pkcs11 engine available +#pkcs11_engine_path=/usr/lib64/engine_pkcs11.so +# configure the path to the pkcs11 module required by the pkcs11 engine +#pkcs11_module_path=/usr/lib64/opensc-pkcs11.so + +# Dynamic EAP methods +# If EAP methods were built dynamically as shared object files, they need to be +# loaded here before being used in the network blocks. By default, EAP methods +# are included statically in the build, so these lines are not needed +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so + +# Driver interface parameters +# This field can be used to configure arbitrary driver interace parameters. The +# format is specific to the selected driver interface. This field is not used +# in most cases. +#driver_param="field=value" + +# Country code +# The ISO/IEC alpha2 country code for the country in which this device is +# currently operating. +#country=US + +# Maximum lifetime for PMKSA in seconds; default 43200 +#dot11RSNAConfigPMKLifetime=43200 +# Threshold for reauthentication (percentage of PMK lifetime); default 70 +#dot11RSNAConfigPMKReauthThreshold=70 +# Timeout for security association negotiation in seconds; default 60 +#dot11RSNAConfigSATimeout=60 + +# Wi-Fi Protected Setup (WPS) parameters + +# Universally Unique IDentifier (UUID; see RFC 4122) of the device +# If not configured, UUID will be generated based on the local MAC address. +#uuid=12345678-9abc-def0-1234-56789abcdef0 + +# Device Name +# User-friendly description of device; up to 32 octets encoded in UTF-8 +#device_name=Wireless Client + +# Manufacturer +# The manufacturer of the device (up to 64 ASCII characters) +#manufacturer=Company + +# Model Name +# Model of the device (up to 32 ASCII characters) +#model_name=cmodel + +# Model Number +# Additional device description (up to 32 ASCII characters) +#model_number=123 + +# Serial Number +# Serial number of the device (up to 32 characters) +#serial_number=12345 + +# Primary Device Type +# Used format: <categ>-<OUI>-<subcateg> +# categ = Category as an integer value +# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for +# default WPS OUI +# subcateg = OUI-specific Sub Category as an integer value +# Examples: +# 1-0050F204-1 (Computer / PC) +# 1-0050F204-2 (Computer / Server) +# 5-0050F204-1 (Storage / NAS) +# 6-0050F204-1 (Network Infrastructure / AP) +#device_type=1-0050F204-1 + +# OS Version +# 4-octet operating system version number (hex string) +#os_version=01020300 + +# Credential processing +# 0 = process received credentials internally (default) +# 1 = do not process received credentials; just pass them over ctrl_iface to +# external program(s) +# 2 = process received credentials internally and pass them over ctrl_iface +# to external program(s) +#wps_cred_processing=0 + +# network block +# +# Each network (usually AP's sharing the same SSID) is configured as a separate +# block in this configuration file. The network blocks are in preference order +# (the first match is used). +# +# network block fields: +# +# disabled: +# 0 = this network can be used (default) +# 1 = this network block is disabled (can be enabled through ctrl_iface, +# e.g., with wpa_cli or wpa_gui) +# +# id_str: Network identifier string for external scripts. This value is passed +# to external action script through wpa_cli as WPA_ID_STR environment +# variable to make it easier to do network specific configuration. +# +# ssid: SSID (mandatory); either as an ASCII string with double quotation or +# as hex string; network name +# +# scan_ssid: +# 0 = do not scan this SSID with specific Probe Request frames (default) +# 1 = scan with SSID-specific Probe Request frames (this can be used to +# find APs that do not accept broadcast SSID or use multiple SSIDs; +# this will add latency to scanning, so enable this only when needed) +# +# bssid: BSSID (optional); if set, this network block is used only when +# associating with the AP using the configured BSSID +# +# priority: priority group (integer) +# By default, all networks will get same priority group (0). If some of the +# networks are more desirable, this field can be used to change the order in +# which wpa_supplicant goes through the networks when selecting a BSS. The +# priority groups will be iterated in decreasing priority (i.e., the larger the +# priority value, the sooner the network is matched against the scan results). +# Within each priority group, networks will be selected based on security +# policy, signal strength, etc. +# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not +# using this priority to select the order for scanning. Instead, they try the +# networks in the order that used in the configuration file. +# +# mode: IEEE 802.11 operation mode +# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) +# 1 = IBSS (ad-hoc, peer-to-peer) +# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) +# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has +# to be set to 2 for IBSS. WPA-None requires following network block options: +# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not +# both), and psk must also be set. +# +# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., +# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial +# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. +# In addition, this value is only used by the station that creates the IBSS. If +# an IBSS network with the configured SSID is already present, the frequency of +# the network will be used instead of this configured value. +# +# proto: list of accepted protocols +# WPA = WPA/IEEE 802.11i/D3.0 +# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) +# If not set, this defaults to: WPA RSN +# +# key_mgmt: list of accepted authenticated key management protocols +# WPA-PSK = WPA pre-shared key (this requires 'psk' field) +# WPA-EAP = WPA using EAP authentication +# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically +# generated WEP keys +# NONE = WPA is not used; plaintext or static WEP could be used +# WPA-PSK-SHA256 = Like WPA-PSK but using stronger SHA256-based algorithms +# WPA-EAP-SHA256 = Like WPA-EAP but using stronger SHA256-based algorithms +# If not set, this defaults to: WPA-PSK WPA-EAP +# +# auth_alg: list of allowed IEEE 802.11 authentication algorithms +# OPEN = Open System authentication (required for WPA/WPA2) +# SHARED = Shared Key authentication (requires static WEP keys) +# LEAP = LEAP/Network EAP (only used with LEAP) +# If not set, automatic selection is used (Open System with LEAP enabled if +# LEAP is allowed as one of the EAP methods). +# +# pairwise: list of accepted pairwise (unicast) ciphers for WPA +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# NONE = Use only Group Keys (deprecated, should not be included if APs support +# pairwise keys) +# If not set, this defaults to: CCMP TKIP +# +# group: list of accepted group (broadcast/multicast) ciphers for WPA +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key +# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11] +# If not set, this defaults to: CCMP TKIP WEP104 WEP40 +# +# psk: WPA preshared key; 256-bit pre-shared key +# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e., +# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be +# generated using the passphrase and SSID). ASCII passphrase must be between +# 8 and 63 characters (inclusive). +# This field is not needed, if WPA-EAP is used. +# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys +# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant +# startup and reconfiguration time can be optimized by generating the PSK only +# only when the passphrase or SSID has actually changed. +# +# eapol_flags: IEEE 802.1X/EAPOL options (bit field) +# Dynamic WEP key required for non-WPA mode +# bit0 (1): require dynamically generated unicast WEP key +# bit1 (2): require dynamically generated broadcast WEP key +# (3 = require both keys; default) +# Note: When using wired authentication, eapol_flags must be set to 0 for the +# authentication to be completed successfully. +# +# mixed_cell: This option can be used to configure whether so called mixed +# cells, i.e., networks that use both plaintext and encryption in the same +# SSID, are allowed when selecting a BSS form scan results. +# 0 = disabled (default) +# 1 = enabled +# +# proactive_key_caching: +# Enable/disable opportunistic PMKSA caching for WPA2. +# 0 = disabled (default) +# 1 = enabled +# +# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or +# hex without quotation, e.g., 0102030405) +# wep_tx_keyidx: Default WEP key index (TX) (0..3) +# +# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is +# allowed. This is only used with RSN/WPA2. +# 0 = disabled (default) +# 1 = enabled +#peerkey=1 +# +# wpa_ptk_rekey: Maximum lifetime for PTK in seconds. This can be used to +# enforce rekeying of PTK to mitigate some attacks against TKIP deficiencies. +# +# Following fields are only used with internal EAP implementation. +# eap: space-separated list of accepted EAP methods +# MD5 = EAP-MD5 (unsecure and does not generate keying material -> +# cannot be used with WPA; to be used as a Phase 2 method +# with EAP-PEAP or EAP-TTLS) +# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# OTP = EAP-OTP (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# GTC = EAP-GTC (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# TLS = EAP-TLS (client and server certificate) +# PEAP = EAP-PEAP (with tunnelled EAP authentication) +# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2 +# authentication) +# If not set, all compiled in methods are allowed. +# +# identity: Identity string for EAP +# This field is also used to configure user NAI for +# EAP-PSK/PAX/SAKE/GPSK. +# anonymous_identity: Anonymous identity string for EAP (to be used as the +# unencrypted identity with EAP types that support different tunnelled +# identity, e.g., EAP-TTLS) +# password: Password string for EAP. This field can include either the +# plaintext password (using ASCII or hex string) or a NtPasswordHash +# (16-byte MD4 hash of password) in hash:<32 hex digits> format. +# NtPasswordHash can only be used when the password is for MSCHAPv2 or +# MSCHAP (EAP-MSCHAPv2, EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP). +# EAP-PSK (128-bit PSK), EAP-PAX (128-bit PSK), and EAP-SAKE (256-bit +# PSK) is also configured using this field. For EAP-GPSK, this is a +# variable length PSK. +# ca_cert: File path to CA certificate file (PEM/DER). This file can have one +# or more trusted CA certificates. If ca_cert and ca_path are not +# included, server certificate will not be verified. This is insecure and +# a trusted CA certificate should always be configured when using +# EAP-TLS/TTLS/PEAP. Full path should be used since working directory may +# change when wpa_supplicant is run in the background. +# On Windows, trusted CA certificates can be loaded from the system +# certificate store by setting this to cert_store://<name>, e.g., +# ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# ca_path: Directory path for CA certificate files (PEM). This path may +# contain multiple CA certificates in OpenSSL format. Common use for this +# is to point to system trusted CA list which is often installed into +# directory like /etc/ssl/certs. If configured, these certificates are +# added to the list of trusted CAs. ca_cert may also be included in that +# case, but it is not required. +# client_cert: File path to client certificate file (PEM/DER) +# Full path should be used since working directory may change when +# wpa_supplicant is run in the background. +# Alternatively, a named configuration blob can be used by setting this +# to blob://<blob name>. +# private_key: File path to client private key file (PEM/DER/PFX) +# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be +# commented out. Both the private key and certificate will be read from +# the PKCS#12 file in this case. Full path should be used since working +# directory may change when wpa_supplicant is run in the background. +# Windows certificate store can be used by leaving client_cert out and +# configuring private_key in one of the following formats: +# cert://substring_to_match +# hash://certificate_thumbprint_in_hex +# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4" +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# Alternatively, a named configuration blob can be used by setting this +# to blob://<blob name>. +# private_key_passwd: Password for private key file (if left out, this will be +# asked through control interface) +# dh_file: File path to DH/DSA parameters file (in PEM format) +# This is an optional configuration file for setting parameters for an +# ephemeral DH key exchange. In most cases, the default RSA +# authentication does not use this configuration. However, it is possible +# setup RSA to use ephemeral DH key exchange. In addition, ciphers with +# DSA keys always use ephemeral DH keys. This can be used to achieve +# forward secrecy. If the file is in DSA parameters format, it will be +# automatically converted into DH params. +# subject_match: Substring to be matched against the subject of the +# authentication server certificate. If this string is set, the server +# sertificate is only accepted if it contains this string in the subject. +# The subject string is in following format: +# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com +# altsubject_match: Semicolon separated string of entries to be matched against +# the alternative subject name of the authentication server certificate. +# If this string is set, the server sertificate is only accepted if it +# contains one of the entries in an alternative subject name extension. +# altSubjectName string is in following format: TYPE:VALUE +# Example: EMAIL:server@example.com +# Example: DNS:server.example.com;DNS:server2.example.com +# Following types are supported: EMAIL, DNS, URI +# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters +# (string with field-value pairs, e.g., "peapver=0" or +# "peapver=1 peaplabel=1") +# 'peapver' can be used to force which PEAP version (0 or 1) is used. +# 'peaplabel=1' can be used to force new label, "client PEAP encryption", +# to be used during key derivation when PEAPv1 or newer. Most existing +# PEAPv1 implementation seem to be using the old label, "client EAP +# encryption", and wpa_supplicant is now using that as the default value. +# Some servers, e.g., Radiator, may require peaplabel=1 configuration to +# interoperate with PEAPv1; see eap_testing.txt for more details. +# 'peap_outer_success=0' can be used to terminate PEAP authentication on +# tunneled EAP-Success. This is required with some RADIUS servers that +# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g., +# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode) +# include_tls_length=1 can be used to force wpa_supplicant to include +# TLS Message Length field in all TLS messages even if they are not +# fragmented. +# sim_min_num_chal=3 can be used to configure EAP-SIM to require three +# challenges (by default, it accepts 2 or 3) +# result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use +# protected result indication. +# 'crypto_binding' option can be used to control PEAPv0 cryptobinding +# behavior: +# * 0 = do not use cryptobinding (default) +# * 1 = use cryptobinding if server supports it +# * 2 = require cryptobinding +# EAP-WSC (WPS) uses following options: pin=<Device Password> or +# pbc=1. +# phase2: Phase2 (inner authentication with TLS tunnel) parameters +# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or +# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS) +# Following certificate/private key fields are used in inner Phase2 +# authentication when using EAP-TTLS or EAP-PEAP. +# ca_cert2: File path to CA certificate file. This file can have one or more +# trusted CA certificates. If ca_cert2 and ca_path2 are not included, +# server certificate will not be verified. This is insecure and a trusted +# CA certificate should always be configured. +# ca_path2: Directory path for CA certificate files (PEM) +# client_cert2: File path to client certificate file +# private_key2: File path to client private key file +# private_key2_passwd: Password for private key file +# dh_file2: File path to DH/DSA parameters file (in PEM format) +# subject_match2: Substring to be matched against the subject of the +# authentication server certificate. +# altsubject_match2: Substring to be matched against the alternative subject +# name of the authentication server certificate. +# +# fragment_size: Maximum EAP fragment size in bytes (default 1398). +# This value limits the fragment size for EAP methods that support +# fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set +# small enough to make the EAP messages fit in MTU of the network +# interface used for EAPOL. The default value is suitable for most +# cases. +# +# EAP-FAST variables: +# pac_file: File path for the PAC entries. wpa_supplicant will need to be able +# to create this file and write updates to it when PAC is being +# provisioned or refreshed. Full path to the file should be used since +# working directory may change when wpa_supplicant is run in the +# background. Alternatively, a named configuration blob can be used by +# setting this to blob://<blob name> +# phase1: fast_provisioning option can be used to enable in-line provisioning +# of EAP-FAST credentials (PAC): +# 0 = disabled, +# 1 = allow unauthenticated provisioning, +# 2 = allow authenticated provisioning, +# 3 = allow both unauthenticated and authenticated provisioning +# fast_max_pac_list_len=<num> option can be used to set the maximum +# number of PAC entries to store in a PAC list (default: 10) +# fast_pac_format=binary option can be used to select binary format for +# storing PAC entries in order to save some space (the default +# text format uses about 2.5 times the size of minimal binary +# format) +# +# wpa_supplicant supports number of "EAP workarounds" to work around +# interoperability issues with incorrectly behaving authentication servers. +# These are enabled by default because some of the issues are present in large +# number of authentication servers. Strict EAP conformance mode can be +# configured by disabling workarounds with eap_workaround=0. + +# Example blocks: + +# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers +network={ + ssid="simple" + psk="very secret passphrase" + priority=5 +} + +# Same as previous, but request SSID-specific scanning (for APs that reject +# broadcast SSID) +network={ + ssid="second ssid" + scan_ssid=1 + psk="very secret passphrase" + priority=2 +} + +# Only WPA-PSK is used. Any valid cipher combination is accepted. +network={ + ssid="example" + proto=WPA + key_mgmt=WPA-PSK + pairwise=CCMP TKIP + group=CCMP TKIP WEP104 WEP40 + psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb + priority=2 +} + +# WPA-Personal(PSK) with TKIP and enforcement for frequent PTK rekeying +network={ + ssid="example" + proto=WPA + key_mgmt=WPA-PSK + pairwise=TKIP + group=TKIP + psk="not so secure passphrase" + wpa_ptk_rekey=600 +} + +# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104 +# or WEP40 as the group cipher will not be accepted. +network={ + ssid="example" + proto=RSN + key_mgmt=WPA-EAP + pairwise=CCMP TKIP + group=CCMP TKIP + eap=TLS + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + priority=1 +} + +# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel +# (e.g., Radiator) +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=PEAP + identity="user@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + phase1="peaplabel=1" + phase2="auth=MSCHAPV2" + priority=10 +} + +# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the +# unencrypted use. Real identity is sent only within an encrypted TLS tunnel. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + priority=2 +} + +# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted +# use. Real identity is sent only within an encrypted TLS tunnel. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + phase2="auth=MSCHAPV2" +} + +# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner +# authentication. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + # Phase1 / outer authentication + anonymous_identity="anonymous@example.com" + ca_cert="/etc/cert/ca.pem" + # Phase 2 / inner authentication + phase2="autheap=TLS" + ca_cert2="/etc/cert/ca2.pem" + client_cert2="/etc/cer/user.pem" + private_key2="/etc/cer/user.prv" + private_key2_passwd="password" + priority=2 +} + +# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and +# group cipher. +network={ + ssid="example" + bssid=00:11:22:33:44:55 + proto=WPA RSN + key_mgmt=WPA-PSK WPA-EAP + pairwise=CCMP + group=CCMP + psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb +} + +# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP +# and all valid ciphers. +network={ + ssid=00010203 + psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +} + + +# EAP-SIM with a GSM SIM or USIM +network={ + ssid="eap-sim-test" + key_mgmt=WPA-EAP + eap=SIM + pin="1234" + pcsc="" +} + + +# EAP-PSK +network={ + ssid="eap-psk-test" + key_mgmt=WPA-EAP + eap=PSK + anonymous_identity="eap_psk_user" + password=06b4be19da289f475aa46a33cb793029 + identity="eap_psk_user@example.com" +} + + +# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using +# EAP-TLS for authentication and key generation; require both unicast and +# broadcast WEP keys. +network={ + ssid="1xtest" + key_mgmt=IEEE8021X + eap=TLS + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + eapol_flags=3 +} + + +# LEAP with dynamic WEP keys +network={ + ssid="leap-example" + key_mgmt=IEEE8021X + eap=LEAP + identity="user" + password="foobar" +} + +# EAP-IKEv2 using shared secrets for both server and peer authentication +network={ + ssid="ikev2-example" + key_mgmt=WPA-EAP + eap=IKEV2 + identity="user" + password="foobar" +} + +# EAP-FAST with WPA (WPA or WPA2) +network={ + ssid="eap-fast-test" + key_mgmt=WPA-EAP + eap=FAST + anonymous_identity="FAST-000102030405" + identity="username" + password="password" + phase1="fast_provisioning=1" + pac_file="/etc/wpa_supplicant.eap-fast-pac" +} + +network={ + ssid="eap-fast-test" + key_mgmt=WPA-EAP + eap=FAST + anonymous_identity="FAST-000102030405" + identity="username" + password="password" + phase1="fast_provisioning=1" + pac_file="blob://eap-fast-pac" +} + +# Plaintext connection (no WPA, no IEEE 802.1X) +network={ + ssid="plaintext-test" + key_mgmt=NONE +} + + +# Shared WEP key connection (no WPA, no IEEE 802.1X) +network={ + ssid="static-wep-test" + key_mgmt=NONE + wep_key0="abcde" + wep_key1=0102030405 + wep_key2="1234567890123" + wep_tx_keyidx=0 + priority=5 +} + + +# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key +# IEEE 802.11 authentication +network={ + ssid="static-wep-test2" + key_mgmt=NONE + wep_key0="abcde" + wep_key1=0102030405 + wep_key2="1234567890123" + wep_tx_keyidx=0 + priority=5 + auth_alg=SHARED +} + + +# IBSS/ad-hoc network with WPA-None/TKIP. +network={ + ssid="test adhoc" + mode=1 + frequency=2412 + proto=WPA + key_mgmt=WPA-NONE + pairwise=NONE + group=TKIP + psk="secret passphrase" +} + + +# Catch all example that allows more or less all configuration modes +network={ + ssid="example" + scan_ssid=1 + key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE + pairwise=CCMP TKIP + group=CCMP TKIP WEP104 WEP40 + psk="very secret passphrase" + eap=TTLS PEAP TLS + identity="user@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + phase1="peaplabel=0" +} + +# Example of EAP-TLS with smartcard (openssl engine) +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TLS + proto=RSN + pairwise=CCMP TKIP + group=CCMP TKIP + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + + engine=1 + + # The engine configured here must be available. Look at + # OpenSSL engine support in the global section. + # The key available through the engine must be the private key + # matching the client certificate configured above. + + # use the opensc engine + #engine_id="opensc" + #key_id="45" + + # use the pkcs11 engine + engine_id="pkcs11" + key_id="id_45" + + # Optional PIN configuration; this can be left out and PIN will be + # asked through the control interface + pin="1234" +} + +# Example configuration showing how to use an inlined blob as a CA certificate +# data instead of using external file +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="blob://exampleblob" + priority=20 +} + +blob-base64-exampleblob={ +SGVsbG8gV29ybGQhCg== +} + + +# Wildcard match for SSID (plaintext APs only). This example select any +# open AP regardless of its SSID. +network={ + key_mgmt=NONE +} +network={ + ssid="qiaomuf" + key_mgmt=WPA-EAP + eap=TLS + identity="user@example.com" + ca_cert="/home/gentoo/temp/ca.pem" + client_cert="/home/gentoo/temp/client.pem" + private_key="/home/gentoo/temp/client.p12" + private_key_passwd="whatever" +# phase2="auth=MSCHAPV2" + priority=10 +} +network={ + ssid="myxjtu2" + scan_ssid=1 + key_mgmt=WPA-PSK + psk="xjtudlc3731" + disabled=0 + key_mgmt=NONE + wep_key0="12345" + wep_key1=1234567890 + wep_key2="zxcvb" + wep_tx_keyidx=1 + auth_alg=OPEN + mode=1 +} +network={ + ssid=ab3ace + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="blob://exampleblob" + priority=20 +} diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c new file mode 100644 index 0000000000..5e94108e98 --- /dev/null +++ b/system-settings/plugins/ifnet/wpa_parser.c @@ -0,0 +1,558 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#include <string.h> +#include <stdlib.h> +#include <nm-system-config-interface.h> +#include "wpa_parser.h" +#include "net_parser.h" +#include "net_utils.h" + +/* Security information */ +static GHashTable *wsec_table = NULL; + +/* Global information used for writing */ +static GHashTable *wsec_global_table = NULL; + +static gboolean wpa_parser_data_changed = FALSE; + +static long +wpa_get_long (GHashTable * table, gchar * key) +{ + return atol (g_hash_table_lookup (table, key)); +} + +static void +destroy_security (GHashTable * network) +{ + gpointer key, value; + GHashTableIter iter; + + g_return_if_fail (network); + g_hash_table_iter_init (&iter, network); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (network); +} + +static GHashTable * +add_security (GHashTable * security) +{ + GHashTable *oldsecurity; + gchar *ssid = g_hash_table_lookup (security, "ssid"), *ssid_key; + gchar *value; + gboolean is_hex_ssid; + + /* Every security information should have a ssid */ + if (!ssid) { + destroy_security (security); + return NULL; + } + + /* Hex format begins with " */ + is_hex_ssid = (ssid[0] != '"'); + if ((value = g_hash_table_lookup (security, "disabled")) != NULL) { + if (strcmp (value, "1") == 0) + return NULL; + } + + /* Default priority is 1 */ + if (g_hash_table_lookup (security, "priority") == NULL) + g_hash_table_insert (security, g_strdup ("priority"), + g_strdup ("1")); + + oldsecurity = g_hash_table_lookup (wsec_table, ssid); + /* Security with lower priority will be ignored */ + if (oldsecurity != NULL) { + if (wpa_get_long (oldsecurity, "priority") >= + wpa_get_long (security, "priority")) { + destroy_security (security); + return NULL; + } else { + g_hash_table_remove (wsec_table, ssid); + destroy_security (oldsecurity); + } + } + + /* format ssid */ + ssid_key = + is_hex_ssid ? g_strdup_printf ("0x%s", + ssid) : + strip_string (g_strdup (ssid), '"'); + g_hash_table_insert (wsec_table, ssid_key, security); + return security; +} + +static void +add_key_value (GHashTable * network, gchar * line) +{ + gchar **key_value; + + if (g_str_has_prefix (line, "network={")) + line += 9; + strip_string (line, '{'); + strip_string (line, '}'); + if (line[0] == '\0') + return; + key_value = g_strsplit (line, "=", 2); + if (g_strv_length (key_value) != 2) { + g_strfreev (key_value); + return; + } + g_strstrip (key_value[0]); + g_strstrip (key_value[1]); + + /* Reserve quotes for psk, wep_key, ssid + * Quotes will determine whether they are hex format */ + if (strcmp (key_value[0], "psk") != 0 + && !g_str_has_prefix (key_value[0], "wep_key") + && strcmp (key_value[0], "ssid") != 0) + strip_string (key_value[1], '"'); + g_hash_table_insert (network, g_strdup (key_value[0]), + g_strdup (key_value[1])); + g_strfreev (key_value); +} + +static void +add_one_wep_key (GHashTable * table, int key_num, gchar * one_wep_key) +{ + if (one_wep_key[0] == 's') { + //asc key + g_hash_table_insert (table, + g_strdup_printf ("wep_key%d", key_num - 1), + g_strdup_printf ("\"%s\"", + one_wep_key + 2)); + } else { + gchar buf[30]; + int i = 0, j = 0; + + //hex key + while (one_wep_key[i] != '\0') { + if (one_wep_key[i] != '-') + buf[j++] = one_wep_key[i]; + i++; + } + buf[j] = '\0'; + g_hash_table_insert (table, + g_strdup_printf ("wep_key%d", key_num - 1), + g_strdup (buf)); + + } +} + +/* Reading wep security information from /etc/conf.d/net. + * This should not be used in futre, use wpa_supplicant instead. */ +static void +add_keys_from_net () +{ + GList *names = ifnet_get_connection_names (); + GList *iter = names; + gchar *wep_keys = "(\\[([1-4])\\]\\s+(s:\\w{5}|s:\\w{13}|" + "([\\da-fA-F]{4}\\-){2}[\\da-fA-F]{2}|" + "([\\da-fA-F]{4}\\-){6}[\\da-fA-F]{2})\\s+)"; + gchar *key_method = + "\\s+key\\s+\\[([1-4])\\]\\s+enc\\s+(open|restricted)"; + GRegex *regex_keys = g_regex_new (wep_keys, 0, 0, NULL); + GRegex *regex_method = g_regex_new (key_method, 0, 0, NULL); + GMatchInfo *keys_info; + GMatchInfo *method_info; + + while (iter) { + gchar *conn_name = iter->data; + GHashTable *table; + gchar *key_str; + + if ((key_str = ifnet_get_data (conn_name, "key")) == NULL) { + iter = g_list_next (iter); + continue; + } + + wpa_add_security (conn_name); + table = _get_hash_table (conn_name); + /* Give lowest priority */ + wpa_set_data (conn_name, "priority", "0"); + g_regex_match (regex_keys, key_str, 0, &keys_info); + /* add wep keys */ + while (g_match_info_matches (keys_info)) { + gchar *key_num = g_match_info_fetch (keys_info, 2); + gchar *one_wep_key = g_match_info_fetch (keys_info, 3); + + add_one_wep_key (table, atoi (key_num), one_wep_key); + g_free (key_num); + g_free (one_wep_key); + g_match_info_next (keys_info, NULL); + } + g_match_info_free (keys_info); + + g_regex_match (regex_method, key_str, 0, &method_info); + /* set default key index and auth alg */ + if (g_match_info_matches (method_info)) { + gchar *default_idx = + g_match_info_fetch (method_info, 1); + gchar *method = g_match_info_fetch (method_info, 2); + + default_idx[0]--; + g_hash_table_insert (table, g_strdup ("wep_tx_keyidx"), + default_idx); + g_hash_table_insert (table, g_strdup ("auth_alg"), + g_ascii_strup (method, -1)); + } + g_match_info_free (method_info); + add_security (table); + iter = g_list_next (iter); + } + g_list_free (names); + g_regex_unref (regex_keys); + g_regex_unref (regex_method); +} + +static void +add_global_data (gchar * line) +{ + gchar **key_value; + + g_strstrip (line); + key_value = g_strsplit (line, "=", 2); + if (g_strv_length (key_value) != 2) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle this line: %s\n", + line); + g_strfreev (key_value); + return; + } + g_hash_table_insert (wsec_global_table, + g_strdup (g_strstrip (key_value[0])), + g_strdup (g_strstrip (key_value[1]))); + g_strfreev (key_value); +} + +void +wpa_parser_init (gchar * wpa_supplicant_conf) +{ + GIOChannel *channel = NULL; + gchar *line; + gboolean complete = FALSE; + + wpa_parser_data_changed = FALSE; + wsec_table = g_hash_table_new (g_str_hash, g_str_equal); + wsec_global_table = g_hash_table_new (g_str_hash, g_str_equal); + + if (g_file_test (wpa_supplicant_conf, G_FILE_TEST_IS_REGULAR)) + channel = + g_io_channel_new_file (wpa_supplicant_conf, "r", NULL); + if (channel == NULL) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open %s for wireless security", + wpa_supplicant_conf); + return; + } + + while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL) + != G_IO_STATUS_EOF) { + g_strstrip (line); + if (line[0] != '#' && line[0] != '\0') { + if (strstr (line, "network={") == NULL) { + add_global_data (line); + g_free (line); + continue; + } else { + GHashTable *network = + g_hash_table_new (g_str_hash, g_str_equal); + gchar *tmp; + + do { + if (line[0] == '#' || line[0] == '\0') { + g_free (line); + continue; + } + /* ignore inline comments */ + if ((tmp = strchr (line, '#')) != NULL) + *tmp = '\0'; + if (strstr (line, "}") != NULL) + complete = TRUE; + add_key_value (network, line); + g_free (line); + } while (complete == FALSE + && + g_io_channel_read_line + (channel, &line, NULL, + NULL, NULL) != G_IO_STATUS_EOF); + add_security (network); + //EOF in inner loop + if (complete == FALSE) { + g_free (line); + break; + } + complete = FALSE; + } + } else + g_free (line); + } + + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + + add_keys_from_net (); +} + +gchar * +wpa_get_value (gchar * ssid, gchar * key) +{ + GHashTable *target = g_hash_table_lookup (wsec_table, ssid); + + if (target) + return g_hash_table_lookup (target, key); + return NULL; +} + +gboolean +exist_ssid (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid) != NULL; +} + +GHashTable * +_get_hash_table (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid); +} + +static gchar *quoted_keys[] = + { "identity", "cert", "private", "phase", "password", NULL }; + +/* tell whether the key needs quotes when writing is performed */ +static gboolean +need_quote (gchar * key) +{ + int i = 0; + + while (quoted_keys[i] != NULL) { + if (strstr (key, quoted_keys[i])) + return TRUE; + i++; + } + return FALSE; +} + +gboolean +wpa_flush_to_file (gchar * config_file) +{ + GIOChannel *channel; + GError **error = NULL; + gpointer key, value, ssid, security; + GHashTableIter iter, iter_security; + gchar *out_line; + gsize bytes_written; + gboolean result = FALSE; + + if (!wpa_parser_data_changed) + return FALSE; + if (!wsec_table || !wsec_global_table) + return FALSE; + + channel = g_io_channel_new_file (config_file, "w", NULL); + if (!channel) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open file %s for writing", config_file); + return FALSE; + } + g_hash_table_iter_init (&iter, wsec_global_table); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Writing to %s", config_file); + g_io_channel_write_chars (channel, + "#Generated by NetworkManager\n" + "###### Global Configuration ######\n", + -1, &bytes_written, error); + + /* Writing global information */ + while (g_hash_table_iter_next (&iter, &key, &value)) { + out_line = + g_strdup_printf ("%s=%s\n", (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, &bytes_written, + error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + g_io_channel_write_chars (channel, + "\n###### Security Configuration ######\n", + -1, &bytes_written, error); + + g_hash_table_iter_init (&iter, wsec_table); + /* Writing security */ + while (g_hash_table_iter_next (&iter, &ssid, &security)) { + g_hash_table_iter_init (&iter_security, + (GHashTable *) security); + g_io_channel_write_chars (channel, "network={\n", -1, + &bytes_written, error); + while (g_hash_table_iter_next (&iter_security, &key, &value)) { + out_line = + g_strdup_printf (need_quote ((gchar *) key) ? + "\t%s=\"%s\"\n" : "\t%s=%s\n", + (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + g_io_channel_write_chars (channel, + "}\n\n", -1, &bytes_written, error); + + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + g_io_channel_flush (channel, error); + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + wpa_parser_data_changed = FALSE; + result = TRUE; + done: + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return result; +} + +/* If value is NULL, this method will delete old key value pair */ +void +wpa_set_data (gchar * ssid, gchar * key, gchar * value) +{ + gpointer orig_key = NULL, orig_value = NULL; + GHashTable *security = g_hash_table_lookup (wsec_table, ssid); + + g_return_if_fail (security != NULL); + + /* Remove old key value pairs */ + if (g_hash_table_lookup_extended + (security, key, &orig_key, &orig_value)) { + g_hash_table_remove (security, orig_key); + g_free (orig_key); + g_free (orig_value); + } + + /* Add new key value */ + if (value) { + gchar *new_value = g_strdup (value); + + if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0 + && !g_str_has_prefix (key, "wep_key")) + strip_string (new_value, '"'); + g_hash_table_insert (security, g_strdup (key), new_value); + } + wpa_parser_data_changed = TRUE; +} + +gboolean +wpa_has_security (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid) != NULL; +} + +gboolean +wpa_add_security (gchar * ssid) +{ + if (wpa_has_security (ssid)) + return FALSE; + else { + GHashTable *security = + g_hash_table_new (g_str_hash, g_str_equal); + gchar *ssid_i; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding security for %s", + ssid); + if (g_str_has_prefix (ssid, "0x")) { + /* hex ssid */ + ssid_i = g_strdup (ssid + 2); + } else { + /* ascii ssid requires quotes */ + ssid_i = g_strdup_printf ("\"%s\"", ssid); + } + g_hash_table_insert (security, strdup ("ssid"), ssid_i); + g_hash_table_insert (security, strdup ("priority"), + strdup ("1")); + g_hash_table_insert (wsec_table, g_strdup (ssid), security); + wpa_parser_data_changed = TRUE; + return TRUE; + } +} + +gboolean +wpa_delete_security (gchar * ssid) +{ + gpointer orig_key, orig_value; + + g_return_val_if_fail (wsec_table != NULL && ssid != NULL, FALSE); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting security for %s", ssid); + if (!g_hash_table_lookup_extended + (wsec_table, ssid, &orig_key, &orig_value)) + return FALSE; + g_hash_table_remove (wsec_table, orig_key); + g_free (orig_key); + destroy_security ((GHashTable *) orig_value); + wpa_parser_data_changed = TRUE; + return TRUE; + +} + +void +wpa_parser_destroy (void) +{ + GHashTableIter iter; + gpointer key; + gpointer value; + + /* Destroy security */ + if (wsec_table) { + g_hash_table_iter_init (&iter, wsec_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + destroy_security ((GHashTable *) value); + g_free (key); + } + + g_hash_table_destroy (wsec_table); + wsec_table = NULL; + } + + /* Destroy global data */ + if (wsec_global_table) { + g_hash_table_iter_init (&iter, wsec_global_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (wsec_global_table); + wsec_global_table = NULL; + } +} diff --git a/system-settings/plugins/ifnet/wpa_parser.h b/system-settings/plugins/ifnet/wpa_parser.h new file mode 100644 index 0000000000..55b0ec0c60 --- /dev/null +++ b/system-settings/plugins/ifnet/wpa_parser.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao <qiaomuf@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _WPA_PARSER_H +#define _WPA_PARSER_H +#define WPA_SUPPLICANT_CONF "/etc/wpa_supplicant/wpa_supplicant.conf" +#include <glib.h> +void wpa_parser_init (gchar * wpa_supplicant_conf); +void wpa_parser_destroy (void); + +/* reader functions */ +gchar *wpa_get_value (gchar * ssid, gchar * key); +gboolean exist_ssid (gchar * ssid); +GHashTable *_get_hash_table (gchar * ssid); +gboolean wpa_has_security (gchar * ssid); + +/* writer functions */ +gboolean wpa_flush_to_file (gchar * config_file); +void wpa_set_data (gchar * ssid, gchar * key, gchar * value); +gboolean wpa_add_security (gchar * ssid); +gboolean wpa_delete_security (gchar * ssid); +#endif diff --git a/system-settings/plugins/ifupdown/Makefile.am b/system-settings/plugins/ifupdown/Makefile.am index ec50311554..652e545fce 100644 --- a/system-settings/plugins/ifupdown/Makefile.am +++ b/system-settings/plugins/ifupdown/Makefile.am @@ -1,3 +1,4 @@ +SUBDIRS=. tests INCLUDES = \ -I$(top_srcdir)/src/system-settings \ @@ -5,15 +6,30 @@ INCLUDES = \ -I$(top_srcdir)/libnm-glib \ -I$(top_srcdir)/libnm-util -pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la +noinst_LTLIBRARIES = libifupdown-io.la -libnm_settings_plugin_ifupdown_la_SOURCES = \ +libifupdown_io_la_SOURCES = \ interface_parser.c \ interface_parser.h \ + parser.c \ + parser.h + +libifupdown_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libifupdown_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la + +libnm_settings_plugin_ifupdown_la_SOURCES = \ nm-ifupdown-connection.c \ nm-ifupdown-connection.h \ - parser.c \ - parser.h \ plugin.c \ plugin.h @@ -28,6 +44,7 @@ libnm_settings_plugin_ifupdown_la_CPPFLAGS = \ libnm_settings_plugin_ifupdown_la_LDFLAGS = -module -avoid-version libnm_settings_plugin_ifupdown_la_LIBADD = \ $(top_builddir)/libnm-util/libnm-util.la \ + libifupdown-io.la \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(GUDEV_LIBS) diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index f28cf7cab1..4635db2ca1 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -73,85 +73,147 @@ void add_data(const char *key,const char *data) //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);} +// join values in src with spaces into dst; dst needs to be large enough +static char *join_values_with_spaces(char *dst, char **src) +{ + if (dst != NULL) { + *dst = '\0'; + if (src != NULL && *src != NULL) { + strcat(dst, *src); + + for (src++; *src != NULL; src++) { + strcat(dst, " "); + strcat(dst, *src); + } + } + } + return(dst); +} -void ifparser_init(void) +void ifparser_init (const char *eni_file, int quiet) { - FILE *inp = fopen(ENI_INTERFACES_FILE, "r"); - int ret = 0; - char *line; - char *space; - char rline[255]; + FILE *inp = fopen (eni_file, "r"); + char line[255]; + int skip_to_block = 1; + int skip_long_line = 0; + int offs = 0; - if (inp == NULL) - { - nm_warning ("Error: Can't open %s\n", ENI_INTERFACES_FILE); + if (inp == NULL) { + if (!quiet) + g_warning ("Error: Can't open %s\n", eni_file); return; } + first = last = NULL; - while(1) + while (!feof(inp)) { - line = space = NULL; - ret = fscanf(inp,"%255[^\n]\n",rline); - if (ret == EOF) + char *token[128]; // 255 chars can only be split into 127 tokens + char value[255]; // large enough to join previously split tokens + char *safeptr; + int toknum; + int len = 0; + + char *ptr = fgets(line+offs, 255-offs, inp); + if (ptr == NULL) break; - // If the line did not match, skip it - if (ret == 0) { - char *ignored; - ignored = fgets(rline, 255, inp); + len = strlen(line); + // skip over-long lines + if (!feof(inp) && len > 0 && line[len-1] != '\n') { + if (!skip_long_line) { + if (!quiet) + g_message ("Error: Skipping over-long-line '%s...'\n", line); + } + skip_long_line = 1; + continue; + } + + // trailing '\n' found: remove it & reset offset to 0 + if (len > 0 && line[len-1] == '\n') { + line[--len] = '\0'; + offs = 0; + } + + // if we're in long_line_skip mode, terminate it for real next line + if (skip_long_line) { + if (len == 0 || line[len-1] != '\\') + skip_long_line = 0; continue; } - line = rline; - while(line[0] == ' ') - line++; - if (line[0]=='#' || line[0]=='\0') + // unwrap wrapped lines + if (len > 0 && line[len-1] == '\\') { + offs = len - 1; continue; + } - SPACE_OR_TAB(line,space) - if (space == NULL) - { - nm_warning ("Error: Can't parse interface line '%s'\n",line); - continue; + //printf(">>%s<<\n", line); + +#define SPACES " \t" + // tokenize input; + for (toknum = 0, token[toknum] = strtok_r(line, SPACES, &safeptr); + token[toknum] != NULL; + toknum++, token[toknum] = strtok_r(NULL, SPACES, &safeptr)) + ; + + // ignore comments and empty lines + if (toknum == 0 || *token[0]=='#') + continue; + + if (toknum < 2) { + if (!quiet) { + g_message ("Error: Can't parse interface line '%s'\n", + join_values_with_spaces(value, token)); } - space[0] = '\0'; + skip_to_block = 1; + continue; + } // 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); + + // iface stanza takes at least 3 parameters + if (strcmp(token[0], "iface") == 0) { + if (toknum < 4) { + if (!quiet) { + g_message ("Error: Can't parse iface line '%s'\n", + join_values_with_spaces(value, token)); + } 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; + add_block(token[0], token[1]); + skip_to_block = 0; + add_data(token[2], join_values_with_spaces(value, token + 3)); + } + // auto and allow-auto stanzas are equivalent, + // both can take multiple interfaces as parameters: add one block for each + else if (strcmp(token[0], "auto") == 0 || + strcmp(token[0], "allow-auto") == 0) { + int i; + for (i = 1; i < toknum; i++) + add_block("auto", token[i]); + skip_to_block = 0; + } + else if (strcmp(token[0], "mapping") == 0) { + add_block(token[0], join_values_with_spaces(value, token + 1)); + skip_to_block = 0; + } + // allow-* can take multiple interfaces as parameters: add one block for each + else if (strncmp(token[0],"allow-",6) == 0) { + int i; + for (i = 1; i < toknum; i++) + add_block(token[0], token[i]); + skip_to_block = 0; + } + else { + if (skip_to_block) { + if (!quiet) { + g_message ("Error: ignoring out-of-block data '%s'\n", + join_values_with_spaces(value, token)); } - space[0] = '\0'; - add_data(space2+1,space+1); - } + } else + add_data(token[0], join_values_with_spaces(value, token + 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); } @@ -190,6 +252,18 @@ if_block *ifparser_getfirst(void) return first; } +int ifparser_get_num_blocks(void) +{ + int i = 0; + if_block *iter = first; + + while (iter) { + i++; + iter = iter->next; + } + return i; +} + if_block *ifparser_getif(const char* iface) { if_block *curr = first; @@ -213,3 +287,15 @@ const char *ifparser_getkey(if_block* iface, const char *key) } return NULL; } + +int ifparser_get_num_info(if_block* iface) +{ + int i = 0; + if_data *iter = iface->info; + + while (iter) { + i++; + iter = iter->next; + } + return i; +} diff --git a/system-settings/plugins/ifupdown/interface_parser.h b/system-settings/plugins/ifupdown/interface_parser.h index 52b98d04c4..ea991c32d1 100644 --- a/system-settings/plugins/ifupdown/interface_parser.h +++ b/system-settings/plugins/ifupdown/interface_parser.h @@ -26,8 +26,6 @@ #include "config.h" -#define ENI_INTERFACES_FILE "/etc/network/interfaces" - typedef struct _if_data { char *key; @@ -43,12 +41,14 @@ typedef struct _if_block struct _if_block *next; } if_block; -void ifparser_init(void); +void ifparser_init(const char *eni_file, int quiet); 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); +int ifparser_get_num_blocks(void); +int ifparser_get_num_info(if_block* iface); void add_block(const char *type, const char* name); void add_data(const char *key,const char *data); diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 34f724ccae..d968f562de 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -55,6 +55,8 @@ #define G_UDEV_API_IS_SUBJECT_TO_CHANGE #include <gudev/gudev.h> +#define ENI_INTERFACES_FILE "/etc/network/interfaces" + #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" @@ -355,7 +357,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) update_system_hostname (inotify_helper, NULL, NULL, config); /* Read in all the interfaces */ - ifparser_init (); + ifparser_init (ENI_INTERFACES_FILE, 0); block = ifparser_getfirst (); while (block) { if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) diff --git a/system-settings/plugins/ifupdown/tests/Makefile.am b/system-settings/plugins/ifupdown/tests/Makefile.am new file mode 100644 index 0000000000..b5dbd13d63 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/Makefile.am @@ -0,0 +1,32 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/ifupdown + +noinst_PROGRAMS = test-ifupdown + +test_ifupdown_SOURCES = \ + test-ifupdown.c + +test_ifupdown_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_ENI_DIR=\"$(abs_srcdir)\" + +test_ifupdown_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/system-settings/plugins/ifupdown/libifupdown-io.la \ + $(DBUS_LIBS) + +if WITH_TESTS + +check-local: test-ifupdown + $(abs_builddir)/test-ifupdown + +endif + +EXTRA_DIST = \ + test1 test2 test3 test4 test5 test6 test7 test8 test9 test11 test12 \ + test13 test14 test15 test16 diff --git a/system-settings/plugins/ifupdown/tests/test-ifupdown.c b/system-settings/plugins/ifupdown/tests/test-ifupdown.c new file mode 100644 index 0000000000..1646536452 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test-ifupdown.c @@ -0,0 +1,496 @@ +/* -*- 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 <glib.h> +#include <string.h> + +#include "interface_parser.h" +#include "parser.h" + +typedef struct { + char *key; + char *data; +} ExpectedKey; + +typedef struct { + char *type; + char *name; + GSList *keys; +} ExpectedBlock; + +typedef struct { + GSList *blocks; +} Expected; + +static ExpectedKey * +expected_key_new (const char *key, const char *data) +{ + ExpectedKey *k; + + k = g_malloc0 (sizeof (ExpectedKey)); + g_assert (k); + k->key = g_strdup (key); + g_assert (k->key); + k->data = g_strdup (data); + g_assert (k->data); + return k; +} + +static void +expected_key_free (ExpectedKey *k) +{ + g_assert (k); + g_free (k->key); + g_free (k->data); + memset (k, 0, sizeof (ExpectedKey)); + g_free (k); +} + +static ExpectedBlock * +expected_block_new (const char *type, const char *name) +{ + ExpectedBlock *b; + + g_assert (type); + g_assert (name); + b = g_malloc0 (sizeof (ExpectedBlock)); + g_assert (b); + b->type = g_strdup (type); + b->name = g_strdup (name); + return b; +} + +static void +expected_block_free (ExpectedBlock *b) +{ + g_assert (b); + g_slist_foreach (b->keys, (GFunc) expected_key_free, NULL); + g_slist_free (b->keys); + g_free (b->type); + g_free (b->name); + memset (b, 0, sizeof (ExpectedBlock)); + g_free (b); +} + +static void +expected_block_add_key (ExpectedBlock *b, ExpectedKey *k) +{ + g_assert (b); + g_assert (k); + b->keys = g_slist_append (b->keys, k); +} + +static Expected * +expected_new (void) +{ + Expected *e; + + e = g_malloc0 (sizeof (Expected)); + g_assert (e); + return e; +} + +static void +expected_add_block (Expected *e, ExpectedBlock *b) +{ + g_assert (e); + g_assert (b); + e->blocks = g_slist_append (e->blocks, b); +} + +static void +expected_free (Expected *e) +{ + g_assert (e); + g_slist_foreach (e->blocks, (GFunc) expected_block_free, NULL); + g_slist_free (e->blocks); + memset (e, 0, sizeof (Expected)); + g_free (e); +} + +static void +compare_expected_to_ifparser (Expected *e) +{ + if_block *n; + GSList *biter, *kiter; + + g_assert_cmpint (g_slist_length (e->blocks), ==, ifparser_get_num_blocks ()); + + for (n = ifparser_getfirst (), biter = e->blocks; + n && biter; + n = n->next, biter = g_slist_next (biter)) { + if_data *m; + ExpectedBlock *b = biter->data; + + g_assert (b->type && n->type); + g_assert_cmpstr (b->type, ==, n->type); + g_assert (b->name && n->name); + g_assert_cmpstr (b->name, ==, n->name); + + g_assert_cmpint (g_slist_length (b->keys), ==, ifparser_get_num_info (n)); + + for (m = n->info, kiter = b->keys; + m && kiter; + m = m->next, kiter = g_slist_next (kiter)) { + ExpectedKey *k = kiter->data; + + g_assert (k->key && m->key); + g_assert_cmpstr (k->key, ==, m->key); + g_assert (k->data && m->data); + g_assert_cmpstr (k->data, ==, m->data); + } + } +} + +static void +dump_blocks (void) +{ + if_block *n; + + g_message ("\n***************************************************"); + for (n = ifparser_getfirst (); n != NULL; n = n->next) { + if_data *m; + + // each block start with its type & name + // (single quotes used to show typ & name baoundaries) + g_print("'%s' '%s'\n", n->type, n->name); + + // each key-value pair within a block is indented & separated by a tab + // (single quotes used to show typ & name baoundaries) + for (m = n->info; m != NULL; m = m->next) + g_print("\t'%s'\t'%s'\n", m->key, m->data); + + // blocks are separated by an empty line + g_print("\n"); + } + g_message ("##################################################\n"); +} + +static void +init_ifparser_with_file (const char *path, const char *file) +{ + char *tmp; + + tmp = g_strdup_printf ("%s/%s", path, file); + ifparser_init (tmp, 1); + g_free (tmp); +} + +static void +test1_ignore_line_before_first_block (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("iface", "eth0"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + + init_ifparser_with_file (path, "test1"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test2_wrapped_line (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "lo"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test2"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test3_wrapped_multiline_multiarg (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("allow-hotplug", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "wlan0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "bnep0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test3"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test4_allow_auto_is_auto (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "eth0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test4"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test5_allow_auto_multiarg (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("allow-hotplug", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "wlan0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test5"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test6_mixed_whitespace (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "lo"); + expected_block_add_key (b, expected_key_new ("inet", "loopback")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test6"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test7_long_line (const char *path) +{ + init_ifparser_with_file (path, "test7"); + g_assert_cmpint (ifparser_get_num_blocks (), ==, 0); + ifparser_destroy (); +} + +static void +test8_long_line_wrapped (const char *path) +{ + init_ifparser_with_file (path, "test8"); + g_assert_cmpint (ifparser_get_num_blocks (), ==, 0); + ifparser_destroy (); +} + +static void +test9_wrapped_lines_in_block (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "eth0"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "static")); + expected_block_add_key (b, expected_key_new ("address", "10.250.2.3")); + expected_block_add_key (b, expected_key_new ("netmask", "255.255.255.192")); + expected_block_add_key (b, expected_key_new ("broadcast", "10.250.2.63")); + expected_block_add_key (b, expected_key_new ("gateway", "10.250.2.50")); + + init_ifparser_with_file (path, "test9"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test11_complex_wrap (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "pppoe"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_block_add_key (b, expected_key_new ("pre-up", "/sbin/ifconfig eth0 up")); + + init_ifparser_with_file (path, "test11"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test12_complex_wrap_split_word (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "pppoe"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_block_add_key (b, expected_key_new ("up", "ifup ppp0=dsl")); + + init_ifparser_with_file (path, "test12"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test13_more_mixed_whitespace (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "dsl"); + expected_block_add_key (b, expected_key_new ("inet", "ppp")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test13"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test14_mixed_whitespace_block_start (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "wlan0"); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_add_block (e, b); + b = expected_block_new ("iface", "wlan-adpm"); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + expected_add_block (e, b); + b = expected_block_new ("iface", "wlan-default"); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test14"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test15_trailing_space (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "bnep0"); + expected_block_add_key (b, expected_key_new ("inet", "static")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test15"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test16_missing_newline (const char *path) +{ + Expected *e; + + e = expected_new (); + expected_add_block (e, expected_block_new ("mapping", "eth0")); + + init_ifparser_with_file (path, "test16"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +#if GLIB_CHECK_VERSION(2,25,12) +typedef GTestFixtureFunc TCFunc; +#else +typedef void (*TCFunc)(void); +#endif + +#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 (); + + if (0) + dump_blocks (); + + g_test_suite_add (suite, TESTCASE (test1_ignore_line_before_first_block, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test2_wrapped_line, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test3_wrapped_multiline_multiarg, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test4_allow_auto_is_auto, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test5_allow_auto_multiarg, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test6_mixed_whitespace, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test7_long_line, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test8_long_line_wrapped, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test9_wrapped_lines_in_block, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test11_complex_wrap, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test12_complex_wrap_split_word, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test13_more_mixed_whitespace, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test14_mixed_whitespace_block_start, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test15_trailing_space, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test16_missing_newline, TEST_ENI_DIR)); + + return g_test_run (); +} + diff --git a/system-settings/plugins/ifupdown/tests/test1 b/system-settings/plugins/ifupdown/tests/test1 new file mode 100644 index 0000000000..74c23b457d --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test1 @@ -0,0 +1,6 @@ +# case 1: line before 1st block (must be ignored) +address 10.250.2.3 + +auto eth0 +iface eth0 inet dhcp + diff --git a/system-settings/plugins/ifupdown/tests/test11 b/system-settings/plugins/ifupdown/tests/test11 new file mode 100644 index 0000000000..89561dd7df --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test11 @@ -0,0 +1,5 @@ +iface pppoe inet manual +# case 11: wrapped line (without leading space on the wrapped part, wrap within a multi-word value) + pre-up /sbin/ifconfig \ +eth0 up + diff --git a/system-settings/plugins/ifupdown/tests/test12 b/system-settings/plugins/ifupdown/tests/test12 new file mode 100644 index 0000000000..6096842e1e --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test12 @@ -0,0 +1,5 @@ +iface pppoe inet manual +# case 12: wrapped line, splitting a word (must be joined again) + up ifup ppp0\ +=dsl + diff --git a/system-settings/plugins/ifupdown/tests/test13 b/system-settings/plugins/ifupdown/tests/test13 new file mode 100644 index 0000000000..c001f7ef1b --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test13 @@ -0,0 +1,3 @@ +# case 13: variations of tabs & spaces +iface dsl inet ppp + diff --git a/system-settings/plugins/ifupdown/tests/test14 b/system-settings/plugins/ifupdown/tests/test14 new file mode 100644 index 0000000000..4a153ab3b5 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test14 @@ -0,0 +1,5 @@ +# case 14: variations of tabs and spaces (all must be recognized as lines starting an iface block) +iface wlan0 inet manual + iface wlan-adpm inet dhcp +iface wlan-default inet dhcp + diff --git a/system-settings/plugins/ifupdown/tests/test15 b/system-settings/plugins/ifupdown/tests/test15 new file mode 100644 index 0000000000..c3ceca2409 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test15 @@ -0,0 +1,3 @@ +# case 15: trailing space (must be ignored) +iface bnep0 inet static + diff --git a/system-settings/plugins/ifupdown/tests/test16 b/system-settings/plugins/ifupdown/tests/test16 new file mode 100644 index 0000000000..f4f74fb5a1 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test16 @@ -0,0 +1,2 @@ +# case 16: last line that is not followed by LF (added with 'echo -n "mapping eth0" >> /e/n/i') +mapping eth0
\ No newline at end of file diff --git a/system-settings/plugins/ifupdown/tests/test2 b/system-settings/plugins/ifupdown/tests/test2 new file mode 100644 index 0000000000..7462b35268 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test2 @@ -0,0 +1,4 @@ +# case 2: wrapped line +auto \ +lo + diff --git a/system-settings/plugins/ifupdown/tests/test3 b/system-settings/plugins/ifupdown/tests/test3 new file mode 100644 index 0000000000..f6293bbdc6 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test3 @@ -0,0 +1,5 @@ +# case 3: line wrapped over multiple lines & multi-argument allow-* +allow-hotplug eth0 \ + wlan0 \ + bnep0 + diff --git a/system-settings/plugins/ifupdown/tests/test4 b/system-settings/plugins/ifupdown/tests/test4 new file mode 100644 index 0000000000..46a40bc9c2 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test4 @@ -0,0 +1,3 @@ +# case 4: 'allow-auto' is synonymous to 'auto' +allow-auto eth0 + diff --git a/system-settings/plugins/ifupdown/tests/test5 b/system-settings/plugins/ifupdown/tests/test5 new file mode 100644 index 0000000000..b69fc42bd0 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test5 @@ -0,0 +1,3 @@ +# case 5: multi-argument allow-* (even worse: trailing space) +allow-hotplug eth0 wlan0 + diff --git a/system-settings/plugins/ifupdown/tests/test6 b/system-settings/plugins/ifupdown/tests/test6 new file mode 100644 index 0000000000..50ac69bd98 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test6 @@ -0,0 +1,3 @@ +# case 6: mix between tabs and spaces + iface lo inet loopback + diff --git a/system-settings/plugins/ifupdown/tests/test7 b/system-settings/plugins/ifupdown/tests/test7 new file mode 100644 index 0000000000..03cb131a98 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test7 @@ -0,0 +1,3 @@ +# case 7: over-long line (must be ignored completely) +123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 + diff --git a/system-settings/plugins/ifupdown/tests/test8 b/system-settings/plugins/ifupdown/tests/test8 new file mode 100644 index 0000000000..311f7e15a4 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test8 @@ -0,0 +1,5 @@ +# case 8: over-long line that wraps to consecutive lines (must be ignored completely) +123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 \ +allow-test eth0 \ +eth0 + diff --git a/system-settings/plugins/ifupdown/tests/test9 b/system-settings/plugins/ifupdown/tests/test9 new file mode 100644 index 0000000000..7d94563af9 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test9 @@ -0,0 +1,10 @@ +iface eth0 inet static +# case 9: wrapped lines inside a block (to be on the safe side) + address \ + 10.250.2.3 + netmask \ + 255.255.255.192 + + broadcast 10.250.2.63 + gateway 10.250.2.50 + |