From c5cf3b1d9bfca3475d85afab5c5fa0916a31e643 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 4 Oct 2009 21:41:49 -0700 Subject: [PATCH 001/392] modem: generalize GSM and CDMA modem classes So that Bluetooth can use them. They used to be NMDevice subclasses, but we need them to be generic objects that both bluetooth and the normal modem stack can use. All because GObject can't do multiple inheritance, but that would probably be even messier. So now that we have generic modem objects, we can create the actual NMDevice subclasses that will wrap them for non-BT modems, and then also have NMDeviceBt wrap them too for DUN. --- marshallers/nm-marshal.list | 3 + src/modem-manager/Makefile.am | 4 +- src/modem-manager/nm-modem-cdma.c | 200 +++++----- src/modem-manager/nm-modem-cdma.h | 8 +- src/modem-manager/nm-modem-gsm.c | 303 +++++----------- src/modem-manager/nm-modem-gsm.h | 9 +- src/modem-manager/nm-modem-manager.c | 51 +-- src/modem-manager/nm-modem-manager.h | 8 +- src/modem-manager/nm-modem.c | 524 ++++++++++++++++++++------- src/modem-manager/nm-modem.h | 93 ++++- src/nm-secrets-provider-interface.h | 3 +- 11 files changed, 709 insertions(+), 497 deletions(-) diff --git a/marshallers/nm-marshal.list b/marshallers/nm-marshal.list index 38669dd32b..85f7158be7 100644 --- a/marshallers/nm-marshal.list +++ b/marshallers/nm-marshal.list @@ -20,6 +20,9 @@ VOID:OBJECT,OBJECT,ENUM VOID:POINTER,STRING VOID:STRING,BOXED BOOLEAN:POINTER,STRING,BOOLEAN,UINT,STRING,STRING +VOID:STRING,BOOLEAN,UINT,STRING,STRING BOOLEAN:VOID VOID:STRING,BOOLEAN +VOID:STRING,OBJECT,POINTER +VOID:BOOLEAN,UINT diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am index fef879ac44..79eab85fa8 100644 --- a/src/modem-manager/Makefile.am +++ b/src/modem-manager/Makefile.am @@ -7,12 +7,12 @@ INCLUDES = \ noinst_LTLIBRARIES = libmodem-manager.la libmodem_manager_la_SOURCES = \ + nm-modem.c \ + nm-modem.h \ nm-modem-cdma.c \ nm-modem-cdma.h \ nm-modem-gsm.c \ nm-modem-gsm.h \ - nm-modem.c \ - nm-modem.h \ nm-modem-manager.h \ nm-modem-manager.c \ nm-modem-types.h diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index 9ba0a78279..c69559710d 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.c @@ -17,6 +17,12 @@ G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM) +#define NM_MODEM_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_CDMA, NMModemCdmaPrivate)) + +typedef struct { + DBusGProxyCall *call; +} NMModemCdmaPrivate; + typedef enum { NM_CDMA_ERROR_CONNECTION_NOT_CDMA = 0, @@ -60,41 +66,41 @@ nm_cdma_error_get_type (void) } -NMDevice * +NMModem * nm_modem_cdma_new (const char *path, const char *device, const char *data_device, - const char *driver) + guint32 ip_method) { g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (device != NULL, NULL); g_return_val_if_fail (data_device != NULL, NULL); - g_return_val_if_fail (driver != NULL, NULL); - return (NMDevice *) g_object_new (NM_TYPE_MODEM_CDMA, - NM_DEVICE_INTERFACE_UDI, path, - NM_DEVICE_INTERFACE_IFACE, data_device, - NM_DEVICE_INTERFACE_DRIVER, driver, - NM_MODEM_PATH, path, - NM_MODEM_DEVICE, device, - NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", - NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, - NULL); + return (NMModem *) g_object_new (NM_TYPE_MODEM_CDMA, + NM_MODEM_PATH, path, + NM_MODEM_DEVICE, device, + NM_MODEM_IFACE, data_device, + NM_MODEM_IP_METHOD, ip_method, + NULL); } static void -stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) { - NMDevice *device = NM_DEVICE (user_data); + NMModemCdma *self = NM_MODEM_CDMA (user_data); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); GError *error = NULL; - dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID); - if (!error) - nm_device_activate_schedule_stage2_device_config (device); + priv->call = NULL; + + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); else { - nm_warning ("CDMA modem connection failed: %s", error->message); + nm_warning ("CDMA connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_error_free (error); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_NONE); } } @@ -116,26 +122,41 @@ create_connect_properties (NMConnection *connection) } static NMActStageReturn -real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) { + NMModemCdma *self = NM_MODEM_CDMA (modem); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); NMConnection *connection; - GHashTable *properties; - connection = nm_act_request_get_connection (nm_device_get_act_request (device)); + connection = nm_act_request_get_connection (req); g_assert (connection); - properties = create_connect_properties (connection); - dbus_g_proxy_begin_call_with_timeout (nm_modem_get_proxy (NM_MODEM (device), MM_DBUS_INTERFACE_MODEM_SIMPLE), - "Connect", stage1_prepare_done, - device, NULL, 120000, - DBUS_TYPE_G_MAP_OF_VARIANT, properties, - G_TYPE_INVALID); + *out_setting_name = nm_connection_need_secrets (connection, out_hints); + if (!*out_setting_name) { + DBusGProxy *proxy; + GHashTable *properties; + + properties = create_connect_properties (connection); + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + priv->call = dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, properties, + G_TYPE_INVALID); + g_hash_table_destroy (properties); + } else { + /* NMModem will handle requesting secrets... */ + } return NM_ACT_STAGE_RETURN_POSTPONE; } static NMConnection * -real_get_best_auto_connection (NMDevice *dev, +real_get_best_auto_connection (NMModem *modem, GSList *connections, char **specific_object) { @@ -159,69 +180,8 @@ real_get_best_auto_connection (NMDevice *dev, return NULL; } -static void -real_connection_secrets_updated (NMDevice *dev, - NMConnection *connection, - GSList *updated_settings, - RequestSecretsCaller caller) -{ - NMActRequest *req; - gboolean found = FALSE; - GSList *iter; - - if (caller == SECRETS_CALLER_PPP) { - NMPPPManager *ppp_manager; - NMSettingCdma *s_cdma = NULL; - - ppp_manager = nm_modem_get_ppp_manager (NM_MODEM (dev)); - g_return_if_fail (ppp_manager != NULL); - - s_cdma = (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); - if (!s_cdma) { - /* Shouldn't ever happen */ - nm_ppp_manager_update_secrets (ppp_manager, - nm_device_get_iface (dev), - NULL, - NULL, - "missing CDMA setting; no secrets could be found."); - } else { - const char *username = nm_setting_cdma_get_username (s_cdma); - const char *password = nm_setting_cdma_get_password (s_cdma); - - nm_ppp_manager_update_secrets (ppp_manager, - nm_device_get_iface (dev), - username ? username : "", - password ? password : "", - NULL); - } - return; - } - - g_return_if_fail (caller == SECRETS_CALLER_CDMA); - g_return_if_fail (nm_device_get_state (dev) == NM_DEVICE_STATE_NEED_AUTH); - - for (iter = updated_settings; iter; iter = g_slist_next (iter)) { - const char *setting_name = (const char *) iter->data; - - if (!strcmp (setting_name, NM_SETTING_CDMA_SETTING_NAME)) - found = TRUE; - else - nm_warning ("Ignoring updated secrets for setting '%s'.", setting_name); - } - - if (!found) - return; - - req = nm_device_get_act_request (dev); - g_assert (req); - - g_return_if_fail (nm_act_request_get_connection (req) == connection); - - nm_device_activate_schedule_stage1_device_prepare (dev); -} - static gboolean -real_check_connection_compatible (NMDevice *device, +real_check_connection_compatible (NMModem *modem, NMConnection *connection, GError **error) { @@ -249,15 +209,46 @@ real_check_connection_compatible (NMDevice *device, return TRUE; } -static const char * -real_get_ppp_name (NMModem *device, NMConnection *connection) +static gboolean +real_get_user_pass (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass) { NMSettingCdma *s_cdma; s_cdma = (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); - g_assert (s_cdma); + if (!s_cdma) + return FALSE; - return nm_setting_cdma_get_username (s_cdma); + if (user) + *user = nm_setting_cdma_get_username (s_cdma); + if (pass) + *pass = nm_setting_cdma_get_password (s_cdma); + + return TRUE; +} + +static const char * +real_get_setting_name (NMModem *modem) +{ + return NM_SETTING_CDMA_SETTING_NAME; +} + +static void +real_deactivate_quickly (NMModem *modem, NMDevice *device) +{ + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (modem); + + if (priv->call) { + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_cancel_call (proxy, priv->call); + priv->call = NULL; + } + + NM_MODEM_CLASS (nm_modem_cdma_parent_class)->deactivate_quickly (modem, device); } /*****************************************************************************/ @@ -270,19 +261,18 @@ nm_modem_cdma_init (NMModemCdma *self) static void nm_modem_cdma_class_init (NMModemCdmaClass *klass) { - NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); NMModemClass *modem_class = NM_MODEM_CLASS (klass); + g_type_class_add_private (object_class, sizeof (NMModemCdmaPrivate)); + /* Virtual methods */ - device_class->get_best_auto_connection = real_get_best_auto_connection; - device_class->connection_secrets_updated = real_connection_secrets_updated; - device_class->act_stage1_prepare = real_act_stage1_prepare; - device_class->check_connection_compatible = real_check_connection_compatible; - - modem_class->get_ppp_name = real_get_ppp_name; - - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - &dbus_glib_nm_device_cdma_object_info); + modem_class->get_user_pass = real_get_user_pass; + modem_class->get_setting_name = real_get_setting_name; + modem_class->get_best_auto_connection = real_get_best_auto_connection; + modem_class->check_connection_compatible = real_check_connection_compatible; + modem_class->act_stage1_prepare = real_act_stage1_prepare; + modem_class->deactivate_quickly = real_deactivate_quickly; dbus_g_error_domain_register (NM_CDMA_ERROR, NULL, NM_TYPE_CDMA_ERROR); } diff --git a/src/modem-manager/nm-modem-cdma.h b/src/modem-manager/nm-modem-cdma.h index 25dd9dcb1d..96606a735a 100644 --- a/src/modem-manager/nm-modem-cdma.h +++ b/src/modem-manager/nm-modem-cdma.h @@ -27,10 +27,10 @@ typedef struct { GType nm_modem_cdma_get_type (void); -NMDevice *nm_modem_cdma_new (const char *path, - const char *device, - const char *data_device, - const char *driver); +NMModem *nm_modem_cdma_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method); G_END_DECLS diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index 8f5b3b2db0..b178590c00 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -31,10 +31,14 @@ typedef enum { } MMModemGsmMode; -#define GSM_SECRETS_TRIES "gsm-secrets-tries" - G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) +#define NM_MODEM_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GSM, NMModemGsmPrivate)) + +typedef struct { + DBusGProxyCall *call; +} NMModemGsmPrivate; + typedef enum { NM_GSM_ERROR_CONNECTION_NOT_GSM = 0, @@ -78,28 +82,22 @@ nm_gsm_error_get_type (void) } -NMDevice * +NMModem * nm_modem_gsm_new (const char *path, const char *device, const char *data_device, - const char *driver, guint32 ip_method) { g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (device != NULL, NULL); g_return_val_if_fail (data_device != NULL, NULL); - g_return_val_if_fail (driver != NULL, NULL); - return (NMDevice *) g_object_new (NM_TYPE_MODEM_GSM, - NM_DEVICE_INTERFACE_UDI, path, - NM_DEVICE_INTERFACE_IFACE, data_device, - NM_DEVICE_INTERFACE_DRIVER, driver, - NM_MODEM_PATH, path, - NM_MODEM_IP_METHOD, ip_method, - NM_MODEM_DEVICE, device, - NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", - NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, - NULL); + return (NMModem *) g_object_new (NM_TYPE_MODEM_GSM, + NM_MODEM_PATH, path, + NM_MODEM_DEVICE, device, + NM_MODEM_IFACE, data_device, + NM_MODEM_IP_METHOD, ip_method, + NULL); } static NMDeviceStateReason @@ -138,31 +136,16 @@ translate_mm_error (GError *error) } static void -clear_pin (NMDevice *device) +stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) { - NMActRequest *req; - NMConnection *connection; - NMSettingGsm *setting; - - req = nm_device_get_act_request (device); - g_assert (req); - connection = nm_act_request_get_connection (req); - g_assert (connection); - setting = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); - g_assert (setting); - - g_object_set (G_OBJECT (setting), NM_SETTING_GSM_PIN, NULL, NULL); -} - -static void -stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); + NMModemGsm *self = NM_MODEM_GSM (user_data); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); GError *error = NULL; - dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID); - if (!error) - nm_device_activate_schedule_stage2_device_config (device); + priv->call = NULL; + + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); else { const char *required_secret = NULL; gboolean retry_secret = FALSE; @@ -170,22 +153,23 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) required_secret = NM_SETTING_GSM_PIN; else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) { - clear_pin (device); required_secret = NM_SETTING_GSM_PIN; retry_secret = TRUE; - } else - nm_warning ("GSM modem connection failed: %s", error->message); + } else { + nm_warning ("GSM connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } if (required_secret) { - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - nm_act_request_get_secrets (nm_device_get_act_request (device), - NM_SETTING_GSM_SETTING_NAME, - retry_secret, - SECRETS_CALLER_GSM, - required_secret, - NULL); + g_signal_emit_by_name (self, NM_MODEM_NEED_AUTH, + NM_SETTING_GSM_SETTING_NAME, + retry_secret, + SECRETS_CALLER_MOBILE_BROADBAND, + required_secret, + NULL); } else - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, translate_mm_error (error)); g_error_free (error); } @@ -248,60 +232,41 @@ create_connect_properties (NMConnection *connection) } static NMActStageReturn -real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) { - NMActRequest *req; + NMModemGsm *self = NM_MODEM_GSM (modem); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); NMConnection *connection; - const char *setting_name; - GPtrArray *hints = NULL; - const char *hint1 = NULL, *hint2 = NULL; - guint32 tries; - req = nm_device_get_act_request (device); - g_assert (req); connection = nm_act_request_get_connection (req); g_assert (connection); - setting_name = nm_connection_need_secrets (connection, &hints); - if (!setting_name) { + *out_setting_name = nm_connection_need_secrets (connection, out_hints); + if (!*out_setting_name) { + DBusGProxy *proxy; GHashTable *properties; properties = create_connect_properties (connection); - dbus_g_proxy_begin_call_with_timeout (nm_modem_get_proxy (NM_MODEM (device), MM_DBUS_INTERFACE_MODEM_SIMPLE), - "Connect", stage1_prepare_done, - device, NULL, 120000, - DBUS_TYPE_G_MAP_OF_VARIANT, properties, - G_TYPE_INVALID); - - return NM_ACT_STAGE_RETURN_POSTPONE; + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + priv->call = dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, properties, + G_TYPE_INVALID); + g_hash_table_destroy (properties); + } else { + /* NMModem will handle requesting secrets... */ } - if (hints) { - if (hints->len > 0) - hint1 = g_ptr_array_index (hints, 0); - if (hints->len > 1) - hint2 = g_ptr_array_index (hints, 1); - } - - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - - tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); - nm_act_request_get_secrets (req, - setting_name, - tries ? TRUE : FALSE, - SECRETS_CALLER_GSM, - hint1, - hint2); - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); - - if (hints) - g_ptr_array_free (hints, TRUE); - return NM_ACT_STAGE_RETURN_POSTPONE; } static NMConnection * -real_get_best_auto_connection (NMDevice *dev, +real_get_best_auto_connection (NMModem *modem, GSList *connections, char **specific_object) { @@ -325,109 +290,8 @@ real_get_best_auto_connection (NMDevice *dev, return NULL; } -static void -real_connection_secrets_updated (NMDevice *dev, - NMConnection *connection, - GSList *updated_settings, - RequestSecretsCaller caller) -{ - NMActRequest *req; - gboolean found = FALSE; - GSList *iter; - - if (caller == SECRETS_CALLER_PPP) { - NMPPPManager *ppp_manager; - NMSettingGsm *s_gsm = NULL; - - ppp_manager = nm_modem_get_ppp_manager (NM_MODEM (dev)); - g_return_if_fail (ppp_manager != NULL); - - s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); - if (!s_gsm) { - /* Shouldn't ever happen */ - nm_ppp_manager_update_secrets (ppp_manager, - nm_device_get_iface (dev), - NULL, - NULL, - "missing GSM setting; no secrets could be found."); - } else { - const char *username = nm_setting_gsm_get_username (s_gsm); - const char *password = nm_setting_gsm_get_password (s_gsm); - - nm_ppp_manager_update_secrets (ppp_manager, - nm_device_get_iface (dev), - username ? username : "", - password ? password : "", - NULL); - } - return; - } - - g_return_if_fail (caller == SECRETS_CALLER_GSM); - g_return_if_fail (nm_device_get_state (dev) == NM_DEVICE_STATE_NEED_AUTH); - - for (iter = updated_settings; iter; iter = g_slist_next (iter)) { - const char *setting_name = (const char *) iter->data; - - if (!strcmp (setting_name, NM_SETTING_GSM_SETTING_NAME)) - found = TRUE; - else - nm_warning ("Ignoring updated secrets for setting '%s'.", setting_name); - } - - if (!found) - return; - - req = nm_device_get_act_request (dev); - g_assert (req); - - g_return_if_fail (nm_act_request_get_connection (req) == connection); - - nm_device_activate_schedule_stage1_device_prepare (dev); -} - -static NMActStageReturn -real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) -{ - NMActRequest *req; - NMConnection *connection; - - req = nm_device_get_act_request (device); - g_assert (req); - - /* Clear secrets tries counter since secrets were successfully used - * already if we get here. - */ - connection = nm_act_request_get_connection (req); - g_assert (connection); - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, NULL); - - if (NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->act_stage2_config) - return NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->act_stage2_config (device, reason); - - return NM_ACT_STAGE_RETURN_SUCCESS; -} - -static void -real_deactivate_quickly (NMDevice *device) -{ - NMActRequest *req; - NMConnection *connection; - - req = nm_device_get_act_request (device); - if (req) { - /* Clear the secrets attempts counter */ - connection = nm_act_request_get_connection (req); - g_assert (connection); - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, NULL); - } - - if (NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly) - NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly (device); -} - static gboolean -real_check_connection_compatible (NMDevice *device, +real_check_connection_compatible (NMModem *modem, NMConnection *connection, GError **error) { @@ -455,17 +319,49 @@ real_check_connection_compatible (NMDevice *device, return TRUE; } -static const char * -real_get_ppp_name (NMModem *device, NMConnection *connection) +static gboolean +real_get_user_pass (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass) { NMSettingGsm *s_gsm; s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); - g_assert (s_gsm); + if (!s_gsm) + return FALSE; - return nm_setting_gsm_get_username (s_gsm); + if (user) + *user = nm_setting_gsm_get_username (s_gsm); + if (pass) + *pass = nm_setting_gsm_get_password (s_gsm); + + return TRUE; } +static const char * +real_get_setting_name (NMModem *modem) +{ + return NM_SETTING_GSM_SETTING_NAME; +} + +static void +real_deactivate_quickly (NMModem *modem, NMDevice *device) +{ + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (modem); + + if (priv->call) { + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_cancel_call (proxy, priv->call); + priv->call = NULL; + } + + NM_MODEM_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly (modem, device); +} + + /*****************************************************************************/ static void @@ -476,21 +372,20 @@ nm_modem_gsm_init (NMModemGsm *self) static void nm_modem_gsm_class_init (NMModemGsmClass *klass) { - NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); NMModemClass *modem_class = NM_MODEM_CLASS (klass); + g_type_class_add_private (object_class, sizeof (NMModemGsmPrivate)); + /* Virtual methods */ - device_class->get_best_auto_connection = real_get_best_auto_connection; - device_class->connection_secrets_updated = real_connection_secrets_updated; - device_class->act_stage1_prepare = real_act_stage1_prepare; - device_class->act_stage2_config = real_act_stage2_config; - device_class->deactivate_quickly = real_deactivate_quickly; - device_class->check_connection_compatible = real_check_connection_compatible; + modem_class->get_user_pass = real_get_user_pass; + modem_class->get_setting_name = real_get_setting_name; + modem_class->get_best_auto_connection = real_get_best_auto_connection; + modem_class->check_connection_compatible = real_check_connection_compatible; + modem_class->act_stage1_prepare = real_act_stage1_prepare; + modem_class->deactivate_quickly = real_deactivate_quickly; - modem_class->get_ppp_name = real_get_ppp_name; - - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - &dbus_glib_nm_device_gsm_object_info); +// device_class->act_stage2_config = real_act_stage2_config; dbus_g_error_domain_register (NM_GSM_ERROR, NULL, NM_TYPE_GSM_ERROR); } diff --git a/src/modem-manager/nm-modem-gsm.h b/src/modem-manager/nm-modem-gsm.h index 4e45811641..41e9094d29 100644 --- a/src/modem-manager/nm-modem-gsm.h +++ b/src/modem-manager/nm-modem-gsm.h @@ -27,11 +27,10 @@ typedef struct { GType nm_modem_gsm_get_type (void); -NMDevice *nm_modem_gsm_new (const char *path, - const char *device, - const char *data_device, - const char *driver, - guint32 ip_method); +NMModem *nm_modem_gsm_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method); G_END_DECLS diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index 3b9f6438a6..cb43c7b725 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -8,6 +8,7 @@ #include "nm-dbus-manager.h" #include "nm-utils.h" #include "nm-modem-types.h" +#include "nm-marshal.h" #define MODEM_POKE_INTERVAL 120 @@ -24,8 +25,8 @@ typedef struct { } NMModemManagerPrivate; enum { - DEVICE_ADDED, - DEVICE_REMOVED, + MODEM_ADDED, + MODEM_REMOVED, LAST_SIGNAL }; @@ -58,9 +59,10 @@ nm_modem_manager_has_modem_for_iface (NMModemManager *manager, g_assert (iface); for (iter = g_hash_table_get_values(priv->modems); iter != NULL; iter = iter->next) { - NMDevice *device = NM_DEVICE(iter->data); - const gchar *device_iface = nm_device_get_iface (device); - if (!g_strcmp0 (iface, device_iface)) + NMModem *modem = NM_MODEM (iter->data); + const char *modem_iface = nm_modem_get_iface (modem); + + if (!g_strcmp0 (iface, modem_iface)) return TRUE; } return FALSE; @@ -162,7 +164,7 @@ static void create_modem (NMModemManager *manager, const char *path) { NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (manager); - NMDevice *device; + NMModem *modem; char *data_device = NULL, *driver = NULL, *master_device = NULL; uint modem_type = MM_MODEM_TYPE_UNKNOWN; uint ip_method = MM_MODEM_IP_METHOD_PPP; @@ -198,19 +200,20 @@ create_modem (NMModemManager *manager, const char *path) } if (modem_type == MM_MODEM_TYPE_GSM) - device = nm_modem_gsm_new (path, master_device, data_device, driver, ip_method); + modem = nm_modem_gsm_new (path, master_device, data_device, ip_method); else if (modem_type == MM_MODEM_TYPE_CDMA) - device = nm_modem_cdma_new (path, master_device, data_device, driver); + modem = nm_modem_cdma_new (path, master_device, data_device, ip_method); else g_error ("Invalid modem type"); g_free (data_device); - g_free (driver); - if (device) { - g_hash_table_insert (priv->modems, g_strdup (path), device); - g_signal_emit (manager, signals[DEVICE_ADDED], 0, device); + if (modem) { + g_hash_table_insert (priv->modems, g_strdup (path), modem); + g_signal_emit (manager, signals[MODEM_ADDED], 0, modem, driver); } + + g_free (driver); } static void @@ -227,7 +230,7 @@ modem_removed (DBusGProxy *proxy, const char *path, gpointer user_data) modem = (NMModem *) g_hash_table_lookup (priv->modems, path); if (modem) { - g_signal_emit (user_data, signals[DEVICE_REMOVED], 0, modem); + g_signal_emit (user_data, signals[MODEM_REMOVED], 0, modem); g_hash_table_remove (priv->modems, path); } } @@ -310,7 +313,7 @@ modem_manager_appeared (NMModemManager *self, gboolean enumerate_devices) static gboolean remove_one_modem (gpointer key, gpointer value, gpointer user_data) { - g_signal_emit (user_data, signals[DEVICE_REMOVED], 0, value); + g_signal_emit (user_data, signals[MODEM_REMOVED], 0, value); return TRUE; } @@ -420,23 +423,21 @@ nm_modem_manager_class_init (NMModemManagerClass *klass) object_class->dispose = dispose; /* signals */ - signals[DEVICE_ADDED] = - g_signal_new ("device-added", + signals[MODEM_ADDED] = + g_signal_new ("modem-added", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMModemManagerClass, device_added), + G_STRUCT_OFFSET (NMModemManagerClass, modem_added), NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + _nm_marshal_VOID__OBJECT_STRING, + G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_STRING); - signals[DEVICE_REMOVED] = - g_signal_new ("device-removed", + signals[MODEM_REMOVED] = + g_signal_new ("modem-removed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMModemManagerClass, device_removed), + G_STRUCT_OFFSET (NMModemManagerClass, modem_removed), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_TYPE_NONE, 1, G_TYPE_OBJECT); } diff --git a/src/modem-manager/nm-modem-manager.h b/src/modem-manager/nm-modem-manager.h index 34e99f1ec8..7402f534d0 100644 --- a/src/modem-manager/nm-modem-manager.h +++ b/src/modem-manager/nm-modem-manager.h @@ -4,7 +4,7 @@ #define NM_MODEM_MANAGER_H #include -#include "nm-device.h" +#include "nm-modem.h" #define NM_TYPE_MODEM_MANAGER (nm_modem_manager_get_type ()) #define NM_MODEM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_MANAGER, NMModemManager)) @@ -21,11 +21,9 @@ typedef struct { GObjectClass parent; /* Signals */ - void (*device_added) (NMModemManager *manager, - NMDevice *device); + void (*modem_added) (NMModemManager *manager, NMModem *modem, const char *driver); - void (*device_removed) (NMModemManager *manager, - NMDevice *device); + void (*modem_removed) (NMModemManager *manager, NMModem *modem); } NMModemManagerClass; GType nm_modem_manager_get_type (void); diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 508ff6a44e..fa39bc8ecc 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -2,27 +2,25 @@ #include #include "nm-modem.h" -#include "nm-device-private.h" #include "NetworkManagerSystem.h" -#include "nm-device-interface.h" #include "nm-dbus-manager.h" #include "nm-setting-connection.h" -#include "nm-setting-gsm.h" -#include "nm-setting-cdma.h" #include "nm-marshal.h" #include "nm-properties-changed-signal.h" #include "nm-modem-types.h" #include "nm-utils.h" -#include "nm-serial-device-glue.h" #include "NetworkManagerUtils.h" +#include "nm-device-private.h" +#include "nm-device-interface.h" -G_DEFINE_TYPE (NMModem, nm_modem, NM_TYPE_DEVICE) +G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT) #define NM_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM, NMModemPrivate)) enum { PROP_0, PROP_DEVICE, + PROP_IFACE, PROP_PATH, PROP_IP_METHOD, @@ -37,6 +35,11 @@ typedef struct { NMIP4Config *pending_ip4_config; guint32 ip_method; char *device; + char *iface; + + guint32 secrets_tries; + + DBusGProxyCall *call; /* PPP stats */ guint32 in_bytes; @@ -45,7 +48,10 @@ typedef struct { enum { PPP_STATS, - PROPERTIES_CHANGED, + PPP_FAILED, + PREPARE_RESULT, + IP4_CONFIG_RESULT, + NEED_AUTH, LAST_SIGNAL }; @@ -81,17 +87,19 @@ nm_modem_get_proxy (NMModem *self, return priv->proxy; } -const char * -nm_modem_get_ppp_name (NMModem *self, - NMConnection *connection) +static void +merge_ip4_config (NMActRequest *req, NMIP4Config *config) { - g_return_val_if_fail (NM_IS_MODEM (self), NULL); - g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + NMConnection *connection; + NMSettingIP4Config *s_ip4; - if (NM_MODEM_GET_CLASS (self)->get_ppp_name) - return NM_MODEM_GET_CLASS (self)->get_ppp_name (self, connection); + /* Merge user-defined overrides into the IP4Config to be applied */ + connection = nm_act_request_get_connection (req); + g_assert (connection); - return NULL; + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + nm_utils_merge_ip4_config (config, s_ip4); } /*****************************************************************************/ @@ -100,14 +108,12 @@ nm_modem_get_ppp_name (NMModem *self, static void ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_data) { - NMDevice *device = NM_DEVICE (user_data); - switch (status) { case NM_PPP_STATUS_DISCONNECT: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_DISCONNECT); + g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_DISCONNECT); break; case NM_PPP_STATUS_DEAD: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED); + g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_FAILED); break; default: break; @@ -120,17 +126,14 @@ ppp_ip4_config (NMPPPManager *ppp_manager, NMIP4Config *config, gpointer user_data) { - NMDevice *device = NM_DEVICE (user_data); + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); guint32 i, num; guint32 bad_dns1 = htonl (0x0A0B0C0D); guint32 good_dns1 = htonl (0x04020201); /* GTE nameserver */ guint32 bad_dns2 = htonl (0x0A0B0C0E); guint32 good_dns2 = htonl (0x04020202); /* GTE nameserver */ - /* Ignore PPP IP4 events that come in after initial configuration */ - if (nm_device_get_state (device) != NM_DEVICE_STATE_IP_CONFIG) - return; - /* Work around a PPP bug (#1732) which causes many mobile broadband * providers to return 10.11.12.13 and 10.11.12.14 for the DNS servers. * Apparently fixed in ppp-2.4.5 but we've had some reports that this is @@ -164,9 +167,8 @@ ppp_ip4_config (NMPPPManager *ppp_manager, } } - nm_device_set_ip_iface (device, iface); - NM_MODEM_GET_PRIVATE (device)->pending_ip4_config = g_object_ref (config); - nm_device_activate_schedule_stage4_ip4_config_get (device); + priv->pending_ip4_config = g_object_ref (config); + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, iface, config, NULL); } static void @@ -187,36 +189,48 @@ ppp_stats (NMPPPManager *ppp_manager, } static NMActStageReturn -ppp_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +ppp_stage3_ip4_config_start (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); - NMActRequest *req; + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); const char *ppp_name = NULL; - GError *err = NULL; + GError *error = NULL; NMActStageReturn ret; - req = nm_device_get_act_request (device); - g_assert (req); + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); - ppp_name = nm_modem_get_ppp_name (NM_MODEM (device), - nm_act_request_get_connection (req)); + if (NM_MODEM_GET_CLASS (self)->get_user_pass) { + NMConnection *connection = nm_act_request_get_connection (req); - priv->ppp_manager = nm_ppp_manager_new (nm_device_get_iface (device)); - if (nm_ppp_manager_start (priv->ppp_manager, req, ppp_name, &err)) { + g_assert (connection); + if (!NM_MODEM_GET_CLASS (self)->get_user_pass (self, connection, &ppp_name, NULL)) + return NM_ACT_STAGE_RETURN_FAILURE; + } + + priv->ppp_manager = nm_ppp_manager_new (priv->iface); + if (nm_ppp_manager_start (priv->ppp_manager, req, ppp_name, &error)) { g_signal_connect (priv->ppp_manager, "state-changed", G_CALLBACK (ppp_state_changed), - device); + self); g_signal_connect (priv->ppp_manager, "ip4-config", G_CALLBACK (ppp_ip4_config), - device); + self); g_signal_connect (priv->ppp_manager, "stats", G_CALLBACK (ppp_stats), - device); + self); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else { - nm_warning ("%s", err->message); - g_error_free (err); + nm_warning ("%s: error starting PPP: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); g_object_unref (priv->ppp_manager); priv->ppp_manager = NULL; @@ -229,20 +243,17 @@ ppp_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) } static NMActStageReturn -ppp_stage4 (NMDevice *device, NMIP4Config **config, NMDeviceStateReason *reason) +ppp_stage4 (NMModem *self, + NMActRequest *req, + NMIP4Config **config, + NMDeviceStateReason *reason) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); - NMConnection *connection; - NMSettingIP4Config *s_ip4; + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); *config = priv->pending_ip4_config; priv->pending_ip4_config = NULL; - /* Merge user-defined overrides into the IP4Config to be applied */ - connection = nm_act_request_get_connection (nm_device_get_act_request (device)); - g_assert (connection); - s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - nm_utils_merge_ip4_config (*config, s_ip4); + merge_ip4_config (req, *config); return NM_ACT_STAGE_RETURN_SUCCESS; } @@ -251,57 +262,80 @@ ppp_stage4 (NMDevice *device, NMIP4Config **config, NMDeviceStateReason *reason) /* IP method static */ static void -static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) { - NMDevice *device = NM_DEVICE (user_data); + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); GValueArray *ret_array = NULL; GError *error = NULL; - if (dbus_g_proxy_end_call (proxy, call_id, &error, + priv->call = NULL; + + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_VALUE_ARRAY, &ret_array, G_TYPE_INVALID)) { - - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); + NMIP4Config *config; NMIP4Address *addr; int i; + config = nm_ip4_config_new (); + addr = nm_ip4_address_new (); nm_ip4_address_set_address (addr, g_value_get_uint (g_value_array_get_nth (ret_array, 0))); nm_ip4_address_set_prefix (addr, 32); + nm_ip4_config_take_address (config, addr); - priv->pending_ip4_config = nm_ip4_config_new (); - nm_ip4_config_take_address (priv->pending_ip4_config, addr); - - for (i = 1; i < ret_array->n_values; i++) - nm_ip4_config_add_nameserver (priv->pending_ip4_config, - g_value_get_uint (g_value_array_get_nth (ret_array, i))); + for (i = 1; i < ret_array->n_values; i++) { + GValue *value = g_value_array_get_nth (ret_array, i); + nm_ip4_config_add_nameserver (config, g_value_get_uint (value)); + } g_value_array_free (ret_array); - nm_device_activate_schedule_stage4_ip4_config_get (device); + + priv->pending_ip4_config = g_object_ref (config); + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, config, NULL); } else { - nm_warning ("Retrieving IP4 configuration failed: %s", error->message); + nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, NULL, error); g_error_free (error); - nm_device_state_changed (device, - NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); } } static NMActStageReturn -static_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +static_stage3_ip4_config_start (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) { - dbus_g_proxy_begin_call (nm_modem_get_proxy (NM_MODEM (device), MM_DBUS_INTERFACE_MODEM), - "GetIP4Config", static_stage3_done, - device, NULL, - G_TYPE_INVALID); + NMModemPrivate *priv; + + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + priv = NM_MODEM_GET_PRIVATE (self); + + priv->call = dbus_g_proxy_begin_call (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), + "GetIP4Config", static_stage3_done, + self, NULL, + G_TYPE_INVALID); return NM_ACT_STAGE_RETURN_POSTPONE; } static NMActStageReturn -static_stage4 (NMDevice *device, NMIP4Config **config, NMDeviceStateReason *reason) +static_stage4 (NMModem *self, + NMActRequest *req, + NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); gboolean no_firmware = FALSE; if (!nm_device_hw_bring_up (device, TRUE, &no_firmware)) { @@ -315,25 +349,42 @@ static_stage4 (NMDevice *device, NMIP4Config **config, NMDeviceStateReason *reas *config = priv->pending_ip4_config; priv->pending_ip4_config = NULL; + merge_ip4_config (req, *config); + return NM_ACT_STAGE_RETURN_SUCCESS; } /*****************************************************************************/ -static NMActStageReturn -real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +NMActStageReturn +nm_modem_stage3_ip4_config_start (NMModem *self, + NMDevice *device, + NMDeviceClass *device_class, + NMDeviceStateReason *reason) { + NMActRequest *req; NMActStageReturn ret; + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device_class != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (device); + g_assert (req); + switch (NM_MODEM_GET_PRIVATE (device)->ip_method) { case MM_MODEM_IP_METHOD_PPP: - ret = ppp_stage3_ip4_config_start (device, reason); + ret = ppp_stage3_ip4_config_start (self, req, reason); break; case MM_MODEM_IP_METHOD_STATIC: - ret = static_stage3_ip4_config_start (device, reason); + ret = static_stage3_ip4_config_start (self, req, reason); break; case MM_MODEM_IP_METHOD_DHCP: - ret = NM_DEVICE_CLASS (nm_modem_parent_class)->act_stage3_ip4_config_start (device, reason); + ret = device_class->act_stage3_ip4_config_start (device, reason); break; default: g_warning ("Invalid IP method"); @@ -344,22 +395,36 @@ real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) return ret; } -static NMActStageReturn -real_act_stage4_get_ip4_config (NMDevice *device, +NMActStageReturn +nm_modem_stage4_get_ip4_config (NMModem *self, + NMDevice *device, + NMDeviceClass *device_class, NMIP4Config **config, NMDeviceStateReason *reason) { + NMActRequest *req; NMActStageReturn ret; - switch (NM_MODEM_GET_PRIVATE (device)->ip_method) { + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device_class != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (device); + g_assert (req); + + switch (NM_MODEM_GET_PRIVATE (self)->ip_method) { case MM_MODEM_IP_METHOD_PPP: - ret = ppp_stage4 (device, config, reason); + ret = ppp_stage4 (self, req, config, reason); break; case MM_MODEM_IP_METHOD_STATIC: - ret = static_stage4 (device, config, reason); + ret = static_stage4 (self, req, device, config, reason); break; case MM_MODEM_IP_METHOD_DHCP: - ret = NM_DEVICE_CLASS (nm_modem_parent_class)->act_stage4_get_ip4_config (device, config, reason); + ret = device_class->act_stage4_get_ip4_config (device, config, reason); break; default: g_warning ("Invalid IP method"); @@ -370,12 +435,155 @@ real_act_stage4_get_ip4_config (NMDevice *device, return ret; } -static void -real_deactivate_quickly (NMDevice *device) +gboolean +nm_modem_connection_secrets_updated (NMModem *self, + NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); + NMModemPrivate *priv; + gboolean found = FALSE; + const char *setting_name; + GSList *iter; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (self), FALSE); + g_return_val_if_fail (req != NULL, FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + priv = NM_MODEM_GET_PRIVATE (self); + + if (caller == SECRETS_CALLER_PPP) { + const char *user = NULL; + const char *pass = NULL; + + g_return_val_if_fail (priv->ppp_manager != NULL, FALSE); + + if (!NM_MODEM_GET_CLASS (self)->get_user_pass (self, connection, &user, &pass)) { + /* Shouldn't ever happen */ + nm_ppp_manager_update_secrets (priv->ppp_manager, + priv->iface, + NULL, + NULL, + "missing GSM/CDMA setting; no secrets could be found."); + } else { + nm_ppp_manager_update_secrets (priv->ppp_manager, + priv->iface, + user ? user : "", + pass ? pass : "", + NULL); + } + return TRUE; + } + + g_return_val_if_fail (caller == SECRETS_CALLER_MOBILE_BROADBAND, FALSE); + + g_assert (NM_MODEM_GET_CLASS (self)->get_setting_name); + setting_name = NM_MODEM_GET_CLASS (self)->get_setting_name (self); + + for (iter = updated_settings; iter; iter = g_slist_next (iter)) { + const char *candidate_setting_name = (const char *) iter->data; + + if (!strcmp (candidate_setting_name, setting_name)) + found = TRUE; + else { + nm_warning ("Ignoring updated secrets for setting '%s'.", + candidate_setting_name); + } + } + + return found; +} + +static NMActStageReturn +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) +{ + *reason = NM_DEVICE_STATE_REASON_UNKNOWN; + return NM_ACT_STAGE_RETURN_FAILURE; +} + +NMActStageReturn +nm_modem_act_stage1_prepare (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + NMActStageReturn ret; + GPtrArray *hints = NULL; + const char *setting_name = NULL; + + ret = NM_MODEM_GET_CLASS (self)->act_stage1_prepare (self, + req, + &hints, + &setting_name, + reason); + if ((ret == NM_ACT_STAGE_RETURN_POSTPONE) && setting_name) { + const char *hint1 = NULL, *hint2 = NULL; + + /* Need some secrets */ + if (hints) { + if (hints->len > 0) + hint1 = g_ptr_array_index (hints, 0); + if (hints->len > 1) + hint2 = g_ptr_array_index (hints, 1); + } + + g_signal_emit (self, signals[NEED_AUTH], 0, + setting_name, + priv->secrets_tries++ ? TRUE : FALSE, + SECRETS_CALLER_MOBILE_BROADBAND, + hint1, + hint2); + + if (hints) + g_ptr_array_free (hints, TRUE); + } + + return ret; +} + +NMActStageReturn +nm_modem_act_stage2_config (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + + /* Clear secrets tries counter since secrets were successfully used + * already if we get here. + */ + priv->secrets_tries = 0; + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +static void +real_deactivate_quickly (NMModem *self, NMDevice *device) +{ + NMModemPrivate *priv; const char *iface; + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); + g_return_if_fail (device != NULL); + g_return_if_fail (NM_IS_DEVICE (device)); + + priv = NM_MODEM_GET_PRIVATE (self); + + priv->secrets_tries = 0; + + if (priv->call) { + dbus_g_proxy_cancel_call (priv->proxy, priv->call); + priv->call = NULL; + } + if (priv->pending_ip4_config) { g_object_unref (priv->pending_ip4_config); priv->pending_ip4_config = NULL; @@ -383,7 +591,7 @@ real_deactivate_quickly (NMDevice *device) priv->in_bytes = priv->out_bytes = 0; - switch (NM_MODEM_GET_PRIVATE (device)->ip_method) { + switch (priv->ip_method) { case MM_MODEM_IP_METHOD_PPP: if (priv->ppp_manager) { g_object_unref (priv->ppp_manager); @@ -392,8 +600,7 @@ real_deactivate_quickly (NMDevice *device) break; case MM_MODEM_IP_METHOD_STATIC: case MM_MODEM_IP_METHOD_DHCP: - iface = nm_device_get_iface (device); - + iface = nm_device_get_ip_iface (device); nm_system_device_flush_routes_with_iface (iface); nm_system_device_flush_addresses_with_iface (iface); nm_system_device_set_up_down_with_iface (iface, FALSE, NULL); @@ -402,38 +609,34 @@ real_deactivate_quickly (NMDevice *device) g_warning ("Invalid IP method"); break; } - - if (NM_DEVICE_CLASS (nm_modem_parent_class)->deactivate) - NM_DEVICE_CLASS (nm_modem_parent_class)->deactivate (device); } -static guint32 -real_get_generic_capabilities (NMDevice *dev) +void +nm_modem_deactivate_quickly (NMModem *self, NMDevice *device) { - return NM_DEVICE_CAP_NM_SUPPORTED; + NM_MODEM_GET_CLASS (self)->deactivate_quickly (self, device); } -static void -device_state_changed (NMDeviceInterface *device, - NMDeviceState new_state, - NMDeviceState old_state, - NMDeviceStateReason reason, - gpointer user_data) +void +nm_modem_device_state_changed (NMModem *self, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason) { - NMModem *self = NM_MODEM (user_data); - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); /* Make sure we don't leave the serial device open */ switch (new_state) { case NM_DEVICE_STATE_NEED_AUTH: - if (priv->ppp_manager) + if (NM_MODEM_GET_PRIVATE (self)->ppp_manager) break; /* else fall through */ case NM_DEVICE_STATE_UNMANAGED: case NM_DEVICE_STATE_UNAVAILABLE: case NM_DEVICE_STATE_FAILED: case NM_DEVICE_STATE_DISCONNECTED: - dbus_g_proxy_call_no_reply (nm_modem_get_proxy (self, NULL), + dbus_g_proxy_call_no_reply (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), "Enable", G_TYPE_BOOLEAN, FALSE, G_TYPE_INVALID); @@ -443,13 +646,13 @@ device_state_changed (NMDeviceInterface *device, } } -static gboolean -real_hw_is_up (NMDevice *device) +gboolean +nm_modem_hw_is_up (NMModem *self, NMDevice *device) { - guint32 ip_method = NM_MODEM_GET_PRIVATE (device)->ip_method; + guint32 ip_method = NM_MODEM_GET_PRIVATE (self)->ip_method; if (ip_method == MM_MODEM_IP_METHOD_STATIC || ip_method == MM_MODEM_IP_METHOD_DHCP) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); NMDeviceState state; state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); @@ -460,13 +663,13 @@ real_hw_is_up (NMDevice *device) return TRUE; } -static gboolean -real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +gboolean +nm_modem_hw_bring_up (NMModem *self, NMDevice *device, gboolean *no_firmware) { - guint32 ip_method = NM_MODEM_GET_PRIVATE (device)->ip_method; + guint32 ip_method = NM_MODEM_GET_PRIVATE (self)->ip_method; if (ip_method == MM_MODEM_IP_METHOD_STATIC || ip_method == MM_MODEM_IP_METHOD_DHCP) { - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (device); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); NMDeviceState state; state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); @@ -477,6 +680,15 @@ real_hw_bring_up (NMDevice *device, gboolean *no_firmware) return TRUE; } +const char * +nm_modem_get_iface (NMModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + return NM_MODEM_GET_PRIVATE (self)->iface; +} + /*****************************************************************************/ static void @@ -504,7 +716,12 @@ constructor (GType type, priv = NM_MODEM_GET_PRIVATE (object); if (!priv->device) { - g_warning ("Modem device not provided"); + g_warning ("Modem parent device not provided"); + goto err; + } + + if (!priv->device) { + g_warning ("Modem command interface not provided"); goto err; } @@ -516,8 +733,6 @@ constructor (GType type, priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), MM_DBUS_SERVICE, priv->path, MM_DBUS_INTERFACE_MODEM); - g_signal_connect (object, "state-changed", G_CALLBACK (device_state_changed), object); - return object; err: @@ -538,6 +753,9 @@ get_property (GObject *object, guint prop_id, case PROP_DEVICE: g_value_set_string (value, priv->device); break; + case PROP_IFACE: + g_value_set_string (value, priv->iface); + break; case PROP_IP_METHOD: g_value_set_uint (value, priv->ip_method); break; @@ -563,7 +781,12 @@ set_property (GObject *object, guint prop_id, /* Construct only */ priv->device = g_value_dup_string (value); break; + case PROP_IFACE: + /* Construct only */ + priv->iface = g_value_dup_string (value); + break; case PROP_IP_METHOD: + /* Construct only */ priv->ip_method = g_value_get_uint (value); break; default: @@ -582,6 +805,7 @@ finalize (GObject *object) g_object_unref (priv->dbus_mgr); + g_free (priv->iface); g_free (priv->path); g_free (priv->device); @@ -592,7 +816,6 @@ static void nm_modem_class_init (NMModemClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); g_type_class_add_private (object_class, sizeof (NMModemPrivate)); @@ -602,12 +825,8 @@ nm_modem_class_init (NMModemClass *klass) object_class->get_property = get_property; object_class->finalize = finalize; - device_class->get_generic_capabilities = real_get_generic_capabilities; - device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; - device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; - device_class->deactivate_quickly = real_deactivate_quickly; - device_class->hw_is_up = real_hw_is_up; - device_class->hw_bring_up = real_hw_bring_up; + klass->act_stage1_prepare = real_act_stage1_prepare; + klass->deactivate_quickly = real_deactivate_quickly; /* Properties */ g_object_class_install_property @@ -616,7 +835,7 @@ nm_modem_class_init (NMModemClass *klass) "DBus path", "DBus path", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_DEVICE, @@ -624,7 +843,15 @@ nm_modem_class_init (NMModemClass *klass) "Device", "Master modem parent device", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_IFACE, + g_param_spec_string (NM_MODEM_IFACE, + "Interface", + "Modem command interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_IP_METHOD, @@ -634,7 +861,7 @@ nm_modem_class_init (NMModemClass *klass) MM_MODEM_IP_METHOD_PPP, MM_MODEM_IP_METHOD_DHCP, MM_MODEM_IP_METHOD_PPP, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /* Signals */ signals[PPP_STATS] = @@ -647,10 +874,41 @@ nm_modem_class_init (NMModemClass *klass) G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - signals[PROPERTIES_CHANGED] = - nm_properties_changed_signal_new (object_class, - G_STRUCT_OFFSET (NMModemClass, properties_changed)); + signals[PPP_FAILED] = + g_signal_new ("ppp-failed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, ppp_failed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - &dbus_glib_nm_serial_device_object_info); + signals[IP4_CONFIG_RESULT] = + g_signal_new (NM_MODEM_IP4_CONFIG_RESULT, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, ip4_config_result), + NULL, NULL, + _nm_marshal_VOID__STRING_OBJECT_POINTER, + G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_OBJECT, G_TYPE_POINTER); + + signals[PREPARE_RESULT] = + g_signal_new (NM_MODEM_PREPARE_RESULT, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, prepare_result), + NULL, NULL, + _nm_marshal_VOID__BOOLEAN_UINT, + G_TYPE_NONE, 2, G_TYPE_BOOLEAN, G_TYPE_UINT); + + signals[NEED_AUTH] = + g_signal_new (NM_MODEM_NEED_AUTH, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, need_auth), + NULL, NULL, + _nm_marshal_VOID__STRING_BOOLEAN_UINT_STRING_STRING, + G_TYPE_NONE, 5, + G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); } + diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h index cd638039f7..ec4f91fac1 100644 --- a/src/modem-manager/nm-modem.h +++ b/src/modem-manager/nm-modem.h @@ -4,8 +4,9 @@ #define NM_MODEM_H #include -#include +#include #include "ppp-manager/nm-ppp-manager.h" +#include "nm-device.h" G_BEGIN_DECLS @@ -18,33 +19,101 @@ G_BEGIN_DECLS #define NM_MODEM_PATH "path" #define NM_MODEM_DEVICE "device" +#define NM_MODEM_IFACE "iface" #define NM_MODEM_IP_METHOD "ip-method" +#define NM_MODEM_PREPARE_RESULT "prepare-result" +#define NM_MODEM_IP4_CONFIG_RESULT "ip4-config-result" +#define NM_MODEM_NEED_AUTH "need-auth" + typedef struct { - NMDevice parent; + GObject parent; } NMModem; typedef struct { - NMDeviceClass parent; + GObjectClass parent; - const char *(*get_ppp_name) (NMModem *self, - NMConnection *connection); + gboolean (*get_user_pass) (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass); + + const char * (*get_setting_name) (NMModem *modem); + + gboolean (*check_connection_compatible) (NMModem *modem, + NMConnection *connection, + GError **error); + + NMConnection * (*get_best_auto_connection) (NMModem *modem, + GSList *connections, + char **specific_object); + + NMActStageReturn (*act_stage1_prepare) (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason); + + void (*deactivate_quickly) (NMModem *self, NMDevice *device); /* Signals */ - void (*ppp_stats) (NMModem *self, guint32 in_bytes, guint32 out_bytes); - void (*properties_changed) (NMModem *self, GHashTable *properties); + void (*ppp_stats) (NMModem *self, guint32 in_bytes, guint32 out_bytes); + void (*ppp_failed) (NMModem *self, NMDeviceStateReason reason); + + void (*prepare_result) (NMModem *self, gboolean success, NMDeviceStateReason reason); + void (*ip4_config_result) (NMModem *self, const char *iface, NMIP4Config *config, GError *error); + + void (*need_auth) (NMModem *self, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2); } NMModemClass; GType nm_modem_get_type (void); /* Protected */ -NMPPPManager *nm_modem_get_ppp_manager (NMModem *self); -DBusGProxy *nm_modem_get_proxy (NMModem *self, - const char *interface); +NMPPPManager *nm_modem_get_ppp_manager (NMModem *modem); +DBusGProxy * nm_modem_get_proxy (NMModem *modem, const char *interface); +const char * nm_modem_get_iface (NMModem *modem); -const char *nm_modem_get_ppp_name (NMModem *self, - NMConnection *connection); +NMActStageReturn nm_modem_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_act_stage2_config (NMModem *modem, + NMActRequest *req, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_stage3_ip4_config_start (NMModem *modem, + NMDevice *device, + NMDeviceClass *device_class, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_stage4_get_ip4_config (NMModem *modem, + NMDevice *device, + NMDeviceClass *device_class, + NMIP4Config **config, + NMDeviceStateReason *reason); + +void nm_modem_deactivate_quickly (NMModem *modem, NMDevice *device); + +void nm_modem_device_state_changed (NMModem *modem, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason); + +gboolean nm_modem_hw_is_up (NMModem *modem, NMDevice *device); + +gboolean nm_modem_hw_bring_up (NMModem *modem, NMDevice *device, gboolean *no_firmware); + +gboolean nm_modem_connection_secrets_updated (NMModem *modem, + NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller); G_END_DECLS diff --git a/src/nm-secrets-provider-interface.h b/src/nm-secrets-provider-interface.h index 299e8c2dc8..3d9e08b186 100644 --- a/src/nm-secrets-provider-interface.h +++ b/src/nm-secrets-provider-interface.h @@ -28,8 +28,7 @@ typedef enum { SECRETS_CALLER_NONE = 0, SECRETS_CALLER_ETHERNET, SECRETS_CALLER_WIFI, - SECRETS_CALLER_GSM, - SECRETS_CALLER_CDMA, + SECRETS_CALLER_MOBILE_BROADBAND, SECRETS_CALLER_PPP, SECRETS_CALLER_VPN } RequestSecretsCaller; From e4e9d4099819b108738a2d4ab0c46713c946f6b8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 4 Oct 2009 23:35:20 -0700 Subject: [PATCH 002/392] modem: re-implement CDMA device on top of generic modem code --- src/Makefile.am | 2 + src/modem-manager/nm-modem-cdma.c | 2 - src/modem-manager/nm-modem-gsm.c | 2 - src/modem-manager/nm-modem.c | 44 +++- src/modem-manager/nm-modem.h | 11 + src/nm-device-cdma.c | 378 ++++++++++++++++++++++++++++++ src/nm-device-cdma.h | 56 +++++ src/nm-manager.c | 52 ++-- 8 files changed, 511 insertions(+), 36 deletions(-) create mode 100644 src/nm-device-cdma.c create mode 100644 src/nm-device-cdma.h diff --git a/src/Makefile.am b/src/Makefile.am index fb337a6bb4..4fb955dd2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,6 +74,8 @@ NetworkManager_SOURCES = \ nm-device-olpc-mesh.h \ nm-device-bt.c \ nm-device-bt.h \ + nm-device-cdma.c \ + nm-device-cdma.h \ NetworkManagerAP.c \ NetworkManagerAP.h \ nm-dbus-manager.h \ diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index c69559710d..f5964d4276 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.c @@ -13,8 +13,6 @@ #include "nm-utils.h" #include "NetworkManagerUtils.h" -#include "nm-device-cdma-glue.h" - G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM) #define NM_MODEM_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_CDMA, NMModemCdmaPrivate)) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index b178590c00..0a631d3aba 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -11,8 +11,6 @@ #include "nm-utils.h" #include "NetworkManagerUtils.h" -#include "nm-device-gsm-glue.h" - typedef enum { MM_MODEM_GSM_MODE_UNKNOWN = 0x00000000, MM_MODEM_GSM_MODE_ANY = 0x00000001, diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index fa39bc8ecc..0b91efd12f 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -268,13 +268,13 @@ static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); GValueArray *ret_array = NULL; GError *error = NULL; + NMIP4Config *config = NULL; priv->call = NULL; if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_VALUE_ARRAY, &ret_array, G_TYPE_INVALID)) { - NMIP4Config *config; NMIP4Address *addr; int i; @@ -285,7 +285,7 @@ static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) nm_ip4_address_set_prefix (addr, 32); nm_ip4_config_take_address (config, addr); - for (i = 1; i < ret_array->n_values; i++) { + for (i = 0; i < ret_array->n_values; i++) { GValue *value = g_value_array_get_nth (ret_array, i); nm_ip4_config_add_nameserver (config, g_value_get_uint (value)); @@ -294,15 +294,10 @@ static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) priv->pending_ip4_config = g_object_ref (config); g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, config, NULL); - } else { - nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - - g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, NULL, error); - g_error_free (error); } + + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, config, error); + g_clear_error (&error); } static NMActStageReturn @@ -564,6 +559,26 @@ nm_modem_act_stage2_config (NMModem *self, return NM_ACT_STAGE_RETURN_SUCCESS; } +NMConnection * +nm_modem_get_best_auto_connection (NMModem *self, + GSList *connections, + char **specific_object) +{ + if (NM_MODEM_GET_CLASS (self)->get_best_auto_connection) + return NM_MODEM_GET_CLASS (self)->get_best_auto_connection (self, connections, specific_object); + return NULL; +} + +gboolean +nm_modem_check_connection_compatible (NMModem *self, + NMConnection *connection, + GError **error) +{ + if (NM_MODEM_GET_CLASS (self)->check_connection_compatible) + return NM_MODEM_GET_CLASS (self)->check_connection_compatible (self, connection, error); + return FALSE; +} + static void real_deactivate_quickly (NMModem *self, NMDevice *device) { @@ -689,6 +704,15 @@ nm_modem_get_iface (NMModem *self) return NM_MODEM_GET_PRIVATE (self)->iface; } +const char * +nm_modem_get_path (NMModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + return NM_MODEM_GET_PRIVATE (self)->path; +} + /*****************************************************************************/ static void diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h index ec4f91fac1..b8af89fb78 100644 --- a/src/modem-manager/nm-modem.h +++ b/src/modem-manager/nm-modem.h @@ -22,6 +22,8 @@ G_BEGIN_DECLS #define NM_MODEM_IFACE "iface" #define NM_MODEM_IP_METHOD "ip-method" +#define NM_MODEM_PPP_STATS "ppp-stats" +#define NM_MODEM_PPP_FAILED "ppp-failed" #define NM_MODEM_PREPARE_RESULT "prepare-result" #define NM_MODEM_IP4_CONFIG_RESULT "ip4-config-result" #define NM_MODEM_NEED_AUTH "need-auth" @@ -78,6 +80,15 @@ GType nm_modem_get_type (void); NMPPPManager *nm_modem_get_ppp_manager (NMModem *modem); DBusGProxy * nm_modem_get_proxy (NMModem *modem, const char *interface); const char * nm_modem_get_iface (NMModem *modem); +const char * nm_modem_get_path (NMModem *modem); + +NMConnection *nm_modem_get_best_auto_connection (NMModem *self, + GSList *connections, + char **specific_object); + +gboolean nm_modem_check_connection_compatible (NMModem *self, + NMConnection *connection, + GError **error); NMActStageReturn nm_modem_act_stage1_prepare (NMModem *modem, NMActRequest *req, diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c new file mode 100644 index 0000000000..0fc721b410 --- /dev/null +++ b/src/nm-device-cdma.c @@ -0,0 +1,378 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + */ + +#include + +#include "nm-dbus-glib-types.h" +#include "nm-modem.h" +#include "nm-modem-cdma.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-device-cdma.h" +#include "nm-utils.h" +#include "NetworkManagerUtils.h" +#include "nm-marshal.h" +#include "nm-properties-changed-signal.h" + +#include "nm-device-cdma-glue.h" +#include "nm-serial-device-glue.h" + +G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE) + +#define NM_DEVICE_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaPrivate)) + +typedef struct { + gboolean disposed; + + NMModem *modem; +} NMDeviceCdmaPrivate; + +enum { + PPP_STATS, + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (NM_DEVICE_CDMA (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + break; + default: + break; + } +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); + + nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_modem_hw_is_up (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, device); +} + +static gboolean +real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +{ + return nm_modem_hw_bring_up (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, device, no_firmware); +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *device, + GSList *connections, + char **specific_object) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); + + return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); +} + +static void +real_connection_secrets_updated (NMDevice *device, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + return; + } + + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; + + /* Otherwise, on success for CDMA secrets we need to schedule stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + nm_device_activate_schedule_stage1_device_prepare (device); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); + + return nm_modem_check_connection_compatible (priv->modem, connection, error); +} + + +static void +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMDeviceCdma *self = NM_DEVICE_CDMA (self); + NMActRequest *req; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); +} + +static void +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); + + if (success) + nm_device_activate_schedule_stage2_device_config (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage1_prepare (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage2_config (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, req, reason); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); + } +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + return nm_modem_stage3_ip4_config_start (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_cdma_parent_class), + reason); +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + return nm_modem_stage4_get_ip4_config (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_cdma_parent_class), + config, + reason); +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); + + nm_modem_deactivate_quickly (priv->modem, device); +} + +static guint32 +real_get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_NM_SUPPORTED; +} + +/*****************************************************************************/ + +NMDevice * +nm_device_cdma_new (NMModemCdma *modem, const char *driver) +{ + NMDevice *device; + + g_return_val_if_fail (modem != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM_CDMA (modem), NULL); + g_return_val_if_fail (driver != NULL, NULL); + + device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_CDMA, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, + NULL); + if (device) { + NM_DEVICE_CDMA_GET_PRIVATE (device)->modem = g_object_ref (modem); + g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); + } + + return device; +} + +static void +nm_device_cdma_init (NMDeviceCdma *self) +{ +} + +static void +dispose (GObject *object) +{ + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_cdma_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + g_object_unref (priv->modem); + priv->modem = NULL; + + G_OBJECT_CLASS (nm_device_cdma_parent_class)->dispose (object); +} + +static void +nm_device_cdma_class_init (NMDeviceCdmaClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceCdmaPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + + device_class->get_best_auto_connection = real_get_best_auto_connection; + device_class->connection_secrets_updated = real_connection_secrets_updated; + device_class->check_connection_compatible = real_check_connection_compatible; + device_class->hw_is_up = real_hw_is_up; + device_class->hw_bring_up = real_hw_bring_up; + device_class->get_generic_capabilities = real_get_generic_capabilities; + device_class->act_stage1_prepare = real_act_stage1_prepare; + device_class->act_stage2_config = real_act_stage2_config; + device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + device_class->deactivate_quickly = real_deactivate_quickly; + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceCdmaClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceCdmaClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_serial_device_object_info); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_cdma_object_info); +} + diff --git a/src/nm-device-cdma.h b/src/nm-device-cdma.h new file mode 100644 index 0000000000..ec4496d742 --- /dev/null +++ b/src/nm-device-cdma.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_CDMA_H +#define NM_DEVICE_CDMA_H + +#include "nm-device.h" +#include "nm-modem-cdma.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_CDMA (nm_device_cdma_get_type ()) +#define NM_DEVICE_CDMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_CDMA, NMDeviceCdma)) +#define NM_DEVICE_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaClass)) +#define NM_IS_DEVICE_CDMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_CDMA)) +#define NM_IS_DEVICE_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_CDMA)) +#define NM_DEVICE_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaClass)) + +typedef struct { + NMDevice parent; +} NMDeviceCdma; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*signal_quality) (NMDeviceCdma *self, guint32 quality); + + void (*ppp_stats) (NMDeviceCdma *self, guint32 in_bytes, guint32 out_bytes); + void (*properties_changed) (NMDeviceCdma *self, GHashTable *properties); +} NMDeviceCdmaClass; + +GType nm_device_cdma_get_type (void); + +NMDevice *nm_device_cdma_new (NMModemCdma *modem, const char *driver); + +G_END_DECLS + +#endif /* NM_DEVICE_CDMA_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index 416df1ac3e..18c5df4627 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -37,6 +37,8 @@ #include "nm-device-ethernet.h" #include "nm-device-wifi.h" #include "nm-device-olpc-mesh.h" +#include "nm-device-cdma.h" +//#include "nm-device-gsm.h" #include "NetworkManagerSystem.h" #include "nm-properties-changed-signal.h" #include "nm-setting-bluetooth.h" @@ -135,6 +137,8 @@ remove_one_device (NMManager *manager, gboolean quitting, gboolean force_unmanage); +static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); + #define SSD_POKE_INTERVAL 120 #define ORIGDEV_TAG "originating-device" @@ -289,26 +293,16 @@ vpn_manager_connection_deactivated_cb (NMVPNManager *manager, static void modem_added (NMModemManager *modem_manager, - NMDevice *modem, + NMModem *modem, + const char *driver, gpointer user_data) { - NMManagerPrivate *priv; - NMDeviceType type; - NMDevice *replace_device; - const char *type_name; + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMDevice *replace_device, *device = NULL; const char *ip_iface; - priv = NM_MANAGER_GET_PRIVATE (user_data); - - type = nm_device_get_device_type (NM_DEVICE (modem)); - if (type == NM_DEVICE_TYPE_GSM) - type_name = "GSM modem"; - else if (type == NM_DEVICE_TYPE_CDMA) - type_name = "CDMA modem"; - else - type_name = "Unknown modem"; - - ip_iface = nm_device_get_ip_iface (modem); + ip_iface = nm_modem_get_iface (modem); replace_device = find_device_by_iface (NM_MANAGER (user_data), ip_iface); if (replace_device) { @@ -319,7 +313,18 @@ modem_added (NMModemManager *modem_manager, TRUE); } - add_device (NM_MANAGER (user_data), NM_DEVICE (g_object_ref (modem))); +#if 0 + if (NM_IS_MODEM_GSM (modem)) + device = nm_device_gsm_new (NM_MODEM_GSM (modem), driver); + else +#endif + if (NM_IS_MODEM_CDMA (modem)) + device = nm_device_cdma_new (NM_MODEM_CDMA (modem), driver); + else + g_message ("%s: unhandled modem '%s'", __func__, ip_iface); + + if (device) + add_device (self, device); } static void @@ -417,13 +422,16 @@ remove_one_device (NMManager *manager, static void modem_removed (NMModemManager *modem_manager, - NMDevice *modem, + NMModem *modem, gpointer user_data) { NMManager *self = NM_MANAGER (user_data); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMDevice *found; - priv->devices = remove_one_device (self, priv->devices, modem, FALSE, TRUE); + found = nm_manager_get_device_by_udi (self, nm_modem_get_path (modem)); + if (found) + priv->devices = remove_one_device (self, priv->devices, found, FALSE, TRUE); } static void @@ -1208,7 +1216,7 @@ add_device (NMManager *self, NMDevice *device) iface = nm_device_get_ip_iface (device); g_assert (iface); - if (!NM_IS_MODEM(device) && nm_modem_manager_has_modem_for_iface (priv->modem_manager, iface)) { + if (!NM_IS_MODEM (device) && nm_modem_manager_has_modem_for_iface (priv->modem_manager, iface)) { g_object_unref (device); return; } @@ -2770,9 +2778,9 @@ nm_manager_init (NMManager *manager) g_object_unref); priv->modem_manager = nm_modem_manager_get (); - priv->modem_added_id = g_signal_connect (priv->modem_manager, "device-added", + priv->modem_added_id = g_signal_connect (priv->modem_manager, "modem-added", G_CALLBACK (modem_added), manager); - priv->modem_removed_id = g_signal_connect (priv->modem_manager, "device-removed", + priv->modem_removed_id = g_signal_connect (priv->modem_manager, "modem-removed", G_CALLBACK (modem_removed), manager); priv->vpn_manager = nm_vpn_manager_get (); From 66fbf31a19891224d612a6731f4c407c24d73538 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 4 Oct 2009 23:57:51 -0700 Subject: [PATCH 003/392] modem: fix stage3 IP config kickoff --- src/modem-manager/nm-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 0b91efd12f..ace65cf35d 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -371,7 +371,7 @@ nm_modem_stage3_ip4_config_start (NMModem *self, req = nm_device_get_act_request (device); g_assert (req); - switch (NM_MODEM_GET_PRIVATE (device)->ip_method) { + switch (NM_MODEM_GET_PRIVATE (self)->ip_method) { case MM_MODEM_IP_METHOD_PPP: ret = ppp_stage3_ip4_config_start (self, req, reason); break; From ac739e3311f4d91e4e42f017700b69d85619e3ea Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 4 Oct 2009 23:59:20 -0700 Subject: [PATCH 004/392] manager: fix up composite modem device detection and suppression Some modems have their ethernet interface show up only on connect, and we want NM to ignore the ethernet interface as a top-level device. --- src/modem-manager/nm-modem-manager.c | 20 -------------------- src/modem-manager/nm-modem-manager.h | 3 --- src/nm-manager.c | 16 +++++++--------- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index cb43c7b725..df71f3d088 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -48,26 +48,6 @@ nm_modem_manager_get (void) return singleton; } -gboolean -nm_modem_manager_has_modem_for_iface (NMModemManager *manager, - const gchar *iface) -{ - NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (manager); - GList *iter; - g_assert (manager); - g_assert (NM_IS_MODEM_MANAGER(manager)); - g_assert (iface); - - for (iter = g_hash_table_get_values(priv->modems); iter != NULL; iter = iter->next) { - NMModem *modem = NM_MODEM (iter->data); - const char *modem_iface = nm_modem_get_iface (modem); - - if (!g_strcmp0 (iface, modem_iface)) - return TRUE; - } - return FALSE; -} - static gboolean get_modem_properties (DBusGConnection *connection, const char *path, diff --git a/src/modem-manager/nm-modem-manager.h b/src/modem-manager/nm-modem-manager.h index 7402f534d0..19b991a381 100644 --- a/src/modem-manager/nm-modem-manager.h +++ b/src/modem-manager/nm-modem-manager.h @@ -30,7 +30,4 @@ GType nm_modem_manager_get_type (void); NMModemManager *nm_modem_manager_get (void); -gboolean nm_modem_manager_has_modem_for_iface (NMModemManager *manager, - const gchar *iface); - #endif /* NM_MODEM_MANAGER_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index 66b50ea26c..e27fb94e31 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -127,15 +127,13 @@ static const char *internal_activate_device (NMManager *manager, gboolean assumed, GError **error); -static NMDevice * -find_device_by_iface (NMManager *self, const gchar *iface); +static NMDevice *find_device_by_iface (NMManager *self, const gchar *iface); -static GSList * -remove_one_device (NMManager *manager, - GSList *list, - NMDevice *device, - gboolean quitting, - gboolean force_unmanage); +static GSList * remove_one_device (NMManager *manager, + GSList *list, + NMDevice *device, + gboolean quitting, + gboolean force_unmanage); static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); @@ -1214,7 +1212,7 @@ add_device (NMManager *self, NMDevice *device) iface = nm_device_get_ip_iface (device); g_assert (iface); - if (!NM_IS_MODEM (device) && nm_modem_manager_has_modem_for_iface (priv->modem_manager, iface)) { + if (!NM_IS_MODEM (device) && find_device_by_iface (self, iface)) { g_object_unref (device); return; } From 8822f7565266e60c328a61aff729c11ca64184b8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Oct 2009 00:05:09 -0700 Subject: [PATCH 005/392] cdma: fix device dispose Move modem destruction from dispose -> finalize, because the superclass still needs to use the device at dispose time. --- src/nm-device-cdma.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 0fc721b410..4f4ee55812 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -39,8 +39,6 @@ G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE) #define NM_DEVICE_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaPrivate)) typedef struct { - gboolean disposed; - NMModem *modem; } NMDeviceCdmaPrivate; @@ -315,20 +313,14 @@ nm_device_cdma_init (NMDeviceCdma *self) } static void -dispose (GObject *object) +finalize (GObject *object) { NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (object); - if (priv->disposed) { - G_OBJECT_CLASS (nm_device_cdma_parent_class)->dispose (object); - return; - } - priv->disposed = TRUE; - g_object_unref (priv->modem); priv->modem = NULL; - G_OBJECT_CLASS (nm_device_cdma_parent_class)->dispose (object); + G_OBJECT_CLASS (nm_device_cdma_parent_class)->finalize (object); } static void @@ -340,7 +332,7 @@ nm_device_cdma_class_init (NMDeviceCdmaClass *klass) g_type_class_add_private (object_class, sizeof (NMDeviceCdmaPrivate)); /* Virtual methods */ - object_class->dispose = dispose; + object_class->finalize = finalize; device_class->get_best_auto_connection = real_get_best_auto_connection; device_class->connection_secrets_updated = real_connection_secrets_updated; From 9fb584242ca3cfa4a4a62b74fc11d8e37dc38f13 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Oct 2009 00:13:01 -0700 Subject: [PATCH 006/392] modem: kill active connections on shutdown --- src/modem-manager/nm-modem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index ace65cf35d..0eb1d9102f 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -624,6 +624,14 @@ real_deactivate_quickly (NMModem *self, NMDevice *device) g_warning ("Invalid IP method"); break; } + + /* Stop the modem and any ongoing connection... */ + if (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + dbus_g_proxy_call_no_reply (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), + "Enable", + G_TYPE_BOOLEAN, FALSE, + G_TYPE_INVALID); + } } void From 55bb7a85fd2e23f97578b0a6d912fa7ffb2bdc46 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Oct 2009 00:42:53 -0700 Subject: [PATCH 007/392] modem: re-implement GSM device on top of generic modem code Serial interface D-Bus info has to be somewhere neutral. Fix a CDMA secrets bug. --- src/Makefile.am | 2 + src/modem-manager/nm-modem.c | 8 + src/modem-manager/nm-modem.h | 2 + src/nm-device-cdma.c | 7 +- src/nm-device-gsm.c | 369 +++++++++++++++++++++++++++++++++++ src/nm-device-gsm.h | 56 ++++++ src/nm-manager.c | 7 +- 7 files changed, 442 insertions(+), 9 deletions(-) create mode 100644 src/nm-device-gsm.c create mode 100644 src/nm-device-gsm.h diff --git a/src/Makefile.am b/src/Makefile.am index 4fb955dd2d..36aa1e68a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,6 +76,8 @@ NetworkManager_SOURCES = \ nm-device-bt.h \ nm-device-cdma.c \ nm-device-cdma.h \ + nm-device-gsm.c \ + nm-device-gsm.h \ NetworkManagerAP.c \ NetworkManagerAP.h \ nm-dbus-manager.h \ diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 0eb1d9102f..a2b37fb0d8 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -13,6 +13,8 @@ #include "nm-device-private.h" #include "nm-device-interface.h" +#include "nm-serial-device-glue.h" + G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT) #define NM_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM, NMModemPrivate)) @@ -944,3 +946,9 @@ nm_modem_class_init (NMModemClass *klass) G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); } +const DBusGObjectInfo * +nm_modem_get_serial_dbus_info (void) +{ + return &dbus_glib_nm_serial_device_object_info; +} + diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h index b8af89fb78..5c0c741c5e 100644 --- a/src/modem-manager/nm-modem.h +++ b/src/modem-manager/nm-modem.h @@ -126,6 +126,8 @@ gboolean nm_modem_connection_secrets_updated (NMModem *modem, GSList *updated_settings, RequestSecretsCaller caller); +const DBusGObjectInfo *nm_modem_get_serial_dbus_info (void); + G_END_DECLS #endif /* NM_MODEM_H */ diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 4f4ee55812..78f5ed3351 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -32,7 +32,6 @@ #include "nm-properties-changed-signal.h" #include "nm-device-cdma-glue.h" -#include "nm-serial-device-glue.h" G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE) @@ -162,7 +161,7 @@ modem_need_auth (NMModem *modem, const char *hint2, gpointer user_data) { - NMDeviceCdma *self = NM_DEVICE_CDMA (self); + NMDeviceCdma *self = NM_DEVICE_CDMA (user_data); NMActRequest *req; req = nm_device_get_act_request (NM_DEVICE (self)); @@ -359,10 +358,10 @@ nm_device_cdma_class_init (NMDeviceCdmaClass *klass) signals[PROPERTIES_CHANGED] = nm_properties_changed_signal_new (object_class, - G_STRUCT_OFFSET (NMDeviceCdmaClass, properties_changed)); + G_STRUCT_OFFSET (NMDeviceCdmaClass, properties_changed)); dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - &dbus_glib_nm_serial_device_object_info); + nm_modem_get_serial_dbus_info ()); dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_nm_device_cdma_object_info); diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c new file mode 100644 index 0000000000..4f738ec3a5 --- /dev/null +++ b/src/nm-device-gsm.c @@ -0,0 +1,369 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + */ + +#include + +#include "nm-dbus-glib-types.h" +#include "nm-modem.h" +#include "nm-modem-gsm.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-device-gsm.h" +#include "nm-utils.h" +#include "NetworkManagerUtils.h" +#include "nm-marshal.h" +#include "nm-properties-changed-signal.h" + +#include "nm-device-gsm-glue.h" + +G_DEFINE_TYPE (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE) + +#define NM_DEVICE_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GSM, NMDeviceGsmPrivate)) + +typedef struct { + NMModem *modem; +} NMDeviceGsmPrivate; + +enum { + PPP_STATS, + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (NM_DEVICE_GSM (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + break; + default: + break; + } +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); + + nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_modem_hw_is_up (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, device); +} + +static gboolean +real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +{ + return nm_modem_hw_bring_up (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, device, no_firmware); +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *device, + GSList *connections, + char **specific_object) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); + + return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); +} + +static void +real_connection_secrets_updated (NMDevice *device, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + return; + } + + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; + + /* Otherwise, on success for GSM secrets we need to schedule stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + nm_device_activate_schedule_stage1_device_prepare (device); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); + + return nm_modem_check_connection_compatible (priv->modem, connection, error); +} + + +static void +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMDeviceGsm *self = NM_DEVICE_GSM (user_data); + NMActRequest *req; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); +} + +static void +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); + + if (success) + nm_device_activate_schedule_stage2_device_config (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage1_prepare (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage2_config (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, req, reason); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); + } +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + return nm_modem_stage3_ip4_config_start (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_gsm_parent_class), + reason); +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + return nm_modem_stage4_get_ip4_config (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_gsm_parent_class), + config, + reason); +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); + + nm_modem_deactivate_quickly (priv->modem, device); +} + +static guint32 +real_get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_NM_SUPPORTED; +} + +/*****************************************************************************/ + +NMDevice * +nm_device_gsm_new (NMModemGsm *modem, const char *driver) +{ + NMDevice *device; + + g_return_val_if_fail (modem != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM_GSM (modem), NULL); + g_return_val_if_fail (driver != NULL, NULL); + + device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_GSM, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, + NULL); + if (device) { + NM_DEVICE_GSM_GET_PRIVATE (device)->modem = g_object_ref (modem); + g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); + } + + return device; +} + +static void +nm_device_gsm_init (NMDeviceGsm *self) +{ +} + +static void +finalize (GObject *object) +{ + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (object); + + g_object_unref (priv->modem); + priv->modem = NULL; + + G_OBJECT_CLASS (nm_device_gsm_parent_class)->finalize (object); +} + +static void +nm_device_gsm_class_init (NMDeviceGsmClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceGsmPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + + device_class->get_best_auto_connection = real_get_best_auto_connection; + device_class->connection_secrets_updated = real_connection_secrets_updated; + device_class->check_connection_compatible = real_check_connection_compatible; + device_class->hw_is_up = real_hw_is_up; + device_class->hw_bring_up = real_hw_bring_up; + device_class->get_generic_capabilities = real_get_generic_capabilities; + device_class->act_stage1_prepare = real_act_stage1_prepare; + device_class->act_stage2_config = real_act_stage2_config; + device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + device_class->deactivate_quickly = real_deactivate_quickly; + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceGsmClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceGsmClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + nm_modem_get_serial_dbus_info ()); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_gsm_object_info); +} + diff --git a/src/nm-device-gsm.h b/src/nm-device-gsm.h new file mode 100644 index 0000000000..1a74cfa1cd --- /dev/null +++ b/src/nm-device-gsm.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_GSM_H +#define NM_DEVICE_GSM_H + +#include "nm-device.h" +#include "nm-modem-gsm.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_GSM (nm_device_gsm_get_type ()) +#define NM_DEVICE_GSM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_GSM, NMDeviceGsm)) +#define NM_DEVICE_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_GSM, NMDeviceGsmClass)) +#define NM_IS_DEVICE_GSM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_GSM)) +#define NM_IS_DEVICE_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_GSM)) +#define NM_DEVICE_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_GSM, NMDeviceGsmClass)) + +typedef struct { + NMDevice parent; +} NMDeviceGsm; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*signal_quality) (NMDeviceGsm *self, guint32 quality); + + void (*ppp_stats) (NMDeviceGsm *self, guint32 in_bytes, guint32 out_bytes); + void (*properties_changed) (NMDeviceGsm *self, GHashTable *properties); +} NMDeviceGsmClass; + +GType nm_device_gsm_get_type (void); + +NMDevice *nm_device_gsm_new (NMModemGsm *modem, const char *driver); + +G_END_DECLS + +#endif /* NM_DEVICE_GSM_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index e27fb94e31..f1ac17162e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -38,7 +38,7 @@ #include "nm-device-wifi.h" #include "nm-device-olpc-mesh.h" #include "nm-device-cdma.h" -//#include "nm-device-gsm.h" +#include "nm-device-gsm.h" #include "NetworkManagerSystem.h" #include "nm-properties-changed-signal.h" #include "nm-setting-bluetooth.h" @@ -311,12 +311,9 @@ modem_added (NMModemManager *modem_manager, TRUE); } -#if 0 if (NM_IS_MODEM_GSM (modem)) device = nm_device_gsm_new (NM_MODEM_GSM (modem), driver); - else -#endif - if (NM_IS_MODEM_CDMA (modem)) + else if (NM_IS_MODEM_CDMA (modem)) device = nm_device_cdma_new (NM_MODEM_CDMA (modem), driver); else g_message ("%s: unhandled modem '%s'", __func__, ip_iface); From bc81b998a91e81e2a62df28dfbb13d9b2606da93 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Oct 2009 00:51:29 -0700 Subject: [PATCH 008/392] build: fix generation of CDMA & GSM dbus interface data --- src/Makefile.am | 8 ++++++++ src/modem-manager/Makefile.am | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 36aa1e68a3..ce3183e279 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -151,6 +151,12 @@ nm-active-connection-glue.h: $(top_srcdir)/introspection/nm-active-connection.xm nm-dhcp4-config-glue.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< +nm-device-cdma-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml + dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< + +nm-device-gsm-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml + dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< + BUILT_SOURCES = \ nm-access-point-glue.h \ nm-manager-glue.h \ @@ -159,6 +165,8 @@ BUILT_SOURCES = \ nm-device-wifi-glue.h \ nm-device-olpc-mesh-glue.h \ nm-device-bt-glue.h \ + nm-device-cdma-glue.h \ + nm-device-gsm-glue.h \ nm-ip4-config-glue.h \ nm-ip6-config-glue.h \ nm-active-connection-glue.h \ diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am index 79eab85fa8..932a041c0d 100644 --- a/src/modem-manager/Makefile.am +++ b/src/modem-manager/Makefile.am @@ -24,18 +24,10 @@ libmodem_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ $(DBUS_LIBS) -nm-device-cdma-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml - dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< - -nm-device-gsm-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml - dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< - nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=$@ $< BUILT_SOURCES = \ - nm-device-cdma-glue.h \ - nm-device-gsm-glue.h \ nm-serial-device-glue.h CLEANFILES = $(BUILT_SOURCES) From 8b4095cb231597eef4c7ee1c2154fcef9a8f396a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 30 Dec 2009 16:30:41 -0600 Subject: [PATCH 009/392] ifcfg-rh: ensure keys/route files are monitored for changes too keys- and route- files weren't passing the should_ignore_file() check in dir_changed() because should_ignore_file() was only taking ifcfg- files into account. Generalize most of the ifcfg name handling functions so that should_ignore_file() will now handle all three variants. Add testcases to ensure that the name handling does what we want it to, and optimize memory usage of utils_get_ifcfg_name() a bit. --- system-settings/plugins/ifcfg-rh/common.h | 1 + system-settings/plugins/ifcfg-rh/plugin.c | 54 ++----- system-settings/plugins/ifcfg-rh/reader.c | 10 +- .../plugins/ifcfg-rh/tests/Makefile.am | 12 +- system-settings/plugins/ifcfg-rh/utils.c | 137 ++++++++++++++---- system-settings/plugins/ifcfg-rh/utils.h | 6 +- 6 files changed, 137 insertions(+), 83 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index d16e881954..d5931c8967 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -26,6 +26,7 @@ #define IFCFG_TAG "ifcfg-" #define KEYS_TAG "keys-" #define ROUTE_TAG "route-" + #define BAK_TAG ".bak" #define TILDE_TAG "~" #define ORIG_TAG ".orig" diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 9961c34355..309fff63e8 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -45,6 +45,7 @@ #include "nm-inotify-helper.h" #include "shvar.h" #include "writer.h" +#include "utils.h" static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); @@ -153,44 +154,6 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) return connection; } -static gboolean -check_suffix (const char *base, const char *tag) -{ - int len, tag_len; - - g_return_val_if_fail (base != NULL, TRUE); - g_return_val_if_fail (tag != NULL, TRUE); - - len = strlen (base); - tag_len = strlen (tag); - if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag)) - return TRUE; - return FALSE; -} - -static gboolean -should_ignore_file (const char *filename) -{ - char *base; - gboolean ignore = TRUE; - - g_return_val_if_fail (filename != NULL, TRUE); - - base = g_path_get_basename (filename); - g_return_val_if_fail (base != NULL, TRUE); - - if ( !strncmp (base, IFCFG_TAG, strlen (IFCFG_TAG)) - && !check_suffix (base, BAK_TAG) - && !check_suffix (base, TILDE_TAG) - && !check_suffix (base, ORIG_TAG) - && !check_suffix (base, REJ_TAG) - && !check_suffix (base, RPMNEW_TAG)) - ignore = FALSE; - - g_free (base); - return ignore; -} - static void read_connections (SCPluginIfcfg *plugin) { @@ -204,7 +167,7 @@ read_connections (SCPluginIfcfg *plugin) while ((item = g_dir_read_name (dir))) { char *full_path; - if (should_ignore_file (item)) + if (utils_should_ignore_file (item, TRUE)) continue; full_path = g_build_filename (IFCFG_DIR, item, NULL); @@ -331,7 +294,6 @@ handle_connection_remove_or_new (SCPluginIfcfg *plugin, } } } - static void dir_changed (GFileMonitor *monitor, GFile *file, @@ -341,16 +303,20 @@ dir_changed (GFileMonitor *monitor, { SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data); SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); - char *name; + char *path, *name; NMIfcfgConnection *connection; gboolean do_remove = FALSE, do_new = FALSE; - name = g_file_get_path (file); - if (should_ignore_file (name)) { - g_free (name); + path = g_file_get_path (file); + if (utils_should_ignore_file (path, FALSE)) { + g_free (path); return; } + /* Given any ifcfg, keys, or routes file, get the ifcfg file path */ + name = utils_get_ifcfg_path (path); + g_free (path); + connection = g_hash_table_lookup (priv->connections, name); if (!connection) { do_new = TRUE; diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 99ae55e28e..0bb89bc150 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -111,11 +111,11 @@ make_connection_setting (const char *file, const char *suggested) { NMSettingConnection *s_con; - char *ifcfg_name = NULL; + const char *ifcfg_name = NULL; char *new_id = NULL, *uuid = NULL, *value; char *ifcfg_id; - ifcfg_name = utils_get_ifcfg_name (file); + ifcfg_name = utils_get_ifcfg_name (file, TRUE); if (!ifcfg_name) return NULL; @@ -180,7 +180,6 @@ make_connection_setting (const char *file, g_free (value); } - g_free (ifcfg_name); return NM_SETTING (s_con); } @@ -2583,7 +2582,7 @@ connection_from_file (const char *filename, shvarFile *parsed; char *type, *nmc = NULL, *bootproto; NMSetting *s_ip4; - char *ifcfg_name = NULL; + const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; g_return_val_if_fail (filename != NULL, NULL); @@ -2601,13 +2600,12 @@ connection_from_file (const char *filename, if (!iscsiadm_path) iscsiadm_path = SBINDIR "/iscsiadm"; - ifcfg_name = utils_get_ifcfg_name (filename); + ifcfg_name = utils_get_ifcfg_name (filename, TRUE); if (!ifcfg_name) { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Ignoring connection '%s' because it's not an ifcfg file.", filename); return NULL; } - g_free (ifcfg_name); parsed = svNewFile (filename); if (!parsed) { diff --git a/system-settings/plugins/ifcfg-rh/tests/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/Makefile.am index f4eafb0d04..8933bb2eab 100644 --- a/system-settings/plugins/ifcfg-rh/tests/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/Makefile.am @@ -6,7 +6,7 @@ INCLUDES = \ -I$(top_srcdir)/libnm-glib \ -I$(top_srcdir)/system-settings/plugins/ifcfg-rh -noinst_PROGRAMS = test-ifcfg-rh +noinst_PROGRAMS = test-ifcfg-rh test-ifcfg-rh-utils test_ifcfg_rh_SOURCES = \ test-ifcfg-rh.c @@ -23,9 +23,19 @@ test_ifcfg_rh_LDADD = \ $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la \ $(DBUS_LIBS) +test_ifcfg_rh_utils_SOURCES = \ + test-ifcfg-rh-utils.c + +test_ifcfg_rh_utils_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_ifcfg_rh_utils_LDADD = \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la + if WITH_TESTS check-local: test-ifcfg-rh + $(abs_builddir)/test-ifcfg-rh-utils $(abs_builddir)/test-ifcfg-rh endif diff --git a/system-settings/plugins/ifcfg-rh/utils.c b/system-settings/plugins/ifcfg-rh/utils.c index b0e5a3379b..3194c2157b 100644 --- a/system-settings/plugins/ifcfg-rh/utils.c +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -115,59 +115,136 @@ utils_hexstr2bin (const char *hex, size_t len) /* End from hostap */ -char * -utils_cert_path (const char *parent, const char *suffix) +static gboolean +check_suffix (const char *base, const char *tag) { - char *name, *dir, *path; + int len, tag_len; - name = utils_get_ifcfg_name (parent); - dir = g_path_get_dirname (parent); - path = g_strdup_printf ("%s/%s-%s", dir, name, suffix); - g_free (dir); - g_free (name); - return path; + g_return_val_if_fail (base != NULL, TRUE); + g_return_val_if_fail (tag != NULL, TRUE); + + len = strlen (base); + tag_len = strlen (tag); + if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag)) + return TRUE; + return FALSE; +} + +gboolean +utils_should_ignore_file (const char *filename, gboolean only_ifcfg) +{ + char *base; + gboolean ignore = TRUE; + gboolean is_ifcfg = FALSE; + gboolean is_other = FALSE; + + g_return_val_if_fail (filename != NULL, TRUE); + + base = g_path_get_basename (filename); + g_return_val_if_fail (base != NULL, TRUE); + + /* Only handle ifcfg, keys, and routes files */ + if (!strncmp (base, IFCFG_TAG, strlen (IFCFG_TAG))) + is_ifcfg = TRUE; + + if (only_ifcfg == FALSE) { + if ( !strncmp (base, KEYS_TAG, strlen (KEYS_TAG)) + || !strncmp (base, ROUTE_TAG, strlen (ROUTE_TAG))) + is_other = TRUE; + } + + /* But not those that have certain suffixes */ + if ( (is_ifcfg || is_other) + && !check_suffix (base, BAK_TAG) + && !check_suffix (base, TILDE_TAG) + && !check_suffix (base, ORIG_TAG) + && !check_suffix (base, REJ_TAG) + && !check_suffix (base, RPMNEW_TAG)) + ignore = FALSE; + + g_free (base); + return ignore; } char * -utils_get_ifcfg_name (const char *file) +utils_cert_path (const char *parent, const char *suffix) { - char *ifcfg_name; + const char *name; + char *dir, *path; + + g_return_val_if_fail (parent != NULL, NULL); + g_return_val_if_fail (suffix != NULL, NULL); + + name = utils_get_ifcfg_name (parent, FALSE); + dir = g_path_get_dirname (parent); + path = g_strdup_printf ("%s/%s-%s", dir, name, suffix); + g_free (dir); + return path; +} + +const char * +utils_get_ifcfg_name (const char *file, gboolean only_ifcfg) +{ + const char *name = NULL, *start = NULL; char *base; + g_return_val_if_fail (file != NULL, NULL); + base = g_path_get_basename (file); if (!base) return NULL; - ifcfg_name = g_strdup (base + strlen (IFCFG_TAG)); + /* Find the point in 'file' where 'base' starts. We use 'file' since it's + * const and thus will survive after we free 'base'. + */ + start = file + strlen (file) - strlen (base); + g_assert (strcmp (start, base) == 0); g_free (base); - return ifcfg_name; + + if (!strncmp (start, IFCFG_TAG, strlen (IFCFG_TAG))) + name = start + strlen (IFCFG_TAG); + else if (only_ifcfg == FALSE) { + if (!strncmp (start, KEYS_TAG, strlen (KEYS_TAG))) + name = start + strlen (KEYS_TAG); + else if (!strncmp (start, ROUTE_TAG, strlen (ROUTE_TAG))) + name = start + strlen (ROUTE_TAG); + } + + return name; } -/* Used to get an extra file path for ifcfg- in the form . - * Currently used for: keys- - * route- +/* Used to get any ifcfg/extra file path from any other ifcfg/extra path + * in the form . */ -char * +static char * utils_get_extra_path (const char *parent, const char *tag) { - char *ifcfg_name; - char *extra_file = NULL; - char *tmp = NULL; + char *item_path = NULL, *dirname; + const char *name; - ifcfg_name = utils_get_ifcfg_name (parent); - if (!ifcfg_name) + g_return_val_if_fail (parent != NULL, NULL); + g_return_val_if_fail (tag != NULL, NULL); + + dirname = g_path_get_dirname (parent); + if (!dirname) return NULL; - tmp = g_path_get_dirname (parent); - if (!tmp) - goto out; + name = utils_get_ifcfg_name (parent, FALSE); + if (name) { + if (!strcmp (dirname, ".")) + item_path = g_strdup_printf ("%s%s", tag, name); + else + item_path = g_strdup_printf ("%s/%s%s", dirname, tag, name); + } + g_free (dirname); - extra_file = g_strdup_printf ("%s/%s%s", tmp, tag, ifcfg_name); + return item_path; +} -out: - g_free (tmp); - g_free (ifcfg_name); - return extra_file; +char * +utils_get_ifcfg_path (const char *parent) +{ + return utils_get_extra_path (parent, IFCFG_TAG); } char * diff --git a/system-settings/plugins/ifcfg-rh/utils.h b/system-settings/plugins/ifcfg-rh/utils.h index 2c7eaee62e..00dbcdcc97 100644 --- a/system-settings/plugins/ifcfg-rh/utils.h +++ b/system-settings/plugins/ifcfg-rh/utils.h @@ -31,9 +31,11 @@ char *utils_hexstr2bin (const char *hex, size_t len); char *utils_cert_path (const char *parent, const char *suffix); -char *utils_get_ifcfg_name (const char *file); +const char *utils_get_ifcfg_name (const char *file, gboolean only_ifcfg); -char *utils_get_extra_path (const char *parent, const char *tag); +gboolean utils_should_ignore_file (const char *filename, gboolean only_ifcfg); + +char *utils_get_ifcfg_path (const char *parent); char *utils_get_keys_path (const char *parent); char *utils_get_route_path (const char *parent); From 97ab9c849739df839daa8c58cb8ebd6fdb41f12a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 1 Jan 2010 13:58:34 -0600 Subject: [PATCH 010/392] ifcfg-rh: add missing testcase --- .../ifcfg-rh/tests/test-ifcfg-rh-utils.c | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c new file mode 100644 index 0000000000..cf2a7c03de --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c @@ -0,0 +1,162 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service - keyfile plugin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include "nm-test-helpers.h" + +#include "common.h" +#include "utils.h" + + +static void +test_get_ifcfg_name (const char *desc, + const char *path, + gboolean only_ifcfg, + const char *expected) +{ + const char *result; + + result = utils_get_ifcfg_name (path, only_ifcfg); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid ifcfg name '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create ifcfg name for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected ifcfg name '%s' created for '%s'", result, path); + } +} + +static void +test_get_ifcfg_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_ifcfg_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid ifcfg name '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create ifcfg name for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected ifcfg name '%s' created for '%s'", result, path); + } +} + +static void +test_get_keys_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_keys_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid extra path '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create extra path for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected extra path '%s' created for '%s'", result, path); + } +} + +static void +test_get_route_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_route_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid extra path '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create extra path for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected extra path '%s' created for '%s'", result, path); + } +} + +static void +test_ignored (const char *desc, const char *path, gboolean expected_ignored) +{ + gboolean result; + + result = utils_should_ignore_file (path, FALSE); + ASSERT (result == expected_ignored, desc, "unexpected ignore result for path '%s'", path); +} + +int main (int argc, char **argv) +{ + char *base; + + /* The tests */ + test_get_ifcfg_name ("get-ifcfg-name-bad", "/foo/bar/adfasdfadf", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-good", "/foo/bar/ifcfg-FooBar", FALSE, "FooBar"); + test_get_ifcfg_name ("get-ifcfg-name-keys", "/foo/bar/keys-BlahLbah", FALSE, "BlahLbah"); + test_get_ifcfg_name ("get-ifcfg-name-route", "/foo/bar/route-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-only-ifcfg-route", "/foo/bar/route-Lalalala", TRUE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-only-ifcfg-keys", "/foo/bar/keys-Lalalala", TRUE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-no-path-ifcfg", "ifcfg-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-no-path-keys", "keys-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-no-path-route", "route-Lalalala", FALSE, "Lalalala"); + + test_get_ifcfg_name ("get-ifcfg-name-bad2-ifcfg", "/foo/bar/asdfasifcfg-Foobar", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-bad2-keys", "/foo/bar/asdfaskeys-Foobar", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-bad2-route", "/foo/bar/asdfasroute-Foobar", FALSE, NULL); + + test_get_ifcfg_path ("ifcfg-path-bad", "/foo/bar/adfasdfasdf", NULL); + test_get_ifcfg_path ("ifcfg-path-from-keys-no-path", "keys-BlahBlah", "ifcfg-BlahBlah"); + test_get_ifcfg_path ("ifcfg-path-from-keys", "/foo/bar/keys-BlahBlah", "/foo/bar/ifcfg-BlahBlah"); + test_get_ifcfg_path ("ifcfg-path-from-route", "/foo/bar/route-BlahBlah", "/foo/bar/ifcfg-BlahBlah"); + + test_get_keys_path ("keys-path-bad", "/foo/bar/asdfasdfasdfasdf", NULL); + test_get_keys_path ("keys-path-from-ifcfg-no-path", "ifcfg-FooBar", "keys-FooBar"); + test_get_keys_path ("keys-path-from-ifcfg", "/foo/bar/ifcfg-FooBar", "/foo/bar/keys-FooBar"); + test_get_keys_path ("keys-path-from-route", "/foo/bar/route-FooBar", "/foo/bar/keys-FooBar"); + + test_get_route_path ("route-path-bad", "/foo/bar/asdfasdfasdfasdf", NULL); + test_get_route_path ("route-path-from-ifcfg-no-path", "ifcfg-FooBar", "route-FooBar"); + test_get_route_path ("route-path-from-ifcfg", "/foo/bar/ifcfg-FooBar", "/foo/bar/route-FooBar"); + test_get_route_path ("route-path-from-keys", "/foo/bar/keys-FooBar", "/foo/bar/route-FooBar"); + + test_ignored ("ignored-ifcfg", "ifcfg-FooBar", FALSE); + test_ignored ("ignored-keys", "keys-FooBar", FALSE); + test_ignored ("ignored-route", "route-FooBar", FALSE); + test_ignored ("ignored-bak", "ifcfg-FooBar" BAK_TAG, TRUE); + test_ignored ("ignored-tilde", "ifcfg-FooBar" TILDE_TAG, TRUE); + test_ignored ("ignored-orig", "ifcfg-FooBar" ORIG_TAG, TRUE); + test_ignored ("ignored-rej", "ifcfg-FooBar" REJ_TAG, TRUE); + test_ignored ("ignored-rpmnew", "ifcfg-FooBar" RPMNEW_TAG, TRUE); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + From c159efb05e31e3b3b8aa9331f13577ff598a0379 Mon Sep 17 00:00:00 2001 From: Luca Ferretti Date: Sat, 2 Jan 2010 18:50:27 -0600 Subject: [PATCH 011/392] po: update italian translation (bgo #595673) --- po/it.po | 138 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 41 deletions(-) diff --git a/po/it.po b/po/it.po index 75fec3465e..87675b3d94 100644 --- a/po/it.po +++ b/po/it.po @@ -1,5 +1,5 @@ # Italian translation for NetworkManager -# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 the NetworkManager CopyRight Holder +# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 THE NetworkManager CopyRight Holder # This file is distributed under the same license as the NetworkManager package. # Francesco Marletta , 2004, 2005, 2006, 2007, 2008, 2009. # @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: NetworkManager 0.7.1\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-04-18 15:24+0000\n" -"PO-Revision-Date: 2009-04-18 18:09+0200\n" +"POT-Creation-Date: 2009-09-18 15:24+0000\n" +"PO-Revision-Date: 2009-09-19 01:12+0200\n" "Last-Translator: Francesco Marletta \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" @@ -30,7 +30,7 @@ msgstr "Non sembra un file di chiave privata PEM." #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." -msgstr "Memoria non sufficiente per archiviare i dati del file PEM." +msgstr "Memoria non sufficiente per memorizzare i dati del file PEM." #: ../libnm-util/crypto.c:154 #, c-format @@ -60,7 +60,7 @@ msgstr "File PEM malformato: formato di IV nel tag DEK-Info non valido." #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "File PEM malformato: cifrario a chiave privata \"%s\" sconosciuto." +msgstr "File PEM malformato: cifrario chiave privata \"%s\" sconosciuto." #: ../libnm-util/crypto.c:222 #, c-format @@ -90,7 +90,7 @@ msgstr "Memoria non sufficiente per archiviare i dati del file." #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "IV deve essere lungo un numero pari di byte" +msgstr "IV deve essere lungo un numero pari di byte." #: ../libnm-util/crypto.c:333 #, c-format @@ -106,7 +106,7 @@ msgstr "IV contiene cifre non esadecimali." #: ../libnm-util/crypto_nss.c:169 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "Il cifrario a chiave privata \"%s\" è sconosciuto." +msgstr "Il cifrario di chiave privata \"%s\" è sconosciuto." #: ../libnm-util/crypto.c:391 #, c-format @@ -116,7 +116,7 @@ msgstr "Memoria non sufficiente per decifrare la chiave privata." #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." -msgstr "Impossibile determinare il tipo di chiave privata." +msgstr "Impossibile stabilire il tipo di chiave privata." #: ../libnm-util/crypto.c:530 #, c-format @@ -137,8 +137,6 @@ msgstr "Inizializzazione del motore MD5 fallita: %s / %s" msgid "Not enough memory for decrypted key buffer." msgstr "Memoria non sufficiente per il buffer della chiave decifrata." -# NdT: ho tradotto "decryption cipher" con decifratore in -# quanto ha più senso che dire "cifrario di decifrazione" #: ../libnm-util/crypto_gnutls.c:160 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." @@ -173,17 +171,17 @@ msgstr "Errore nell'inizializzare i dati dei certificati: %s" #: ../libnm-util/crypto_gnutls.c:257 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "Impossibile decifrare il certificato: %s" +msgstr "Impossibile decodificare il certificato: %s" #: ../libnm-util/crypto_gnutls.c:281 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" -msgstr "Impossibile inizializzare il decifratore PKCS#12: %s" +msgstr "Impossibile inizializzare il decodificatore PKCS#12: %s" #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Couldn't decode PKCS#12 file: %s" -msgstr "Impossibile decifrare il file PKCS#12: %s" +msgstr "Impossibile decodificare il file PKCS#12: %s" #: ../libnm-util/crypto_gnutls.c:306 #, c-format @@ -234,7 +232,7 @@ msgstr "Finalizzazione della decifrazione della chiave privata fallita: %d." #: ../libnm-util/crypto_nss.c:284 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Impossibile decifrare il certificato: %d" +msgstr "Impossibile decodificare il certificato: %d" #: ../libnm-util/crypto_nss.c:319 #, c-format @@ -244,71 +242,68 @@ msgstr "Impossibile convertire la password in UCS2: %d" #: ../libnm-util/crypto_nss.c:347 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" -msgstr "Impossibile inizializzare il decifratore PKCS#12: %d" +msgstr "Impossibile inizializzare il decodificatore PKCS#12: %d" #: ../libnm-util/crypto_nss.c:356 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Impossibile decifrare il file PKCS#12: %d" +msgstr "Impossibile decodificare il file PKCS#12: %d" #: ../libnm-util/crypto_nss.c:365 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Impossibile verificare il file PKCS#12: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" -msgstr "errore nell'elaborazione del messaggio netlink: %s" +msgstr "errore nell'elaborare il messaggio netlink: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "impossibile allocare un handle netlink per monitorare lo stato del " "collegamento: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "impossibile collegarsi a netlink per monitorare lo stato del collegamento: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" "impossibile unirsi a un gruppo netlink per monitorare lo stato del " "collegamento: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "impossibile allocare la cache dei collegamenti netlink per monitorare lo " "stato del collegamento: %s" -#: ../src/nm-netlink-monitor.c:422 -#, c-format -msgid "error updating link cache: %s" -msgstr "errore nell'aggiornamento della cache del collegamento: %s" - -#: ../src/nm-netlink-monitor.c:488 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 msgid "error occurred while waiting for data on socket" msgstr "si è verificato un errore durante l'attesa dei dati sul socket" -#: ../src/NetworkManager.c:294 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opzione non valida. Usare --help per ottenere un elenco delle opzioni " "valide.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:96 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# Creato da NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:102 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -317,20 +312,81 @@ msgstr "" "# Unito da %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "impossibile allocare un handle netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "impossibile collegarsi a netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "impossibile unirsi a un gruppo netlink: %s" + +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "" -"NOTA: il risolutore glibc potrebbe non supportare più di 3 server di nomi." +msgstr "NOTA: il risolutore libc non supporta più di 3 server di nomi." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." -msgstr "I server di nomi elencati sotto potrebbero non essere riconosciuti." +msgstr "I server di nomi elencati sotto non possono essere riconosciuti." -#: ../system-settings/plugins/ifcfg-rh/reader.c:2149 +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "%s (automatica)" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 msgid "System" msgstr "Sistema" -#: ../system-settings/src/nm-default-wired-connection.c:182 -#, c-format -msgid "Auto %s" -msgstr "Auto %s" +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Condivide connessione attraverso una rete WiFi protetta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Condivide connessione attraverso una rete WiFi aperta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modifica il nome host persistente del sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modifica le connessioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"La politica di sistema impedisce di modificare le impostazioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"La politica di sistema impedisce di modificare il nome host persistente del " +"sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"La politica di sistema impedisce di condividere connessioni attraverso una " +"rete WiFi protetta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"La politica di sistema impedisce di condividere connessioni attraverso una " +"rete WiFi aperta" From 306e01d6b08b689ed3062027c6922ee0da0d949f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 4 Jan 2010 17:30:39 -0600 Subject: [PATCH 012/392] release: bump version to 0.7.998 (rc2) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2d59fa1b9c..28734d6e77 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.7.997, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.7.998, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) AM_MAINTAINER_MODE From 3b0255f73c6d539b5dcd882f38c5d23ad3f7dab2 Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Tue, 5 Jan 2010 18:51:53 -0600 Subject: [PATCH 013/392] libnm-util: add IPv6 comparison functions --- libnm-util/nm-param-spec-specialized.c | 207 ++++++++++++++++++++++++- 1 file changed, 205 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index 10621fac47..ad0febfcf6 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -31,8 +31,11 @@ struct _NMParamSpecSpecialized { #include #include +#include #include +#include "nm-dbus-glib-types.h" + /***********************************************************/ /* nm_gvalues_compare */ @@ -367,11 +370,129 @@ nm_gvalues_compare_map (const GValue *value1, const GValue *value2) return ret; } +static gint +nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) +{ + GValueArray *values1, *values2; + GValue *tmp_val; + GByteArray *addr1, *addr2; + guint32 prefix1, prefix2; + gint ret = 0; + int i; + + /* IP6 addresses are GValueArrays (see nm-dbus-glib-types.h) */ + values1 = g_value_get_boxed (value1); + values2 = g_value_get_boxed (value2); + + /* Since they are NM IPv6 address structures, we expect both + * to contain two elements as specified in nm-dbus-glib-types.h. + */ + g_return_val_if_fail (values1->n_values == 2, 0); + g_return_val_if_fail (values2->n_values == 2, 0); + + /* First struct IPv6 address */ + tmp_val = g_value_array_get_nth (values1, 0); + addr1 = g_value_get_boxed (tmp_val); + /* First struct IPv6 prefix */ + tmp_val = g_value_array_get_nth (values1, 1); + prefix1 = g_value_get_uint (tmp_val); + + /* Second struct IPv6 address */ + tmp_val = g_value_array_get_nth (values2, 0); + addr2 = g_value_get_boxed (tmp_val); + /* Second struct IPv6 prefix */ + tmp_val = g_value_array_get_nth (values2, 1); + prefix2 = g_value_get_uint (tmp_val); + + /* Compare IPv6 addresses */ + if (prefix1 != prefix2) + return prefix1 < prefix2 ? -1 : prefix1 > prefix2; + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)addr1->data, (struct in6_addr *)addr2->data)) { + for (i = 0; ret == 0 && i < addr1->len; i++) + ret = addr1->data[i] < addr2->data[i] ? -1 : addr1->data[i] > addr2->data[i]; + } + + return ret; +} + +static gint +nm_gvalue_ip6_route_compare (const GValue *value1, const GValue *value2) +{ + GValueArray *values1, *values2; + GValue *tmp_val; + GByteArray *dest1, *dest2; + GByteArray *next_hop1, *next_hop2; + guint32 prefix1, prefix2; + guint32 metric1, metric2; + gint ret = 0; + int i; + + /* IP6 routes are GValueArrays (see nm-dbus-glib-types.h) */ + values1 = g_value_get_boxed (value1); + values2 = g_value_get_boxed (value2); + + /* Since they are NM IPv6 route structures, we expect both + * to contain 4 elements as specified in nm-dbus-glib-types.h. + */ + g_return_val_if_fail (values1->n_values == 4, 0); + g_return_val_if_fail (values2->n_values == 4, 0); + + /* First struct IPv6 route */ + tmp_val = g_value_array_get_nth (values1, 0); + dest1 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values1, 1); + prefix1 = g_value_get_uint (tmp_val); + tmp_val = g_value_array_get_nth (values1, 2); + next_hop1 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values1, 3); + metric1 = g_value_get_uint (tmp_val); + + /* Second struct IPv6 route */ + tmp_val = g_value_array_get_nth (values2, 0); + dest2 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values2, 1); + prefix2 = g_value_get_uint (tmp_val); + tmp_val = g_value_array_get_nth (values2, 2); + next_hop2 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values2, 3); + metric2 = g_value_get_uint (tmp_val); + + /* Compare the routes */ + if (prefix1 != prefix2) + return prefix1 < prefix2 ? -1 : prefix1 > prefix2; + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)dest1->data, (struct in6_addr *)dest2->data)) { + for (i = 0; ret == 0 && i < dest1->len; i++) + ret = dest1->data[i] < dest2->data[i] ? -1 : dest1->data[i] > dest2->data[i]; + } + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)next_hop1->data, (struct in6_addr *)next_hop2->data)) { + for (i = 0; ret == 0 && i < next_hop1->len; i++) + ret = next_hop1->data[i] < next_hop2->data[i] ? -1 : next_hop1->data[i] > next_hop2->data[i]; + } + + if (metric1 != metric2) + ret = metric1 < metric2 ? -1 : metric1 > metric2; + + return ret; +} + static gint nm_gvalues_compare_struct (const GValue *value1, const GValue *value2) { - g_warning ("Not implemented"); - return 0; + /* value1 and value2 must contain the same type since + * nm_gvalues_compare() enforced that already. + */ + + if (G_VALUE_HOLDS (value1, DBUS_TYPE_G_IP6_ADDRESS)) { + return nm_gvalue_ip6_address_compare (value1, value2); + } else if (G_VALUE_HOLDS (value1, DBUS_TYPE_G_IP6_ROUTE)) { + return nm_gvalue_ip6_route_compare (value1, value2); + } else { + g_warning ("Don't know how to compare structures"); + return (value1 == value2); + } } gint @@ -736,6 +857,87 @@ compare_gvalue_hash (void) g_print ("Comparing different str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); } +static void +compare_ip6_addresses (void) +{ + GValueArray *array1; + GValueArray *array2; + GValueArray *array3; + GByteArray *ba1; + GByteArray *ba2; + GByteArray *ba3; + GValue element = { 0 }; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + struct in6_addr addr1; + struct in6_addr addr2; + struct in6_addr addr3; + guint32 prefix1 = 64; + guint32 prefix2 = 64; + guint32 prefix3 = 0; + + inet_pton (AF_INET6, "1:2:3:4:5:6:7:8", &addr1, sizeof (struct in6_addr)); + inet_pton (AF_INET6, "ffff:2:3:4:5:6:7:8", &addr2, sizeof (struct in6_addr)); + inet_pton (AF_INET6, "::", &addr3, sizeof (struct in6_addr)); + + /* address 1 */ + ba1 = g_byte_array_new (); + array1 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba1, (guint8 *) addr1.s6_addr, 16); + g_value_take_boxed (&element, ba1); + g_value_array_append (array1, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix1); + g_value_array_append (array1, &element); + g_value_unset (&element); + + /* address 2 */ + ba2 = g_byte_array_new (); + array2 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba2, (guint8 *) addr2.s6_addr, 16); + g_value_take_boxed (&element, ba2); + g_value_array_append (array2, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix2); + g_value_array_append (array2, &element); + g_value_unset (&element); + + /* address 3 */ + ba3 = g_byte_array_new (); + array3 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba3, (guint8 *) addr3.s6_addr, 16); + g_value_take_boxed (&element, ba3); + g_value_array_append (array3, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix3); + g_value_array_append (array3, &element); + g_value_unset (&element); + + g_value_init (&value1, DBUS_TYPE_G_IP6_ADDRESS); + g_value_init (&value2, DBUS_TYPE_G_IP6_ADDRESS); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array1); + g_print ("Comparing identical IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array2); + g_print ("Comparing different IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array3); + g_print ("Comparing different IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); +} + int main (int argc, char *argv[]) { @@ -751,6 +953,7 @@ main (int argc, char *argv[]) compare_ptrarrays (); compare_str_hash (); compare_gvalue_hash (); + compare_ip6_addresses (); return 0; } From 686425adcef5c81a3e72e6aa143fd267e3cb2212 Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Tue, 5 Jan 2010 19:05:01 -0600 Subject: [PATCH 014/392] ifcfg-rh: add IPv6 addressing and routes support (rh #523288) --- system-settings/plugins/ifcfg-rh/common.h | 1 + .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 19 +- system-settings/plugins/ifcfg-rh/reader.c | 478 ++++++++++- system-settings/plugins/ifcfg-rh/reader.h | 1 + .../tests/network-scripts/Makefile.am | 4 +- .../ifcfg-test-static-routes-legacy | 1 + .../ifcfg-test-wired-defroute-no | 4 + ...fcfg-test-wired-defroute-no-gatewaydev-yes | 4 + .../ifcfg-test-wired-ipv6-manual | 18 + .../ifcfg-test-wired-never-default | 3 +- .../network-scripts/ifcfg-test-wired-static | 7 +- ...work-test-wired-defroute-no-gatewaydev-yes | 1 + .../network-test-wired-never-default | 3 + .../route6-test-wired-ipv6-manual | 1 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 780 +++++++++++++++++- system-settings/plugins/ifcfg-rh/utils.c | 19 +- system-settings/plugins/ifcfg-rh/utils.h | 2 + system-settings/plugins/ifcfg-rh/writer.c | 225 ++++- system-settings/plugins/ifcfg-rh/writer.h | 1 - 19 files changed, 1553 insertions(+), 19 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index d5931c8967..f5ab1c896d 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -26,6 +26,7 @@ #define IFCFG_TAG "ifcfg-" #define KEYS_TAG "keys-" #define ROUTE_TAG "route-" +#define ROUTE6_TAG "route6-" #define BAK_TAG ".bak" #define TILDE_TAG "~" diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 0abf6d4565..b54bc8af21 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -63,6 +63,9 @@ typedef struct { char *routefile; int routefile_wd; + char *route6file; + int route6file_wd; + char *udi; char *unmanaged; } NMIfcfgConnectionPrivate; @@ -93,7 +96,7 @@ files_changed_cb (NMInotifyHelper *ih, NMIfcfgConnection *self = NM_IFCFG_CONNECTION (user_data); NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self); - if ((evt->wd != priv->file_wd) && (evt->wd != priv->keyfile_wd) && (evt->wd != priv->routefile_wd)) + if ((evt->wd != priv->file_wd) && (evt->wd != priv->keyfile_wd) && (evt->wd != priv->routefile_wd) && (evt->wd != priv->route6file_wd)) return; /* push the event up to the plugin */ @@ -111,11 +114,12 @@ nm_ifcfg_connection_new (const char *filename, char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; NMInotifyHelper *ih; g_return_val_if_fail (filename != NULL, NULL); - tmp = connection_from_file (filename, NULL, NULL, NULL, &unmanaged, &keyfile, &routefile, error, ignore_error); + tmp = connection_from_file (filename, NULL, NULL, NULL, &unmanaged, &keyfile, &routefile, &route6file, error, ignore_error); if (!tmp) return NULL; @@ -145,6 +149,9 @@ nm_ifcfg_connection_new (const char *filename, priv->routefile = routefile; priv->routefile_wd = nm_inotify_helper_add_watch (ih, routefile); + priv->route6file = route6file; + priv->route6file_wd = nm_inotify_helper_add_watch (ih, route6file); + return NM_IFCFG_CONNECTION (object); } @@ -176,7 +183,6 @@ update (NMSettingsConnectionInterface *connection, IFCFG_DIR, priv->filename, priv->keyfile, - priv->routefile, &error)) { callback (connection, error, user_data); g_error_free (error); @@ -199,6 +205,9 @@ do_delete (NMSettingsConnectionInterface *connection, if (priv->routefile) g_unlink (priv->routefile); + if (priv->route6file) + g_unlink (priv->route6file); + return parent_settings_connection_iface->delete (connection, callback, user_data); } @@ -243,6 +252,10 @@ finalize (GObject *object) if (priv->routefile_wd >= 0) nm_inotify_helper_remove_watch (ih, priv->routefile_wd); + g_free (priv->route6file); + if (priv->route6file_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->route6file_wd); + G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->finalize (object); } diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 0bb89bc150..62cba2068a 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -494,6 +495,31 @@ read_ip4_address (shvarFile *ifcfg, return success; } +static gboolean +parse_ip6_address (const char *value, + struct in6_addr *out_addr, + GError **error) +{ + struct in6_addr ip6_addr; + gboolean success = FALSE; + + g_return_val_if_fail (value != NULL, FALSE); + g_return_val_if_fail (out_addr != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + *out_addr = in6addr_any; + + if (inet_pton (AF_INET6, value, &ip6_addr) > 0) { + *out_addr = ip6_addr; + success = TRUE; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 address '%s'", value); + } + return success; +} + static NMIP4Address * read_full_ip4_address (shvarFile *ifcfg, const char *network_file, @@ -851,6 +877,227 @@ error: return success; } +static NMIP6Address * +parse_full_ip6_address (const char *addr_str, GError **error) +{ + NMIP6Address *addr; + char **list; + char *ip_tag, *prefix_tag; + struct in6_addr tmp = IN6ADDR_ANY_INIT; + gboolean success = FALSE; + + g_return_val_if_fail (addr_str != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (*error == NULL, NULL); + + /* Split the adddress and prefix */ + list = g_strsplit_set (addr_str, "/", 2); + if (g_strv_length (list) < 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 address '%s'", addr_str); + goto error; + } + + ip_tag = list[0]; + prefix_tag = list[1]; + + addr = nm_ip6_address_new (); + /* IP address */ + if (ip_tag) { + if (!parse_ip6_address (ip_tag, &tmp, error)) + goto error; + } + + nm_ip6_address_set_address (addr, &tmp); + + /* Prefix */ + if (prefix_tag) { + long int prefix; + + errno = 0; + prefix = strtol (prefix_tag, NULL, 10); + if (errno || prefix <= 0 || prefix > 128) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 prefix '%s'", prefix_tag); + goto error; + } + nm_ip6_address_set_prefix (addr, (guint32) prefix); + } else { + /* Missing prefix is treated as prefix of 64 */ + nm_ip6_address_set_prefix (addr, 64); + } + + success = TRUE; + +error: + if (!success) { + nm_ip6_address_unref (addr); + addr = NULL; + } + + g_strfreev (list); + return addr; +} + +/* IPv6 address is very complex to describe completely by a regular expression, + * so don't try to, rather use looser syntax to comprise all possibilities + * NOTE: The regexes below don't describe all variants allowed by 'ip route add', + * namely destination IP without 'to' keyword is recognized just at line start. + */ +#define IPV6_ADDR_REGEX "[0-9A-Fa-f:.]+" + +static gboolean +read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **error) +{ + char *contents = NULL; + gsize len = 0; + char **lines = NULL, **iter; + GRegex *regex_to1, *regex_to2, *regex_via, *regex_metric; + GMatchInfo *match_info; + NMIP6Route *route; + struct in6_addr ip6_addr; + char *dest = NULL, *prefix = NULL, *next_hop = NULL, *metric = NULL; + long int prefix_int, metric_int; + gboolean success = FALSE; + + const char *pattern_empty = "^\\s*(\\#.*)?$"; + const char *pattern_to1 = "^\\s*(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_to2 = "to\\s+(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_via = "via\\s+(" IPV6_ADDR_REGEX ")"; /* IPv6 of gateway */ + const char *pattern_metric = "metric\\s+(\\d+)"; /* metric */ + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip6 != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + /* Read the route file */ + if (!g_file_get_contents (filename, &contents, &len, NULL)) + return FALSE; + + if (len == 0) { + g_free (contents); + return FALSE; + } + + /* Create regexes for pieces to be matched */ + regex_to1 = g_regex_new (pattern_to1, 0, 0, NULL); + regex_to2 = g_regex_new (pattern_to2, 0, 0, NULL); + regex_via = g_regex_new (pattern_via, 0, 0, NULL); + regex_metric = g_regex_new (pattern_metric, 0, 0, NULL); + + /* New NMIP6Route structure */ + route = nm_ip6_route_new (); + + /* Iterate through file lines */ + lines = g_strsplit_set (contents, "\n\r", -1); + for (iter = lines; iter && *iter; iter++) { + + /* Skip empty lines */ + if (g_regex_match_simple (pattern_empty, *iter, 0, 0)) + continue; + + /* Destination */ + g_regex_match (regex_to1, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_regex_match (regex_to2, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP6 route destination address in record: '%s'", *iter); + goto error; + } + } + dest = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (!strcmp (dest, "default")) + strcpy (dest, "::"); + if (inet_pton (AF_INET6, dest, &ip6_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route destination address '%s'", dest); + g_free (dest); + goto error; + } + nm_ip6_route_set_dest (route, &ip6_addr); + g_free (dest); + + /* Prefix - is optional; 128 if missing */ + prefix = g_match_info_fetch (match_info, 2); + prefix_int = 128; + if (prefix) { + errno = 0; + prefix_int = strtol (prefix, NULL, 10); + if (errno || prefix_int < 0 || prefix_int > 128) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route destination prefix '%s'", prefix); + g_free (prefix); + goto error; + } + } + + nm_ip6_route_set_prefix (route, (guint32) prefix_int); + g_free (prefix); + + /* Next hop */ + g_regex_match (regex_via, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP6 route gateway address in record: '%s'", *iter); + goto error; + } + next_hop = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (inet_pton (AF_INET6, next_hop, &ip6_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route gateway address '%s'", next_hop); + g_free (next_hop); + goto error; + } + nm_ip6_route_set_next_hop (route, &ip6_addr); + g_free (next_hop); + + /* Metric */ + g_regex_match (regex_metric, *iter, 0, &match_info); + metric_int = 0; + if (g_match_info_matches (match_info)) { + metric = g_match_info_fetch (match_info, 1); + errno = 0; + metric_int = strtol (metric, NULL, 10); + if (errno || metric_int < 0 || metric_int > G_MAXUINT32) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route metric '%s'", metric); + g_free (metric); + goto error; + } + g_free (metric); + } + + nm_ip6_route_set_metric (route, (guint32) metric_int); + g_match_info_free (match_info); + + if (!nm_setting_ip6_config_add_route (s_ip6, route)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP6 route"); + } + + success = TRUE; + +error: + g_free (contents); + g_strfreev (lines); + nm_ip6_route_unref (route); + g_regex_unref (regex_to1); + g_regex_unref (regex_to2); + g_regex_unref (regex_via); + g_regex_unref (regex_metric); + + return success; +} + static NMSetting * make_ip4_setting (shvarFile *ifcfg, @@ -990,16 +1237,31 @@ make_ip4_setting (shvarFile *ifcfg, g_free (value); } - /* DNS servers */ + /* DNS servers + * Pick up just IPv4 addresses (IPv6 addresses are taken by make_ip6_setting()) + */ for (i = 1, tmp_success = TRUE; i <= 10 && tmp_success; i++) { char *tag; guint32 dns; + struct in6_addr ip6_dns; + GError *tmp_err = NULL; tag = g_strdup_printf ("DNS%u", i); tmp_success = read_ip4_address (ifcfg, tag, &dns, error); if (!tmp_success) { - g_free (tag); - goto error; + /* if it's IPv6, don't exit */ + dns = 0; + value = svGetValue (ifcfg, tag, FALSE); + if (value) { + tmp_success = parse_ip6_address (value, &ip6_dns, &tmp_err); + g_clear_error (&tmp_err); + g_free (value); + } + if (!tmp_success) { + g_free (tag); + goto error; + } + g_clear_error (error); } if (dns && !nm_setting_ip4_config_add_dns (s_ip4, dns)) @@ -1091,6 +1353,202 @@ error: return NULL; } +static NMSetting * +make_ip6_setting (shvarFile *ifcfg, + const char *network_file, + const char *iscsiadm_path, + GError **error) +{ + NMSettingIP6Config *s_ip6 = NULL; + char *value = NULL; + char *str_value; + char *route6_path = NULL; + gboolean bool_value, ipv6forwarding, ipv6_autoconf; + char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + guint32 i; + shvarFile *network_ifcfg; + gboolean never_default = FALSE, tmp_success; + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + if (!s_ip6) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not allocate IP6 setting"); + return NULL; + } + + /* Is IPV6 enabled? Set method to "ignored", when not enabled */ + str_value = svGetValue (ifcfg, "IPV6INIT", FALSE); + bool_value = svTrueValue (ifcfg, "IPV6INIT", FALSE); + if (!str_value) { + network_ifcfg = svNewFile (network_file); + if (network_ifcfg) { + bool_value = svTrueValue (network_ifcfg, "IPV6INIT", FALSE); + svCloseFile (network_ifcfg); + } + } + g_free (str_value); + + if (!bool_value) { + /* IPv6 is disabled */ + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, + NULL); + return NM_SETTING (s_ip6); + } + + /* First check if IPV6_DEFROUTE is set for this device; IPV6_DEFROUTE has the + * opposite meaning from never-default. The default if IPV6_DEFROUTE is not + * specified is IPV6_DEFROUTE=yes which means that this connection can be used + * as a default route + */ + never_default = !svTrueValue (ifcfg, "IPV6_DEFROUTE", TRUE); + + /* Then check if IPV6_DEFAULTGW or IPV6_DEFAULTDEV is specified; + * they are global and override IPV6_DEFROUTE + * When both are set, the device specified in IPV6_DEFAULTGW takes preference. + */ + network_ifcfg = svNewFile (network_file); + if (network_ifcfg) { + char *ipv6_defaultgw, *ipv6_defaultdev; + char *default_dev = NULL; + + /* Get the connection ifcfg device name and the global default route device */ + value = svGetValue (ifcfg, "DEVICE", FALSE); + ipv6_defaultgw = svGetValue (network_ifcfg, "IPV6_DEFAULTGW", FALSE); + ipv6_defaultdev = svGetValue (network_ifcfg, "IPV6_DEFAULTDEV", FALSE); + + if (ipv6_defaultgw) { + default_dev = strchr (ipv6_defaultgw, '%'); + if (default_dev) + default_dev++; + } + if (!default_dev) + default_dev = ipv6_defaultdev; + + /* If there was a global default route device specified, then only connections + * for that device can be the default connection. + */ + if (default_dev && value) + never_default = !!strcmp (value, default_dev); + + g_free (ipv6_defaultgw); + g_free (ipv6_defaultdev); + g_free (value); + svCloseFile (network_ifcfg); + } + + /* Find out method property */ + ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE); + ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding); + + if (ipv6_autoconf) + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + else { + /* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */ + str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE); + if (!str_value) + str_value = svGetValue (ifcfg, "IPV6ADDR_SECONDARIES", FALSE); + + if (!str_value) + method = NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL; + g_free (str_value); + } + /* TODO - handle other methods */ + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, method, + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "IPV6_PEERDNS", TRUE), + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "IPV6_PEERROUTES", TRUE), + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default, + NULL); + + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + NMIP6Address *addr; + char *val; + char *ipv6addr, *ipv6addr_secondaries; + char **list = NULL, **iter; + + ipv6addr = svGetValue (ifcfg, "IPV6ADDR", FALSE); + ipv6addr_secondaries = svGetValue (ifcfg, "IPV6ADDR_SECONDARIES", FALSE); + + val = g_strjoin (ipv6addr && ipv6addr_secondaries ? " " : NULL, + ipv6addr ? ipv6addr : "", + ipv6addr_secondaries ? ipv6addr_secondaries : "", + NULL); + g_free (ipv6addr); + g_free (ipv6addr_secondaries); + + list = g_strsplit_set (val, " ", 0); + g_free (val); + for (iter = list; iter && *iter; iter++, i++) { + addr = parse_full_ip6_address (*iter, error); + if (!addr) { + g_strfreev (list); + goto error; + } + + if (!nm_setting_ip6_config_add_address (s_ip6, addr)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP6 address"); + nm_ip6_address_unref (addr); + } + g_strfreev (list); + } else if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + /* TODO - autoconf or DHCPv6 stuff goes here */ + } + + /* DNS servers + * Pick up just IPv6 addresses (IPv4 addresses are taken by make_ip4_setting()) + */ + for (i = 1, tmp_success = TRUE; i <= 10 && tmp_success; i++) { + char *tag; + struct in6_addr ip6_dns; + + ip6_dns = in6addr_any; + tag = g_strdup_printf ("DNS%u", i); + value = svGetValue (ifcfg, tag, FALSE); + if (value) + tmp_success = parse_ip6_address (value, &ip6_dns, error); + + if (!tmp_success) { + struct in_addr ip4_addr; + if (inet_pton (AF_INET, value, &ip4_addr) != 1) { + g_free (tag); + g_free (value); + goto error; + } + /* ignore error - it is IPv4 address */ + tmp_success = TRUE; + g_clear_error (error); + } + + if (!IN6_IS_ADDR_UNSPECIFIED (&ip6_dns) && !nm_setting_ip6_config_add_dns (s_ip6, &ip6_dns)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate DNS server %s", tag); + g_free (tag); + g_free (value); + } + + /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */ + + /* Read static routes from route6- file */ + route6_path = utils_get_route6_path (ifcfg->fileName); + if (!route6_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not get route6 file path for '%s'", ifcfg->fileName); + goto error; + } + + read_route6_file (route6_path, s_ip6, error); + g_free (route6_path); + if (error && *error) + goto error; + + return NM_SETTING (s_ip6); + +error: + g_object_unref (s_ip6); + return NULL; +} + static gboolean add_one_wep_key (shvarFile *ifcfg, const char *shvar_key, @@ -2575,13 +3033,14 @@ connection_from_file (const char *filename, char **unmanaged, char **keyfile, char **routefile, + char **route6file, GError **error, gboolean *ignore_error) { NMConnection *connection = NULL; shvarFile *parsed; char *type, *nmc = NULL, *bootproto; - NMSetting *s_ip4; + NMSetting *s_ip4, *s_ip6; const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; @@ -2592,6 +3051,8 @@ connection_from_file (const char *filename, g_return_val_if_fail (*keyfile == NULL, NULL); g_return_val_if_fail (routefile != NULL, NULL); g_return_val_if_fail (*routefile == NULL, NULL); + g_return_val_if_fail (route6file != NULL, NULL); + g_return_val_if_fail (*route6file == NULL, NULL); /* Non-NULL only for unit tests; normally use /etc/sysconfig/network */ if (!network_file) @@ -2694,6 +3155,14 @@ connection_from_file (const char *filename, nm_connection_add_setting (connection, s_ip4); } + s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, error); + if (*error) { + g_object_unref (connection); + connection = NULL; + goto done; + } else if (s_ip6) + nm_connection_add_setting (connection, s_ip6); + /* iSCSI / ibft connections are read-only since their settings are * stored in NVRAM and can only be changed in BIOS. */ @@ -2716,6 +3185,7 @@ connection_from_file (const char *filename, *keyfile = utils_get_keys_path (filename); *routefile = utils_get_route_path (filename); + *route6file = utils_get_route6_path (filename); done: svCloseFile (parsed); diff --git a/system-settings/plugins/ifcfg-rh/reader.h b/system-settings/plugins/ifcfg-rh/reader.h index a5df59c632..2a031977dc 100644 --- a/system-settings/plugins/ifcfg-rh/reader.h +++ b/system-settings/plugins/ifcfg-rh/reader.h @@ -33,6 +33,7 @@ NMConnection *connection_from_file (const char *filename, char **unmanaged, char **keyfile, char **routefile, + char **route6file, GError **error, gboolean *ignore_error); 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 7d55382709..78ac04d487 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -52,7 +52,9 @@ EXTRA_DIST = \ ifcfg-test-wired-static-routes \ route-test-wired-static-routes \ ifcfg-test-wired-static-routes-legacy \ - route-test-wired-static-routes-legacy + route-test-wired-static-routes-legacy \ + ifcfg-test-wired-ipv6-manual \ + route6-test-wired-ipv6-manual check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy index 606f56b798..2173729d17 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy @@ -7,5 +7,6 @@ BOOTPROTO=dhcp DEFROUTE=yes UUID=ba60d05a-7898-820d-c2db-427a88f8f2a5 ONBOOT=yes +IPV6INIT=no PEERDNS=yes PEERROUTES=yes diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no index 266fe1eebd..fe8b15b29a 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no @@ -9,3 +9,7 @@ NM_CONTROLLED=yes PEERDNS=yes DEFROUTE=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes index ede2927301..3cf4323dd2 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes @@ -9,3 +9,7 @@ NM_CONTROLLED=yes PEERDNS=yes DEFROUTE=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual new file mode 100644 index 0000000000..4be4044f18 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual @@ -0,0 +1,18 @@ +# Intel Corporation 82567LM Gigabit Network Connection +TYPE=Ethernet +DEVICE=eth2 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DNS1=10.2.0.4 +DNS2=10.2.0.5 +DNS3=1:2:3:4::a +DNS4=1:2:3:4::b +DOMAIN="lorem.com ipsum.org dolor.edu" +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR="1001:abba::1234/56" +IPV6ADDR_SECONDARIES="2001:abba::2234/64 3001:abba::3234/96" diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default index c059253075..12d5b5e635 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default @@ -7,4 +7,5 @@ ONBOOT=yes USERCTL=yes NM_CONTROLLED=yes PEERDNS=yes - +IPV6INIT=yes +IPV6_AUTOCONF=yes diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static index 7faf49bdae..c8315f45d3 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static @@ -5,7 +5,6 @@ HWADDR=00:11:22:33:44:ee BOOTPROTO=none ONBOOT=yes USERCTL=yes -IPV6INIT=no MTU=1492 NM_CONTROLLED=yes DNS1=4.2.2.1 @@ -13,3 +12,9 @@ DNS2=4.2.2.2 IPADDR=192.168.1.5 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR=dead:beaf::1 +IPV6ADDR_SECONDARIES="dead:beaf::2/56" +DNS3=1:2:3:4::a +DNS4=1:2:3:4::b diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes index b5579c67d4..0d6a302f12 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes @@ -1 +1,2 @@ GATEWAYDEV=eth0 +IPV6_DEFAULTDEV=eth0 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default index b5579c67d4..9a292679a1 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default @@ -1 +1,4 @@ GATEWAYDEV=eth0 +# when devices in IPV6_DEFAULTDEV and IPV6_DEFAULTGW don't match the one in IPV6_DEFAULTGW is prefered +IPV6_DEFAULTDEV=eth4 +IPV6_DEFAULTGW=2001::1234%eth0 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual new file mode 100644 index 0000000000..ae4e47ae55 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual @@ -0,0 +1 @@ +9876::1234/96 via 9876::7777 metric 2 diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 5c899acbda..88ce1fffe9 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -187,6 +188,7 @@ test_read_minimal (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -202,6 +204,7 @@ test_read_minimal (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -319,6 +322,7 @@ test_read_unmanaged (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -334,6 +338,7 @@ test_read_unmanaged (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -430,9 +435,11 @@ test_read_wired_static (const char *file, const char *expected_id) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *unmanaged = FALSE; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const GByteArray *array; @@ -441,9 +448,15 @@ test_read_wired_static (const char *file, const char *expected_id) const char *expected_dns1 = "4.2.2.1"; const char *expected_dns2 = "4.2.2.2"; struct in_addr addr; + struct in6_addr addr6; const char *expected_address1 = "192.168.1.5"; const char *expected_address1_gw = "192.168.1.1"; + const char *expected6_address1 = "dead:beaf::1"; + const char *expected6_address2 = "dead:beaf::2"; + const char *expected6_dns1 = "1:2:3:4::a"; + const char *expected6_dns2 = "1:2:3:4::b"; NMIP4Address *ip4_addr; + NMIP6Address *ip6_addr; connection = connection_from_file (file, NULL, @@ -452,6 +465,7 @@ test_read_wired_static (const char *file, const char *expected_id) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -617,6 +631,89 @@ test_read_wired_static (const char *file, const char *expected_id) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); + if (!strcmp (expected_id, "System test-wired-static")) { + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-static-verify-ip6", "failed to verify %s: missing %s setting", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns1, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns2, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #2", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value #2", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 2, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "wired-static-verify-ip6", "failed to verify %s: missing IP6 address #1", + file); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix", + file); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert IP address #1", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #1", + file); + + /* Address #2 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1); + ASSERT (ip6_addr, + "wired-static-verify-ip6", "failed to verify %s: missing IP6 address #2", + file); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 56, + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #2 prefix", + file); + + ASSERT (inet_pton (AF_INET6, expected6_address2, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert IP address #2", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #2", + file); + } + g_object_unref (connection); } @@ -632,6 +729,7 @@ test_read_wired_dhcp (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const GByteArray *array; @@ -650,6 +748,7 @@ test_read_wired_dhcp (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -802,6 +901,7 @@ test_read_wired_global_gateway (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -818,6 +918,7 @@ test_read_wired_global_gateway (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -923,9 +1024,11 @@ test_read_wired_never_default (void) 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; @@ -938,6 +1041,7 @@ test_read_wired_never_default (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1007,6 +1111,28 @@ test_read_wired_never_default (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS); + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-never-default-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0, + "wired-never-default-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == TRUE, + "wired-never-default-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_object_unref (connection); } @@ -1019,9 +1145,11 @@ test_read_wired_defroute_no (void) 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; @@ -1034,6 +1162,7 @@ test_read_wired_defroute_no (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1096,6 +1225,28 @@ test_read_wired_defroute_no (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_NEVER_DEFAULT); + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-defroute-no-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0, + "wired-defroute-no-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == TRUE, + "wired-defroute-no-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_object_unref (connection); } @@ -1109,9 +1260,11 @@ test_read_wired_defroute_no_gatewaydev_yes (void) 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; @@ -1124,6 +1277,7 @@ test_read_wired_defroute_no_gatewaydev_yes (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1194,6 +1348,28 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_NEVER_DEFAULT); + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-defroute-no-gatewaydev-yes-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, + "wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE, + "wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_object_unref (connection); } @@ -1209,6 +1385,7 @@ test_read_wired_static_routes (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -1227,6 +1404,7 @@ test_read_wired_static_routes (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); @@ -1355,6 +1533,7 @@ test_read_wired_static_routes (void) g_free (keyfile); g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1370,6 +1549,7 @@ test_read_wired_static_routes_legacy (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -1390,6 +1570,7 @@ test_read_wired_static_routes_legacy (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); @@ -1557,6 +1738,300 @@ test_read_wired_static_routes_legacy (void) g_free (keyfile); g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_IPV6_MANUAL TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-ipv6-manual" + +static void +test_read_wired_ipv6_manual (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_id = "System test-wired-ipv6-manual"; + const char *expected_address1 = "1001:abba::1234"; + const char *expected_address2 = "2001:abba::2234"; + const char *expected_address3 = "3001:abba::3234"; + guint32 expected_prefix1 = 56; + guint32 expected_prefix2 = 64; + guint32 expected_prefix3 = 96; + const char *expected_route1_dest = "9876::1234"; + guint32 expected_route1_prefix = 96; + const char *expected_route1_nexthop = "9876::7777"; + guint32 expected_route1_metric = 2; + const char *expected_dns1 = "1:2:3:4::a"; + const char *expected_dns2 = "1:2:3:4::b"; + NMIP6Address *ip6_addr; + NMIP6Route *ip6_route; + struct in6_addr addr; + + connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_MANUAL, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-ipv6-manual-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_MANUAL, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-ipv6-manual-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_MANUAL, error->message); + + ASSERT (unmanaged == FALSE, + "wired-ipv6-manual-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-ipv6-manual-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-ipv6-manual-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-ipv6-manual-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-ipv6-manual-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* DNS search domains */ + ASSERT (nm_setting_ip4_config_get_num_dns_searches (s_ip4) == 3, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 0); + ASSERT (tmp != NULL, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + ASSERT (strcmp (tmp, "lorem.com") == 0, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + + tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 1); + ASSERT (tmp != NULL, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + ASSERT (strcmp (tmp, "ipsum.org") == 0, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + + tmp = nm_setting_ip4_config_get_dns_search (s_ip4, 2); + ASSERT (tmp != NULL, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + ASSERT (strcmp (tmp, "dolor.edu") == 0, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == FALSE, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + + /* IP addresses */ + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 3, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix1, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_address1, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* Address #2 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1); + ASSERT (ip6_addr, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #2", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix2, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #2 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_address2, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #2", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #2", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* Address #3 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 2); + ASSERT (ip6_addr, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 address #3", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix3, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #3 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_address3, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP address #3", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 address #3", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* Routes */ + ASSERT (nm_setting_ip6_config_get_num_routes (s_ip6) == 1, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + /* Route #1 */ + ip6_route = nm_setting_ip6_config_get_route (s_ip6, 0); + ASSERT (ip6_route, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 route #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_route1_dest, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP route dest #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_dest (ip6_route), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route dest #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_route_get_prefix (ip6_route) == expected_route1_prefix, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route #1 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_route1_nexthop, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP route next_hop #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_next_hop (ip6_route), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route next hop #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_route_get_metric (ip6_route) == expected_route1_metric, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route #1 metric", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected_dns1, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected_dns2, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value #2", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + /* DNS domains - none as domains are stuffed to 'ipv4' setting */ + ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1570,6 +2045,7 @@ test_read_onboot_no (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; @@ -1580,6 +2056,7 @@ test_read_onboot_no (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1623,6 +2100,7 @@ test_read_wired_8021x_peap_mschapv2 (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -1639,6 +2117,7 @@ test_read_wired_8021x_peap_mschapv2 (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1805,6 +2284,7 @@ test_read_wifi_open (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -1823,6 +2303,7 @@ test_read_wifi_open (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -1980,6 +2461,7 @@ test_read_wifi_open_auto (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -1993,6 +2475,7 @@ test_read_wifi_open_auto (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2056,6 +2539,7 @@ test_read_wifi_open_ssid_hex (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2070,6 +2554,7 @@ test_read_wifi_open_ssid_hex (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2135,6 +2620,7 @@ test_read_wifi_open_ssid_bad (const char *file, const char *test) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; @@ -2145,6 +2631,7 @@ test_read_wifi_open_ssid_bad (const char *file, const char *test) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); @@ -2162,6 +2649,7 @@ test_read_wifi_open_ssid_quoted (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2176,6 +2664,7 @@ test_read_wifi_open_ssid_quoted (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2247,6 +2736,7 @@ test_read_wifi_wep (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2266,6 +2756,7 @@ test_read_wifi_wep (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2510,6 +3001,7 @@ test_read_wifi_wep_adhoc (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2529,6 +3021,7 @@ test_read_wifi_wep_adhoc (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2771,6 +3264,7 @@ test_read_wifi_leap (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2785,6 +3279,7 @@ test_read_wifi_leap (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -2906,6 +3401,7 @@ test_read_wifi_wpa_psk (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -2935,6 +3431,7 @@ test_read_wifi_wpa_psk (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3218,6 +3715,7 @@ test_read_wifi_wpa_psk_unquoted (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -3231,6 +3729,7 @@ test_read_wifi_wpa_psk_unquoted (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3314,6 +3813,7 @@ test_read_wifi_wpa_psk_unquoted2 (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; @@ -3328,6 +3828,7 @@ test_read_wifi_wpa_psk_unquoted2 (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection == NULL, @@ -3348,6 +3849,7 @@ test_read_wifi_wpa_psk_adhoc (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -3365,6 +3867,7 @@ test_read_wifi_wpa_psk_adhoc (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3534,6 +4037,7 @@ test_read_wifi_wpa_psk_hex (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -3550,6 +4054,7 @@ test_read_wifi_wpa_psk_hex (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3686,6 +4191,7 @@ test_read_wifi_wpa_eap_tls (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp, *password; @@ -3699,6 +4205,7 @@ test_read_wifi_wpa_eap_tls (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3830,6 +4337,7 @@ test_read_wifi_wpa_eap_ttls_tls (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp, *password; @@ -3843,6 +4351,7 @@ test_read_wifi_wpa_eap_ttls_tls (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -3996,6 +4505,7 @@ test_read_wifi_wep_eap_ttls_chap (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -4010,6 +4520,7 @@ test_read_wifi_wep_eap_ttls_chap (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -4148,7 +4659,8 @@ test_write_wired_static (void) NMConnection *reread; NMSettingConnection *s_con; NMSettingWired *s_wired; - NMSettingIP4Config *s_ip4; + NMSettingIP4Config *s_ip4, *reread_s_ip4; + NMSettingIP6Config *s_ip6, *reread_s_ip6; static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; GByteArray *mac; guint32 mtu = 1492; @@ -4162,15 +4674,35 @@ test_write_wired_static (void) const guint32 prefix = 24; const char *dns_search1 = "foobar.com"; const char *dns_search2 = "lab.foobar.com"; + const char *dns_search3 = "foobar6.com"; + const char *dns_search4 = "lab6.foobar.com"; + struct in6_addr ip6, ip6_1, ip6_2; + struct in6_addr route1_dest, route2_dest, route1_nexthop, route2_nexthop; + struct in6_addr dns6_1, dns6_2; + const guint32 route1_prefix = 64, route2_prefix = 0; + const guint32 route1_metric = 99, route2_metric = 1; NMIP4Address *addr; + NMIP6Address *addr6; + NMIP6Route *route6; gboolean success; GError *error = NULL; char *testfile = NULL; char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; + inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6); + inet_pton (AF_INET6, "2003:1234:abcd::2", &ip6_1); + inet_pton (AF_INET6, "3003:1234:abcd::3", &ip6_2); + inet_pton (AF_INET6, "2222:aaaa:bbbb:cccc::", &route1_dest); + inet_pton (AF_INET6, "2222:aaaa:bbbb:cccc:dddd:eeee:5555:6666", &route1_nexthop); + inet_pton (AF_INET6, "::", &route2_dest); + inet_pton (AF_INET6, "2222:aaaa::9999", &route2_nexthop); + inet_pton (AF_INET6, "fade:0102:0103::face", &dns6_1); + inet_pton (AF_INET6, "cafe:ffff:eeee:dddd:cccc:bbbb:aaaa:feed", &dns6_2); + connection = nm_connection_new (); ASSERT (connection != NULL, "wired-static-write", "failed to allocate new connection"); @@ -4239,6 +4771,61 @@ test_write_wired_static (void) nm_setting_ip4_config_add_dns_search (s_ip4, dns_search1); nm_setting_ip4_config_add_dns_search (s_ip4, dns_search2); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-static-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + + /* Add addresses */ + addr6 = nm_ip6_address_new (); + nm_ip6_address_set_address (addr6, &ip6); + nm_ip6_address_set_prefix (addr6, 11); + nm_setting_ip6_config_add_address (s_ip6, addr6); + nm_ip6_address_unref (addr6); + + addr6 = nm_ip6_address_new (); + nm_ip6_address_set_address (addr6, &ip6_1); + nm_ip6_address_set_prefix (addr6, 22); + nm_setting_ip6_config_add_address (s_ip6, addr6); + nm_ip6_address_unref (addr6); + + addr6 = nm_ip6_address_new (); + nm_ip6_address_set_address (addr6, &ip6_2); + nm_ip6_address_set_prefix (addr6, 33); + nm_setting_ip6_config_add_address (s_ip6, addr6); + nm_ip6_address_unref (addr6); + + /* Add routes */ + route6 = nm_ip6_route_new (); + nm_ip6_route_set_dest (route6, &route1_dest); + nm_ip6_route_set_prefix (route6, route1_prefix); + nm_ip6_route_set_next_hop (route6, &route1_nexthop); + nm_ip6_route_set_metric (route6, route1_metric); + nm_setting_ip6_config_add_route (s_ip6, route6); + nm_ip6_route_unref (route6); + + route6 = nm_ip6_route_new (); + nm_ip6_route_set_dest (route6, &route2_dest); + nm_ip6_route_set_prefix (route6, route2_prefix); + nm_ip6_route_set_next_hop (route6, &route2_nexthop); + nm_ip6_route_set_metric (route6, route2_metric); + nm_setting_ip6_config_add_route (s_ip6, route6); + nm_ip6_route_unref (route6); + + /* DNS servers */ + nm_setting_ip6_config_add_dns (s_ip6, &dns6_1); + nm_setting_ip6_config_add_dns (s_ip6, &dns6_2); + + /* DNS domains */ + nm_setting_ip6_config_add_dns_search (s_ip6, dns_search3); + nm_setting_ip6_config_add_dns_search (s_ip6, dns_search4); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wired-static-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -4263,6 +4850,7 @@ test_write_wired_static (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -4273,10 +4861,27 @@ test_write_wired_static (void) ASSERT (nm_connection_verify (reread, &error), "wired-static-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + /* FIXME: currently DNS domains from IPv6 setting are stored in 'DOMAIN' key in ifcfg-file + * However after re-reading they are dropped into IPv4 setting. + * So, in order to comparison succeeded, move DNS domains back to IPv6 setting. + */ + reread_s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP4_CONFIG)); + reread_s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP6_CONFIG)); + nm_setting_ip6_config_add_dns_search (reread_s_ip6, nm_setting_ip4_config_get_dns_search (reread_s_ip4, 2)); + nm_setting_ip6_config_add_dns_search (reread_s_ip6, nm_setting_ip4_config_get_dns_search (reread_s_ip4, 3)); + nm_setting_ip4_config_remove_dns_search (reread_s_ip4, 3); + nm_setting_ip4_config_remove_dns_search (reread_s_ip4, 2); + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "wired-static-write", "written and re-read connection weren't the same."); + if (route6file) + unlink (route6file); + g_free (testfile); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -4289,6 +4894,7 @@ test_write_wired_dhcp (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -4296,6 +4902,7 @@ test_write_wired_dhcp (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; connection = nm_connection_new (); @@ -4344,6 +4951,17 @@ test_write_wired_dhcp (void) "wired-dhcp-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, + NULL); + /* Save the ifcfg */ success = writer_new_connection (connection, TEST_SCRATCH_DIR "/network-scripts/", @@ -4364,6 +4982,7 @@ test_write_wired_dhcp (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -4397,6 +5016,8 @@ test_read_write_static_routes_legacy (void) char *keyfile2 = NULL; char *routefile = NULL; char *routefile2 = NULL; + char *route6file = NULL; + char *route6file2 = NULL; gboolean ignore_error = FALSE; gboolean success; GError *error = NULL; @@ -4409,6 +5030,7 @@ test_read_write_static_routes_legacy (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -4495,10 +5117,12 @@ test_read_write_static_routes_legacy (void) &unmanaged, &keyfile2, &routefile2, + &route6file2, &error, &ignore_error); unlink (testfile); unlink (routefile2); + unlink (route6file2); ASSERT (reread != NULL, "read-write-static-routes-legacy-reread", "failed to read %s: %s", testfile, error->message); @@ -4517,6 +5141,8 @@ test_read_write_static_routes_legacy (void) g_free (keyfile2); g_free (routefile); g_free (routefile2); + g_free (route6file); + g_free (route6file2); g_object_unref (connection); g_object_unref (reread); } @@ -4529,6 +5155,7 @@ test_write_wired_static_routes (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; GByteArray *mac; guint32 mtu = 1492; @@ -4554,6 +5181,7 @@ test_write_wired_static_routes (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; connection = nm_connection_new (); @@ -4640,6 +5268,15 @@ test_write_wired_static_routes (void) nm_setting_ip4_config_add_dns_search (s_ip4, dns_search1); nm_setting_ip4_config_add_dns_search (s_ip4, dns_search2); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wired-static-routes-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -4664,6 +5301,7 @@ test_write_wired_static_routes (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -4684,6 +5322,7 @@ test_write_wired_static_routes (void) g_free (testfile); g_free (keyfile); g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -4696,6 +5335,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; NMSetting8021x *s_8021x; char *uuid; gboolean success; @@ -4704,6 +5344,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; connection = nm_connection_new (); @@ -4742,6 +5383,15 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + /* 802.1x setting */ s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); ASSERT (s_8021x != NULL, @@ -4792,6 +5442,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -4822,6 +5473,7 @@ test_write_wifi_open (void) NMSettingConnection *s_con; NMSettingWireless *s_wifi; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -4829,6 +5481,7 @@ test_write_wifi_open (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; @@ -4895,6 +5548,15 @@ test_write_wifi_open (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-open-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-open-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -4919,6 +5581,7 @@ test_write_wifi_open (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -4945,6 +5608,7 @@ test_write_wifi_open_hex_ssid (void) NMSettingConnection *s_con; NMSettingWireless *s_wifi; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -4952,6 +5616,7 @@ test_write_wifi_open_hex_ssid (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -5002,6 +5667,15 @@ test_write_wifi_open_hex_ssid (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-open-hex-ssid-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-open-hex-ssid-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5026,6 +5700,7 @@ test_write_wifi_open_hex_ssid (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5053,6 +5728,7 @@ test_write_wifi_wep (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5060,6 +5736,7 @@ test_write_wifi_wep (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = "blahblah"; @@ -5129,6 +5806,15 @@ test_write_wifi_wep (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wep-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5153,6 +5839,7 @@ test_write_wifi_wep (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5192,6 +5879,7 @@ test_write_wifi_wep_adhoc (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5199,6 +5887,7 @@ test_write_wifi_wep_adhoc (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = "blahblah"; @@ -5276,6 +5965,15 @@ test_write_wifi_wep_adhoc (void) nm_setting_ip4_config_add_dns (s_ip4, dns1); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wep-adhoc-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5300,6 +5998,7 @@ test_write_wifi_wep_adhoc (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5339,6 +6038,7 @@ test_write_wifi_leap (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5346,6 +6046,7 @@ test_write_wifi_leap (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = "blahblah"; @@ -5412,6 +6113,15 @@ test_write_wifi_leap (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-leap-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-leap-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5436,6 +6146,7 @@ test_write_wifi_leap (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5480,6 +6191,7 @@ test_write_wifi_wpa_psk (const char *name, NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid, *tmp; gboolean success; GError *error = NULL; @@ -5487,6 +6199,7 @@ test_write_wifi_wpa_psk (const char *name, char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = "blahblah"; @@ -5567,6 +6280,15 @@ test_write_wifi_wpa_psk (const char *name, g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + test_name, "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, test_name, "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5591,6 +6313,7 @@ test_write_wifi_wpa_psk (const char *name, &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5624,6 +6347,7 @@ test_write_wifi_wpa_psk_adhoc (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5631,6 +6355,7 @@ test_write_wifi_wpa_psk_adhoc (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const unsigned char ssid_data[] = "blahblah"; @@ -5714,6 +6439,15 @@ test_write_wifi_wpa_psk_adhoc (void) nm_setting_ip4_config_add_dns (s_ip4, dns1); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wpa-psk-adhoc-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5738,6 +6472,7 @@ test_write_wifi_wpa_psk_adhoc (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5770,6 +6505,7 @@ test_write_wifi_wpa_eap_tls (void) NMSettingWirelessSecurity *s_wsec; NMSetting8021x *s_8021x; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5777,6 +6513,7 @@ test_write_wifi_wpa_eap_tls (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const char *ssid_data = "blahblah"; @@ -5879,6 +6616,15 @@ test_write_wifi_wpa_eap_tls (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wpa-eap-tls-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -5903,6 +6649,7 @@ test_write_wifi_wpa_eap_tls (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -5935,6 +6682,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) NMSettingWirelessSecurity *s_wsec; NMSetting8021x *s_8021x; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -5942,6 +6690,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const char *ssid_data = "blahblah"; @@ -6062,6 +6811,15 @@ test_write_wifi_wpa_eap_ttls_tls (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wpa-eap-ttls-tls-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -6086,6 +6844,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -6118,6 +6877,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) NMSettingWirelessSecurity *s_wsec; NMSetting8021x *s_8021x; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; gboolean success; GError *error = NULL; @@ -6125,6 +6885,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GByteArray *ssid; const char *ssid_data = "blahblah"; @@ -6217,6 +6978,15 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + ASSERT (nm_connection_verify (connection, &error) == TRUE, "wifi-wpa-eap-ttls-mschapv2-write", "failed to verify connection: %s", (error && error->message) ? error->message : "(unknown)"); @@ -6241,6 +7011,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); unlink (testfile); @@ -6275,6 +7046,7 @@ test_read_ibft_dhcp (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -6290,6 +7062,7 @@ test_read_ibft_dhcp (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -6408,6 +7181,7 @@ test_read_ibft_static (void) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; @@ -6429,6 +7203,7 @@ test_read_ibft_static (void) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection != NULL, @@ -6613,6 +7388,7 @@ test_read_ibft_malformed (const char *name, const char *iscsiadm_path) char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; + char *route6file = NULL; gboolean ignore_error = FALSE; GError *error = NULL; @@ -6623,6 +7399,7 @@ test_read_ibft_malformed (const char *name, const char *iscsiadm_path) &unmanaged, &keyfile, &routefile, + &route6file, &error, &ignore_error); ASSERT (connection == NULL, @@ -6925,6 +7702,7 @@ int main (int argc, char **argv) test_read_wired_defroute_no_gatewaydev_yes (); test_read_wired_static_routes (); test_read_wired_static_routes_legacy (); + test_read_wired_ipv6_manual (); test_read_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 3194c2157b..211458bec8 100644 --- a/system-settings/plugins/ifcfg-rh/utils.c +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -149,7 +149,8 @@ utils_should_ignore_file (const char *filename, gboolean only_ifcfg) if (only_ifcfg == FALSE) { if ( !strncmp (base, KEYS_TAG, strlen (KEYS_TAG)) - || !strncmp (base, ROUTE_TAG, strlen (ROUTE_TAG))) + || !strncmp (base, ROUTE_TAG, strlen (ROUTE_TAG)) + || !strncmp (base, ROUTE6_TAG, strlen (ROUTE6_TAG))) is_other = TRUE; } @@ -208,6 +209,8 @@ utils_get_ifcfg_name (const char *file, gboolean only_ifcfg) name = start + strlen (KEYS_TAG); else if (!strncmp (start, ROUTE_TAG, strlen (ROUTE_TAG))) name = start + strlen (ROUTE_TAG); + else if (!strncmp (start, ROUTE6_TAG, strlen (ROUTE6_TAG))) + name = start + strlen (ROUTE6_TAG); } return name; @@ -259,6 +262,12 @@ utils_get_route_path (const char *parent) return utils_get_extra_path (parent, ROUTE_TAG); } +char * +utils_get_route6_path (const char *parent) +{ + return utils_get_extra_path (parent, ROUTE6_TAG); +} + shvarFile * utils_get_extra_ifcfg (const char *parent, const char *tag, gboolean should_create) { @@ -291,9 +300,15 @@ utils_get_route_ifcfg (const char *parent, gboolean should_create) return utils_get_extra_ifcfg (parent, ROUTE_TAG, should_create); } +shvarFile * +utils_get_route6_ifcfg (const char *parent, gboolean should_create) +{ + return utils_get_extra_ifcfg (parent, ROUTE6_TAG, should_create); +} + /* Finds out if route file has new or older format * Returns TRUE - new syntax (ADDRESS=a.b.c.d ...), error opening file or empty - * FALSE - legacy syntax (1.2.3.0/24 via 11.22.33.44) + * FALSE - older syntax, i.e. argument to 'ip route add' (1.2.3.0/24 via 11.22.33.44) */ gboolean utils_has_route_file_new_syntax (const char *filename) diff --git a/system-settings/plugins/ifcfg-rh/utils.h b/system-settings/plugins/ifcfg-rh/utils.h index 00dbcdcc97..d5e3a13354 100644 --- a/system-settings/plugins/ifcfg-rh/utils.h +++ b/system-settings/plugins/ifcfg-rh/utils.h @@ -38,10 +38,12 @@ gboolean utils_should_ignore_file (const char *filename, gboolean only_ifcfg); char *utils_get_ifcfg_path (const char *parent); char *utils_get_keys_path (const char *parent); char *utils_get_route_path (const char *parent); +char *utils_get_route6_path (const char *parent); shvarFile *utils_get_extra_ifcfg (const char *parent, const char *tag, gboolean should_create); shvarFile *utils_get_keys_ifcfg (const char *parent, gboolean should_create); shvarFile *utils_get_route_ifcfg (const char *parent, gboolean should_create); +shvarFile *utils_get_route6_ifcfg (const char *parent, gboolean should_create); gboolean utils_has_route_file_new_syntax (const char *filename); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 8a54855cb5..767c352435 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -855,8 +856,10 @@ write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError g_return_val_if_fail (*error == NULL, FALSE); num = nm_setting_ip4_config_get_num_routes (s_ip4); - if (num == 0) + if (num == 0) { + unlink (filename); return TRUE; + } route_items = g_malloc0 (sizeof (char*) * (num + 1)); for (i = 0; i < num; i++) { @@ -1117,6 +1120,213 @@ out: return success; } +static gboolean +write_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **error) +{ + char dest[INET6_ADDRSTRLEN]; + char next_hop[INET6_ADDRSTRLEN]; + char **route_items; + char *route_contents; + NMIP6Route *route; + const struct in6_addr *ip; + guint32 prefix, metric; + guint32 i, num; + gboolean success = FALSE; + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip6 != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + num = nm_setting_ip6_config_get_num_routes (s_ip6); + if (num == 0) { + unlink (filename); + return TRUE; + } + + route_items = g_malloc0 (sizeof (char*) * (num + 1)); + for (i = 0; i < num; i++) { + route = nm_setting_ip6_config_get_route (s_ip6, i); + + memset (dest, 0, sizeof (dest)); + ip = nm_ip6_route_get_dest (route); + inet_ntop (AF_INET6, (const void *) ip, &dest[0], sizeof (dest)); + + prefix = nm_ip6_route_get_prefix (route); + + memset (next_hop, 0, sizeof (next_hop)); + ip = nm_ip6_route_get_next_hop (route); + inet_ntop (AF_INET6, (const void *) ip, &next_hop[0], sizeof (next_hop)); + + metric = nm_ip6_route_get_metric (route); + + route_items[i] = g_strdup_printf ("%s/%u via %s metric %u\n", dest, prefix, next_hop, metric); + } + route_items[num] = NULL; + route_contents = g_strjoinv (NULL, route_items); + g_strfreev (route_items); + + if (!g_file_set_contents (filename, route_contents, -1, NULL)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Writing route6 file '%s' failed", filename); + goto error; + } + + success = TRUE; + +error: + g_free (route_contents); + return success; +} + +static gboolean +write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) +{ + NMSettingIP6Config *s_ip6; + NMSettingIP4Config *s_ip4; + const char *value; + char *addr_key, *prefix; + guint32 i, num, num4; + GString *searches; + char buf[INET6_ADDRSTRLEN]; + NMIP6Address *addr; + const struct in6_addr *ip; + GString *ip_str1, *ip_str2, *ip_ptr; + char *route6_path; + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (!s_ip6) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_IP6_CONFIG_SETTING_NAME); + return FALSE; + } + + value = nm_setting_ip6_config_get_method (s_ip6); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + svSetValue (ifcfg, "IPV6INIT", "no", FALSE); + return TRUE; + } + else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); + } + else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + } + else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + } + else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + /* TODO */ + } + + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* Write out IP addresses */ + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + + ip_str1 = g_string_new (NULL); + ip_str2 = g_string_new (NULL); + for (i = 0; i < num; i++) { + if (i == 0) + ip_ptr = ip_str1; + else + ip_ptr = ip_str2; + + addr = nm_setting_ip6_config_get_address (s_ip6, i); + ip = nm_ip6_address_get_address (addr); + prefix = g_strdup_printf ("%u", nm_ip6_address_get_prefix (addr)); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + if (i > 1) + g_string_append_c (ip_ptr, ' '); /* separate addresses in IPV6ADDR_SECONDARIES */ + g_string_append (ip_ptr, buf); + g_string_append_c (ip_ptr, '/'); + g_string_append (ip_ptr, prefix); + g_free (prefix); + } + + svSetValue (ifcfg, "IPV6ADDR", ip_str1->str, FALSE); + svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", ip_str2->str, FALSE); + g_string_free (ip_str1, TRUE); + g_string_free (ip_str2, TRUE); + } + + /* Write out DNS - 'DNS' key is used both for IPv4 and IPv6 */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + num4 = s_ip4 ? nm_setting_ip4_config_get_num_dns (s_ip4) : 0; /* from where to start with IPv6 entries */ + num = nm_setting_ip6_config_get_num_dns (s_ip6); + for (i = 0; i < 254; i++) { + addr_key = g_strdup_printf ("DNS%d", i + num4 + 1); + + if (i >= num) + svSetValue (ifcfg, addr_key, NULL, FALSE); + else { + ip = nm_setting_ip6_config_get_dns (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + svSetValue (ifcfg, addr_key, buf, FALSE); + } + g_free (addr_key); + } + + /* Write out DNS domains - 'DOMAIN' key is shared for both IPv4 and IPv6 domains */ + num = nm_setting_ip6_config_get_num_dns_searches (s_ip6); + if (num > 0) { + char *ip4_domains; + ip4_domains = svGetValue (ifcfg, "DOMAIN", FALSE); + searches = g_string_new (ip4_domains); + for (i = 0; i < num; i++) { + if (searches->len > 0) + g_string_append_c (searches, ' '); + g_string_append (searches, nm_setting_ip6_config_get_dns_search (s_ip6, i)); + } + svSetValue (ifcfg, "DOMAIN", searches->str, FALSE); + g_string_free (searches, TRUE); + g_free (ip4_domains); + } + + /* handle IPV6_DEFROUTE */ + /* IPV6_DEFROUTE has the opposite meaning from 'never-default' */ + if (nm_setting_ip6_config_get_never_default(s_ip6)) + svSetValue (ifcfg, "IPV6_DEFROUTE", "no", FALSE); + else + svSetValue (ifcfg, "IPV6_DEFROUTE", "yes", FALSE); + + svSetValue (ifcfg, "IPV6_PEERDNS", NULL, FALSE); + svSetValue (ifcfg, "IPV6_PEERROUTES", NULL, FALSE); + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + svSetValue (ifcfg, "IPV6_PEERDNS", + nm_setting_ip6_config_get_ignore_auto_dns (s_ip6) ? "no" : "yes", + FALSE); + + svSetValue (ifcfg, "IPV6_PEERROUTES", + nm_setting_ip6_config_get_ignore_auto_routes (s_ip6) ? "no" : "yes", + FALSE); + } + + /* Static routes go to route6- file */ + route6_path = utils_get_route6_path (ifcfg->fileName); + if (!route6_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not get route6 file path for '%s'", ifcfg->fileName); + goto error; + } + write_route6_file (route6_path, s_ip6, error); + g_free (route6_path); + if (error && *error) + goto error; + + return TRUE; + +error: + return FALSE; +} + static char * escape_id (const char *id) { @@ -1142,11 +1352,11 @@ write_connection (NMConnection *connection, const char *ifcfg_dir, const char *filename, const char *keyfile, - const char *routefile, char **out_filename, GError **error) { NMSettingConnection *s_con; + NMSettingIP6Config *s_ip6; gboolean success = FALSE; shvarFile *ifcfg = NULL; char *ifcfg_name = NULL; @@ -1216,6 +1426,12 @@ write_connection (NMConnection *connection, if (!write_ip4_setting (connection, ifcfg, error)) goto out; + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) { + if (!write_ip6_setting (connection, ifcfg, error)) + goto out; + } + write_connection_setting (s_con, ifcfg); if (svWriteFile (ifcfg, 0644)) { @@ -1243,7 +1459,7 @@ writer_new_connection (NMConnection *connection, char **out_filename, GError **error) { - return write_connection (connection, ifcfg_dir, NULL, NULL, NULL, out_filename, error); + return write_connection (connection, ifcfg_dir, NULL, NULL, out_filename, error); } gboolean @@ -1251,9 +1467,8 @@ writer_update_connection (NMConnection *connection, const char *ifcfg_dir, const char *filename, const char *keyfile, - const char *routefile, GError **error) { - return write_connection (connection, ifcfg_dir, filename, keyfile, routefile, NULL, error); + return write_connection (connection, ifcfg_dir, filename, keyfile, NULL, error); } diff --git a/system-settings/plugins/ifcfg-rh/writer.h b/system-settings/plugins/ifcfg-rh/writer.h index 2762705312..edeac0cccc 100644 --- a/system-settings/plugins/ifcfg-rh/writer.h +++ b/system-settings/plugins/ifcfg-rh/writer.h @@ -34,7 +34,6 @@ gboolean writer_update_connection (NMConnection *connection, const char *ifcfg_dir, const char *filename, const char *keyfile, - const char *routefile, GError **error); #endif /* _WRITER_H_ */ From a74e2cfde052120753bd2050fb9a7a1dc79e8a8f Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Fri, 8 Jan 2010 11:23:39 -0800 Subject: [PATCH 015/392] keyfile: add IPv6 support (bgo #593814) (fixes by dcbw to use '/' as the prefix separator) --- system-settings/plugins/keyfile/io/reader.c | 333 +++++++++++++++++- system-settings/plugins/keyfile/io/writer.c | 200 ++++++++++- .../tests/keyfiles/Test_Wired_Connection | 10 + .../plugins/keyfile/tests/test-keyfile.c | 280 ++++++++++++++- 4 files changed, 803 insertions(+), 20 deletions(-) diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index 13c4b12703..3a4ec42e84 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -15,8 +15,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2009 Novell, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -69,7 +70,7 @@ get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *ou errno = 0; tmp = strtol (str, NULL, 10); if (errno || (tmp < 0) || (tmp > max_val)) { - g_warning ("%s: ignoring invalid IPv4 %s item '%s'", __func__, key_name, str); + g_warning ("%s: ignoring invalid IP %s item '%s'", __func__, key_name, str); return FALSE; } @@ -78,13 +79,13 @@ get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *ou } static void -free_one_address (gpointer data, gpointer user_data) +free_one_ip4_address (gpointer data, gpointer user_data) { g_array_free ((GArray *) data, TRUE); } static GPtrArray * -read_addresses (GKeyFile *file, +read_ip4_addresses (GKeyFile *file, const char *setting_name, const char *key) { @@ -166,27 +167,27 @@ ip4_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) GPtrArray *addresses; const char *setting_name = nm_setting_get_name (setting); - addresses = read_addresses (keyfile, setting_name, key); + addresses = read_ip4_addresses (keyfile, setting_name, key); /* Work around for previous syntax */ if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) - addresses = read_addresses (keyfile, setting_name, "address"); + addresses = read_ip4_addresses (keyfile, setting_name, "address"); if (addresses) { g_object_set (setting, key, addresses, NULL); - g_ptr_array_foreach (addresses, free_one_address, NULL); + g_ptr_array_foreach (addresses, free_one_ip4_address, NULL); g_ptr_array_free (addresses, TRUE); } } static void -free_one_route (gpointer data, gpointer user_data) +free_one_ip4_route (gpointer data, gpointer user_data) { g_array_free ((GArray *) data, TRUE); } static GPtrArray * -read_routes (GKeyFile *file, +read_ip4_routes (GKeyFile *file, const char *setting_name, const char *key) { @@ -272,10 +273,10 @@ ip4_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) GPtrArray *routes; const char *setting_name = nm_setting_get_name (setting); - routes = read_routes (keyfile, setting_name, key); + routes = read_ip4_routes (keyfile, setting_name, key); if (routes) { g_object_set (setting, key, routes, NULL); - g_ptr_array_foreach (routes, free_one_route, NULL); + g_ptr_array_foreach (routes, free_one_ip4_route, NULL); g_ptr_array_free (routes, TRUE); } } @@ -303,8 +304,9 @@ ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) continue; } - g_array_append_val (array, addr.s_addr); + g_array_append_val (array, addr.s_addr); } + g_strfreev (list); if (array) { g_object_set (setting, key, array, NULL); @@ -312,6 +314,294 @@ ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) } } +static void +free_one_ip6_address (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static char * +split_prefix (char *addr) +{ + char *slash; + + g_return_val_if_fail (addr != NULL, NULL); + + /* Find the prefix and split the string */ + slash = strchr (addr, '/'); + if (slash && slash > addr) { + slash++; + *(slash - 1) = '\0'; + } + + return slash; +} + +static GPtrArray * +read_ip6_addresses (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *addresses; + struct in6_addr addr; + guint32 prefix; + int i = 0; + + addresses = g_ptr_array_sized_new (3); + + /* Look for individual addresses */ + while (i++ < 1000) { + char *tmp, *key_name, *str_prefix; + int ret; + GValueArray *values; + GByteArray *address; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string (file, setting_name, key_name, NULL); + g_free (key_name); + + if (!tmp) + break; /* all done */ + + /* convert the string array into IPv6 addresses */ + values = g_value_array_new (2); /* NMIP6Address has 2 items */ + + /* Split the address and prefix */ + str_prefix = split_prefix (tmp); + + /* address */ + ret = inet_pton (AF_INET6, tmp, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* Missing prefix defaults to /64 */ + prefix = 64; + } + + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + g_ptr_array_add (addresses, values); + +next: + g_free (tmp); + } + + if (addresses->len < 1) { + g_ptr_array_free (addresses, TRUE); + addresses = NULL; + } + + return addresses; +} + +static void +ip6_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *addresses; + const char *setting_name = nm_setting_get_name (setting); + + addresses = read_ip6_addresses (keyfile, setting_name, key); + + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_ip6_address, NULL); + g_ptr_array_free (addresses, TRUE); + } +} + +static void +free_one_ip6_route (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static GPtrArray * +read_ip6_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + struct in6_addr addr; + guint32 prefix, metric; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp; + char *key_name, *str_prefix; + gsize length = 0; + int ret; + GValueArray *values; + GByteArray *address; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 3) { + g_warning ("%s: ignoring invalid IPv6 address item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IPv6 routes */ + values = g_value_array_new (4); /* NMIP6Route has 4 items */ + + /* Split the route and prefix */ + str_prefix = split_prefix (tmp[0]); + + /* destination address */ + ret = inet_pton (AF_INET6, tmp[0], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[0]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* default to 64 if unspecified */ + prefix = 64; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* next hop address */ + ret = inet_pton (AF_INET6, tmp[1], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[1]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* metric */ + metric = 0; + if (!get_one_int (tmp[2], G_MAXUINT32, key_name, &metric)) { + g_value_array_free (values); + goto next; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, metric); + g_value_array_append (values, &value); + g_value_unset (&value); + + g_ptr_array_add (routes, values); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + +static void +ip6_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *routes; + const char *setting_name = nm_setting_get_name (setting); + + routes = read_ip6_routes (keyfile, setting_name, key); + + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_ip6_route, NULL); + g_ptr_array_free (routes, TRUE); + } +} + +static void +free_one_ip6_dns (gpointer data, gpointer user_data) +{ + g_byte_array_free ((GByteArray *) data, TRUE); +} + +static void +ip6_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GPtrArray *array = NULL; + gsize length; + char **list, **iter; + int ret; + + list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); + if (!list || !g_strv_length (list)) + return; + + array = g_ptr_array_sized_new (length); + for (iter = list; *iter; iter++) { + GByteArray *byte_array; + struct in6_addr addr; + + ret = inet_pton (AF_INET6, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid DNS server IPv6 address '%s'", __func__, *iter); + continue; + } + byte_array = g_byte_array_new (); + g_byte_array_append (byte_array, (guint8 *) addr.s6_addr, 16); + + g_ptr_array_add (array, byte_array); + } + g_strfreev (list); + + if (array) { + g_object_set (setting, key, array, NULL); + g_ptr_array_foreach (array, free_one_ip6_dns, NULL); + g_ptr_array_free (array, TRUE); + } +} static void mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) @@ -407,22 +697,35 @@ typedef struct { /* A table of keys that require further parsing/conversion becuase they are * stored in a format that can't be automatically read using the key's type. - * i.e. IP addresses, which are stored in NetworkManager as guint32, but are - * stored in keyfiles as strings, eg "10.1.1.2". + * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are + * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored + * in struct in6_addr internally, but as string in keyfiles. */ static KeyParser key_parsers[] = { { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES, FALSE, ip4_addr_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES, + FALSE, + ip6_addr_parser }, { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ROUTES, FALSE, ip4_route_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES, + FALSE, + ip6_route_parser }, { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS, FALSE, ip4_dns_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS, + FALSE, + ip6_dns_parser }, { NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS, TRUE, diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index efa5d1d4e5..d9f36af7a6 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -184,6 +185,189 @@ ip4_route_writer (GKeyFile *file, write_ip4_values (file, setting_name, key, array, 4, 0, 2); } +static void +ip6_dns_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + GByteArray *byte_array; + char **list; + int i, num = 0; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + list = g_new0 (char *, array->len + 1); + + for (i = 0; i < array->len; i++) { + char buf[INET6_ADDRSTRLEN]; + + byte_array = g_ptr_array_index (array, i); + if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, sizeof (buf))) { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + } else + list[num++] = g_strdup (buf); + } + + g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); + g_strfreev (list); +} + +static gboolean +ip6_array_to_addr (GValueArray *values, guint32 idx, char *buf, size_t buflen) +{ + GByteArray *byte_array; + GValue *addr_val; + + g_return_val_if_fail (buflen >= INET6_ADDRSTRLEN, FALSE); + + /* address */ + addr_val = g_value_array_get_nth (values, idx); + byte_array = g_value_get_boxed (addr_val); + errno = 0; + if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, buflen)) { + GString *ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 10); + + /* error converting the address */ + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (idx = 1; idx < 16; idx++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[idx]); + nm_warning ("%s: error %d converting IP6 address %s", + __func__, errno, ip6_str->str); + g_string_free (ip6_str, TRUE); + return FALSE; + } + + return TRUE; +} + +static char * +ip6_array_to_addr_prefix (GValueArray *values) +{ + GValue *prefix_val; + char *ret = NULL; + GString *ip6_str; + char buf[INET6_ADDRSTRLEN]; + + /* address */ + if (ip6_array_to_addr (values, 0, buf, sizeof (buf))) { + /* Enough space for the address, '/', and the prefix */ + ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 5); + + /* prefix */ + g_string_append (ip6_str, buf); + prefix_val = g_value_array_get_nth (values, 1); + g_string_append_printf (ip6_str, "/%u", g_value_get_uint (prefix_val)); + + ret = ip6_str->str; + g_string_free (ip6_str, FALSE); + } + + return ret; +} + +static void +ip6_addr_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name, *ip6_addr; + + if (values->n_values % 2) { + nm_warning ("%s: error writing IP6 address %d; address array length" + " %d is not a multiple of 2.", + __func__, i, values->n_values); + continue; + } + + ip6_addr = ip6_array_to_addr_prefix (values); + if (ip6_addr) { + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string (file, setting_name, key_name, ip6_addr); + g_free (key_name); + g_free (ip6_addr); + } + } +} + +static void +ip6_route_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + char *list[3]; + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name; + guint32 int_val; + char buf[INET6_ADDRSTRLEN]; + + memset (list, 0, sizeof (list)); + + /* Address and prefix */ + list[0] = ip6_array_to_addr_prefix (values); + if (!list[0]) + continue; + + /* Next Hop */ + if (!ip6_array_to_addr (values, 2, buf, sizeof (buf))) + continue; + list[1] = g_strdup (buf); + + /* Metric */ + value = g_value_array_get_nth (values, 3); + int_val = g_value_get_uint (value); + list[2] = g_strdup_printf ("%d", int_val); + + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, 3); + g_free (key_name); + + g_free (list[0]); + g_free (list[1]); + g_free (list[2]); + } +} + + static void mac_address_writer (GKeyFile *file, NMSetting *setting, @@ -259,19 +443,29 @@ typedef struct { /* A table of keys that require further parsing/conversion becuase they are * stored in a format that can't be automatically read using the key's type. - * i.e. IP addresses, which are stored in NetworkManager as guint32, but are - * stored in keyfiles as strings, eg "10.1.1.2". + * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are + * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored + * in struct in6_addr internally, but as string in keyfiles. */ static KeyWriter key_writers[] = { { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES, ip4_addr_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES, + ip6_addr_writer }, { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ROUTES, ip4_route_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES, + ip6_route_writer }, { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS, ip4_dns_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS, + ip6_dns_writer }, { NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS, mac_address_writer }, diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection index f542811551..5785dc2485 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection @@ -20,3 +20,13 @@ addresses1=192.168.0.5;24;192.168.0.1; addresses2=1.2.3.4;16;1.2.1.1; ignore-auto-routes=false ignore-auto-dns=false + +[ipv6] +method=manual +dns=1111:dddd::aaaa;1::cafe; +dns-search=super-domain.com;redhat.com;gnu.org; +addresses1=abcd:1234:ffff::cdde/64 +addresses2=1:2:3:4:5:6:7:8/96 +routes1=a:b:c:d::/64;f:e:d:c:1:2:3:4;99; +ignore-auto-routes=false +ignore-auto-dns=false diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 0f8c2ccbe3..58ec940301 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "nm-test-helpers.h" @@ -50,6 +51,7 @@ test_read_valid_wired_connection (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; GError *error = NULL; const GByteArray *array; char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; @@ -66,6 +68,18 @@ test_read_valid_wired_connection (void) const char *expected_address1_gw = "192.168.0.1"; const char *expected_address2_gw = "1.2.1.1"; NMIP4Address *ip4_addr; + const char *expected6_dns1 = "1111:dddd::aaaa"; + const char *expected6_dns2 = "1::cafe"; + const char *expected6_dnssearch1 = "super-domain.com"; + const char *expected6_dnssearch2 = "redhat.com"; + const char *expected6_dnssearch3 = "gnu.org"; + struct in6_addr addr6; + const char *expected6_address1 = "abcd:1234:ffff::cdde"; + const char *expected6_address2 = "1:2:3:4:5:6:7:8"; + const char *expected6_route_dest = "a:b:c:d::"; + const char *expected6_route_nh = "f:e:d:c:1:2:3:4"; + NMIP6Address *ip6_addr; + NMIP6Route *ip6_route; connection = connection_from_file (TEST_WIRED_FILE); ASSERT (connection != NULL, @@ -215,7 +229,7 @@ test_read_valid_wired_connection (void) NM_SETTING_IP4_CONFIG_ADDRESSES); ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 24, - "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1 gateway", + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1 prefix", TEST_WIRED_FILE, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); @@ -251,7 +265,7 @@ test_read_valid_wired_connection (void) NM_SETTING_IP4_CONFIG_ADDRESSES); ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 16, - "connection-verify-wired", "failed to verify %s: unexpected IP4 address #2 gateway", + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #2 prefix", TEST_WIRED_FILE, NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); @@ -278,6 +292,172 @@ test_read_valid_wired_connection (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "connection-verify-ip6", "failed to verify %s: missing %s setting", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP6 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns2, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 2, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + /* DNS Searches */ + ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 3, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + + ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 0), expected6_dnssearch1), + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 1), expected6_dnssearch2), + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + ASSERT (!strcmp (nm_setting_ip6_config_get_dns_search (s_ip6, 2), expected6_dnssearch3), + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value #3", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #2 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 96, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #2 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address2, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Route #1 */ + ip6_route = nm_setting_ip6_config_get_route (s_ip6, 0); + ASSERT (ip6_route, + "connection-verify-wired", "failed to verify %s: missing IP6 route #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (inet_pton (AF_INET6, expected6_route_dest, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_dest (ip6_route), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (nm_ip6_route_get_prefix (ip6_route) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 route #1 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (inet_pton (AF_INET6, expected6_route_nh, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP route next hop #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_next_hop (ip6_route), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (nm_ip6_route_get_metric (ip6_route) == 99, + "connection-verify-wired", "failed to verify %s: unexpected IP6 route #1 metric", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + g_object_unref (connection); } @@ -327,6 +507,49 @@ add_one_ip4_route (NMSettingIP4Config *s_ip4, nm_ip4_route_unref (route); } +static void +add_one_ip6_address (NMSettingIP6Config *s_ip6, + const char *addr, + guint32 prefix) +{ + struct in6_addr tmp; + NMIP6Address *ip6_addr; + + ip6_addr = nm_ip6_address_new (); + nm_ip6_address_set_prefix (ip6_addr, prefix); + + inet_pton (AF_INET6, addr, &tmp); + nm_ip6_address_set_address (ip6_addr, &tmp); + + nm_setting_ip6_config_add_address (s_ip6, ip6_addr); + nm_ip6_address_unref (ip6_addr); +} + +static void +add_one_ip6_route (NMSettingIP6Config *s_ip6, + const char *dest, + const char *nh, + guint32 prefix, + guint32 metric) +{ + struct in6_addr addr; + NMIP6Route *route; + + route = nm_ip6_route_new (); + nm_ip6_route_set_prefix (route, prefix); + nm_ip6_route_set_metric (route, metric); + + inet_pton (AF_INET6, dest, &addr); + nm_ip6_route_set_dest (route, &addr); + + inet_pton (AF_INET6, nh, &addr); + nm_ip6_route_set_next_hop (route, &addr); + + nm_setting_ip6_config_add_route (s_ip6, route); + nm_ip6_route_unref (route); +} + + static void test_write_wired_connection (void) { @@ -334,6 +557,7 @@ test_write_wired_connection (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; GByteArray *mac; unsigned char tmpmac[] = { 0x99, 0x88, 0x77, 0x66, 0x55, 0x44 }; @@ -344,6 +568,7 @@ test_write_wired_connection (void) pid_t owner_grp; uid_t owner_uid; struct in_addr addr; + struct in6_addr addr6; const char *dns1 = "4.2.2.1"; const char *dns2 = "4.2.2.2"; const char *address1 = "192.168.0.5"; @@ -354,6 +579,14 @@ test_write_wired_connection (void) const char *route1_nh = "10.10.10.1"; const char *route2 = "0.0.0.0"; const char *route2_nh = "1.2.1.1"; + const char *dns6_1 = "1::cafe"; + const char *dns6_2 = "2::cafe"; + const char *address6_1 = "abcd::beef"; + const char *address6_2 = "dcba::beef"; + const char *route6_1 = "1:2:3:4:5:6:7:8"; + const char *route6_1_nh = "8:7:6:5:4:3:2:1"; + const char *route6_2 = "::"; + const char *route6_2_nh = "2001::1111"; guint64 timestamp = 0x12345678L; connection = nm_connection_new (); @@ -420,6 +653,35 @@ test_write_wired_connection (void) inet_pton (AF_INET, dns2, &addr); nm_setting_ip4_config_add_dns (s_ip4, addr.s_addr); + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + + /* Addresses */ + add_one_ip6_address (s_ip6, address6_1, 64); + add_one_ip6_address (s_ip6, address6_2, 56); + + /* Routes */ + add_one_ip6_route (s_ip6, route6_1, route6_1_nh, 64, 3); + add_one_ip6_route (s_ip6, route6_2, route6_2_nh, 56, 1); + + /* DNS servers */ + inet_pton (AF_INET6, dns6_1, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + inet_pton (AF_INET6, dns6_2, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + + /* DNS searches */ + nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com"); + /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); @@ -570,6 +832,7 @@ test_write_wireless_connection (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; char *uuid; GByteArray *bssid; unsigned char tmpbssid[] = { 0xaa, 0xb9, 0xa1, 0x74, 0x55, 0x44 }; @@ -640,6 +903,18 @@ test_write_wireless_connection (void) NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, + NULL); + /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); @@ -688,6 +963,7 @@ int main (int argc, char **argv) base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); g_free (base); + dbus_g_connection_unref (bus); return 0; } From 2ef7ea02b35aa47401d0cf3e97a0daa2e5267884 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Jan 2010 14:57:23 -0800 Subject: [PATCH 016/392] test: enable IPv6 setting defaults test --- libnm-util/tests/test-settings-defaults.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-util/tests/test-settings-defaults.c b/libnm-util/tests/test-settings-defaults.c index 7f0adc561f..9f38a14555 100644 --- a/libnm-util/tests/test-settings-defaults.c +++ b/libnm-util/tests/test-settings-defaults.c @@ -118,7 +118,7 @@ int main (int argc, char **argv) test_defaults (NM_TYPE_SETTING_CDMA, NM_SETTING_CDMA_SETTING_NAME); test_defaults (NM_TYPE_SETTING_GSM, NM_SETTING_GSM_SETTING_NAME); test_defaults (NM_TYPE_SETTING_IP4_CONFIG, NM_SETTING_IP4_CONFIG_SETTING_NAME); -// test_defaults (NM_TYPE_SETTING_IP6_CONFIG, NM_SETTING_IP6_CONFIG_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_IP6_CONFIG, NM_SETTING_IP6_CONFIG_SETTING_NAME); test_defaults (NM_TYPE_SETTING_PPP, NM_SETTING_PPP_SETTING_NAME); test_defaults (NM_TYPE_SETTING_PPPOE, NM_SETTING_PPPOE_SETTING_NAME); test_defaults (NM_TYPE_SETTING_SERIAL, NM_SETTING_SERIAL_SETTING_NAME); From 69790deeddbae2a11bdc82e0b7f41a9772e6cfed Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Jan 2010 14:57:46 -0800 Subject: [PATCH 017/392] libnm-util: add IPv6 method 'dhcp' --- libnm-util/nm-setting-ip6-config.c | 94 ++++++++++++++++-------------- libnm-util/nm-setting-ip6-config.h | 3 +- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index b1577f06f4..a62b697416 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. */ #include @@ -435,26 +435,23 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP6_CONFIG_ADDRESSES); return FALSE; } - } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) - || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) + } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { - if (!priv->ignore_auto_dns) { - if (priv->dns && g_slist_length (priv->dns)) { - g_set_error (error, - NM_SETTING_IP6_CONFIG_ERROR, - NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, - NM_SETTING_IP6_CONFIG_DNS); - return FALSE; - } + if (g_slist_length (priv->dns)) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP6_CONFIG_DNS); + return FALSE; + } - if (g_slist_length (priv->dns_search)) { - g_set_error (error, - NM_SETTING_IP6_CONFIG_ERROR, - NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, - NM_SETTING_IP6_CONFIG_DNS_SEARCH); - return FALSE; - } + if (g_slist_length (priv->dns_search)) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + return FALSE; } if (g_slist_length (priv->addresses)) { @@ -464,6 +461,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP6_CONFIG_ADDRESSES); return FALSE; } + } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + /* nothing to do */ } else { g_set_error (error, NM_SETTING_IP6_CONFIG_ERROR, @@ -598,30 +598,33 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * * IPv6 configuration method. If 'auto' is specified then the appropriate * automatic method (DHCP, PPP, advertisement, etc) is used for the - * interface and most other properties can be left unset. If 'link-local' - * is specified, then an IPv6 link-local address will be assigned to the - * interface. If 'manual' is specified, static IP addressing is used and - * at least one IP address must be given in the 'addresses' property. If - * 'ignored' is specified, IPv6 configuration is not done. This property - * must be set. NOTE: DHCP configuration and the 'shared' method are not - * yet supported. + * interface and most other properties can be left unset. To force the use + * of DHCP only, specify 'dhcp'; this method is only valid for ethernet- + * based hardware. If 'link-local' is specified, then an IPv6 link-local + * address will be assigned to the interface. If 'manual' is specified, + * static IP addressing is used and at least one IP address must be given + * in the 'addresses' property. If 'ignored' is specified, IPv6 + * configuration is not done. This property must be set. NOTE: the 'shared' + * method are not yet supported. **/ g_object_class_install_property (object_class, PROP_METHOD, g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, "Method", "IPv6 configuration method. If 'auto' is specified " - "then the appropriate automatic method (DHCP, PPP, " + "then the appropriate automatic method (PPP, router " "advertisement, etc) is used for the device and " - "most other properties can be left unset. If " + "most other properties can be left unset. To force " + "the use of DHCP only, specify 'dhcp'; this method " + "is only valid for ethernet-based hardware. If " "'link-local' is specified, then an IPv6 link-local " "address will be assigned to the interface. If " "'manual' is specified, static IP addressing is " "used and at least one IP address must be given in " " the 'addresses' property. If 'ignored' is " "specified, IPv6 configuration is not done. This " - "property must be set. NOTE: DHCP configuration " - "and the 'shared' method are not yet supported.", + "property must be set. NOTE: the 'shared' method" + "is not yet supported.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -740,38 +743,39 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) /** * NMSettingIP6Config:ignore-auto-routes: * - * When the method is set to 'auto' and this property to TRUE, automatically - * configured routes are ignored and only routes specified in - * #NMSettingIP6Config:routes, if any, are used. + * When the method is set to 'auto' or 'dhcp' and this property is set to + * TRUE, automatically configured routes are ignored and only routes + * specified in #NMSettingIP6Config:routes, if any, are used. **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_ROUTES, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, "Ignore automatic routes", - "When the method is set to 'auto' and this property " - "to TRUE, automatically configured routes are " - "ignored and only routes specified in the 'routes' " - "property, if any, are used.", + "When the method is set to 'auto' or 'dhcp' and this " + "property is set to TRUE, automatically configured " + "routes are ignored and only routes specified in the " + "'routes' property, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingIP6Config:ignore-auto-dns: * - * When the method is set to 'auto' and this property to TRUE, automatically - * configured nameservers and search domains are ignored and only namservers - * and search domains specified in #NMSettingIP6Config:dns and - * #NMSettingIP6Config:dns-search, if any, are used. + * When the method is set to 'auto' or 'dhcp' and this property is set to + * TRUE, automatically configured nameservers and search domains are ignored + * and only namservers and search domains specified in + * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are + * used. **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_DNS, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, "Ignore DHCPv6/RDNSS DNS", - "When the method is set to 'auto' and this property " - "to TRUE, automatically configured nameservers and " - "search domains are ignored and only namservers and " - "search domains specified in the 'dns' and 'dns-search' " - "properties, if any, are used.", + "When the method is set to 'auto' or 'dhcp' and this " + "property is set to TRUE, automatically configured " + "nameservers and search domains are ignored and only " + "namservers and search domains specified in the 'dns' " + "and 'dns-search' properties, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index 18082e4eaa..b089679e4e 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. */ #ifndef NM_SETTING_IP6_CONFIG_H @@ -65,6 +65,7 @@ GQuark nm_setting_ip6_config_error_quark (void); #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore" #define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" +#define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp" #define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local" #define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual" #define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared" From 3ee1eb7a6c7226ad90dadec15f4e3d51af5ba05a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Jan 2010 15:22:11 -0800 Subject: [PATCH 018/392] dhcp6: add dhclient ipv6 states --- src/dhcp-manager/nm-dhcp-manager.c | 122 ++++++++++++----------------- src/dhcp-manager/nm-dhcp-manager.h | 38 +++++---- src/nm-device.c | 8 +- 3 files changed, 76 insertions(+), 92 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index c3ca358dca..8942b01d2b 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -146,10 +146,13 @@ nm_dhcp_manager_class_init (NMDHCPManagerClass *manager_class) static gboolean state_is_bound (guint8 state) { - if ((state == DHC_BOUND) - || (state == DHC_RENEW) + if ( (state == DHC_BOUND4) + || (state == DHC_BOUND6) + || (state == DHC_RENEW4) + || (state == DHC_RENEW6) || (state == DHC_REBOOT) - || (state == DHC_REBIND) + || (state == DHC_REBIND4) + || (state == DHC_REBIND6) || (state == DHC_IPV4LL)) return TRUE; @@ -200,83 +203,60 @@ nm_dhcp_device_destroy (NMDHCPDevice *device) g_slice_free (NMDHCPDevice, device); } +typedef struct { + NMDHCPState state; + const char *name; +} DhcState; + +#define STATE_TABLE_SIZE (sizeof (state_table) / sizeof (state_table[0])) + +static DhcState state_table[] = { + { DHC_NBI, "nbi" }, + { DHC_PREINIT, "preinit" }, + { DHC_BOUND4, "bound" }, + { DHC_BOUND6, "bound6" }, + { DHC_IPV4LL, "ipv4ll" }, + { DHC_RENEW4, "renew" }, + { DHC_RENEW6, "renew6" }, + { DHC_REBOOT, "reboot" }, + { DHC_REBIND4, "rebind" }, + { DHC_REBIND6, "rebind6" }, + { DHC_STOP, "stop" }, + { DHC_MEDIUM, "medium" }, + { DHC_TIMEOUT, "timeout" }, + { DHC_FAIL, "fail" }, + { DHC_EXPIRE, "expire" }, + { DHC_RELEASE, "release" }, + { DHC_START, "start" }, + { DHC_ABEND, "abend" }, + { DHC_END, "end" }, + { DHC_DEPREF6, "depref6" }, +}; static inline const char * state_to_string (guint32 state) { - switch (state) - { - case DHC_PREINIT: - return "preinit"; - case DHC_BOUND: - return "bound"; - case DHC_IPV4LL: - return "bound (ipv4ll)"; - case DHC_RENEW: - return "renew"; - case DHC_REBOOT: - return "reboot"; - case DHC_REBIND: - return "rebind"; - case DHC_STOP: - return "stop"; - case DHC_MEDIUM: - return "medium"; - case DHC_TIMEOUT: - return "timeout"; - case DHC_FAIL: - return "fail"; - case DHC_EXPIRE: - return "expire"; - case DHC_RELEASE: - return "release"; - case DHC_START: - return "successfully started"; - case DHC_ABEND: - return "abnormal exit"; - case DHC_END: - return "normal exit"; - default: - break; + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (state == state_table[i].state) + return state_table[i].name; } + return NULL; } -static inline guint32 -string_to_state (const char *state) +static inline NMDHCPState +string_to_state (const char *name) { - if (strcmp("PREINIT", state) == 0) - return DHC_PREINIT; - else if (strcmp("BOUND", state) == 0) - return DHC_BOUND; - else if (strcmp("IPV4LL", state) == 0) - return DHC_IPV4LL; - else if (strcmp("RENEW", state) == 0) - return DHC_RENEW; - else if (strcmp("REBOOT", state) == 0) - return DHC_REBOOT; - else if (strcmp("REBIND", state) == 0) - return DHC_REBIND; - else if (strcmp("STOP", state) == 0) - return DHC_STOP; - else if (strcmp("MEDIUM", state) == 0) - return DHC_MEDIUM; - else if (strcmp("TIMEOUT", state) == 0) - return DHC_TIMEOUT; - else if (strcmp("FAIL", state) == 0) - return DHC_FAIL; - else if (strcmp("EXPIRE", state) == 0) - return DHC_EXPIRE; - else if (strcmp("RELEASE", state) == 0) - return DHC_RELEASE; - else if (strcmp("START", state) == 0) - return DHC_START; - else if (strcmp("ABEND", state) == 0) - return DHC_ABEND; - else if (strcmp("END", state) == 0) - return DHC_END; - else - return 255; + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (!strcasecmp (name, state_table[i].name)) + return state_table[i].state; + } + + return 255; } static char * diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 124008493a..46d0ea4bc3 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -41,23 +41,27 @@ #define NM_DHCP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) typedef enum { - DHC_NBI=0, /* no broadcast interfaces found */ - DHC_PREINIT, /* configuration started */ - DHC_BOUND, /* lease obtained */ - DHC_IPV4LL, /* IPv4LL address obtained */ - DHC_RENEW, /* lease renewed */ - DHC_REBOOT, /* have valid lease, but now obtained a different one */ - DHC_REBIND, /* new, different lease */ - DHC_STOP, /* remove old lease */ - DHC_MEDIUM, /* media selection begun */ - DHC_TIMEOUT, /* timed out contacting DHCP server */ - DHC_FAIL, /* all attempts to contact server timed out, sleeping */ - DHC_EXPIRE, /* lease has expired, renewing */ - DHC_RELEASE, /* releasing lease */ - DHC_START, /* sent when dhclient started OK */ - DHC_ABEND, /* dhclient exited abnormally */ - DHC_END, /* dhclient exited normally */ - DHC_END_OPTIONS, /* last option in subscription sent */ + DHC_NBI = 0, /* no broadcast interfaces found */ + DHC_PREINIT, /* configuration started */ + DHC_BOUND4, /* IPv4 lease obtained */ + DHC_BOUND6, /* IPv6 lease obtained */ + DHC_IPV4LL, /* IPv4LL address obtained */ + DHC_RENEW4, /* IPv4 lease renewed */ + DHC_RENEW6, /* IPv6 lease renewed */ + DHC_REBOOT, /* have valid lease, but now obtained a different one */ + DHC_REBIND4, /* IPv4 new/different lease */ + DHC_REBIND6, /* IPv6 new/different lease */ + DHC_STOP, /* remove old lease */ + DHC_MEDIUM, /* media selection begun */ + DHC_TIMEOUT, /* timed out contacting DHCP server */ + DHC_FAIL, /* all attempts to contact server timed out, sleeping */ + DHC_EXPIRE, /* lease has expired, renewing */ + DHC_RELEASE, /* releasing lease */ + DHC_START, /* sent when dhclient started OK */ + DHC_ABEND, /* dhclient exited abnormally */ + DHC_END, /* dhclient exited normally */ + DHC_DEPREF6, /* IPv6 lease depreferred */ + DHC_END_OPTIONS, /* last option in subscription sent */ } NMDHCPState; typedef struct { diff --git a/src/nm-device.c b/src/nm-device.c index 6c0f99ca47..05c9598254 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2314,10 +2314,10 @@ dhcp_state_changed (NMDHCPManager *dhcp_manager, dev_state = nm_device_get_state (device); switch (state) { - case DHC_BOUND: /* lease obtained */ - case DHC_RENEW: /* lease renewed */ - case DHC_REBOOT: /* have valid lease, but now obtained a different one */ - case DHC_REBIND: /* new, different lease */ + case DHC_BOUND4: /* lease obtained */ + case DHC_RENEW4: /* lease renewed */ + case DHC_REBOOT: /* have valid lease, but now obtained a different one */ + case DHC_REBIND4: /* new, different lease */ if (dev_state == NM_DEVICE_STATE_IP_CONFIG) nm_device_activate_schedule_stage4_ip4_config_get (device); else if (dev_state == NM_DEVICE_STATE_ACTIVATED) From d997785db37b9b4c64c7bf41932193665dad4262 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Jan 2010 17:16:05 -0800 Subject: [PATCH 019/392] dhcp6: genericize DHCP client tracking Since the same interface could be used for both DHCPv4 and DHCPv6 we can't just use 'iface' for tracking DHCP client lease changes. Instead use a generated client ID, and track DHCP events based on the client's PID instead of interface name. --- src/dhcp-manager/nm-dhcp-dhclient.c | 99 ++--- src/dhcp-manager/nm-dhcp-dhcpcd.c | 30 +- src/dhcp-manager/nm-dhcp-manager.c | 553 +++++++++++++++------------- src/dhcp-manager/nm-dhcp-manager.h | 67 ++-- src/nm-device-ethernet.c | 8 +- src/nm-device.c | 44 ++- src/tests/test-dhcp-options.c | 20 +- 7 files changed, 438 insertions(+), 383 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 478ac298f0..e0deabb4a8 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.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. */ #define _XOPEN_SOURCE @@ -119,7 +119,7 @@ add_lease_option (GHashTable *hash, char *line) } GSList * -nm_dhcp_client_get_lease_ip4_config (const char *iface, const char *uuid) +nm_dhcp4_client_get_lease_config (const char *iface, const char *uuid) { GSList *parsed = NULL, *iter, *leases = NULL; char *contents = NULL; @@ -288,7 +288,7 @@ out: #define DHCP_HOSTNAME_FORMAT DHCP_HOSTNAME_TAG " \"%s\"; # added by NetworkManager" static gboolean -merge_dhclient_config (NMDHCPDevice *device, +merge_dhclient_config (NMDHCPClient *client, NMSettingIP4Config *s_ip4, guint8 *anycast_addr, const char *contents, @@ -298,8 +298,8 @@ merge_dhclient_config (NMDHCPDevice *device, GString *new_contents; gboolean success = FALSE; - g_return_val_if_fail (device != NULL, FALSE); - g_return_val_if_fail (device->iface != NULL, FALSE); + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (client->iface != NULL, FALSE); new_contents = g_string_new (_("# Created by NetworkManager\n")); @@ -374,13 +374,13 @@ merge_dhclient_config (NMDHCPDevice *device, " initial-interval 1; \n" " anycast-mac ethernet %02x:%02x:%02x:%02x:%02x:%02x;\n" "}\n", - device->iface, + client->iface, anycast_addr[0], anycast_addr[1], anycast_addr[2], anycast_addr[3], anycast_addr[4], anycast_addr[5]); } - if (g_file_set_contents (device->conf_file, new_contents->str, -1, error)) + if (g_file_set_contents (client->conf_file, new_contents->str, -1, error)) success = TRUE; g_string_free (new_contents, TRUE); @@ -394,7 +394,7 @@ merge_dhclient_config (NMDHCPDevice *device, * config file along with the NM options. */ static gboolean -create_dhclient_config (NMDHCPDevice *device, +create_dhclient_config (NMDHCPClient *client, NMSettingIP4Config *s_ip4, guint8 *dhcp_anycast_addr) { @@ -403,7 +403,8 @@ create_dhclient_config (NMDHCPDevice *device, gboolean success = FALSE; char *tmp; - g_return_val_if_fail (device != NULL, FALSE); + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (client->iface != NULL, FALSE); #if defined(TARGET_SUSE) orig = g_strdup (SYSCONFDIR "/dhclient.conf"); @@ -412,16 +413,16 @@ create_dhclient_config (NMDHCPDevice *device, #elif defined(TARGET_GENTOO) orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); #else - orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", device->iface); + orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", client->iface); #endif if (!orig) { - nm_warning ("%s: not enough memory for dhclient options.", device->iface); + nm_warning ("%s: not enough memory for dhclient options.", client->iface); return FALSE; } - tmp = g_strdup_printf ("nm-dhclient-%s.conf", device->iface); - device->conf_file = g_build_filename ("/var", "run", tmp, NULL); + tmp = g_strdup_printf ("nm-dhclient-%s.conf", client->iface); + client->conf_file = g_build_filename ("/var", "run", tmp, NULL); g_free (tmp); if (!g_file_test (orig, G_FILE_TEST_EXISTS)) @@ -429,18 +430,18 @@ create_dhclient_config (NMDHCPDevice *device, if (!g_file_get_contents (orig, &contents, NULL, &error)) { nm_warning ("%s: error reading dhclient configuration %s: %s", - device->iface, orig, error->message); + client->iface, orig, error->message); g_error_free (error); goto out; } out: error = NULL; - if (merge_dhclient_config (device, s_ip4, dhcp_anycast_addr, contents, orig, &error)) + if (merge_dhclient_config (client, s_ip4, dhcp_anycast_addr, contents, orig, &error)) success = TRUE; else { nm_warning ("%s: error creating dhclient configuration: %s", - device->iface, error->message); + client->iface, error->message); g_error_free (error); } @@ -460,12 +461,12 @@ dhclient_child_setup (gpointer user_data G_GNUC_UNUSED) GPid -nm_dhcp_client_start (NMDHCPDevice *device, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) +nm_dhcp4_client_start (NMDHCPClient *client, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) { - GPtrArray *dhclient_argv = NULL; + GPtrArray *argv = NULL; GPid pid = 0; GError *error = NULL; char *pid_contents = NULL; @@ -475,51 +476,51 @@ nm_dhcp_client_start (NMDHCPDevice *device, goto out; } - device->pid_file = get_pidfile_for_iface (device->iface); - if (!device->pid_file) { - nm_warning ("%s: not enough memory for dhclient options.", device->iface); + client->pid_file = get_pidfile_for_iface (client->iface); + if (!client->pid_file) { + nm_warning ("%s: not enough memory for dhclient options.", client->iface); goto out; } - device->lease_file = get_leasefile_for_iface (device->iface, uuid); - if (!device->lease_file) { - nm_warning ("%s: not enough memory for dhclient options.", device->iface); + client->lease_file = get_leasefile_for_iface (client->iface, uuid); + if (!client->lease_file) { + nm_warning ("%s: not enough memory for dhclient options.", client->iface); goto out; } - if (!create_dhclient_config (device, s_ip4, dhcp_anycast_addr)) + if (!create_dhclient_config (client, s_ip4, dhcp_anycast_addr)) goto out; /* Kill any existing dhclient bound to this interface */ - if (g_file_get_contents (device->pid_file, &pid_contents, NULL, NULL)) { + if (g_file_get_contents (client->pid_file, &pid_contents, NULL, NULL)) { unsigned long int tmp = strtoul (pid_contents, NULL, 10); if (!((tmp == ULONG_MAX) && (errno == ERANGE))) - nm_dhcp_client_stop (device, (pid_t) tmp); - remove (device->pid_file); + nm_dhcp_client_stop (client, (pid_t) tmp); + remove (client->pid_file); } - dhclient_argv = g_ptr_array_new (); - g_ptr_array_add (dhclient_argv, (gpointer) DHCP_CLIENT_PATH); + argv = g_ptr_array_new (); + g_ptr_array_add (argv, (gpointer) DHCP_CLIENT_PATH); - g_ptr_array_add (dhclient_argv, (gpointer) "-d"); + g_ptr_array_add (argv, (gpointer) "-d"); - g_ptr_array_add (dhclient_argv, (gpointer) "-sf"); /* Set script file */ - g_ptr_array_add (dhclient_argv, (gpointer) ACTION_SCRIPT_PATH ); + g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ + g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); - g_ptr_array_add (dhclient_argv, (gpointer) "-pf"); /* Set pid file */ - g_ptr_array_add (dhclient_argv, (gpointer) device->pid_file); + g_ptr_array_add (argv, (gpointer) "-pf"); /* Set pid file */ + g_ptr_array_add (argv, (gpointer) client->pid_file); - g_ptr_array_add (dhclient_argv, (gpointer) "-lf"); /* Set lease file */ - g_ptr_array_add (dhclient_argv, (gpointer) device->lease_file); + g_ptr_array_add (argv, (gpointer) "-lf"); /* Set lease file */ + g_ptr_array_add (argv, (gpointer) client->lease_file); - g_ptr_array_add (dhclient_argv, (gpointer) "-cf"); /* Set interface config file */ - g_ptr_array_add (dhclient_argv, (gpointer) device->conf_file); + g_ptr_array_add (argv, (gpointer) "-cf"); /* Set interface config file */ + g_ptr_array_add (argv, (gpointer) client->conf_file); - g_ptr_array_add (dhclient_argv, (gpointer) device->iface); - g_ptr_array_add (dhclient_argv, NULL); + g_ptr_array_add (argv, (gpointer) client->iface); + g_ptr_array_add (argv, NULL); - if (!g_spawn_async (NULL, (char **) dhclient_argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, + if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhclient_child_setup, NULL, &pid, &error)) { nm_warning ("dhclient failed to start. error: '%s'", error->message); g_error_free (error); @@ -530,7 +531,7 @@ nm_dhcp_client_start (NMDHCPDevice *device, out: g_free (pid_contents); - g_ptr_array_free (dhclient_argv, TRUE); + g_ptr_array_free (argv, TRUE); return pid; } @@ -596,9 +597,9 @@ error: } gboolean -nm_dhcp_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) +nm_dhcp4_client_process_classless_routes (GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) { const char *str; char **octets, **o; diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index a8d929a528..6ba3f0a91c 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -50,7 +50,7 @@ get_pidfile_for_iface (const char * iface) } GSList * -nm_dhcp_client_get_lease_ip4_config (const char *iface, const char *uuid) +nm_dhcp4_client_get_lease_config (const char *iface, const char *uuid) { return NULL; } @@ -65,10 +65,10 @@ dhcpcd_child_setup (gpointer user_data G_GNUC_UNUSED) GPid -nm_dhcp_client_start (NMDHCPDevice *device, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) +nm_dhcp4_client_start (NMDHCPClient *client, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) { GPtrArray *argv = NULL; GPid pid = 0; @@ -80,19 +80,19 @@ nm_dhcp_client_start (NMDHCPDevice *device, goto out; } - device->pid_file = get_pidfile_for_iface (device->iface); - if (!device->pid_file) { - nm_warning ("%s: not enough memory for dhcpcd options.", device->iface); + client->pid_file = get_pidfile_for_iface (client->iface); + if (!client->pid_file) { + nm_warning ("%s: not enough memory for dhcpcd options.", client->iface); goto out; } /* Kill any existing dhcpcd bound to this interface */ - if (g_file_get_contents (device->pid_file, &pid_contents, NULL, NULL)) { + if (g_file_get_contents (client->pid_file, &pid_contents, NULL, NULL)) { unsigned long int tmp = strtoul (pid_contents, NULL, 10); if (!((tmp == ULONG_MAX) && (errno == ERANGE))) - nm_dhcp_client_stop (device, (pid_t) tmp); - remove (device->pid_file); + nm_dhcp_client_stop (client, (pid_t) tmp); + remove (client->pid_file); } argv = g_ptr_array_new (); @@ -107,7 +107,7 @@ nm_dhcp_client_start (NMDHCPDevice *device, g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); - g_ptr_array_add (argv, (gpointer) device->iface); + g_ptr_array_add (argv, (gpointer) client->iface); g_ptr_array_add (argv, NULL); if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, @@ -126,9 +126,9 @@ out: } gboolean -nm_dhcp_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) +nm_dhcp4_client_process_classless_routes (GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) { const char *str; char **routes, **r; diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 8942b01d2b..2b48a2651d 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.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) 2006 - 2008 Novell, Inc. * */ @@ -50,9 +50,10 @@ #define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */ typedef struct { + guint32 next_id; NMDBusManager * dbus_mgr; - GHashTable * devices; - DBusGProxy * proxy; + GHashTable * clients; + DBusGProxy * proxy; NMHostnameProvider *hostname_provider; } NMDHCPManagerPrivate; @@ -69,82 +70,9 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -static NMDHCPManager *nm_dhcp_manager_new (void); +static void nm_dhcp_manager_cancel_transaction_real (NMDHCPClient *client); -static void nm_dhcp_manager_cancel_transaction_real (NMDHCPDevice *device); - -static void hostname_provider_destroyed (gpointer data, GObject *destroyed_object); - -NMDHCPManager * -nm_dhcp_manager_get (void) -{ - static NMDHCPManager *singleton = NULL; - - if (!singleton) - singleton = nm_dhcp_manager_new (); - else - g_object_ref (singleton); - - g_assert (singleton); - return singleton; -} - -static void -nm_dhcp_manager_init (NMDHCPManager *manager) -{ -} - -static void -finalize (GObject *object) -{ - NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); - - if (priv->hostname_provider) { - g_object_weak_unref (G_OBJECT (priv->hostname_provider), hostname_provider_destroyed, object); - priv->hostname_provider = NULL; - } - - g_hash_table_destroy (priv->devices); - g_object_unref (priv->proxy); - g_object_unref (priv->dbus_mgr); - - G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->finalize (object); -} - -static void -nm_dhcp_manager_class_init (NMDHCPManagerClass *manager_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (manager_class); - - g_type_class_add_private (manager_class, sizeof (NMDHCPManagerPrivate)); - - /* virtual methods */ - object_class->finalize = finalize; - - /* signals */ - signals[STATE_CHANGED] = - g_signal_new ("state-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDHCPManagerClass, state_changed), - NULL, NULL, - _nm_marshal_VOID__STRING_UCHAR, - G_TYPE_NONE, 2, - G_TYPE_STRING, - G_TYPE_UCHAR); - - signals[TIMEOUT] = - g_signal_new ("timeout", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDHCPManagerClass, timeout), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, - G_TYPE_STRING); -} - -static gboolean state_is_bound (guint8 state) +static gboolean state_is_bound (guint32 state) { if ( (state == DHC_BOUND4) || (state == DHC_BOUND6) @@ -161,46 +89,46 @@ static gboolean state_is_bound (guint8 state) static void -nm_dhcp_device_timeout_cleanup (NMDHCPDevice * device) +nm_dhcp_client_timeout_cleanup (NMDHCPClient *client) { - if (device->timeout_id) { - g_source_remove (device->timeout_id); - device->timeout_id = 0; + if (client->timeout_id) { + g_source_remove (client->timeout_id); + client->timeout_id = 0; } } static void -nm_dhcp_device_watch_cleanup (NMDHCPDevice * device) +nm_dhcp_client_watch_cleanup (NMDHCPClient *client) { - if (device->watch_id) { - g_source_remove (device->watch_id); - device->watch_id = 0; + if (client->watch_id) { + g_source_remove (client->watch_id); + client->watch_id = 0; } } static void -nm_dhcp_device_destroy (NMDHCPDevice *device) +nm_dhcp_client_destroy (NMDHCPClient *client) { int ignored; - nm_dhcp_device_timeout_cleanup (device); + nm_dhcp_client_timeout_cleanup (client); - if (device->pid) - nm_dhcp_client_stop (device, device->pid); + if (client->pid) + nm_dhcp_client_stop (client, client->pid); - if (device->options) - g_hash_table_destroy (device->options); + if (client->options) + g_hash_table_destroy (client->options); - if (device->conf_file) { - ignored = unlink (device->conf_file); - g_free (device->conf_file); + if (client->conf_file) { + ignored = unlink (client->conf_file); + g_free (client->conf_file); } - g_free (device->pid_file); - g_free (device->lease_file); - g_free (device->iface); + g_free (client->pid_file); + g_free (client->lease_file); + g_free (client->iface); - g_slice_free (NMDHCPDevice, device); + g_slice_free (NMDHCPClient, client); } typedef struct { @@ -316,7 +244,7 @@ copy_option (gpointer key, gpointer value, gpointer user_data) { - NMDHCPDevice * device = (NMDHCPDevice *) user_data; + NMDHCPClient *client = user_data; const char *str_key = (const char *) key; char *str_value = NULL; @@ -329,21 +257,21 @@ copy_option (gpointer key, str_value = garray_to_string ((GArray *) g_value_get_boxed (value), str_key); if (str_value) - g_hash_table_insert (device->options, g_strdup (str_key), str_value); + g_hash_table_insert (client->options, g_strdup (str_key), str_value); } static void -handle_options (NMDHCPManager * manager, - NMDHCPDevice * device, - GHashTable * options, - const char * reason) +handle_options (NMDHCPManager *manager, + NMDHCPClient *client, + GHashTable *options, + const char *reason) { - guint32 old_state = device->state; + guint32 old_state = client->state; guint32 new_state = string_to_state (reason); /* Clear old and save new DHCP options */ - g_hash_table_remove_all (device->options); - g_hash_table_foreach (options, copy_option, device); + g_hash_table_remove_all (client->options); + g_hash_table_foreach (options, copy_option, client); if (old_state == new_state) return; @@ -351,20 +279,78 @@ handle_options (NMDHCPManager * manager, /* Handle changed device state */ if (state_is_bound (new_state)) { /* Cancel the timeout if the DHCP client is now bound */ - nm_dhcp_device_timeout_cleanup (device); + nm_dhcp_client_timeout_cleanup (client); } - device->state = new_state; + client->state = new_state; nm_info ("DHCP: device %s state changed %s -> %s", - device->iface, + client->iface, state_to_string (old_state), - state_to_string (device->state)); + state_to_string (client->state)); - g_signal_emit (G_OBJECT (device->manager), + g_signal_emit (G_OBJECT (client->manager), signals[STATE_CHANGED], 0, - device->iface, - device->state); + client->id, + client->state); +} + +static NMDHCPClient * +get_client_for_pid (NMDHCPManager *manager, GPid pid) +{ + NMDHCPManagerPrivate *priv; + GHashTableIter iter; + gpointer value; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + g_hash_table_iter_init (&iter, priv->clients); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + NMDHCPClient *candidate = value; + + if (candidate->pid == pid) + return candidate; + } + + return NULL; +} + +static NMDHCPClient * +get_client_for_iface (NMDHCPManager *manager, const char *iface) +{ + NMDHCPManagerPrivate *priv; + GHashTableIter iter; + gpointer value; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); + g_return_val_if_fail (iface, NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + g_hash_table_iter_init (&iter, priv->clients); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + NMDHCPClient *candidate = value; + + if (!strcmp (iface, candidate->iface)) + return candidate; + } + + return NULL; +} + +static NMDHCPClient * +get_client_for_id (NMDHCPManager *manager, guint32 id) +{ + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); + g_return_val_if_fail (id > 0, NULL); + + return g_hash_table_lookup (NM_DHCP_MANAGER_GET_PRIVATE (manager)->clients, + GUINT_TO_POINTER (id)); } static void @@ -372,14 +358,13 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, GHashTable *options, gpointer user_data) { - NMDHCPManager * manager; - NMDHCPManagerPrivate * priv; - NMDHCPDevice * device; - char * iface = NULL; - char * pid_str = NULL; - char * reason = NULL; + NMDHCPManager *manager; + NMDHCPManagerPrivate *priv; + NMDHCPClient *client; + char *iface = NULL; + char *pid_str = NULL; + char *reason = NULL; unsigned long temp; - pid_t pid; manager = NM_DHCP_MANAGER (user_data); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); @@ -390,29 +375,27 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, goto out; } - device = (NMDHCPDevice *) g_hash_table_lookup (priv->devices, iface); - if (device == NULL) { - nm_warning ("Unhandled DHCP event for interface %s", iface); - goto out; - } - pid_str = get_option (options, "pid"); if (pid_str == NULL) { nm_warning ("DHCP event didn't have associated PID."); goto out; } - temp = strtoul(pid_str, NULL, 10); + temp = strtoul (pid_str, NULL, 10); if ((temp == ULONG_MAX) && (errno == ERANGE)) { nm_warning ("Couldn't convert PID"); goto out; } - pid = (pid_t) temp; - if (pid != device->pid) { - nm_warning ("Received DHCP event from unexpected PID %u (expected %u)", - pid, - device->pid); + client = get_client_for_pid (manager, (GPid) temp); + if (client == NULL) { + nm_warning ("Unhandled DHCP event for interface %s", iface); + goto out; + } + + if (strcmp (iface, client->iface)) { + nm_warning ("Received DHCP event from unexpected interface '%s' (expected '%s')", + iface, client->iface); goto out; } @@ -422,7 +405,7 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, goto out; } - handle_options (manager, device, options, reason); + handle_options (manager, client, options, reason); out: g_free (iface); @@ -435,20 +418,18 @@ nm_dhcp_manager_new (void) { NMDHCPManager *manager; NMDHCPManagerPrivate *priv; - DBusGConnection * g_connection; + DBusGConnection *g_connection; manager = g_object_new (NM_TYPE_DHCP_MANAGER, NULL); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - priv->devices = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, - (GDestroyNotify) nm_dhcp_device_destroy); - if (!priv->devices) { - nm_warning ("Error: not enough memory to initialize DHCP manager " - "tables"); + priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, + (GDestroyNotify) nm_dhcp_client_destroy); + if (!priv->clients) { + nm_warning ("Error: not enough memory to initialize DHCP manager tables"); g_object_unref (manager); - manager = NULL; - goto out; + return NULL; } priv->dbus_mgr = nm_dbus_manager_get (); @@ -460,6 +441,7 @@ nm_dhcp_manager_new (void) if (!priv->proxy) { nm_warning ("Error: could not init DHCP manager proxy"); g_object_unref (manager); + return NULL; } dbus_g_proxy_add_signal (priv->proxy, @@ -472,7 +454,6 @@ nm_dhcp_manager_new (void) manager, NULL); -out: return manager; } @@ -486,56 +467,54 @@ out: static gboolean nm_dhcp_manager_handle_timeout (gpointer user_data) { - NMDHCPDevice *device = (NMDHCPDevice *) user_data; + NMDHCPClient *client = user_data; - nm_info ("(%s): DHCP transaction took too long, stopping it.", device->iface); + nm_info ("(%s): DHCP transaction took too long, stopping it.", client->iface); - nm_dhcp_manager_cancel_transaction (device->manager, device->iface); + nm_dhcp_manager_cancel_transaction (client->manager, client->id); - g_signal_emit (G_OBJECT (device->manager), signals[TIMEOUT], 0, device->iface); + g_signal_emit (G_OBJECT (client->manager), signals[TIMEOUT], 0, client->id); return FALSE; } -static NMDHCPDevice * -nm_dhcp_device_new (NMDHCPManager *manager, const char *iface) +static NMDHCPClient * +nm_dhcp_client_new (NMDHCPManager *manager, const char *iface) { - NMDHCPDevice *device; - GHashTable * hash = NM_DHCP_MANAGER_GET_PRIVATE (manager)->devices; + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + NMDHCPClient *client; - device = g_slice_new0 (NMDHCPDevice); - if (!device) { + client = g_slice_new0 (NMDHCPClient); + if (!client) { nm_warning ("%s: Out of memory creating DHCP transaction object.", iface); return NULL; } - device->iface = g_strdup (iface); - if (!device) { + client->id = priv->next_id++; + client->iface = g_strdup (iface); + if (!client) { nm_warning ("%s: Out of memory creating DHCP transaction object " "property 'iface'.", iface); goto error; } - device->manager = manager; + client->manager = manager; /* Do this after the transaction cancel since that clears options out */ - device->options = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - g_free); - if (!device->options) { + client->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + if (!client->options) { nm_warning ("%s: Out of memory creating DHCP transaction object " "property 'options'.", iface); goto error; } - g_hash_table_insert (hash, device->iface, device); - return device; + g_hash_table_insert (priv->clients, GUINT_TO_POINTER (client->id), client); + return client; error: - nm_dhcp_device_destroy (device); + nm_dhcp_client_destroy (client); return NULL; } @@ -548,21 +527,21 @@ error: */ static void dhcp_watch_cb (GPid pid, gint status, gpointer user_data) { - NMDHCPDevice *device = (NMDHCPDevice *)user_data; + NMDHCPClient *client = user_data; if (!WIFEXITED (status)) { - device->state = DHC_ABEND; + client->state = DHC_ABEND; nm_warning ("dhcp client died abnormally"); } - device->pid = 0; + client->pid = 0; - nm_dhcp_device_watch_cleanup (device); - nm_dhcp_device_timeout_cleanup (device); + nm_dhcp_client_watch_cleanup (client); + nm_dhcp_client_timeout_cleanup (client); - g_signal_emit (G_OBJECT (device->manager), signals[STATE_CHANGED], 0, device->iface, device->state); + g_signal_emit (G_OBJECT (client->manager), signals[STATE_CHANGED], 0, client->id, client->state); } -gboolean +guint32 nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, const char *iface, const char *uuid, @@ -571,21 +550,22 @@ nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, guint8 *dhcp_anycast_addr) { NMDHCPManagerPrivate *priv; - NMDHCPDevice *device; + NMDHCPClient *client; NMSettingIP4Config *setting; - g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), FALSE); - g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (manager, 0); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), 0); + g_return_val_if_fail (iface != NULL, 0); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - device = (NMDHCPDevice *) g_hash_table_lookup (priv->devices, iface); - if (!device) - device = nm_dhcp_device_new (manager, iface); + client = get_client_for_iface (manager, iface); + if (!client) + client = nm_dhcp_client_new (manager, iface); - if (device->pid && (device->state < DHC_ABEND)) { + if (client->pid && (client->state < DHC_ABEND)) { /* Cancel any DHCP transaction already in progress */ - nm_dhcp_manager_cancel_transaction_real (device); + nm_dhcp_manager_cancel_transaction_real (client); } if (s_ip4 && @@ -601,44 +581,42 @@ nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, nm_hostname_provider_get_hostname (priv->hostname_provider), NULL); - } else { + } else setting = s_ip4 ? g_object_ref (s_ip4) : NULL; - } if (timeout == 0) timeout = NM_DHCP_TIMEOUT; nm_info ("Activation (%s) Beginning DHCP transaction (timeout in %d seconds)", iface, timeout); - device->pid = nm_dhcp_client_start (device, uuid, setting, dhcp_anycast_addr); + client->pid = nm_dhcp4_client_start (client, uuid, setting, dhcp_anycast_addr); if (setting) g_object_unref (setting); - if (device->pid == 0) + if (client->pid == 0) return FALSE; /* Set up a timeout on the transaction to kill it after the timeout */ - device->timeout_id = g_timeout_add_seconds (timeout, + client->timeout_id = g_timeout_add_seconds (timeout, nm_dhcp_manager_handle_timeout, - device); - device->watch_id = g_child_watch_add (device->pid, - (GChildWatchFunc) dhcp_watch_cb, - device); - return TRUE; + client); + client->watch_id = g_child_watch_add (client->pid, + (GChildWatchFunc) dhcp_watch_cb, + client); + return client->id; } void -nm_dhcp_client_stop (NMDHCPDevice *device, pid_t pid) +nm_dhcp_client_stop (NMDHCPClient *client, GPid pid) { int i = 15; /* 3 seconds */ + g_return_if_fail (client != NULL); g_return_if_fail (pid > 0); - /* Clean up the watch handler since we're explicitly killing - * the daemon - */ - nm_dhcp_device_watch_cleanup (device); + /* Clean up the watch handler since we're explicitly killing the daemon */ + nm_dhcp_client_watch_cleanup (client); /* Tell it to quit; maybe it wants to send out a RELEASE message */ kill (pid, SIGTERM); @@ -663,7 +641,7 @@ nm_dhcp_client_stop (NMDHCPDevice *device, pid_t pid) } if (i <= 0) { - nm_warning ("%s: dhcp client pid %d didn't exit, will kill it.", device->iface, pid); + nm_warning ("%s: dhcp client pid %d didn't exit, will kill it.", client->iface, pid); kill (pid, SIGKILL); nm_debug ("waiting for dhcp client pid %d to exit", pid); @@ -673,41 +651,42 @@ nm_dhcp_client_stop (NMDHCPDevice *device, pid_t pid) } static void -nm_dhcp_manager_cancel_transaction_real (NMDHCPDevice *device) +nm_dhcp_manager_cancel_transaction_real (NMDHCPClient *client) { - g_return_if_fail (device->pid > 0); + g_return_if_fail (client != NULL); + g_return_if_fail (client->pid > 0); - nm_dhcp_client_stop (device, device->pid); + nm_dhcp_client_stop (client, client->pid); nm_info ("(%s): canceled DHCP transaction, dhcp client pid %d", - device->iface, - device->pid); + client->iface, + client->pid); - device->pid = 0; - device->state = DHC_END; + client->pid = 0; + client->state = DHC_END; /* Clean up the pidfile if it got left around */ - if (device->pid_file) { - remove (device->pid_file); - g_free (device->pid_file); - device->pid_file = NULL; + if (client->pid_file) { + remove (client->pid_file); + g_free (client->pid_file); + client->pid_file = NULL; } /* Free leasefile (but don't delete) */ - if (device->lease_file) { - g_free (device->lease_file); - device->lease_file = NULL; + if (client->lease_file) { + g_free (client->lease_file); + client->lease_file = NULL; } /* Clean up config file if it got left around */ - if (device->conf_file) { - remove (device->conf_file); - g_free (device->conf_file); - device->conf_file = NULL; + if (client->conf_file) { + remove (client->conf_file); + g_free (client->conf_file); + client->conf_file = NULL; } - nm_dhcp_device_timeout_cleanup (device); - g_hash_table_remove_all (device->options); + nm_dhcp_client_timeout_cleanup (client); + g_hash_table_remove_all (client->options); } @@ -718,23 +697,20 @@ nm_dhcp_manager_cancel_transaction_real (NMDHCPDevice *device) * */ void -nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, - const char *iface) +nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, guint32 id) { - NMDHCPDevice *device; + NMDHCPClient *client; NMDHCPManagerPrivate *priv; + g_return_if_fail (manager != NULL); g_return_if_fail (NM_IS_DHCP_MANAGER (manager)); - g_return_if_fail (iface != NULL); + g_return_if_fail (id > 0); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - device = (NMDHCPDevice *) g_hash_table_lookup (priv->devices, iface); - - if (!device || !device->pid) - return; - - nm_dhcp_manager_cancel_transaction_real (device); + client = get_client_for_id (manager, id); + if (client && client->pid) + nm_dhcp_manager_cancel_transaction_real (client); } static void @@ -823,7 +799,7 @@ out: /* Given a table of DHCP options from the client, convert into an IP4Config */ NMIP4Config * -nm_dhcp_manager_options_to_ip4_config (const char *iface, GHashTable *options) +nm_dhcp4_manager_options_to_config (const char *iface, GHashTable *options) { NMIP4Config *ip4_config = NULL; struct in_addr tmp_addr; @@ -863,7 +839,7 @@ nm_dhcp_manager_options_to_ip4_config (const char *iface, GHashTable *options) /* Routes: if the server returns classless static routes, we MUST ignore * the 'static_routes' option. */ - have_classless = nm_dhcp_client_process_classless_routes (options, ip4_config, &gwaddr); + have_classless = nm_dhcp4_client_process_classless_routes (options, ip4_config, &gwaddr); if (!have_classless) { gwaddr = 0; /* Ensure client code doesn't lie */ process_classful_routes (options, ip4_config); @@ -979,29 +955,29 @@ error: * */ NMIP4Config * -nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, - const char *iface) +nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, guint32 id) { NMDHCPManagerPrivate *priv; - NMDHCPDevice *device; + NMDHCPClient *client; + g_return_val_if_fail (manager != NULL, NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); - g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (id > 0, NULL); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - device = (NMDHCPDevice *) g_hash_table_lookup (priv->devices, iface); - if (!device) { - nm_warning ("Device '%s' transaction not started.", iface); + client = get_client_for_id (manager, id); + if (!client) { + nm_warning ("Device DHCP transaction %d not started.", id); return NULL; } - if (!state_is_bound (device->state)) { - nm_warning ("%s: dhcp client didn't bind to a lease.", device->iface); + if (!state_is_bound (client->state)) { + nm_warning ("%s: dhcp client didn't bind to a lease.", client->iface); return NULL; } - return nm_dhcp_manager_options_to_ip4_config (iface, device->options); + return nm_dhcp4_manager_options_to_config (client->iface, client->options); } #define NEW_TAG "new_" @@ -1044,34 +1020,35 @@ iterate_dhcp4_config_option (gpointer key, gboolean nm_dhcp_manager_foreach_dhcp4_option (NMDHCPManager *self, - const char *iface, + guint32 id, GHFunc func, gpointer user_data) { NMDHCPManagerPrivate *priv; - NMDHCPDevice *device; + NMDHCPClient *client; Dhcp4ForeachInfo info = { NULL, NULL }; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), FALSE); - g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (id > 0, FALSE); g_return_val_if_fail (func != NULL, FALSE); priv = NM_DHCP_MANAGER_GET_PRIVATE (self); - device = (NMDHCPDevice *) g_hash_table_lookup (priv->devices, iface); - if (!device) { - nm_warning ("Device '%s' transaction not started.", iface); + client = get_client_for_id (self, id); + if (!client) { + nm_warning ("Device DHCP transaction %d not started.", id); return FALSE; } - if (!state_is_bound (device->state)) { - nm_warning ("%s: dhclient didn't bind to a lease.", device->iface); + if (!state_is_bound (client->state)) { + nm_warning ("%s: dhclient didn't bind to a lease.", client->iface); return FALSE; } info.func = func; info.user_data = user_data; - g_hash_table_foreach (device->options, iterate_dhcp4_config_option, &info); + g_hash_table_foreach (client->options, iterate_dhcp4_config_option, &info); return TRUE; } @@ -1103,14 +1080,86 @@ nm_dhcp_manager_set_hostname_provider (NMDHCPManager *manager, } GSList * -nm_dhcp_manager_get_lease_ip4_config (NMDHCPManager *self, - const char *iface, - const char *uuid) +nm_dhcp4_manager_get_lease_config (NMDHCPManager *self, + const char *iface, + const char *uuid) { + g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL); - return nm_dhcp_client_get_lease_ip4_config (iface, uuid); + return nm_dhcp4_client_get_lease_config (iface, uuid); +} + +/***************************************************/ + +NMDHCPManager * +nm_dhcp_manager_get (void) +{ + static NMDHCPManager *singleton = NULL; + + if (!singleton) + singleton = nm_dhcp_manager_new (); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static void +nm_dhcp_manager_init (NMDHCPManager *manager) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + priv->next_id = 1; +} + +static void +finalize (GObject *object) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); + + if (priv->hostname_provider) { + g_object_weak_unref (G_OBJECT (priv->hostname_provider), hostname_provider_destroyed, object); + priv->hostname_provider = NULL; + } + + g_hash_table_destroy (priv->clients); + g_object_unref (priv->proxy); + g_object_unref (priv->dbus_mgr); + + G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->finalize (object); +} + +static void +nm_dhcp_manager_class_init (NMDHCPManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMDHCPManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPManagerClass, state_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + signals[TIMEOUT] = + g_signal_new ("timeout", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPManagerClass, timeout), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); } diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 46d0ea4bc3..3b8a6a410e 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -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) 2006 - 2008 Novell, Inc. */ @@ -51,6 +51,7 @@ typedef enum { DHC_REBOOT, /* have valid lease, but now obtained a different one */ DHC_REBIND4, /* IPv4 new/different lease */ DHC_REBIND6, /* IPv6 new/different lease */ + DHC_DEPREF6, /* IPv6 lease depreferred */ DHC_STOP, /* remove old lease */ DHC_MEDIUM, /* media selection begun */ DHC_TIMEOUT, /* timed out contacting DHCP server */ @@ -60,7 +61,6 @@ typedef enum { DHC_START, /* sent when dhclient started OK */ DHC_ABEND, /* dhclient exited abnormally */ DHC_END, /* dhclient exited normally */ - DHC_DEPREF6, /* IPv6 lease depreferred */ DHC_END_OPTIONS, /* last option in subscription sent */ } NMDHCPState; @@ -72,22 +72,23 @@ typedef struct { GObjectClass parent; /* Signals */ - void (*state_changed) (NMDHCPManager *manager, char *iface, NMDHCPState state); - void (*timeout) (NMDHCPManager *manager, char *iface); + void (*state_changed) (NMDHCPManager *manager, guint32 id, NMDHCPState state); + void (*timeout) (NMDHCPManager *manager, guint32 id); } NMDHCPManagerClass; typedef struct { - char * iface; - guchar state; - GPid pid; - char * pid_file; - char * conf_file; - char * lease_file; - guint timeout_id; - guint watch_id; - NMDHCPManager * manager; - GHashTable * options; -} NMDHCPDevice; + GPid id; + char * iface; + guchar state; + GPid pid; + char * pid_file; + char * conf_file; + char * lease_file; + guint timeout_id; + guint watch_id; + NMDHCPManager * manager; + GHashTable * options; +} NMDHCPClient; GType nm_dhcp_manager_get_type (void); @@ -95,42 +96,42 @@ NMDHCPManager *nm_dhcp_manager_get (void); void nm_dhcp_manager_set_hostname_provider(NMDHCPManager *manager, NMHostnameProvider *provider); -gboolean nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, +guint32 nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, const char *iface, const char *uuid, NMSettingIP4Config *s_ip4, guint32 timeout, guint8 *dhcp_anycast_addr); void nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, - const char *iface); -NMIP4Config * nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, const char *iface); -NMDHCPState nm_dhcp_manager_get_state_for_device (NMDHCPManager *manager, const char *iface); + guint32 id); +NMIP4Config * nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, guint32 id); +NMDHCPState nm_dhcp_manager_get_client_state (NMDHCPManager *manager, guint32 id); gboolean nm_dhcp_manager_foreach_dhcp4_option (NMDHCPManager *self, - const char *iface, + guint32 id, GHFunc func, gpointer user_data); -GSList * nm_dhcp_manager_get_lease_ip4_config (NMDHCPManager *self, +GSList * nm_dhcp4_manager_get_lease_config (NMDHCPManager *self, const char *iface, const char *uuid); /* The following are implemented by the DHCP client backends */ -GPid nm_dhcp_client_start (NMDHCPDevice *device, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *anycast_addr); -void nm_dhcp_client_stop (NMDHCPDevice *device, pid_t pid); +GPid nm_dhcp4_client_start (NMDHCPClient *client, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr); +void nm_dhcp_client_stop (NMDHCPClient *client, pid_t pid); -gboolean nm_dhcp_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr); +gboolean nm_dhcp4_client_process_classless_routes (GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr); -GSList * nm_dhcp_client_get_lease_ip4_config (const char *iface, - const char *uuid); +GSList * nm_dhcp4_client_get_lease_config (const char *iface, + const char *uuid); /* Test functions */ -NMIP4Config *nm_dhcp_manager_options_to_ip4_config (const char *iface, - GHashTable *options); +NMIP4Config *nm_dhcp4_manager_options_to_config (const char *iface, + GHashTable *options); #endif /* NM_DHCP_MANAGER_H */ diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 037d603380..72073e4150 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.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) 2006 - 2008 Novell, Inc. */ @@ -1608,9 +1608,9 @@ ip4_match_config (NMDevice *self, NMConnection *connection) /* Get any saved leases that apply to this connection */ dhcp_mgr = nm_dhcp_manager_get (); - leases = nm_dhcp_manager_get_lease_ip4_config (dhcp_mgr, - nm_device_get_iface (self), - nm_setting_connection_get_uuid (s_con)); + leases = nm_dhcp4_manager_get_lease_config (dhcp_mgr, + nm_device_get_iface (self), + nm_setting_connection_get_uuid (s_con)); g_object_unref (dhcp_mgr); method = nm_setting_ip4_config_get_method (s_ip4); diff --git a/src/nm-device.c b/src/nm-device.c index 05c9598254..4be3fc23e3 100644 --- a/src/nm-device.c +++ b/src/nm-device.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) 2006 - 2008 Novell, Inc. */ @@ -105,6 +105,7 @@ typedef struct { /* IP4 configuration info */ NMIP4Config * ip4_config; /* Config from DHCP, PPP, or system config files */ NMDHCPManager * dhcp_manager; + guint32 dhcp4_id; guint32 dhcp_timeout; gulong dhcp_state_sigid; gulong dhcp_timeout_sigid; @@ -1090,7 +1091,6 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) if (!s_ip4 || !method || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - gboolean success; guint8 *anycast = NULL; if (priv->dhcp_anycast_address) @@ -1102,10 +1102,15 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) /* DHCP manager will cancel any transaction already in progress and we do not want to cancel this activation if we get "down" state from that. */ g_signal_handler_block (priv->dhcp_manager, priv->dhcp_state_sigid); - success = nm_dhcp_manager_begin_transaction (priv->dhcp_manager, ip_iface, uuid, s_ip4, priv->dhcp_timeout, anycast); + priv->dhcp4_id = nm_dhcp_manager_begin_transaction (priv->dhcp_manager, + ip_iface, + uuid, + s_ip4, + priv->dhcp_timeout, + anycast); g_signal_handler_unblock (priv->dhcp_manager, priv->dhcp_state_sigid); - if (success) { + if (priv->dhcp4_id) { /* DHCP devices will be notified by the DHCP manager when * stuff happens. */ @@ -1315,14 +1320,14 @@ real_act_stage4_get_ip4_config (NMDevice *self, s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); if (nm_device_get_use_dhcp (self)) { - *config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, ip_iface); + *config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, priv->dhcp4_id); if (*config) { /* Merge user-defined overrides into the IP4Config to be applied */ nm_utils_merge_ip4_config (*config, s_ip4); nm_dhcp4_config_reset (priv->dhcp4_config); nm_dhcp_manager_foreach_dhcp4_option (priv->dhcp_manager, - ip_iface, + priv->dhcp4_id, dhcp4_add_option_cb, priv->dhcp4_config); @@ -2013,7 +2018,7 @@ nm_device_deactivate_quickly (NMDevice *self) /* Stop any ongoing DHCP transaction on this device */ if (nm_device_get_act_request (self)) { if (nm_device_get_use_dhcp (self)) { - nm_dhcp_manager_cancel_transaction (priv->dhcp_manager, nm_device_get_ip_iface (self)); + nm_dhcp_manager_cancel_transaction (priv->dhcp_manager, priv->dhcp4_id); nm_device_set_use_dhcp (self, FALSE); /* Notify of invalid DHCP4 config */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); @@ -2027,6 +2032,8 @@ nm_device_deactivate_quickly (NMDevice *self) g_object_unref (priv->dnsmasq_manager); priv->dnsmasq_manager = NULL; } + + priv->dhcp4_id = 0; } aipd_cleanup (self); @@ -2255,7 +2262,6 @@ handle_dhcp_lease_change (NMDevice *device) NMConnection *connection; NMActRequest *req; NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; - const char *ip_iface; gboolean assumed; if (!nm_device_get_use_dhcp (device)) { @@ -2263,9 +2269,7 @@ handle_dhcp_lease_change (NMDevice *device) return; } - ip_iface = nm_device_get_ip_iface (device); - - config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, ip_iface); + config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, priv->dhcp4_id); if (!config) { nm_warning ("failed to get DHCP config for rebind"); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); @@ -2286,7 +2290,7 @@ handle_dhcp_lease_change (NMDevice *device) if (nm_device_set_ip4_config (device, config, assumed, &reason)) { nm_dhcp4_config_reset (priv->dhcp4_config); nm_dhcp_manager_foreach_dhcp4_option (priv->dhcp_manager, - ip_iface, + priv->dhcp4_id, dhcp4_add_option_cb, priv->dhcp4_config); } else { @@ -2297,7 +2301,7 @@ handle_dhcp_lease_change (NMDevice *device) static void dhcp_state_changed (NMDHCPManager *dhcp_manager, - const char *iface, + guint32 id, NMDHCPState state, gpointer user_data) { @@ -2305,10 +2309,8 @@ dhcp_state_changed (NMDHCPManager *dhcp_manager, NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); NMDeviceState dev_state; - if (strcmp (nm_device_get_ip_iface (device), iface) != 0) - return; - - if (!nm_device_get_act_request (device)) + if ( !nm_device_get_act_request (device) + || (priv->dhcp4_id != id)) return; dev_state = nm_device_get_state (device); @@ -2350,12 +2352,14 @@ dhcp_state_changed (NMDHCPManager *dhcp_manager, static void dhcp_timeout (NMDHCPManager *dhcp_manager, - const char *iface, + guint32 id, gpointer user_data) { - NMDevice * device = NM_DEVICE (user_data); + NMDevice *device = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - if (strcmp (nm_device_get_ip_iface (device), iface) != 0) + if ( !nm_device_get_act_request (device) + || (priv->dhcp4_id != id)) return; if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c index 90828d9dd8..a99feea9db 100644 --- a/src/tests/test-dhcp-options.c +++ b/src/tests/test-dhcp-options.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) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. * */ @@ -88,7 +88,7 @@ test_generic_options (void) const char *expected_route2_gw = "10.1.1.1"; options = fill_table (generic_options, NULL); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-generic", "failed to parse DHCP4 options"); @@ -199,7 +199,7 @@ test_wins_options (void) options = fill_table (generic_options, NULL); options = fill_table (wins_options, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-wins", "failed to parse DHCP4 options"); @@ -245,7 +245,7 @@ test_classless_static_routes (void) options = fill_table (generic_options, NULL); options = fill_table (classless_routes_options, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-rfc3442", "failed to parse DHCP4 options"); @@ -311,7 +311,7 @@ test_invalid_classless_routes1 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes1, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-1", "failed to parse DHCP4 options"); @@ -362,7 +362,7 @@ test_invalid_classless_routes2 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes2, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-2", "failed to parse DHCP4 options"); @@ -432,7 +432,7 @@ test_invalid_classless_routes3 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes3, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-3", "failed to parse DHCP4 options"); @@ -483,7 +483,7 @@ test_gateway_in_classless_routes (void) options = fill_table (generic_options, NULL); options = fill_table (gw_in_classless_routes, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-rfc3442-gateway", "failed to parse DHCP4 options"); @@ -537,7 +537,7 @@ test_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (escaped_searches_options, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-escaped-domain-searches", "failed to parse DHCP4 options"); @@ -568,7 +568,7 @@ test_invalid_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_escaped_searches_options, options); - ip4_config = nm_dhcp_manager_options_to_ip4_config ("eth0", options); + ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); ASSERT (ip4_config != NULL, "dhcp-invalid-escaped-domain-searches", "failed to parse DHCP4 options"); From 18062350492afa7f062f3ed4338ca0186d491e9b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 12 Jan 2010 22:09:28 -0800 Subject: [PATCH 020/392] dhcp: convert dhcp backends to classes --- src/Makefile.am | 1 + src/dhcp-manager/Makefile.am | 10 +- src/dhcp-manager/nm-dhcp-client.c | 900 ++++++++++++++++++++++++++ src/dhcp-manager/nm-dhcp-client.h | 122 ++++ src/dhcp-manager/nm-dhcp-dhclient.c | 248 +++++--- src/dhcp-manager/nm-dhcp-dhclient.h | 45 ++ src/dhcp-manager/nm-dhcp-dhcpcd.c | 129 ++-- src/dhcp-manager/nm-dhcp-dhcpcd.h | 45 ++ src/dhcp-manager/nm-dhcp-manager.c | 952 +++++----------------------- src/dhcp-manager/nm-dhcp-manager.h | 94 +-- src/nm-device-ethernet.c | 6 +- src/nm-device.c | 315 +++++---- src/tests/test-dhcp-options.c | 52 +- 13 files changed, 1709 insertions(+), 1210 deletions(-) create mode 100644 src/dhcp-manager/nm-dhcp-client.c create mode 100644 src/dhcp-manager/nm-dhcp-client.h create mode 100644 src/dhcp-manager/nm-dhcp-dhclient.h create mode 100644 src/dhcp-manager/nm-dhcp-dhcpcd.h diff --git a/src/Makefile.am b/src/Makefile.am index f351c787d1..60aa93ee15 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,6 +46,7 @@ libtest_dhcp_la_CPPFLAGS = \ $(LIBNL_CFLAGS) libtest_dhcp_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index b7b0c6581c..711c2a5058 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -9,9 +9,14 @@ INCLUDES = \ noinst_LTLIBRARIES = libdhcp-manager.la libdhcp_manager_la_SOURCES = \ + nm-dhcp-client.c \ + nm-dhcp-client.h \ nm-dhcp-manager.c \ nm-dhcp-manager.h \ - nm-dhcp-@DHCP_CLIENT@.c + nm-dhcp-dhclient.h \ + nm-dhcp-dhclient.c \ + nm-dhcp-dhcpcd.h \ + nm-dhcp-dhcpcd.c libdhcp_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ @@ -29,6 +34,3 @@ libdhcp_manager_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) -EXTRA_DIST = \ - nm-dhcp-dhclient.c \ - nm-dhcp-dhcpcd.c diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c new file mode 100644 index 0000000000..e39c9bf312 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -0,0 +1,900 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2010 Red Hat, Inc. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" +#include "nm-dhcp-client.h" + +#define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */ + +typedef struct { + char * iface; + guchar state; + GPid pid; + guint timeout_id; + guint watch_id; + GHashTable * options; +} NMDHCPClientPrivate; + +#define NM_DHCP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CLIENT, NMDHCPClientPrivate)) + +G_DEFINE_TYPE_EXTENDED (NMDHCPClient, nm_dhcp_client, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, {}) + +enum { + STATE_CHANGED, + TIMEOUT, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_IFACE, + LAST_PROP +}; + +/********************************************/ + +GPid +nm_dhcp_client_get_pid (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, -1); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), -1); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->pid; +} + +const char * +nm_dhcp_client_get_iface (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->iface; +} + +/********************************************/ + +static void +timeout_cleanup (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } +} + +static void +watch_cleanup (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (priv->watch_id) { + g_source_remove (priv->watch_id); + priv->watch_id = 0; + } +} + +static void +stop_process (GPid pid, const char *iface) +{ + int i = 15; /* 3 seconds */ + + g_return_if_fail (pid > 0); + + /* Tell it to quit; maybe it wants to send out a RELEASE message */ + kill (pid, SIGTERM); + + while (i-- > 0) { + gint child_status; + int ret; + + ret = waitpid (pid, &child_status, WNOHANG); + if (ret > 0) + break; + + if (ret == -1) { + /* Child already exited */ + if (errno == ECHILD) + break; + /* Took too long; shoot it in the head */ + i = 0; + break; + } + g_usleep (G_USEC_PER_SEC / 5); + } + + if (i <= 0) { + if (iface) { + g_warning ("%s: dhcp client pid %d didn't exit, will kill it.", + iface, pid); + } + kill (pid, SIGKILL); + + g_warning ("waiting for dhcp client pid %d to exit", pid); + waitpid (pid, NULL, 0); + g_warning ("dhcp client pid %d cleaned up", pid); + } +} + +static void +real_stop (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_if_fail (priv->pid > 0); + + /* Clean up the watch handler since we're explicitly killing the daemon */ + watch_cleanup (self); + + stop_process (priv->pid, priv->iface); +} + +static gboolean +daemon_timeout (gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + g_message ("(%s): DHCP transaction took too long, stopping it.", priv->iface); + g_signal_emit (G_OBJECT (self), signals[TIMEOUT], 0); + return FALSE; +} + +static void +daemon_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (!WIFEXITED (status)) { + priv->state = DHC_ABEND; + g_warning ("dhcp client died abnormally"); + } + priv->pid = 0; + + watch_cleanup (self); + timeout_cleanup (self); + + g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], 0, priv->state); +} + +gboolean +nm_dhcp_client_start (NMDHCPClient *self, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout_secs, + guint8 *dhcp_anycast_addr) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->pid == -1, FALSE); + + if (timeout_secs == 0) + timeout_secs = NM_DHCP_TIMEOUT; + + g_message ("Activation (%s) Beginning DHCP transaction (timeout in %d seconds)", + priv->iface, timeout_secs); + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, + uuid, + s_ip4, + dhcp_anycast_addr); + if (priv->pid <= 0) + return FALSE; + + /* Set up a timeout on the transaction to kill it after the timeout */ + priv->timeout_id = g_timeout_add_seconds (timeout_secs, + daemon_timeout, + self); + priv->watch_id = g_child_watch_add (priv->pid, + (GChildWatchFunc) daemon_watch_cb, + self); + + return TRUE; +} + +void +nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name) +{ + char *pid_contents = NULL, *proc_contents = NULL, *proc_path = NULL; + long int tmp; + + /* Check for an existing instance and stop it */ + if (!g_file_get_contents (pid_file, &pid_contents, NULL, NULL)) + return; + + errno = 0; + tmp = strtol (pid_contents, NULL, 10); + if ((errno == 0) && (tmp > 1)) { + const char *exe; + + /* Ensure the process is a DHCP client */ + proc_path = g_strdup_printf ("/proc/%ld/cmdline", tmp); + if (g_file_get_contents (proc_path, &proc_contents, NULL, NULL)) { + exe = strrchr (proc_contents, '/'); + if (exe) + exe++; + else + exe = proc_contents; + + if (!strcmp (exe, binary_name)) + stop_process ((GPid) tmp, NULL); + } + } + + remove (pid_file); + g_free (proc_path); + g_free (pid_contents); + g_free (proc_contents); +} + +void +nm_dhcp_client_stop (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + /* Kill the DHCP client */ + if (priv->pid > 0) { + NM_DHCP_CLIENT_GET_CLASS (self)->stop (self); + + g_message ("(%s): canceled DHCP transaction, dhcp client pid %d", + priv->iface, + priv->pid); + } + + /* And clean stuff up */ + + priv->pid = -1; + priv->state = DHC_END; + + g_hash_table_remove_all (priv->options); + + timeout_cleanup (self); + watch_cleanup (self); +} + +/********************************************/ + +static gboolean +state_is_bound (guint32 state) +{ + if ( (state == DHC_BOUND4) + || (state == DHC_BOUND6) + || (state == DHC_RENEW4) + || (state == DHC_RENEW6) + || (state == DHC_REBOOT) + || (state == DHC_REBIND4) + || (state == DHC_REBIND6) + || (state == DHC_IPV4LL)) + return TRUE; + + return FALSE; +} + +typedef struct { + NMDHCPState state; + const char *name; +} DhcState; + +#define STATE_TABLE_SIZE (sizeof (state_table) / sizeof (state_table[0])) + +static DhcState state_table[] = { + { DHC_NBI, "nbi" }, + { DHC_PREINIT, "preinit" }, + { DHC_BOUND4, "bound" }, + { DHC_BOUND6, "bound6" }, + { DHC_IPV4LL, "ipv4ll" }, + { DHC_RENEW4, "renew" }, + { DHC_RENEW6, "renew6" }, + { DHC_REBOOT, "reboot" }, + { DHC_REBIND4, "rebind" }, + { DHC_REBIND6, "rebind6" }, + { DHC_STOP, "stop" }, + { DHC_MEDIUM, "medium" }, + { DHC_TIMEOUT, "timeout" }, + { DHC_FAIL, "fail" }, + { DHC_EXPIRE, "expire" }, + { DHC_RELEASE, "release" }, + { DHC_START, "start" }, + { DHC_ABEND, "abend" }, + { DHC_END, "end" }, + { DHC_DEPREF6, "depref6" }, +}; + +static inline const char * +state_to_string (guint32 state) +{ + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (state == state_table[i].state) + return state_table[i].name; + } + + return NULL; +} + +static inline NMDHCPState +string_to_state (const char *name) +{ + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (!strcasecmp (name, state_table[i].name)) + return state_table[i].state; + } + + return 255; +} + +static char * +garray_to_string (GArray *array, const char *key) +{ + GString *str; + int i; + unsigned char c; + char *converted = NULL; + + g_return_val_if_fail (array != NULL, NULL); + + /* Since the DHCP options come through environment variables, they should + * already be UTF-8 safe, but just make sure. + */ + str = g_string_sized_new (array->len); + for (i = 0; i < array->len; i++) { + c = array->data[i]; + + /* Convert NULLs to spaces and non-ASCII characters to ? */ + if (c == '\0') + c = ' '; + else if (c > 127) + c = '?'; + str = g_string_append_c (str, c); + } + str = g_string_append_c (str, '\0'); + + converted = str->str; + if (!g_utf8_validate (converted, -1, NULL)) + g_warning ("%s: DHCP option '%s' couldn't be converted to UTF-8", __func__, key); + g_string_free (str, FALSE); + return converted; +} + +static void +copy_option (gpointer key, + gpointer value, + gpointer user_data) +{ + GHashTable *hash = user_data; + const char *str_key = (const char *) key; + char *str_value = NULL; + + if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { + g_warning ("Unexpected key %s value type was not " + "DBUS_TYPE_G_UCHAR_ARRAY", + str_key); + return; + } + + str_value = garray_to_string ((GArray *) g_value_get_boxed (value), str_key); + if (str_value) + g_hash_table_insert (hash, g_strdup (str_key), str_value); +} + +void +nm_dhcp_client_new_options (NMDHCPClient *self, + GHashTable *options, + const char *reason) +{ + NMDHCPClientPrivate *priv; + guint32 old_state; + guint32 new_state; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + g_return_if_fail (options != NULL); + g_return_if_fail (reason != NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + old_state = priv->state; + new_state = string_to_state (reason); + + /* Clear old and save new DHCP options */ + g_hash_table_remove_all (priv->options); + g_hash_table_foreach (options, copy_option, priv->options); + + if (old_state == new_state) + return; + + /* Handle changed device state */ + if (state_is_bound (new_state)) { + /* Cancel the timeout if the DHCP client is now bound */ + timeout_cleanup (self); + } + + priv->state = new_state; + g_message ("DHCP: device %s state changed %s -> %s", + priv->iface, + state_to_string (old_state), + state_to_string (priv->state)); + + g_signal_emit (G_OBJECT (self), + signals[STATE_CHANGED], + 0, + priv->state); +} + +#define NEW_TAG "new_" +#define OLD_TAG "old_" + +typedef struct { + GHFunc func; + gpointer user_data; +} Dhcp4ForeachInfo; + +static void +iterate_dhcp4_config_option (gpointer key, + gpointer value, + gpointer user_data) +{ + Dhcp4ForeachInfo *info = (Dhcp4ForeachInfo *) user_data; + char *tmp_key = NULL; + const char **p; + static const char *filter_options[] = { + "interface", "pid", "reason", "dhcp_message_type", NULL + }; + + /* Filter out stuff that's not actually new DHCP options */ + for (p = filter_options; *p; p++) { + if (!strcmp (*p, (const char *) key)) + return; + if (!strncmp ((const char *) key, OLD_TAG, strlen (OLD_TAG))) + return; + } + + /* Remove the "new_" prefix that dhclient passes back */ + if (!strncmp ((const char *) key, NEW_TAG, strlen (NEW_TAG))) + tmp_key = g_strdup ((const char *) (key + strlen (NEW_TAG))); + else + tmp_key = g_strdup ((const char *) key); + + (*info->func) ((gpointer) tmp_key, value, info->user_data); + g_free (tmp_key); +} + +gboolean +nm_dhcp_client_foreach_dhcp4_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data) +{ + NMDHCPClientPrivate *priv; + Dhcp4ForeachInfo info = { NULL, NULL }; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + g_return_val_if_fail (func != NULL, FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (!state_is_bound (priv->state)) { + g_warning ("%s: dhclient didn't bind to a lease.", priv->iface); + return FALSE; + } + + info.func = func; + info.user_data = user_data; + g_hash_table_foreach (priv->options, iterate_dhcp4_config_option, &info); + return TRUE; +} + +/********************************************/ + +static void +process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) +{ + const char *str; + char **searches, **s; + + str = g_hash_table_lookup (options, "new_static_routes"); + if (!str) + return; + + searches = g_strsplit (str, " ", 0); + if ((g_strv_length (searches) % 2)) { + g_message (" static routes provided, but invalid"); + goto out; + } + + for (s = searches; *s; s += 2) { + NMIP4Route *route; + struct in_addr rt_addr; + struct in_addr rt_route; + + if (inet_pton (AF_INET, *s, &rt_addr) <= 0) { + g_warning ("DHCP provided invalid static route address: '%s'", *s); + continue; + } + if (inet_pton (AF_INET, *(s + 1), &rt_route) <= 0) { + g_warning ("DHCP provided invalid static route gateway: '%s'", *(s + 1)); + continue; + } + + // FIXME: ensure the IP addresse and route are sane + + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); + nm_ip4_route_set_prefix (route, 32); /* 255.255.255.255 */ + nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); + + nm_ip4_config_take_route (ip4_config, route); + g_message (" static route %s gw %s", *s, *(s + 1)); + } + +out: + g_strfreev (searches); +} + +static void +process_domain_search (NMIP4Config *ip4_config, const char *str) +{ + char **searches, **s; + char *unescaped, *p; + int i; + + g_return_if_fail (str != NULL); + g_return_if_fail (ip4_config != NULL); + + p = unescaped = g_strdup (str); + do { + p = strstr (p, "\\032"); + if (!p) + break; + + /* Clear the escaped space with real spaces */ + for (i = 0; i < 4; i++) + *p++ = ' '; + } while (*p++); + + if (strchr (unescaped, '\\')) { + g_message (" invalid domain search: '%s'", unescaped); + goto out; + } + + searches = g_strsplit (unescaped, " ", 0); + for (s = searches; *s; s++) { + if (strlen (*s)) { + g_message (" domain search '%s'", *s); + nm_ip4_config_add_search (ip4_config, *s); + } + } + g_strfreev (searches); + +out: + g_free (unescaped); +} + +/* Given a table of DHCP options from the client, convert into an IP4Config */ +static NMIP4Config * +ip4_options_to_config (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + NMIP4Config *ip4_config = NULL; + struct in_addr tmp_addr; + NMIP4Address *addr = NULL; + char *str = NULL; + guint32 gwaddr = 0; + gboolean have_classless = FALSE; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->options != NULL, NULL); + + ip4_config = nm_ip4_config_new (); + if (!ip4_config) { + g_warning ("%s: couldn't allocate memory for an IP4Config!", priv->iface); + return NULL; + } + + addr = nm_ip4_address_new (); + if (!addr) { + g_warning ("%s: couldn't allocate memory for an IP4 Address!", priv->iface); + goto error; + } + + str = g_hash_table_lookup (priv->options, "new_ip_address"); + if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { + nm_ip4_address_set_address (addr, tmp_addr.s_addr); + g_message (" address %s", str); + } else + goto error; + + str = g_hash_table_lookup (priv->options, "new_subnet_mask"); + if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { + nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr)); + g_message (" prefix %d (%s)", nm_ip4_address_get_prefix (addr), str); + } + + /* Routes: if the server returns classless static routes, we MUST ignore + * the 'static_routes' option. + */ + if (NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes) { + have_classless = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes (self, + priv->options, + ip4_config, + &gwaddr); + } + + if (!have_classless) { + gwaddr = 0; /* Ensure client code doesn't lie */ + process_classful_routes (priv->options, ip4_config); + } + + if (gwaddr) { + char buf[INET_ADDRSTRLEN + 1]; + + inet_ntop (AF_INET, &gwaddr, buf, sizeof (buf)); + g_message (" gateway %s", buf); + nm_ip4_address_set_gateway (addr, gwaddr); + } else { + /* If the gateway wasn't provided as a classless static route with a + * subnet length of 0, try to find it using the old-style 'routers' option. + */ + str = g_hash_table_lookup (priv->options, "new_routers"); + if (str) { + char **routers = g_strsplit (str, " ", 0); + char **s; + + for (s = routers; *s; s++) { + /* FIXME: how to handle multiple routers? */ + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_address_set_gateway (addr, tmp_addr.s_addr); + g_message (" gateway %s", *s); + break; + } else + g_warning ("Ignoring invalid gateway '%s'", *s); + } + g_strfreev (routers); + } + } + + nm_ip4_config_take_address (ip4_config, addr); + addr = NULL; + + str = g_hash_table_lookup (priv->options, "new_host_name"); + if (str) + g_message (" hostname '%s'", str); + + str = g_hash_table_lookup (priv->options, "new_domain_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_nameserver (ip4_config, tmp_addr.s_addr); + g_message (" nameserver '%s'", *s); + } else + g_warning ("Ignoring invalid nameserver '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_domain_name"); + if (str) { + char **domains = g_strsplit (str, " ", 0); + char **s; + + for (s = domains; *s; s++) { + g_message (" domain name '%s'", *s); + nm_ip4_config_add_domain (ip4_config, *s); + } + g_strfreev (domains); + } + + str = g_hash_table_lookup (priv->options, "new_domain_search"); + if (str) + process_domain_search (ip4_config, str); + + str = g_hash_table_lookup (priv->options, "new_netbios_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_wins (ip4_config, tmp_addr.s_addr); + g_message (" wins '%s'", *s); + } else + g_warning ("Ignoring invalid WINS server '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_interface_mtu"); + if (str) { + int int_mtu; + + errno = 0; + int_mtu = strtol (str, NULL, 10); + if ((errno == EINVAL) || (errno == ERANGE)) + goto error; + + if (int_mtu > 576) + nm_ip4_config_set_mtu (ip4_config, int_mtu); + } + + return ip4_config; + +error: + if (addr) + nm_ip4_address_unref (addr); + g_object_unref (ip4_config); + return NULL; +} + +NMIP4Config * +nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (test && !state_is_bound (priv->state)) { + g_warning ("%s: dhcp client didn't bind to a lease.", priv->iface); + return NULL; + } + + return ip4_options_to_config (self); +} + +/********************************************/ + +static void +nm_dhcp_client_init (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + priv->pid = -1; +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_IFACE: + g_value_set_string (value, priv->iface); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_IFACE: + /* construct-only */ + priv->iface = g_strdup (g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (object); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + /* Stopping the client is left up to the controlling device + * explicitly since we may want to quit NetworkManager but not terminate + * the DHCP client. + */ + + g_hash_table_destroy (priv->options); + g_free (priv->iface); + + G_OBJECT_CLASS (nm_dhcp_client_parent_class)->dispose (object); +} + +static void +nm_dhcp_client_class_init (NMDHCPClientClass *client_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (client_class); + + g_type_class_add_private (client_class, sizeof (NMDHCPClientPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + client_class->stop = real_stop; + + g_object_class_install_property + (object_class, PROP_IFACE, + g_param_spec_string (NM_DHCP_CLIENT_INTERFACE, + "iface", + "Interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[TIMEOUT] = + g_signal_new ("timeout", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, timeout), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h new file mode 100644 index 0000000000..0e5d81229d --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -0,0 +1,122 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_CLIENT_H +#define NM_DHCP_CLIENT_H + +#include +#include + +#include + +#define NM_TYPE_DHCP_CLIENT (nm_dhcp_client_get_type ()) +#define NM_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClient)) +#define NM_DHCP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_CLIENT, NMDHCPClientClass)) +#define NM_IS_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_CLIENT)) +#define NM_IS_DHCP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_CLIENT)) +#define NM_DHCP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClientClass)) + +#define NM_DHCP_CLIENT_INTERFACE "iface" + +typedef enum { + DHC_NBI = 0, /* no broadcast interfaces found */ + DHC_PREINIT, /* configuration started */ + DHC_BOUND4, /* IPv4 lease obtained */ + DHC_BOUND6, /* IPv6 lease obtained */ + DHC_IPV4LL, /* IPv4LL address obtained */ + DHC_RENEW4, /* IPv4 lease renewed */ + DHC_RENEW6, /* IPv6 lease renewed */ + DHC_REBOOT, /* have valid lease, but now obtained a different one */ + DHC_REBIND4, /* IPv4 new/different lease */ + DHC_REBIND6, /* IPv6 new/different lease */ + DHC_DEPREF6, /* IPv6 lease depreferred */ + DHC_STOP, /* remove old lease */ + DHC_MEDIUM, /* media selection begun */ + DHC_TIMEOUT, /* timed out contacting DHCP server */ + DHC_FAIL, /* all attempts to contact server timed out, sleeping */ + DHC_EXPIRE, /* lease has expired, renewing */ + DHC_RELEASE, /* releasing lease */ + DHC_START, /* sent when dhclient started OK */ + DHC_ABEND, /* dhclient exited abnormally */ + DHC_END, /* dhclient exited normally */ + DHC_END_OPTIONS, /* last option in subscription sent */ +} NMDHCPState; + +typedef struct { + GObject parent; +} NMDHCPClient; + +typedef struct { + GObjectClass parent; + + /* Methods */ + + /* Given the options table, extract any classless routes, add them to + * the IP4 config and return TRUE if any existed. If a gateway was sent + * as a classless route return that in out_gwaddr. + */ + gboolean (*ip4_process_classless_routes) (NMDHCPClient *self, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *out_gwaddr); + + GPid (*ip4_start) (NMDHCPClient *self, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr); + + void (*stop) (NMDHCPClient *self); + + /* Signals */ + void (*state_changed) (NMDHCPClient *self, NMDHCPState state); + void (*timeout) (NMDHCPClient *self); +} NMDHCPClientClass; + +GType nm_dhcp_client_get_type (void); + +GPid nm_dhcp_client_get_pid (NMDHCPClient *self); + +const char *nm_dhcp_client_get_iface (NMDHCPClient *self); + +gboolean nm_dhcp_client_start (NMDHCPClient *self, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout_secs, + guint8 *dhcp_anycast_addr); + +void nm_dhcp_client_stop (NMDHCPClient *self); + +void nm_dhcp_client_new_options (NMDHCPClient *self, + GHashTable *options, + const char *reason); + +gboolean nm_dhcp_client_foreach_dhcp4_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data); + +NMIP4Config *nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test); + +/* Backend helpers */ +void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name); + +/* Implemented by the backends */ +GSList *nm_dhcp_backend_get_lease_config (const char *iface, + const char *uuid); + +#endif /* NM_DHCP_CLIENT_H */ + diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index e0deabb4a8..c47d155b0f 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -36,46 +36,37 @@ #include -#include "nm-dhcp-manager.h" +#include "nm-dhcp-dhclient.h" #include "nm-utils.h" +G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) -#define NM_DHCP_MANAGER_PID_FILENAME "dhclient" -#define NM_DHCP_MANAGER_PID_FILE_EXT "pid" +#define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientPrivate)) #if defined(TARGET_DEBIAN) -#define NM_DHCP_MANAGER_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3" +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3" #elif defined(TARGET_SUSE) || defined(TARGET_MANDRIVA) -#define NM_DHCP_MANAGER_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" #else -#define NM_DHCP_MANAGER_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" #endif -#define NM_DHCP_MANAGER_LEASE_FILENAME "dhclient" -#define NM_DHCP_MANAGER_LEASE_FILE_EXT "lease" #define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" - -static char * -get_pidfile_for_iface (const char * iface) -{ - return g_strdup_printf ("%s/%s-%s.%s", - NM_DHCP_MANAGER_RUN_DIR, - NM_DHCP_MANAGER_PID_FILENAME, - iface, - NM_DHCP_MANAGER_PID_FILE_EXT); -} +typedef struct { + char *conf_file; + char *lease_file; + char *pid_file; +} NMDHCPDhclientPrivate; static char * get_leasefile_for_iface (const char * iface, const char *uuid) { - return g_strdup_printf ("%s/%s-%s-%s.%s", - NM_DHCP_MANAGER_LEASE_DIR, - NM_DHCP_MANAGER_LEASE_FILENAME, + return g_strdup_printf ("%s/dhclient-%s-%s.lease", + NM_DHCLIENT_LEASE_DIR, uuid, - iface, - NM_DHCP_MANAGER_LEASE_FILE_EXT); + iface); } static void @@ -119,7 +110,7 @@ add_lease_option (GHashTable *hash, char *line) } GSList * -nm_dhcp4_client_get_lease_config (const char *iface, const char *uuid) +nm_dhcp_backend_get_lease_config (const char *iface, const char *uuid) { GSList *parsed = NULL, *iter, *leases = NULL; char *contents = NULL; @@ -288,28 +279,39 @@ out: #define DHCP_HOSTNAME_FORMAT DHCP_HOSTNAME_TAG " \"%s\"; # added by NetworkManager" static gboolean -merge_dhclient_config (NMDHCPClient *client, +merge_dhclient_config (const char *iface, + const char *conf_file, NMSettingIP4Config *s_ip4, guint8 *anycast_addr, - const char *contents, - const char *orig, + const char *orig_path, GError **error) { GString *new_contents; + char *orig_contents = NULL; gboolean success = FALSE; - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (client->iface != NULL, FALSE); - + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (conf_file != NULL, FALSE); + new_contents = g_string_new (_("# Created by NetworkManager\n")); + if (g_file_test (orig_path, G_FILE_TEST_EXISTS)) { + GError *read_error = NULL; + + if (!g_file_get_contents (orig_path, &orig_contents, NULL, &read_error)) { + nm_warning ("%s: error reading dhclient configuration %s: %s", + iface, orig_path, read_error->message); + g_error_free (read_error); + } + } + /* Add existing options, if any, but ignore stuff NM will replace. */ - if (contents) { + if (orig_contents) { char **lines = NULL, **line; - g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig); + g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig_path); - lines = g_strsplit_set (contents, "\n\r", 0); + lines = g_strsplit_set (orig_contents, "\n\r", 0); for (line = lines; lines && *line; line++) { gboolean ignore = FALSE; @@ -334,6 +336,7 @@ merge_dhclient_config (NMDHCPClient *client, if (lines) g_strfreev (lines); + g_free (orig_contents); } else g_string_append_c (new_contents, '\n'); @@ -374,14 +377,13 @@ merge_dhclient_config (NMDHCPClient *client, " initial-interval 1; \n" " anycast-mac ethernet %02x:%02x:%02x:%02x:%02x:%02x;\n" "}\n", - client->iface, + iface, anycast_addr[0], anycast_addr[1], anycast_addr[2], anycast_addr[3], anycast_addr[4], anycast_addr[5]); } - if (g_file_set_contents (client->conf_file, new_contents->str, -1, error)) - success = TRUE; + success = g_file_set_contents (conf_file, new_contents->str, -1, error); g_string_free (new_contents, TRUE); return success; @@ -393,18 +395,16 @@ merge_dhclient_config (NMDHCPClient *client, * read their single config file and merge that into a custom per-interface * config file along with the NM options. */ -static gboolean -create_dhclient_config (NMDHCPClient *client, +static char * +create_dhclient_config (const char *iface, NMSettingIP4Config *s_ip4, guint8 *dhcp_anycast_addr) { - char *orig = NULL, *contents = NULL; + char *orig = NULL, *tmp, *conf_file = NULL; GError *error = NULL; gboolean success = FALSE; - char *tmp; - g_return_val_if_fail (client != NULL, FALSE); - g_return_val_if_fail (client->iface != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); #if defined(TARGET_SUSE) orig = g_strdup (SYSCONFDIR "/dhclient.conf"); @@ -413,41 +413,28 @@ create_dhclient_config (NMDHCPClient *client, #elif defined(TARGET_GENTOO) orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); #else - orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", client->iface); + orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface); #endif if (!orig) { - nm_warning ("%s: not enough memory for dhclient options.", client->iface); + nm_warning ("%s: not enough memory for dhclient options.", iface); return FALSE; } - tmp = g_strdup_printf ("nm-dhclient-%s.conf", client->iface); - client->conf_file = g_build_filename ("/var", "run", tmp, NULL); + tmp = g_strdup_printf ("nm-dhclient-%s.conf", iface); + conf_file = g_build_filename ("/var", "run", tmp, NULL); g_free (tmp); - if (!g_file_test (orig, G_FILE_TEST_EXISTS)) - goto out; - - if (!g_file_get_contents (orig, &contents, NULL, &error)) { - nm_warning ("%s: error reading dhclient configuration %s: %s", - client->iface, orig, error->message); - g_error_free (error); - goto out; - } - -out: error = NULL; - if (merge_dhclient_config (client, s_ip4, dhcp_anycast_addr, contents, orig, &error)) - success = TRUE; - else { + success = merge_dhclient_config (iface, conf_file, s_ip4, dhcp_anycast_addr, orig, &error); + if (!success) { nm_warning ("%s: error creating dhclient configuration: %s", - client->iface, error->message); + iface, error->message); g_error_free (error); } - g_free (contents); g_free (orig); - return success; + return conf_file; } @@ -459,45 +446,49 @@ dhclient_child_setup (gpointer user_data G_GNUC_UNUSED) setpgid (pid, pid); } - -GPid -nm_dhcp4_client_start (NMDHCPClient *client, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) +static GPid +real_ip4_start (NMDHCPClient *client, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) { + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); GPtrArray *argv = NULL; GPid pid = 0; GError *error = NULL; - char *pid_contents = NULL; + const char *iface; + char *binary_name; + + g_return_val_if_fail (priv->pid_file == NULL, -1); + + iface = nm_dhcp_client_get_iface (client); + + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient-%s.pid", iface); + if (!priv->pid_file) { + nm_warning ("%s: not enough memory for dhcpcd options.", iface); + return -1; + } if (!g_file_test (DHCP_CLIENT_PATH, G_FILE_TEST_EXISTS)) { nm_warning (DHCP_CLIENT_PATH " does not exist."); - goto out; + return -1; } - client->pid_file = get_pidfile_for_iface (client->iface); - if (!client->pid_file) { - nm_warning ("%s: not enough memory for dhclient options.", client->iface); - goto out; + /* Kill any existing dhclient from the pidfile */ + binary_name = g_path_get_basename (DHCP_CLIENT_PATH); + nm_dhcp_client_stop_existing (priv->pid_file, binary_name); + g_free (binary_name); + + priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); + if (!priv->conf_file) { + nm_warning ("%s: error creating dhclient configuration file.", iface); + return -1; } - client->lease_file = get_leasefile_for_iface (client->iface, uuid); - if (!client->lease_file) { - nm_warning ("%s: not enough memory for dhclient options.", client->iface); - goto out; - } - - if (!create_dhclient_config (client, s_ip4, dhcp_anycast_addr)) - goto out; - - /* Kill any existing dhclient bound to this interface */ - if (g_file_get_contents (client->pid_file, &pid_contents, NULL, NULL)) { - unsigned long int tmp = strtoul (pid_contents, NULL, 10); - - if (!((tmp == ULONG_MAX) && (errno == ERANGE))) - nm_dhcp_client_stop (client, (pid_t) tmp); - remove (client->pid_file); + priv->lease_file = get_leasefile_for_iface (iface, uuid); + if (!priv->lease_file) { + nm_warning ("%s: not enough memory for dhclient options.", iface); + return -1; } argv = g_ptr_array_new (); @@ -509,32 +500,43 @@ nm_dhcp4_client_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); g_ptr_array_add (argv, (gpointer) "-pf"); /* Set pid file */ - g_ptr_array_add (argv, (gpointer) client->pid_file); + g_ptr_array_add (argv, (gpointer) priv->pid_file); g_ptr_array_add (argv, (gpointer) "-lf"); /* Set lease file */ - g_ptr_array_add (argv, (gpointer) client->lease_file); + g_ptr_array_add (argv, (gpointer) priv->lease_file); g_ptr_array_add (argv, (gpointer) "-cf"); /* Set interface config file */ - g_ptr_array_add (argv, (gpointer) client->conf_file); + g_ptr_array_add (argv, (gpointer) priv->conf_file); - g_ptr_array_add (argv, (gpointer) client->iface); + g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhclient_child_setup, NULL, &pid, &error)) { nm_warning ("dhclient failed to start. error: '%s'", error->message); g_error_free (error); - goto out; - } + pid = -1; + } else + nm_info ("dhclient started with pid %d", pid); - nm_info ("dhclient started with pid %d", pid); - -out: - g_free (pid_contents); g_ptr_array_free (argv, TRUE); return pid; } +static void +real_stop (NMDHCPClient *client) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); + + /* Chain up to parent */ + NM_DHCP_CLIENT_CLASS (nm_dhcp_dhclient_parent_class)->stop (client); + + if (priv->conf_file) + remove (priv->conf_file); + if (priv->pid_file) + remove (priv->pid_file); +} + static const char ** process_rfc3442_route (const char **octets, NMIP4Route **out_route) { @@ -596,10 +598,11 @@ error: return o; } -gboolean -nm_dhcp4_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) +static gboolean +real_ip4_process_classless_routes (NMDHCPClient *client, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) { const char *str; char **octets, **o; @@ -664,3 +667,38 @@ out: return have_routes; } +/***************************************************/ + +static void +nm_dhcp_dhclient_init (NMDHCPDhclient *self) +{ +} + +static void +dispose (GObject *object) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (object); + + g_free (priv->pid_file); + g_free (priv->conf_file); + g_free (priv->lease_file); + + G_OBJECT_CLASS (nm_dhcp_dhclient_parent_class)->dispose (object); +} + +static void +nm_dhcp_dhclient_class_init (NMDHCPDhclientClass *dhclient_class) +{ + NMDHCPClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhclient_class); + GObjectClass *object_class = G_OBJECT_CLASS (dhclient_class); + + g_type_class_add_private (dhclient_class, sizeof (NMDHCPDhclientPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + + client_class->ip4_start = real_ip4_start; + client_class->stop = real_stop; + client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; +} + diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h new file mode 100644 index 0000000000..bad6452f79 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhclient.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_DHCLIENT_H +#define NM_DHCP_DHCLIENT_H + +#include +#include + +#include "nm-dhcp-client.h" + +#define NM_TYPE_DHCP_DHCLIENT (nm_dhcp_dhclient_get_type ()) +#define NM_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclient)) +#define NM_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientClass)) +#define NM_IS_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_DHCLIENT)) +#define NM_IS_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_DHCLIENT)) +#define NM_DHCP_DHCLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientClass)) + +typedef struct { + NMDHCPClient parent; +} NMDHCPDhclient; + +typedef struct { + NMDHCPClientClass parent; +} NMDHCPDhclientClass; + +GType nm_dhcp_dhclient_get_type (void); + +#endif /* NM_DHCP_DHCLIENT_H */ + diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 6ba3f0a91c..ba210eda63 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -2,6 +2,7 @@ /* nm-dhcp-dhcpcd.c - dhcpcd specific hooks for NetworkManager * * Copyright (C) 2008 Roy Marples + * Copyright (C) 2010 Dan Williams * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,26 +32,22 @@ #include #include -#include "nm-dhcp-manager.h" +#include "nm-dhcp-dhcpcd.h" #include "nm-utils.h" -#define NM_DHCP_MANAGER_PID_FILENAME "dhcpcd" -#define NM_DHCP_MANAGER_PID_FILE_EXT "pid" +G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_DHCPCD) + +#define NM_DHCP_DHCPCD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdPrivate)) #define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" +typedef struct { + char *pid_file; +} NMDHCPDhcpcdPrivate; -static char * -get_pidfile_for_iface (const char * iface) -{ - return g_strdup_printf ("/var/run/%s-%s.%s", - NM_DHCP_MANAGER_PID_FILENAME, - iface, - NM_DHCP_MANAGER_PID_FILE_EXT); -} GSList * -nm_dhcp4_client_get_lease_config (const char *iface, const char *uuid) +nm_dhcp_backend_get_lease_config (const char *iface, const char *uuid) { return NULL; } @@ -63,37 +60,38 @@ dhcpcd_child_setup (gpointer user_data G_GNUC_UNUSED) setpgid (pid, pid); } - -GPid -nm_dhcp4_client_start (NMDHCPClient *client, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) +static GPid +real_ip4_start (NMDHCPClient *client, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) { + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); GPtrArray *argv = NULL; GPid pid = 0; GError *error = NULL; - char *pid_contents = NULL; + char *pid_contents = NULL, *binary_name; + const char *iface; + + g_return_val_if_fail (priv->pid_file == NULL, -1); + + iface = nm_dhcp_client_get_iface (client); + + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhcpcd-%s.pid", iface); + if (!priv->pid_file) { + nm_warning ("%s: not enough memory for dhcpcd options.", iface); + return -1; + } if (!g_file_test (DHCP_CLIENT_PATH, G_FILE_TEST_EXISTS)) { nm_warning (DHCP_CLIENT_PATH " does not exist."); - goto out; + return -1; } - client->pid_file = get_pidfile_for_iface (client->iface); - if (!client->pid_file) { - nm_warning ("%s: not enough memory for dhcpcd options.", client->iface); - goto out; - } - - /* Kill any existing dhcpcd bound to this interface */ - if (g_file_get_contents (client->pid_file, &pid_contents, NULL, NULL)) { - unsigned long int tmp = strtoul (pid_contents, NULL, 10); - - if (!((tmp == ULONG_MAX) && (errno == ERANGE))) - nm_dhcp_client_stop (client, (pid_t) tmp); - remove (client->pid_file); - } + /* Kill any existing dhclient from the pidfile */ + binary_name = g_path_get_basename (DHCP_CLIENT_PATH); + nm_dhcp_client_stop_existing (priv->pid_file, binary_name); + g_free (binary_name); argv = g_ptr_array_new (); g_ptr_array_add (argv, (gpointer) DHCP_CLIENT_PATH); @@ -107,28 +105,38 @@ nm_dhcp4_client_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); - g_ptr_array_add (argv, (gpointer) client->iface); + g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhcpcd_child_setup, NULL, &pid, &error)) { nm_warning ("dhcpcd failed to start. error: '%s'", error->message); g_error_free (error); - goto out; - } + } else + nm_info ("dhcpcd started with pid %d", pid); - nm_info ("dhcpcd started with pid %d", pid); - -out: g_free (pid_contents); g_ptr_array_free (argv, TRUE); return pid; } -gboolean -nm_dhcp4_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) +static void +real_stop (NMDHCPClient *client) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); + + /* Chain up to parent */ + NM_DHCP_CLIENT_CLASS (nm_dhcp_dhcpcd_parent_class)->stop (client); + + if (priv->pid_file) + remove (priv->pid_file); +} + +static gboolean +real_ip4_process_classless_routes (NMDHCPClient *client, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) { const char *str; char **routes, **r; @@ -201,3 +209,36 @@ out: return have_routes; } +/***************************************************/ + +static void +nm_dhcp_dhcpcd_init (NMDHCPDhcpcd *self) +{ +} + +static void +dispose (GObject *object) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (object); + + g_free (priv->pid_file); + + G_OBJECT_CLASS (nm_dhcp_dhcpcd_parent_class)->dispose (object); +} + +static void +nm_dhcp_dhcpcd_class_init (NMDHCPDhcpcdClass *dhcpcd_class) +{ + NMDHCPClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhcpcd_class); + GObjectClass *object_class = G_OBJECT_CLASS (dhcpcd_class); + + g_type_class_add_private (dhcpcd_class, sizeof (NMDHCPDhcpcdPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + + client_class->ip4_start = real_ip4_start; + client_class->stop = real_stop; + client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; +} + diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.h b/src/dhcp-manager/nm-dhcp-dhcpcd.h new file mode 100644 index 0000000000..f564bc7f71 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_DHCPCD_H +#define NM_DHCP_DHCPCD_H + +#include +#include + +#include "nm-dhcp-client.h" + +#define NM_TYPE_DHCP_DHCPCD (nm_dhcp_dhcpcd_get_type ()) +#define NM_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcd)) +#define NM_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdClass)) +#define NM_IS_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_DHCPCD)) +#define NM_IS_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_DHCPCD)) +#define NM_DHCP_DHCPCD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdClass)) + +typedef struct { + NMDHCPClient parent; +} NMDHCPDhcpcd; + +typedef struct { + NMDHCPClientClass parent; +} NMDHCPDhcpcdClass; + +GType nm_dhcp_dhcpcd_get_type (void); + +#endif /* NM_DHCP_DHCPCD_H */ + diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 2b48a2651d..f1a84cdd46 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include #include #include @@ -37,6 +35,7 @@ #include #include "nm-dhcp-manager.h" +#include "nm-dhcp-dhclient.h" #include "nm-marshal.h" #include "nm-utils.h" #include "nm-dbus-manager.h" @@ -47,13 +46,11 @@ #define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" #define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" -#define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */ - typedef struct { - guint32 next_id; - NMDBusManager * dbus_mgr; - GHashTable * clients; - DBusGProxy * proxy; + guint32 next_id; + NMDBusManager * dbus_mgr; + GHashTable * clients; + DBusGProxy * proxy; NMHostnameProvider *hostname_provider; } NMDHCPManagerPrivate; @@ -62,131 +59,6 @@ typedef struct { G_DEFINE_TYPE (NMDHCPManager, nm_dhcp_manager, G_TYPE_OBJECT) -enum { - STATE_CHANGED, - TIMEOUT, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -static void nm_dhcp_manager_cancel_transaction_real (NMDHCPClient *client); - -static gboolean state_is_bound (guint32 state) -{ - if ( (state == DHC_BOUND4) - || (state == DHC_BOUND6) - || (state == DHC_RENEW4) - || (state == DHC_RENEW6) - || (state == DHC_REBOOT) - || (state == DHC_REBIND4) - || (state == DHC_REBIND6) - || (state == DHC_IPV4LL)) - return TRUE; - - return FALSE; -} - - -static void -nm_dhcp_client_timeout_cleanup (NMDHCPClient *client) -{ - if (client->timeout_id) { - g_source_remove (client->timeout_id); - client->timeout_id = 0; - } -} - -static void -nm_dhcp_client_watch_cleanup (NMDHCPClient *client) -{ - if (client->watch_id) { - g_source_remove (client->watch_id); - client->watch_id = 0; - } -} - -static void -nm_dhcp_client_destroy (NMDHCPClient *client) -{ - int ignored; - - nm_dhcp_client_timeout_cleanup (client); - - if (client->pid) - nm_dhcp_client_stop (client, client->pid); - - if (client->options) - g_hash_table_destroy (client->options); - - if (client->conf_file) { - ignored = unlink (client->conf_file); - g_free (client->conf_file); - } - - g_free (client->pid_file); - g_free (client->lease_file); - g_free (client->iface); - - g_slice_free (NMDHCPClient, client); -} - -typedef struct { - NMDHCPState state; - const char *name; -} DhcState; - -#define STATE_TABLE_SIZE (sizeof (state_table) / sizeof (state_table[0])) - -static DhcState state_table[] = { - { DHC_NBI, "nbi" }, - { DHC_PREINIT, "preinit" }, - { DHC_BOUND4, "bound" }, - { DHC_BOUND6, "bound6" }, - { DHC_IPV4LL, "ipv4ll" }, - { DHC_RENEW4, "renew" }, - { DHC_RENEW6, "renew6" }, - { DHC_REBOOT, "reboot" }, - { DHC_REBIND4, "rebind" }, - { DHC_REBIND6, "rebind6" }, - { DHC_STOP, "stop" }, - { DHC_MEDIUM, "medium" }, - { DHC_TIMEOUT, "timeout" }, - { DHC_FAIL, "fail" }, - { DHC_EXPIRE, "expire" }, - { DHC_RELEASE, "release" }, - { DHC_START, "start" }, - { DHC_ABEND, "abend" }, - { DHC_END, "end" }, - { DHC_DEPREF6, "depref6" }, -}; - -static inline const char * -state_to_string (guint32 state) -{ - int i; - - for (i = 0; i < STATE_TABLE_SIZE; i++) { - if (state == state_table[i].state) - return state_table[i].name; - } - - return NULL; -} - -static inline NMDHCPState -string_to_state (const char *name) -{ - int i; - - for (i = 0; i < STATE_TABLE_SIZE; i++) { - if (!strcasecmp (name, state_table[i].name)) - return state_table[i].state; - } - - return 255; -} - static char * garray_to_string (GArray *array, const char *key) { @@ -220,81 +92,6 @@ garray_to_string (GArray *array, const char *key) return converted; } -static char * -get_option (GHashTable *hash, const char *key) -{ - GValue *value; - - value = g_hash_table_lookup (hash, key); - if (value == NULL) - return NULL; - - if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { - nm_warning ("Unexpected key %s value type was not " - "DBUS_TYPE_G_UCHAR_ARRAY", - (char *) key); - return NULL; - } - - return garray_to_string ((GArray *) g_value_get_boxed (value), key); -} - -static void -copy_option (gpointer key, - gpointer value, - gpointer user_data) -{ - NMDHCPClient *client = user_data; - const char *str_key = (const char *) key; - char *str_value = NULL; - - if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { - nm_warning ("Unexpected key %s value type was not " - "DBUS_TYPE_G_UCHAR_ARRAY", - str_key); - return; - } - - str_value = garray_to_string ((GArray *) g_value_get_boxed (value), str_key); - if (str_value) - g_hash_table_insert (client->options, g_strdup (str_key), str_value); -} - -static void -handle_options (NMDHCPManager *manager, - NMDHCPClient *client, - GHashTable *options, - const char *reason) -{ - guint32 old_state = client->state; - guint32 new_state = string_to_state (reason); - - /* Clear old and save new DHCP options */ - g_hash_table_remove_all (client->options); - g_hash_table_foreach (options, copy_option, client); - - if (old_state == new_state) - return; - - /* Handle changed device state */ - if (state_is_bound (new_state)) { - /* Cancel the timeout if the DHCP client is now bound */ - nm_dhcp_client_timeout_cleanup (client); - } - - client->state = new_state; - nm_info ("DHCP: device %s state changed %s -> %s", - client->iface, - state_to_string (old_state), - state_to_string (client->state)); - - g_signal_emit (G_OBJECT (client->manager), - signals[STATE_CHANGED], - 0, - client->id, - client->state); -} - static NMDHCPClient * get_client_for_pid (NMDHCPManager *manager, GPid pid) { @@ -309,9 +106,9 @@ get_client_for_pid (NMDHCPManager *manager, GPid pid) g_hash_table_iter_init (&iter, priv->clients); while (g_hash_table_iter_next (&iter, NULL, &value)) { - NMDHCPClient *candidate = value; + NMDHCPClient *candidate = NM_DHCP_CLIENT (value); - if (candidate->pid == pid) + if (nm_dhcp_client_get_pid (candidate) == pid) return candidate; } @@ -319,7 +116,8 @@ get_client_for_pid (NMDHCPManager *manager, GPid pid) } static NMDHCPClient * -get_client_for_iface (NMDHCPManager *manager, const char *iface) +get_client_for_iface (NMDHCPManager *manager, + const char *iface) { NMDHCPManagerPrivate *priv; GHashTableIter iter; @@ -333,24 +131,32 @@ get_client_for_iface (NMDHCPManager *manager, const char *iface) g_hash_table_iter_init (&iter, priv->clients); while (g_hash_table_iter_next (&iter, NULL, &value)) { - NMDHCPClient *candidate = value; + NMDHCPClient *candidate = NM_DHCP_CLIENT (value); - if (!strcmp (iface, candidate->iface)) + if (!strcmp (iface, nm_dhcp_client_get_iface (candidate))) return candidate; } return NULL; } -static NMDHCPClient * -get_client_for_id (NMDHCPManager *manager, guint32 id) +static char * +get_option (GHashTable *hash, const char *key) { - g_return_val_if_fail (manager != NULL, NULL); - g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); - g_return_val_if_fail (id > 0, NULL); + GValue *value; - return g_hash_table_lookup (NM_DHCP_MANAGER_GET_PRIVATE (manager)->clients, - GUINT_TO_POINTER (id)); + value = g_hash_table_lookup (hash, key); + if (value == NULL) + return NULL; + + if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { + g_warning ("Unexpected key %s value type was not " + "DBUS_TYPE_G_UCHAR_ARRAY", + (char *) key); + return NULL; + } + + return garray_to_string ((GArray *) g_value_get_boxed (value), key); } static void @@ -393,9 +199,9 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, goto out; } - if (strcmp (iface, client->iface)) { + if (strcmp (iface, nm_dhcp_client_get_iface (client))) { nm_warning ("Received DHCP event from unexpected interface '%s' (expected '%s')", - iface, client->iface); + iface, nm_dhcp_client_get_iface (client)); goto out; } @@ -405,7 +211,7 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, goto out; } - handle_options (manager, client, options, reason); + nm_dhcp_client_new_options (client, options, reason); out: g_free (iface); @@ -425,7 +231,7 @@ nm_dhcp_manager_new (void) priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, - (GDestroyNotify) nm_dhcp_client_destroy); + (GDestroyNotify) g_object_unref); if (!priv->clients) { nm_warning ("Error: not enough memory to initialize DHCP manager tables"); g_object_unref (manager); @@ -457,599 +263,120 @@ nm_dhcp_manager_new (void) return manager; } +#define STATE_ID_TAG "state-id" +#define TIMEOUT_ID_TAG "timeout-id" -/* - * nm_dhcp_manager_handle_timeout - * - * Called after timeout of a DHCP transaction to notify device of the failure. - * - */ -static gboolean -nm_dhcp_manager_handle_timeout (gpointer user_data) +static void +remove_client (NMDHCPManager *self, NMDHCPClient *client) { - NMDHCPClient *client = user_data; + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + guint id; - nm_info ("(%s): DHCP transaction took too long, stopping it.", client->iface); + id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), STATE_ID_TAG)); + if (id) + g_signal_handler_disconnect (client, id); - nm_dhcp_manager_cancel_transaction (client->manager, client->id); + id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), TIMEOUT_ID_TAG)); + if (id) + g_signal_handler_disconnect (client, id); - g_signal_emit (G_OBJECT (client->manager), signals[TIMEOUT], 0, client->id); + /* Stopping the client is left up to the controlling device + * explicitly since we may want to quit NetworkManager but not terminate + * the DHCP client. + */ - return FALSE; + g_hash_table_remove (priv->clients, client); } -static NMDHCPClient * -nm_dhcp_client_new (NMDHCPManager *manager, const char *iface) +static void +client_state_changed (NMDHCPClient *client, NMDHCPState new_state, gpointer user_data) { - NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - NMDHCPClient *client; - - client = g_slice_new0 (NMDHCPClient); - if (!client) { - nm_warning ("%s: Out of memory creating DHCP transaction object.", iface); - return NULL; - } - - client->id = priv->next_id++; - client->iface = g_strdup (iface); - if (!client) { - nm_warning ("%s: Out of memory creating DHCP transaction object " - "property 'iface'.", - iface); - goto error; - } - - client->manager = manager; - - /* Do this after the transaction cancel since that clears options out */ - client->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - if (!client->options) { - nm_warning ("%s: Out of memory creating DHCP transaction object " - "property 'options'.", - iface); - goto error; - } - - g_hash_table_insert (priv->clients, GUINT_TO_POINTER (client->id), client); - return client; - -error: - nm_dhcp_client_destroy (client); - return NULL; + if (new_state == DHC_ABEND || new_state == DHC_END) + remove_client (NM_DHCP_MANAGER (user_data), client); } - -/* - * dhcp_watch_cb - * - * Watch our child dhclient process and get notified of events from it. - * - */ -static void dhcp_watch_cb (GPid pid, gint status, gpointer user_data) +static void +client_timeout (NMDHCPClient *client, gpointer user_data) { - NMDHCPClient *client = user_data; - - if (!WIFEXITED (status)) { - client->state = DHC_ABEND; - nm_warning ("dhcp client died abnormally"); - } - client->pid = 0; - - nm_dhcp_client_watch_cleanup (client); - nm_dhcp_client_timeout_cleanup (client); - - g_signal_emit (G_OBJECT (client->manager), signals[STATE_CHANGED], 0, client->id, client->state); + remove_client (NM_DHCP_MANAGER (user_data), client); } -guint32 -nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, - const char *iface, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout, - guint8 *dhcp_anycast_addr) +static void +add_client (NMDHCPManager *self, NMDHCPClient *client) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + guint id; + + id = g_signal_connect (client, "state-changed", G_CALLBACK (client_state_changed), self); + g_object_set_data (G_OBJECT (client), STATE_ID_TAG, GUINT_TO_POINTER (id)); + + id = g_signal_connect (client, "timeout", G_CALLBACK (client_timeout), self); + g_object_set_data (G_OBJECT (client), TIMEOUT_ID_TAG, GUINT_TO_POINTER (id)); + + g_hash_table_insert (priv->clients, client, g_object_ref (client)); +} + +/* Caller owns a reference to the NMDHCPClient on return */ +NMDHCPClient * +nm_dhcp_manager_start_client (NMDHCPManager *self, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr) { NMDHCPManagerPrivate *priv; NMDHCPClient *client; - NMSettingIP4Config *setting; + NMSettingIP4Config *setting = NULL; + gboolean success = FALSE; - g_return_val_if_fail (manager, 0); - g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), 0); - g_return_val_if_fail (iface != NULL, 0); + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); + g_return_val_if_fail (iface != NULL, NULL); - priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + priv = NM_DHCP_MANAGER_GET_PRIVATE (self); - client = get_client_for_iface (manager, iface); - if (!client) - client = nm_dhcp_client_new (manager, iface); - - if (client->pid && (client->state < DHC_ABEND)) { - /* Cancel any DHCP transaction already in progress */ - nm_dhcp_manager_cancel_transaction_real (client); + /* Kill any old client instance */ + client = get_client_for_iface (self, iface); + if (client) { + nm_dhcp_client_stop (client); + remove_client (self, client); } - if (s_ip4 && - nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) && - nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL && - priv->hostname_provider != NULL) { - /* We're asked to send the hostname to DHCP server, - the hostname isn't specified, - and a hostname provider is registered: use that */ + /* And make a new one */ + client = g_object_new (NM_TYPE_DHCP_DHCLIENT, + NM_DHCP_CLIENT_INTERFACE, iface, + NULL); + g_return_val_if_fail (client != NULL, NULL); + add_client (self, client); + if ( s_ip4 + && nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) + && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) + && priv->hostname_provider != NULL) { + + /* We're asked to send the hostname to DHCP server, the hostname + * isn't specified, and a hostname provider is registered: use that + */ setting = NM_SETTING_IP4_CONFIG (nm_setting_duplicate (NM_SETTING (s_ip4))); g_object_set (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, nm_hostname_provider_get_hostname (priv->hostname_provider), NULL); - } else - setting = s_ip4 ? g_object_ref (s_ip4) : NULL; + } - if (timeout == 0) - timeout = NM_DHCP_TIMEOUT; - - nm_info ("Activation (%s) Beginning DHCP transaction (timeout in %d seconds)", - iface, timeout); - client->pid = nm_dhcp4_client_start (client, uuid, setting, dhcp_anycast_addr); + success = nm_dhcp_client_start (client, uuid, setting, timeout, dhcp_anycast_addr); if (setting) g_object_unref (setting); - if (client->pid == 0) - return FALSE; - - /* Set up a timeout on the transaction to kill it after the timeout */ - client->timeout_id = g_timeout_add_seconds (timeout, - nm_dhcp_manager_handle_timeout, - client); - client->watch_id = g_child_watch_add (client->pid, - (GChildWatchFunc) dhcp_watch_cb, - client); - return client->id; -} - -void -nm_dhcp_client_stop (NMDHCPClient *client, GPid pid) -{ - int i = 15; /* 3 seconds */ - - g_return_if_fail (client != NULL); - g_return_if_fail (pid > 0); - - /* Clean up the watch handler since we're explicitly killing the daemon */ - nm_dhcp_client_watch_cleanup (client); - - /* Tell it to quit; maybe it wants to send out a RELEASE message */ - kill (pid, SIGTERM); - - while (i-- > 0) { - gint child_status; - int ret; - - ret = waitpid (pid, &child_status, WNOHANG); - if (ret > 0) - break; - - if (ret == -1) { - /* Child already exited */ - if (errno == ECHILD) - break; - /* Took too long; shoot it in the head */ - i = 0; - break; - } - g_usleep (G_USEC_PER_SEC / 5); + if (!success) { + remove_client (self, client); + g_object_unref (client); + client = NULL; } - if (i <= 0) { - nm_warning ("%s: dhcp client pid %d didn't exit, will kill it.", client->iface, pid); - kill (pid, SIGKILL); - - nm_debug ("waiting for dhcp client pid %d to exit", pid); - waitpid (pid, NULL, 0); - nm_debug ("dhcp client pid %d cleaned up", pid); - } -} - -static void -nm_dhcp_manager_cancel_transaction_real (NMDHCPClient *client) -{ - g_return_if_fail (client != NULL); - g_return_if_fail (client->pid > 0); - - nm_dhcp_client_stop (client, client->pid); - - nm_info ("(%s): canceled DHCP transaction, dhcp client pid %d", - client->iface, - client->pid); - - client->pid = 0; - client->state = DHC_END; - - /* Clean up the pidfile if it got left around */ - if (client->pid_file) { - remove (client->pid_file); - g_free (client->pid_file); - client->pid_file = NULL; - } - - /* Free leasefile (but don't delete) */ - if (client->lease_file) { - g_free (client->lease_file); - client->lease_file = NULL; - } - - /* Clean up config file if it got left around */ - if (client->conf_file) { - remove (client->conf_file); - g_free (client->conf_file); - client->conf_file = NULL; - } - - nm_dhcp_client_timeout_cleanup (client); - g_hash_table_remove_all (client->options); -} - - -/* - * nm_dhcp_manager_cancel_transaction - * - * Stop any in-progress DHCP transaction on a particular device. - * - */ -void -nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, guint32 id) -{ - NMDHCPClient *client; - NMDHCPManagerPrivate *priv; - - g_return_if_fail (manager != NULL); - g_return_if_fail (NM_IS_DHCP_MANAGER (manager)); - g_return_if_fail (id > 0); - - priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - - client = get_client_for_id (manager, id); - if (client && client->pid) - nm_dhcp_manager_cancel_transaction_real (client); -} - -static void -process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) -{ - const char *str; - char **searches, **s; - - str = g_hash_table_lookup (options, "new_static_routes"); - if (!str) - return; - - searches = g_strsplit (str, " ", 0); - if ((g_strv_length (searches) % 2)) { - nm_info (" static routes provided, but invalid"); - goto out; - } - - for (s = searches; *s; s += 2) { - NMIP4Route *route; - struct in_addr rt_addr; - struct in_addr rt_route; - - if (inet_pton (AF_INET, *s, &rt_addr) <= 0) { - nm_warning ("DHCP provided invalid static route address: '%s'", *s); - continue; - } - if (inet_pton (AF_INET, *(s + 1), &rt_route) <= 0) { - nm_warning ("DHCP provided invalid static route gateway: '%s'", *(s + 1)); - continue; - } - - // FIXME: ensure the IP addresse and route are sane - - route = nm_ip4_route_new (); - nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); - nm_ip4_route_set_prefix (route, 32); /* 255.255.255.255 */ - nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); - - nm_ip4_config_take_route (ip4_config, route); - nm_info (" static route %s gw %s", *s, *(s + 1)); - } - -out: - g_strfreev (searches); -} - -static void -process_domain_search (NMIP4Config *ip4_config, const char *str) -{ - char **searches, **s; - char *unescaped, *p; - int i; - - g_return_if_fail (str != NULL); - g_return_if_fail (ip4_config != NULL); - - p = unescaped = g_strdup (str); - do { - p = strstr (p, "\\032"); - if (!p) - break; - - /* Clear the escaped space with real spaces */ - for (i = 0; i < 4; i++) - *p++ = ' '; - } while (*p++); - - if (strchr (unescaped, '\\')) { - nm_info (" invalid domain search: '%s'", unescaped); - goto out; - } - - searches = g_strsplit (unescaped, " ", 0); - for (s = searches; *s; s++) { - if (strlen (*s)) { - nm_info (" domain search '%s'", *s); - nm_ip4_config_add_search (ip4_config, *s); - } - } - g_strfreev (searches); - -out: - g_free (unescaped); -} - -/* Given a table of DHCP options from the client, convert into an IP4Config */ -NMIP4Config * -nm_dhcp4_manager_options_to_config (const char *iface, GHashTable *options) -{ - NMIP4Config *ip4_config = NULL; - struct in_addr tmp_addr; - NMIP4Address *addr = NULL; - char *str = NULL; - guint32 gwaddr = 0; - gboolean have_classless = FALSE; - - g_return_val_if_fail (iface != NULL, NULL); - g_return_val_if_fail (options != NULL, NULL); - - ip4_config = nm_ip4_config_new (); - if (!ip4_config) { - nm_warning ("%s: couldn't allocate memory for an IP4Config!", iface); - return NULL; - } - - addr = nm_ip4_address_new (); - if (!addr) { - nm_warning ("%s: couldn't allocate memory for an IP4 Address!", iface); - goto error; - } - - str = g_hash_table_lookup (options, "new_ip_address"); - if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { - nm_ip4_address_set_address (addr, tmp_addr.s_addr); - nm_info (" address %s", str); - } else - goto error; - - str = g_hash_table_lookup (options, "new_subnet_mask"); - if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { - nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr)); - nm_info (" prefix %d (%s)", nm_ip4_address_get_prefix (addr), str); - } - - /* Routes: if the server returns classless static routes, we MUST ignore - * the 'static_routes' option. - */ - have_classless = nm_dhcp4_client_process_classless_routes (options, ip4_config, &gwaddr); - if (!have_classless) { - gwaddr = 0; /* Ensure client code doesn't lie */ - process_classful_routes (options, ip4_config); - } - - if (gwaddr) { - char buf[INET_ADDRSTRLEN + 1]; - - inet_ntop (AF_INET, &gwaddr, buf, sizeof (buf)); - nm_info (" gateway %s", buf); - nm_ip4_address_set_gateway (addr, gwaddr); - } else { - /* If the gateway wasn't provided as a classless static route with a - * subnet length of 0, try to find it using the old-style 'routers' option. - */ - str = g_hash_table_lookup (options, "new_routers"); - if (str) { - char **routers = g_strsplit (str, " ", 0); - char **s; - - for (s = routers; *s; s++) { - /* FIXME: how to handle multiple routers? */ - if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { - nm_ip4_address_set_gateway (addr, tmp_addr.s_addr); - nm_info (" gateway %s", *s); - break; - } else - nm_warning ("Ignoring invalid gateway '%s'", *s); - } - g_strfreev (routers); - } - } - - nm_ip4_config_take_address (ip4_config, addr); - addr = NULL; - - str = g_hash_table_lookup (options, "new_host_name"); - if (str) - nm_info (" hostname '%s'", str); - - str = g_hash_table_lookup (options, "new_domain_name_servers"); - if (str) { - char **searches = g_strsplit (str, " ", 0); - char **s; - - for (s = searches; *s; s++) { - if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { - nm_ip4_config_add_nameserver (ip4_config, tmp_addr.s_addr); - nm_info (" nameserver '%s'", *s); - } else - nm_warning ("Ignoring invalid nameserver '%s'", *s); - } - g_strfreev (searches); - } - - str = g_hash_table_lookup (options, "new_domain_name"); - if (str) { - char **domains = g_strsplit (str, " ", 0); - char **s; - - for (s = domains; *s; s++) { - nm_info (" domain name '%s'", *s); - nm_ip4_config_add_domain (ip4_config, *s); - } - g_strfreev (domains); - } - - str = g_hash_table_lookup (options, "new_domain_search"); - if (str) - process_domain_search (ip4_config, str); - - str = g_hash_table_lookup (options, "new_netbios_name_servers"); - if (str) { - char **searches = g_strsplit (str, " ", 0); - char **s; - - for (s = searches; *s; s++) { - if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { - nm_ip4_config_add_wins (ip4_config, tmp_addr.s_addr); - nm_info (" wins '%s'", *s); - } else - nm_warning ("Ignoring invalid WINS server '%s'", *s); - } - g_strfreev (searches); - } - - str = g_hash_table_lookup (options, "new_interface_mtu"); - if (str) { - int int_mtu; - - errno = 0; - int_mtu = strtol (str, NULL, 10); - if ((errno == EINVAL) || (errno == ERANGE)) - goto error; - - if (int_mtu > 576) - nm_ip4_config_set_mtu (ip4_config, int_mtu); - } - - return ip4_config; - -error: - if (addr) - nm_ip4_address_unref (addr); - g_object_unref (ip4_config); - return NULL; -} - -/* - * nm_dhcp_manager_get_ip4_config - * - * Get IP4 configuration values from the DHCP daemon - * - */ -NMIP4Config * -nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, guint32 id) -{ - NMDHCPManagerPrivate *priv; - NMDHCPClient *client; - - g_return_val_if_fail (manager != NULL, NULL); - g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); - g_return_val_if_fail (id > 0, NULL); - - priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - - client = get_client_for_id (manager, id); - if (!client) { - nm_warning ("Device DHCP transaction %d not started.", id); - return NULL; - } - - if (!state_is_bound (client->state)) { - nm_warning ("%s: dhcp client didn't bind to a lease.", client->iface); - return NULL; - } - - return nm_dhcp4_manager_options_to_config (client->iface, client->options); -} - -#define NEW_TAG "new_" -#define OLD_TAG "old_" - -typedef struct { - GHFunc func; - gpointer user_data; -} Dhcp4ForeachInfo; - -static void -iterate_dhcp4_config_option (gpointer key, - gpointer value, - gpointer user_data) -{ - Dhcp4ForeachInfo *info = (Dhcp4ForeachInfo *) user_data; - char *tmp_key = NULL; - const char **p; - static const char *filter_options[] = { - "interface", "pid", "reason", "dhcp_message_type", NULL - }; - - /* Filter out stuff that's not actually new DHCP options */ - for (p = filter_options; *p; p++) { - if (!strcmp (*p, (const char *) key)) - return; - if (!strncmp ((const char *) key, OLD_TAG, strlen (OLD_TAG))) - return; - } - - /* Remove the "new_" prefix that dhclient passes back */ - if (!strncmp ((const char *) key, NEW_TAG, strlen (NEW_TAG))) - tmp_key = g_strdup ((const char *) (key + strlen (NEW_TAG))); - else - tmp_key = g_strdup ((const char *) key); - - (*info->func) ((gpointer) tmp_key, value, info->user_data); - g_free (tmp_key); -} - -gboolean -nm_dhcp_manager_foreach_dhcp4_option (NMDHCPManager *self, - guint32 id, - GHFunc func, - gpointer user_data) -{ - NMDHCPManagerPrivate *priv; - NMDHCPClient *client; - Dhcp4ForeachInfo info = { NULL, NULL }; - - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), FALSE); - g_return_val_if_fail (id > 0, FALSE); - g_return_val_if_fail (func != NULL, FALSE); - - priv = NM_DHCP_MANAGER_GET_PRIVATE (self); - - client = get_client_for_id (self, id); - if (!client) { - nm_warning ("Device DHCP transaction %d not started.", id); - return FALSE; - } - - if (!state_is_bound (client->state)) { - nm_warning ("%s: dhclient didn't bind to a lease.", client->iface); - return FALSE; - } - - info.func = func; - info.user_data = user_data; - g_hash_table_foreach (client->options, iterate_dhcp4_config_option, &info); - return TRUE; + return client; } static void @@ -1080,16 +407,35 @@ nm_dhcp_manager_set_hostname_provider (NMDHCPManager *manager, } GSList * -nm_dhcp4_manager_get_lease_config (NMDHCPManager *self, - const char *iface, - const char *uuid) +nm_dhcp_manager_get_lease_config (NMDHCPManager *self, + const char *iface, + const char *uuid) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL); - return nm_dhcp4_client_get_lease_config (iface, uuid); + return nm_dhcp_backend_get_lease_config (iface, uuid); +} + +NMIP4Config * +nm_dhcp_manager_test_ip4_options_to_config (const char *iface, + GHashTable *options, + const char *reason) +{ + NMDHCPClient *client; + NMIP4Config *config; + + client = (NMDHCPClient *) g_object_new (NM_TYPE_DHCP_DHCLIENT, + NM_DHCP_CLIENT_INTERFACE, iface, + NULL); + g_return_val_if_fail (client != NULL, NULL); + nm_dhcp_client_new_options (client, options, reason); + config = nm_dhcp_client_get_ip4_config (client, TRUE); + g_object_unref (client); + + return config; } /***************************************************/ @@ -1116,6 +462,20 @@ nm_dhcp_manager_init (NMDHCPManager *manager) priv->next_id = 1; } +static void +dispose (GObject *object) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); + GList *values, *iter; + + values = g_hash_table_get_values (priv->clients); + for (iter = values; iter; iter = g_list_next (iter)) + remove_client (NM_DHCP_MANAGER (object), NM_DHCP_CLIENT (iter->data)); + g_list_free (values); + + G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->dispose (object); +} + static void finalize (GObject *object) { @@ -1142,24 +502,6 @@ nm_dhcp_manager_class_init (NMDHCPManagerClass *manager_class) /* virtual methods */ object_class->finalize = finalize; - - /* signals */ - signals[STATE_CHANGED] = - g_signal_new ("state-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDHCPManagerClass, state_changed), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - signals[TIMEOUT] = - g_signal_new ("timeout", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDHCPManagerClass, timeout), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); + object_class->dispose = dispose; } diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 3b8a6a410e..7c82ca59ac 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -27,12 +27,11 @@ #include +#include "nm-dhcp-client.h" #include "nm-ip4-config.h" #include "nm-dhcp4-config.h" #include "nm-hostname-provider.h" -#define NM_DHCP_MANAGER_RUN_DIR LOCALSTATEDIR "/run" - #define NM_TYPE_DHCP_MANAGER (nm_dhcp_manager_get_type ()) #define NM_DHCP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManager)) #define NM_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) @@ -40,98 +39,35 @@ #define NM_IS_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_MANAGER)) #define NM_DHCP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) -typedef enum { - DHC_NBI = 0, /* no broadcast interfaces found */ - DHC_PREINIT, /* configuration started */ - DHC_BOUND4, /* IPv4 lease obtained */ - DHC_BOUND6, /* IPv6 lease obtained */ - DHC_IPV4LL, /* IPv4LL address obtained */ - DHC_RENEW4, /* IPv4 lease renewed */ - DHC_RENEW6, /* IPv6 lease renewed */ - DHC_REBOOT, /* have valid lease, but now obtained a different one */ - DHC_REBIND4, /* IPv4 new/different lease */ - DHC_REBIND6, /* IPv6 new/different lease */ - DHC_DEPREF6, /* IPv6 lease depreferred */ - DHC_STOP, /* remove old lease */ - DHC_MEDIUM, /* media selection begun */ - DHC_TIMEOUT, /* timed out contacting DHCP server */ - DHC_FAIL, /* all attempts to contact server timed out, sleeping */ - DHC_EXPIRE, /* lease has expired, renewing */ - DHC_RELEASE, /* releasing lease */ - DHC_START, /* sent when dhclient started OK */ - DHC_ABEND, /* dhclient exited abnormally */ - DHC_END, /* dhclient exited normally */ - DHC_END_OPTIONS, /* last option in subscription sent */ -} NMDHCPState; - typedef struct { GObject parent; } NMDHCPManager; typedef struct { GObjectClass parent; - - /* Signals */ - void (*state_changed) (NMDHCPManager *manager, guint32 id, NMDHCPState state); - void (*timeout) (NMDHCPManager *manager, guint32 id); } NMDHCPManagerClass; -typedef struct { - GPid id; - char * iface; - guchar state; - GPid pid; - char * pid_file; - char * conf_file; - char * lease_file; - guint timeout_id; - guint watch_id; - NMDHCPManager * manager; - GHashTable * options; -} NMDHCPClient; - GType nm_dhcp_manager_get_type (void); NMDHCPManager *nm_dhcp_manager_get (void); + void nm_dhcp_manager_set_hostname_provider(NMDHCPManager *manager, NMHostnameProvider *provider); -guint32 nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, - const char *iface, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout, - guint8 *dhcp_anycast_addr); -void nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, - guint32 id); -NMIP4Config * nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, guint32 id); -NMDHCPState nm_dhcp_manager_get_client_state (NMDHCPManager *manager, guint32 id); +NMDHCPClient * nm_dhcp_manager_start_client (NMDHCPManager *manager, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr); -gboolean nm_dhcp_manager_foreach_dhcp4_option (NMDHCPManager *self, - guint32 id, - GHFunc func, - gpointer user_data); +GSList * nm_dhcp_manager_get_lease_config (NMDHCPManager *self, + const char *iface, + const char *uuid); -GSList * nm_dhcp4_manager_get_lease_config (NMDHCPManager *self, - const char *iface, - const char *uuid); - -/* The following are implemented by the DHCP client backends */ -GPid nm_dhcp4_client_start (NMDHCPClient *client, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *anycast_addr); -void nm_dhcp_client_stop (NMDHCPClient *client, pid_t pid); - -gboolean nm_dhcp4_client_process_classless_routes (GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr); - -GSList * nm_dhcp4_client_get_lease_config (const char *iface, - const char *uuid); - -/* Test functions */ -NMIP4Config *nm_dhcp4_manager_options_to_config (const char *iface, - GHashTable *options); +/* For testing only */ +NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *iface, + GHashTable *options, + const char *reason); #endif /* NM_DHCP_MANAGER_H */ diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 72073e4150..f20afcc45c 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1608,9 +1608,9 @@ ip4_match_config (NMDevice *self, NMConnection *connection) /* Get any saved leases that apply to this connection */ dhcp_mgr = nm_dhcp_manager_get (); - leases = nm_dhcp4_manager_get_lease_config (dhcp_mgr, - nm_device_get_iface (self), - nm_setting_connection_get_uuid (s_con)); + leases = nm_dhcp_manager_get_lease_config (dhcp_mgr, + nm_device_get_iface (self), + nm_setting_connection_get_uuid (s_con)); g_object_unref (dhcp_mgr); method = nm_setting_ip4_config_get_method (s_ip4); diff --git a/src/nm-device.c b/src/nm-device.c index 4be3fc23e3..586c93949c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -105,7 +105,7 @@ typedef struct { /* IP4 configuration info */ NMIP4Config * ip4_config; /* Config from DHCP, PPP, or system config files */ NMDHCPManager * dhcp_manager; - guint32 dhcp4_id; + NMDHCPClient * dhcp4_client; guint32 dhcp_timeout; gulong dhcp_state_sigid; gulong dhcp_timeout_sigid; @@ -1058,6 +1058,120 @@ aipd_exec (NMDevice *self, GError **error) return TRUE; } +static void +dhcp4_add_option_cb (gpointer key, gpointer value, gpointer user_data) +{ + nm_dhcp4_config_add_option (NM_DHCP4_CONFIG (user_data), + (const char *) key, + (const char *) value); +} + +static void +handle_dhcp_lease_change (NMDevice *device) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMIP4Config *config; + NMSettingIP4Config *s_ip4; + NMConnection *connection; + NMActRequest *req; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + gboolean assumed; + + if (!nm_device_get_use_dhcp (device)) { + nm_warning ("got DHCP rebind for device that wasn't using DHCP."); + return; + } + + config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); + if (!config) { + nm_warning ("failed to get DHCP config for rebind"); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + return; + } + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + nm_utils_merge_ip4_config (config, s_ip4); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, config); + + assumed = nm_act_request_get_assumed (req); + if (nm_device_set_ip4_config (device, config, assumed, &reason)) { + nm_dhcp4_config_reset (priv->dhcp4_config); + nm_dhcp_client_foreach_dhcp4_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); + } else { + nm_warning ("Failed to update IP4 config in response to DHCP event."); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + } +} + +static void +dhcp_state_changed (NMDHCPClient *client, + NMDHCPState state, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMDeviceState dev_state; + + if (!nm_device_get_act_request (device)) + return; + + dev_state = nm_device_get_state (device); + + switch (state) { + case DHC_BOUND4: /* lease obtained */ + case DHC_RENEW4: /* lease renewed */ + case DHC_REBOOT: /* have valid lease, but now obtained a different one */ + case DHC_REBIND4: /* new, different lease */ + if (dev_state == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_get (device); + else if (dev_state == NM_DEVICE_STATE_ACTIVATED) + handle_dhcp_lease_change (device); + break; + case DHC_TIMEOUT: /* timed out contacting DHCP server */ + nm_dhcp4_config_reset (priv->dhcp4_config); + + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + break; + case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ + case DHC_ABEND: /* dhclient exited abnormally */ + case DHC_END: /* dhclient exited normally */ + nm_dhcp4_config_reset (priv->dhcp4_config); + + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DHCP_FAILED); + } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + if (nm_device_get_use_dhcp (device)) { + /* dhclient quit and therefore can't renew our lease, kill the conneciton */ + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + } + } + break; + default: + break; + } +} + +static void +dhcp_timeout (NMDHCPClient *client, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + if (!nm_device_get_act_request (device)) + return; + + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_timeout (device); +} + static NMActStageReturn real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) { @@ -1101,16 +1215,22 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) /* DHCP manager will cancel any transaction already in progress and we do not want to cancel this activation if we get "down" state from that. */ - g_signal_handler_block (priv->dhcp_manager, priv->dhcp_state_sigid); - priv->dhcp4_id = nm_dhcp_manager_begin_transaction (priv->dhcp_manager, - ip_iface, - uuid, - s_ip4, - priv->dhcp_timeout, - anycast); - g_signal_handler_unblock (priv->dhcp_manager, priv->dhcp_state_sigid); + priv->dhcp4_client = nm_dhcp_manager_start_client (priv->dhcp_manager, + ip_iface, + uuid, + s_ip4, + priv->dhcp_timeout, + anycast); + if (priv->dhcp4_client) { + priv->dhcp_state_sigid = g_signal_connect (priv->dhcp4_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp_timeout_sigid = g_signal_connect (priv->dhcp4_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); - if (priv->dhcp4_id) { /* DHCP devices will be notified by the DHCP manager when * stuff happens. */ @@ -1288,14 +1408,6 @@ nm_device_new_ip4_shared_config (NMDevice *self, NMDeviceStateReason *reason) return config; } -static void -dhcp4_add_option_cb (gpointer key, gpointer value, gpointer user_data) -{ - nm_dhcp4_config_add_option (NM_DHCP4_CONFIG (user_data), - (const char *) key, - (const char *) value); -} - static NMActStageReturn real_act_stage4_get_ip4_config (NMDevice *self, NMIP4Config **config, @@ -1320,16 +1432,15 @@ real_act_stage4_get_ip4_config (NMDevice *self, s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); if (nm_device_get_use_dhcp (self)) { - *config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, priv->dhcp4_id); + *config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); if (*config) { /* Merge user-defined overrides into the IP4Config to be applied */ nm_utils_merge_ip4_config (*config, s_ip4); nm_dhcp4_config_reset (priv->dhcp4_config); - nm_dhcp_manager_foreach_dhcp4_option (priv->dhcp_manager, - priv->dhcp4_id, - dhcp4_add_option_cb, - priv->dhcp4_config); + nm_dhcp_client_foreach_dhcp4_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); /* Notify of new DHCP4 config */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); @@ -2015,14 +2126,14 @@ nm_device_deactivate_quickly (NMDevice *self) /* Clear any delayed transitions */ delayed_transitions_clear (self); - /* Stop any ongoing DHCP transaction on this device */ if (nm_device_get_act_request (self)) { if (nm_device_get_use_dhcp (self)) { - nm_dhcp_manager_cancel_transaction (priv->dhcp_manager, priv->dhcp4_id); nm_device_set_use_dhcp (self, FALSE); + /* Notify of invalid DHCP4 config */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); } else if (priv->dnsmasq_manager) { + /* Or any shared connection */ if (priv->dnsmasq_state_id) { g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); priv->dnsmasq_state_id = 0; @@ -2032,8 +2143,6 @@ nm_device_deactivate_quickly (NMDevice *self) g_object_unref (priv->dnsmasq_manager); priv->dnsmasq_manager = NULL; } - - priv->dhcp4_id = 0; } aipd_cleanup (self); @@ -2253,119 +2362,6 @@ nm_device_can_interrupt_activation (NMDevice *self) /* IP Configuration stuff */ -static void -handle_dhcp_lease_change (NMDevice *device) -{ - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - NMIP4Config *config; - NMSettingIP4Config *s_ip4; - NMConnection *connection; - NMActRequest *req; - NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; - gboolean assumed; - - if (!nm_device_get_use_dhcp (device)) { - nm_warning ("got DHCP rebind for device that wasn't using DHCP."); - return; - } - - config = nm_dhcp_manager_get_ip4_config (priv->dhcp_manager, priv->dhcp4_id); - if (!config) { - nm_warning ("failed to get DHCP config for rebind"); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - return; - } - - req = nm_device_get_act_request (device); - g_assert (req); - connection = nm_act_request_get_connection (req); - g_assert (connection); - - s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); - nm_utils_merge_ip4_config (config, s_ip4); - - g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, config); - - assumed = nm_act_request_get_assumed (req); - if (nm_device_set_ip4_config (device, config, assumed, &reason)) { - nm_dhcp4_config_reset (priv->dhcp4_config); - nm_dhcp_manager_foreach_dhcp4_option (priv->dhcp_manager, - priv->dhcp4_id, - dhcp4_add_option_cb, - priv->dhcp4_config); - } else { - nm_warning ("Failed to update IP4 config in response to DHCP event."); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); - } -} - -static void -dhcp_state_changed (NMDHCPManager *dhcp_manager, - guint32 id, - NMDHCPState state, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - NMDeviceState dev_state; - - if ( !nm_device_get_act_request (device) - || (priv->dhcp4_id != id)) - return; - - dev_state = nm_device_get_state (device); - - switch (state) { - case DHC_BOUND4: /* lease obtained */ - case DHC_RENEW4: /* lease renewed */ - case DHC_REBOOT: /* have valid lease, but now obtained a different one */ - case DHC_REBIND4: /* new, different lease */ - if (dev_state == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_get (device); - else if (dev_state == NM_DEVICE_STATE_ACTIVATED) - handle_dhcp_lease_change (device); - break; - case DHC_TIMEOUT: /* timed out contacting DHCP server */ - nm_dhcp4_config_reset (priv->dhcp4_config); - - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_timeout (device); - break; - case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ - case DHC_ABEND: /* dhclient exited abnormally */ - case DHC_END: /* dhclient exited normally */ - nm_dhcp4_config_reset (priv->dhcp4_config); - - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DHCP_FAILED); - } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { - if (nm_device_get_use_dhcp (device)) { - /* dhclient quit and therefore can't renew our lease, kill the conneciton */ - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - } - } - break; - default: - break; - } -} - -static void -dhcp_timeout (NMDHCPManager *dhcp_manager, - guint32 id, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - - if ( !nm_device_get_act_request (device) - || (priv->dhcp4_id != id)) - return; - - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_timeout (device); -} - gboolean nm_device_get_use_dhcp (NMDevice *self) { @@ -2390,17 +2386,8 @@ nm_device_set_use_dhcp (NMDevice *self, g_object_unref (priv->dhcp4_config); priv->dhcp4_config = nm_dhcp4_config_new (); - if (!priv->dhcp_manager) { + if (!priv->dhcp_manager) priv->dhcp_manager = nm_dhcp_manager_get (); - priv->dhcp_state_sigid = g_signal_connect (priv->dhcp_manager, - "state-changed", - G_CALLBACK (dhcp_state_changed), - self); - priv->dhcp_timeout_sigid = g_signal_connect (priv->dhcp_manager, - "timeout", - G_CALLBACK (dhcp_timeout), - self); - } } else { if (priv->dhcp4_config) { g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); @@ -2408,11 +2395,25 @@ nm_device_set_use_dhcp (NMDevice *self, priv->dhcp4_config = NULL; } + if (priv->dhcp4_client) { + /* Stop any ongoing DHCP transaction on this device */ + if (priv->dhcp_state_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_state_sigid); + priv->dhcp_state_sigid = 0; + } + + if (priv->dhcp_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_timeout_sigid); + priv->dhcp_timeout_sigid = 0; + } + + nm_dhcp_client_stop (priv->dhcp4_client); + + g_object_unref (priv->dhcp4_client); + priv->dhcp4_client = NULL; + } + if (priv->dhcp_manager) { - g_signal_handler_disconnect (priv->dhcp_manager, priv->dhcp_state_sigid); - priv->dhcp_state_sigid = 0; - g_signal_handler_disconnect (priv->dhcp_manager, priv->dhcp_timeout_sigid); - priv->dhcp_timeout_sigid = 0; g_object_unref (priv->dhcp_manager); priv->dhcp_manager = NULL; } @@ -2770,6 +2771,7 @@ dispose (GObject *object) nm_device_take_down (self, FALSE, NM_DEVICE_STATE_REASON_REMOVED); nm_device_set_ip4_config (self, NULL, FALSE, &ignored); + nm_device_set_use_dhcp (self, FALSE); } clear_act_request (self); @@ -2777,10 +2779,7 @@ dispose (GObject *object) activation_source_clear (self, TRUE, AF_INET); activation_source_clear (self, TRUE, AF_INET6); - if (!take_down) { - nm_device_set_use_dhcp (self, FALSE); - nm_device_cleanup_ip6 (self); - } + nm_device_cleanup_ip6 (self); if (priv->dnsmasq_manager) { if (priv->dnsmasq_state_id) { diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c index a99feea9db..6f5fb011f0 100644 --- a/src/tests/test-dhcp-options.c +++ b/src/tests/test-dhcp-options.c @@ -35,15 +35,43 @@ typedef struct { const char *value; } Option; +static void +destroy_gvalue (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static GValue * +string_to_byte_array_gvalue (const char *str) +{ + GByteArray *array; + GValue *val; + + array = g_byte_array_sized_new (strlen (str)); + g_byte_array_append (array, (const guint8 *) str, strlen (str)); + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (val, array); + + return val; +} + static GHashTable * fill_table (Option *test_options, GHashTable *table) { Option *opt; if (!table) - table = g_hash_table_new (g_str_hash, g_str_equal); - for (opt = test_options; opt->name; opt++) - g_hash_table_insert (table, (gpointer) opt->name, (gpointer) opt->value); + table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_gvalue); + for (opt = test_options; opt->name; opt++) { + g_hash_table_insert (table, + (gpointer) opt->name, + string_to_byte_array_gvalue (opt->value)); + } return table; } @@ -88,7 +116,7 @@ test_generic_options (void) const char *expected_route2_gw = "10.1.1.1"; options = fill_table (generic_options, NULL); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-generic", "failed to parse DHCP4 options"); @@ -199,7 +227,7 @@ test_wins_options (void) options = fill_table (generic_options, NULL); options = fill_table (wins_options, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-wins", "failed to parse DHCP4 options"); @@ -245,7 +273,7 @@ test_classless_static_routes (void) options = fill_table (generic_options, NULL); options = fill_table (classless_routes_options, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442", "failed to parse DHCP4 options"); @@ -311,7 +339,7 @@ test_invalid_classless_routes1 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes1, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-1", "failed to parse DHCP4 options"); @@ -362,7 +390,7 @@ test_invalid_classless_routes2 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes2, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-2", "failed to parse DHCP4 options"); @@ -432,7 +460,7 @@ test_invalid_classless_routes3 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes3, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-3", "failed to parse DHCP4 options"); @@ -483,7 +511,7 @@ test_gateway_in_classless_routes (void) options = fill_table (generic_options, NULL); options = fill_table (gw_in_classless_routes, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-gateway", "failed to parse DHCP4 options"); @@ -537,7 +565,7 @@ test_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (escaped_searches_options, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-escaped-domain-searches", "failed to parse DHCP4 options"); @@ -568,7 +596,7 @@ test_invalid_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_escaped_searches_options, options); - ip4_config = nm_dhcp4_manager_options_to_config ("eth0", options); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-invalid-escaped-domain-searches", "failed to parse DHCP4 options"); From 702836b42f28466f1d156a7585e19e659152f45b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 12 Jan 2010 22:55:24 -0800 Subject: [PATCH 021/392] dhcp: allow runtime DHCP client selection via config file --- configure.ac | 123 ++++++++++++++++------------ src/NetworkManager.c | 17 ++-- src/dhcp-manager/Makefile.am | 3 +- src/dhcp-manager/nm-dhcp-client.h | 4 - src/dhcp-manager/nm-dhcp-dhclient.c | 10 +-- src/dhcp-manager/nm-dhcp-dhclient.h | 2 + src/dhcp-manager/nm-dhcp-dhcpcd.c | 10 +-- src/dhcp-manager/nm-dhcp-dhcpcd.h | 2 + src/dhcp-manager/nm-dhcp-manager.c | 91 ++++++++++++-------- src/dhcp-manager/nm-dhcp-manager.h | 3 + 10 files changed, 156 insertions(+), 109 deletions(-) diff --git a/configure.ac b/configure.ac index 28734d6e77..5206bd07b5 100644 --- a/configure.ac +++ b/configure.ac @@ -286,67 +286,73 @@ else fi AC_SUBST(PPPD_PLUGIN_DIR) -# DHCP client -AC_ARG_WITH([dhcp-client], AS_HELP_STRING([--with-dhcp-client=dhcpcd|dhclient], [path to the chosen dhcp client])) +# dhclient support +AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support])) # If a full path is given, use that and do not test if it works or not. -case "${with_dhcp_client}" in +case "${with_dhclient}" in /*) - DHCP_CLIENT_PATH="${with_dhcp_client}" - AC_MSG_NOTICE(using the DHCP client ${DHCP_CLIENT_PATH}) + DHCLIENT_PATH="${with_dhclient}" + AC_MSG_NOTICE(using dhclient at ${DHCLIENT_PATH}) + ;; + no) AC_MSG_NOTICE(dhclient support disabled) + ;; + *) + AC_MSG_CHECKING(for dhclient) + # NM only works with ISC dhclient - other derivatives don't have + # the same userland. NM also requires dhclient 4.x since older + # versions do not have IPv6 support. + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhclient" --version 2>&1` in + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; break;; + esac + done + if test -n "${DHCLIENT_PATH}"; then + AC_MSG_RESULT($DHCLIENT_PATH) + else + AC_MSG_RESULT(no) + fi ;; esac -if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhclient" \); then - # We only work with ISC dhclient - the FreeBSD and OpenBSD derivatives don't have the same userland. - AC_MSG_CHECKING(for dhclient) - for client in "$with_dhcp_client" /sbin/dhclient /usr/pkg/sbin/dhclient /usr/local/sbin/dhclient; do - test -x "$client" || continue - case `"$client" --version 2>&1` in - "isc-dhclient-"*) DHCP_CLIENT_PATH="$client"; break;; - esac - done - if test -z "$DHCP_CLIENT_PATH"; then - AC_MSG_RESULT(no) - if test -n "$with_dhcp_client"; then - AC_MSG_ERROR([Could not find ISC dhclient]) + +# dhcpcd support +AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support])) +# If a full path is given, use that and do not test if it works or not. +case "${with_dhcpcd}" in + /*) + DHCPCD_PATH="${with_dhcpcd}" + AC_MSG_NOTICE(using dhcpcd at ${DHCPCD_PATH}) + ;; + no) AC_MSG_NOTICE(dhcpcd support disabled) + ;; + *) + AC_MSG_CHECKING(for dhcpcd) + # We fully work with upstream dhcpcd-4 + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhcpcd" --version 2>/dev/null` in + "dhcpcd "[123]*);; + "dhcpcd "*) DHCP_CLIENT_PATH="$path/dhcpcd"; break;; + esac + done + if test -n "${DHCPCD_PATH}"; then + AC_MSG_RESULT($DHCPCD_PATH) + else + AC_MSG_RESULT(no) fi - else - AC_MSG_RESULT($DHCP_CLIENT_PATH) - fi -fi -if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhcpcd" \); then - test -n "$DHCP_CLIENT_PATH" && echo bar - # We fully work with upstream dhcpcd-4 - AC_MSG_CHECKING([for dhcpcd]) - for client in "$with_dhcp_client" /sbin/dhcpcd /usr/pkg/sbin/dhcpcd /usr/local/sbin/dhcpcd; do - test -x "$client" || continue - case `"$client" --version 2>/dev/null` in - "dhcpcd "[123]*);; - "dhcpcd "*) DHCP_CLIENT_PATH="$client"; break;; - esac - done - if test -z "$DHCP_CLIENT_PATH"; then - AC_MSG_RESULT(no) - if test -n "$with_dhcp_client"; then - AC_MSG_ERROR([Could not find dhcpcd-4 or newer]) - fi - else - AC_MSG_RESULT($DHCP_CLIENT_PATH) - fi -fi -if test -z "$DHCP_CLIENT_PATH"; then + ;; +esac + +if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then # DHCP clients are not a build time dependency, only runtime. # dhclient has been the longtime default for NM and it's in /sbin # in most distros, so use it. AC_MSG_WARN([Could not find a suitable DHCP client]) - DHCP_CLIENT_PATH=/sbin/dhclient + DHCLIENT_PATH=/sbin/dhclient AC_MSG_WARN([Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}]) fi -AC_SUBST(DHCP_CLIENT_PATH) -DHCP_CLIENT=`basename "$DHCP_CLIENT_PATH"` -if test "$DHCP_CLIENT" != "dhclient" -a "$DHCP_CLIENT" != "dhcpcd"; then - AC_MSG_ERROR([No backend for the DHCP client ${DHCP_CLIENT}]) -fi -AC_SUBST(DHCP_CLIENT) +AC_SUBST(DHCLIENT_PATH) +AC_SUBST(DHCPCD_PATH) # resolvconf support AC_ARG_WITH([resolvconf], @@ -492,12 +498,25 @@ NetworkManager.pc AC_OUTPUT echo -echo Distribution targeting: ${with_distro} +echo Distribution target: ${with_distro} echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO' +echo + +if test -n "${DHCLIENT_PATH}"; then + echo ISC dhclient support: ${DHCLIENT_PATH} +else + echo ISC dhclient support: no +fi + +if test -n "${DHCPCD_PATH}"; then + echo dhcpcd support: ${DHCPCD_PATH} +else + echo dhcpcd support: no +fi + echo echo Building documentation: ${with_docs} -echo echo Building tests: ${with_tests} echo diff --git a/src/NetworkManager.c b/src/NetworkManager.c index 09a4320c78..a6639b8c8e 100644 --- a/src/NetworkManager.c +++ b/src/NetworkManager.c @@ -302,7 +302,10 @@ done: } static gboolean -parse_config_file (const char *filename, char **plugins, GError **error) +parse_config_file (const char *filename, + char **plugins, + char **dhcp_client, + GError **error) { GKeyFile *config; @@ -321,6 +324,8 @@ parse_config_file (const char *filename, char **plugins, GError **error) if (*error) return FALSE; + *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); + g_key_file_free (config); return TRUE; } @@ -435,7 +440,7 @@ main (int argc, char *argv[]) gboolean become_daemon = FALSE; gboolean g_fatal_warnings = FALSE; char *pidfile = NULL, *user_pidfile = NULL; - char *config = NULL, *plugins = NULL; + char *config = NULL, *plugins = NULL, *dhcp = NULL; char *state_file = NM_DEFAULT_SYSTEM_STATE_FILE; gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE; gboolean success; @@ -498,7 +503,7 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { - if (!parse_config_file (config, &plugins, &error)) { + if (!parse_config_file (config, &plugins, &dhcp, &error)) { g_warning ("Config file %s invalid: (%d) %s.", config, error ? error->code : -1, @@ -507,7 +512,7 @@ main (int argc, char *argv[]) } } else { config = NM_DEFAULT_SYSTEM_CONF_FILE; - if (!parse_config_file (config, &plugins, &error)) { + if (!parse_config_file (config, &plugins, &dhcp, &error)) { g_warning ("Default config file %s invalid: (%d) %s.", config, error ? error->code : -1, @@ -620,9 +625,9 @@ main (int argc, char *argv[]) goto done; } - dhcp_mgr = nm_dhcp_manager_get (); + dhcp_mgr = nm_dhcp_manager_new (dhcp ? dhcp : "dhclient", &error); if (!dhcp_mgr) { - nm_warning ("Failed to start the DHCP manager."); + nm_warning ("Failed to start the DHCP manager: %s.", error->message); goto done; } diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index 711c2a5058..ff9041c390 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -27,7 +27,8 @@ libdhcp_manager_la_CPPFLAGS = \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ - -DDHCP_CLIENT_PATH=\"$(DHCP_CLIENT_PATH)\" + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" libdhcp_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 0e5d81229d..5cf77737e1 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -114,9 +114,5 @@ NMIP4Config *nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) /* Backend helpers */ void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name); -/* Implemented by the backends */ -GSList *nm_dhcp_backend_get_lease_config (const char *iface, - const char *uuid); - #endif /* NM_DHCP_CLIENT_H */ diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index c47d155b0f..7eec31d312 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -110,7 +110,7 @@ add_lease_option (GHashTable *hash, char *line) } GSList * -nm_dhcp_backend_get_lease_config (const char *iface, const char *uuid) +nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) { GSList *parsed = NULL, *iter, *leases = NULL; char *contents = NULL; @@ -469,13 +469,13 @@ real_ip4_start (NMDHCPClient *client, return -1; } - if (!g_file_test (DHCP_CLIENT_PATH, G_FILE_TEST_EXISTS)) { - nm_warning (DHCP_CLIENT_PATH " does not exist."); + if (!g_file_test (DHCLIENT_PATH, G_FILE_TEST_EXISTS)) { + nm_warning (DHCLIENT_PATH " does not exist."); return -1; } /* Kill any existing dhclient from the pidfile */ - binary_name = g_path_get_basename (DHCP_CLIENT_PATH); + binary_name = g_path_get_basename (DHCLIENT_PATH); nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); @@ -492,7 +492,7 @@ real_ip4_start (NMDHCPClient *client, } argv = g_ptr_array_new (); - g_ptr_array_add (argv, (gpointer) DHCP_CLIENT_PATH); + g_ptr_array_add (argv, (gpointer) DHCLIENT_PATH); g_ptr_array_add (argv, (gpointer) "-d"); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h index bad6452f79..db9f73d254 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.h +++ b/src/dhcp-manager/nm-dhcp-dhclient.h @@ -41,5 +41,7 @@ typedef struct { GType nm_dhcp_dhclient_get_type (void); +GSList *nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid); + #endif /* NM_DHCP_DHCLIENT_H */ diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index ba210eda63..fb1fd1bf1c 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -47,7 +47,7 @@ typedef struct { GSList * -nm_dhcp_backend_get_lease_config (const char *iface, const char *uuid) +nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid) { return NULL; } @@ -83,18 +83,18 @@ real_ip4_start (NMDHCPClient *client, return -1; } - if (!g_file_test (DHCP_CLIENT_PATH, G_FILE_TEST_EXISTS)) { - nm_warning (DHCP_CLIENT_PATH " does not exist."); + if (!g_file_test (DHCPCD_PATH, G_FILE_TEST_EXISTS)) { + nm_warning (DHCPCD_PATH " does not exist."); return -1; } /* Kill any existing dhclient from the pidfile */ - binary_name = g_path_get_basename (DHCP_CLIENT_PATH); + binary_name = g_path_get_basename (DHCPCD_PATH); nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); argv = g_ptr_array_new (); - g_ptr_array_add (argv, (gpointer) DHCP_CLIENT_PATH); + g_ptr_array_add (argv, (gpointer) DHCPCD_PATH); g_ptr_array_add (argv, (gpointer) "-B"); /* Don't background on lease (disable fork()) */ diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.h b/src/dhcp-manager/nm-dhcp-dhcpcd.h index f564bc7f71..9a98129419 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.h +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.h @@ -41,5 +41,7 @@ typedef struct { GType nm_dhcp_dhcpcd_get_type (void); +GSList *nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid); + #endif /* NM_DHCP_DHCPCD_H */ diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index f1a84cdd46..59fc2536de 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -36,6 +36,7 @@ #include "nm-dhcp-manager.h" #include "nm-dhcp-dhclient.h" +#include "nm-dhcp-dhcpcd.h" #include "nm-marshal.h" #include "nm-utils.h" #include "nm-dbus-manager.h" @@ -46,8 +47,14 @@ #define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" #define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" +static NMDHCPManager *singleton = NULL; + +typedef GSList * (*GetLeaseConfigFunc) (const char *iface, const char *uuid); + typedef struct { - guint32 next_id; + GType client_type; + GetLeaseConfigFunc get_lease_config_func; + NMDBusManager * dbus_mgr; GHashTable * clients; DBusGProxy * proxy; @@ -219,23 +226,36 @@ out: g_free (reason); } -static NMDHCPManager * -nm_dhcp_manager_new (void) +NMDHCPManager * +nm_dhcp_manager_new (const char *client, GError **error) { - NMDHCPManager *manager; NMDHCPManagerPrivate *priv; DBusGConnection *g_connection; - manager = g_object_new (NM_TYPE_DHCP_MANAGER, NULL); - priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + g_warn_if_fail (singleton == NULL); + g_return_val_if_fail (client != NULL, NULL); + + singleton = g_object_new (NM_TYPE_DHCP_MANAGER, NULL); + priv = NM_DHCP_MANAGER_GET_PRIVATE (singleton); + + /* Figure out which DHCP client to use */ + if (!strcmp (client, "dhclient") && strlen (DHCLIENT_PATH)) { + priv->client_type = NM_TYPE_DHCP_DHCLIENT; + priv->get_lease_config_func = nm_dhcp_dhclient_get_lease_config; + } else if (!strcmp (client, "dhcpcd") && strlen (DHCPCD_PATH)) { + priv->client_type = NM_TYPE_DHCP_DHCPCD; + priv->get_lease_config_func = nm_dhcp_dhcpcd_get_lease_config; + } else { + g_set_error (error, 0, 0, "unknown or missing DHCP client '%s'", client); + goto error; + } priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_object_unref); if (!priv->clients) { - nm_warning ("Error: not enough memory to initialize DHCP manager tables"); - g_object_unref (manager); - return NULL; + g_set_error_literal (error, 0, 0, "not enough memory to initialize DHCP manager"); + goto error; } priv->dbus_mgr = nm_dbus_manager_get (); @@ -245,9 +265,8 @@ nm_dhcp_manager_new (void) "/", NM_DHCP_CLIENT_DBUS_IFACE); if (!priv->proxy) { - nm_warning ("Error: could not init DHCP manager proxy"); - g_object_unref (manager); - return NULL; + g_set_error_literal (error, 0, 0, "not enough memory to initialize DHCP manager proxy"); + goto error; } dbus_g_proxy_add_signal (priv->proxy, @@ -256,11 +275,16 @@ nm_dhcp_manager_new (void) G_TYPE_INVALID); dbus_g_proxy_connect_signal (priv->proxy, "Event", - G_CALLBACK (nm_dhcp_manager_handle_event), - manager, - NULL); + G_CALLBACK (nm_dhcp_manager_handle_event), + singleton, + NULL); - return manager; + return singleton; + +error: + g_object_unref (singleton); + singleton = NULL; + return singleton; } #define STATE_ID_TAG "state-id" @@ -416,7 +440,7 @@ nm_dhcp_manager_get_lease_config (NMDHCPManager *self, g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL); - return nm_dhcp_backend_get_lease_config (iface, uuid); + return NM_DHCP_MANAGER_GET_PRIVATE (self)->get_lease_config_func (iface, uuid); } NMIP4Config * @@ -443,23 +467,13 @@ nm_dhcp_manager_test_ip4_options_to_config (const char *iface, NMDHCPManager * nm_dhcp_manager_get (void) { - static NMDHCPManager *singleton = NULL; - - if (!singleton) - singleton = nm_dhcp_manager_new (); - else - g_object_ref (singleton); - - g_assert (singleton); - return singleton; + g_warn_if_fail (singleton != NULL); + return g_object_ref (singleton); } static void nm_dhcp_manager_init (NMDHCPManager *manager) { - NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); - - priv->next_id = 1; } static void @@ -468,10 +482,12 @@ dispose (GObject *object) NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); GList *values, *iter; - values = g_hash_table_get_values (priv->clients); - for (iter = values; iter; iter = g_list_next (iter)) - remove_client (NM_DHCP_MANAGER (object), NM_DHCP_CLIENT (iter->data)); - g_list_free (values); + if (priv->clients) { + values = g_hash_table_get_values (priv->clients); + for (iter = values; iter; iter = g_list_next (iter)) + remove_client (NM_DHCP_MANAGER (object), NM_DHCP_CLIENT (iter->data)); + g_list_free (values); + } G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->dispose (object); } @@ -486,9 +502,12 @@ finalize (GObject *object) priv->hostname_provider = NULL; } - g_hash_table_destroy (priv->clients); - g_object_unref (priv->proxy); - g_object_unref (priv->dbus_mgr); + if (priv->clients) + g_hash_table_destroy (priv->clients); + if (priv->proxy) + g_object_unref (priv->proxy); + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->finalize (object); } diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 7c82ca59ac..441d9fce14 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -70,4 +70,7 @@ NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *iface, GHashTable *options, const char *reason); +/* Only for NetworkManager.c */ +NMDHCPManager *nm_dhcp_manager_new (const char *client, GError **error); + #endif /* NM_DHCP_MANAGER_H */ From 81f23ea3836245d111306ad38345a83b4f7a6a3f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 12 Jan 2010 23:07:44 -0800 Subject: [PATCH 022/392] dhcp: actually use runtime-selected DHCP client --- src/dhcp-manager/nm-dhcp-manager.c | 49 ++++++++++++++++----- src/dhcp-manager/nm-dhcp-manager.h | 3 +- src/tests/Makefile.am | 4 +- src/tests/test-dhcp-options.c | 71 ++++++++++++++++++------------ 4 files changed, 86 insertions(+), 41 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 59fc2536de..6da14ed145 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -226,6 +226,21 @@ out: g_free (reason); } +static GType +get_client_type (const char *client, GError **error) +{ + g_return_val_if_fail (client != NULL, 0); + + if (!strcmp (client, "dhclient") && strlen (DHCLIENT_PATH)) + return NM_TYPE_DHCP_DHCLIENT; + else if (!strcmp (client, "dhcpcd") && strlen (DHCPCD_PATH)) + return NM_TYPE_DHCP_DHCPCD; + else + g_set_error (error, 0, 0, "unknown or missing DHCP client '%s'", client); + + return 0; +} + NMDHCPManager * nm_dhcp_manager_new (const char *client, GError **error) { @@ -239,16 +254,16 @@ nm_dhcp_manager_new (const char *client, GError **error) priv = NM_DHCP_MANAGER_GET_PRIVATE (singleton); /* Figure out which DHCP client to use */ - if (!strcmp (client, "dhclient") && strlen (DHCLIENT_PATH)) { - priv->client_type = NM_TYPE_DHCP_DHCLIENT; - priv->get_lease_config_func = nm_dhcp_dhclient_get_lease_config; - } else if (!strcmp (client, "dhcpcd") && strlen (DHCPCD_PATH)) { - priv->client_type = NM_TYPE_DHCP_DHCPCD; - priv->get_lease_config_func = nm_dhcp_dhcpcd_get_lease_config; - } else { - g_set_error (error, 0, 0, "unknown or missing DHCP client '%s'", client); + priv->client_type = get_client_type (client, error); + if (!priv->client_type) goto error; - } + + if (priv->client_type == NM_TYPE_DHCP_DHCLIENT) + priv->get_lease_config_func = nm_dhcp_dhclient_get_lease_config; + else if (priv->client_type == NM_TYPE_DHCP_DHCPCD) + priv->get_lease_config_func = nm_dhcp_dhcpcd_get_lease_config; + else + g_assert_not_reached (); priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, @@ -368,7 +383,7 @@ nm_dhcp_manager_start_client (NMDHCPManager *self, } /* And make a new one */ - client = g_object_new (NM_TYPE_DHCP_DHCLIENT, + client = g_object_new (priv->client_type, NM_DHCP_CLIENT_INTERFACE, iface, NULL); g_return_val_if_fail (client != NULL, NULL); @@ -444,14 +459,24 @@ nm_dhcp_manager_get_lease_config (NMDHCPManager *self, } NMIP4Config * -nm_dhcp_manager_test_ip4_options_to_config (const char *iface, +nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client, + const char *iface, GHashTable *options, const char *reason) { NMDHCPClient *client; NMIP4Config *config; + GType client_type; + GError *error = NULL; - client = (NMDHCPClient *) g_object_new (NM_TYPE_DHCP_DHCLIENT, + client_type = get_client_type (dhcp_client, &error); + if (!client_type) { + g_warning ("Error: %s", error ? error->message : "(unknown)"); + g_clear_error (&error); + return NULL; + } + + client = (NMDHCPClient *) g_object_new (client_type, NM_DHCP_CLIENT_INTERFACE, iface, NULL); g_return_val_if_fail (client != NULL, NULL); diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 441d9fce14..dab33601ae 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -66,7 +66,8 @@ GSList * nm_dhcp_manager_get_lease_config (NMDHCPManager *self, const char *uuid); /* For testing only */ -NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *iface, +NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client, + const char *iface, GHashTable *options, const char *reason); diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 398042ccb5..75f9cffd59 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -13,7 +13,9 @@ test_dhcp_options_SOURCES = \ test_dhcp_options_CPPFLAGS = \ $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) + $(DBUS_CFLAGS) \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" test_dhcp_options_LDADD = \ $(top_builddir)/libnm-util/libnm-util.la \ diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c index 6f5fb011f0..6211f1d9ce 100644 --- a/src/tests/test-dhcp-options.c +++ b/src/tests/test-dhcp-options.c @@ -97,7 +97,7 @@ static Option generic_options[] = { }; static void -test_generic_options (void) +test_generic_options (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -116,7 +116,7 @@ test_generic_options (void) const char *expected_route2_gw = "10.1.1.1"; options = fill_table (generic_options, NULL); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-generic", "failed to parse DHCP4 options"); @@ -215,7 +215,7 @@ static Option wins_options[] = { }; static void -test_wins_options (void) +test_wins_options (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -227,7 +227,7 @@ test_wins_options (void) options = fill_table (generic_options, NULL); options = fill_table (wins_options, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-wins", "failed to parse DHCP4 options"); @@ -259,7 +259,7 @@ static Option classless_routes_options[] = { }; static void -test_classless_static_routes (void) +test_classless_static_routes (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -273,7 +273,7 @@ test_classless_static_routes (void) options = fill_table (generic_options, NULL); options = fill_table (classless_routes_options, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442", "failed to parse DHCP4 options"); @@ -327,7 +327,7 @@ static Option invalid_classless_routes1[] = { }; static void -test_invalid_classless_routes1 (void) +test_invalid_classless_routes1 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -339,7 +339,7 @@ test_invalid_classless_routes1 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes1, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-1", "failed to parse DHCP4 options"); @@ -376,7 +376,7 @@ static Option invalid_classless_routes2[] = { }; static void -test_invalid_classless_routes2 (void) +test_invalid_classless_routes2 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -390,7 +390,7 @@ test_invalid_classless_routes2 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes2, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-2", "failed to parse DHCP4 options"); @@ -448,7 +448,7 @@ static Option invalid_classless_routes3[] = { }; static void -test_invalid_classless_routes3 (void) +test_invalid_classless_routes3 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -460,7 +460,7 @@ test_invalid_classless_routes3 (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_classless_routes3, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-invalid-3", "failed to parse DHCP4 options"); @@ -497,7 +497,7 @@ static Option gw_in_classless_routes[] = { }; static void -test_gateway_in_classless_routes (void) +test_gateway_in_classless_routes (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -511,7 +511,7 @@ test_gateway_in_classless_routes (void) options = fill_table (generic_options, NULL); options = fill_table (gw_in_classless_routes, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-rfc3442-gateway", "failed to parse DHCP4 options"); @@ -554,7 +554,7 @@ static Option escaped_searches_options[] = { }; static void -test_escaped_domain_searches (void) +test_escaped_domain_searches (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -565,7 +565,7 @@ test_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (escaped_searches_options, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-escaped-domain-searches", "failed to parse DHCP4 options"); @@ -588,7 +588,7 @@ static Option invalid_escaped_searches_options[] = { }; static void -test_invalid_escaped_domain_searches (void) +test_invalid_escaped_domain_searches (const char *client) { GHashTable *options; NMIP4Config *ip4_config; @@ -596,7 +596,7 @@ test_invalid_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (invalid_escaped_searches_options, options); - ip4_config = nm_dhcp_manager_test_ip4_options_to_config ("eth0", options, "rebind"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, "dhcp-invalid-escaped-domain-searches", "failed to parse DHCP4 options"); @@ -607,6 +607,9 @@ test_invalid_escaped_domain_searches (void) g_hash_table_destroy (options); } +#define DHCLIENT "dhclient" +#define DHCPCD "dhcpcd" + int main (int argc, char **argv) { GError *error = NULL; @@ -620,15 +623,29 @@ int main (int argc, char **argv) FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); /* The tests */ - test_generic_options (); - test_wins_options (); - test_classless_static_routes (); - test_invalid_classless_routes1 (); - test_invalid_classless_routes2 (); - test_invalid_classless_routes3 (); - test_gateway_in_classless_routes (); - test_escaped_domain_searches (); - test_invalid_escaped_domain_searches (); + if (strlen (DHCLIENT_PATH)) { + test_generic_options (DHCLIENT); + test_wins_options (DHCLIENT); + test_classless_static_routes (DHCLIENT); + test_invalid_classless_routes1 (DHCLIENT); + test_invalid_classless_routes2 (DHCLIENT); + test_invalid_classless_routes3 (DHCLIENT); + test_gateway_in_classless_routes (DHCLIENT); + test_escaped_domain_searches (DHCLIENT); + test_invalid_escaped_domain_searches (DHCLIENT); + } + + if (strlen (DHCPCD_PATH)) { + test_generic_options (DHCPCD); + test_wins_options (DHCPCD); + test_classless_static_routes (DHCPCD); + test_invalid_classless_routes1 (DHCPCD); + test_invalid_classless_routes2 (DHCPCD); + test_invalid_classless_routes3 (DHCPCD); + test_gateway_in_classless_routes (DHCPCD); + test_escaped_domain_searches (DHCPCD); + test_invalid_escaped_domain_searches (DHCPCD); + } base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); From fe62e59c7e0ac04c05123dd18e19ccc04a289152 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 13 Jan 2010 16:51:20 -0800 Subject: [PATCH 023/392] dhcp: add DHCPv6 functionality --- src/dhcp-manager/nm-dhcp-client.c | 145 +++++++++++++++++++++++----- src/dhcp-manager/nm-dhcp-client.h | 30 ++++-- src/dhcp-manager/nm-dhcp-dhclient.c | 46 ++++++--- src/dhcp-manager/nm-dhcp-dhcpcd.c | 14 ++- src/dhcp-manager/nm-dhcp-manager.c | 110 +++++++++++++++------ src/dhcp-manager/nm-dhcp-manager.h | 20 ++-- src/nm-device.c | 12 +-- 7 files changed, 288 insertions(+), 89 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index e39c9bf312..382b7d4a91 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -32,10 +32,12 @@ #include "nm-dbus-glib-types.h" #include "nm-dhcp-client.h" -#define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */ - typedef struct { char * iface; + gboolean ipv6; + char * uuid; + guint32 timeout; + guchar state; GPid pid; guint timeout_id; @@ -58,6 +60,9 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, PROP_IFACE, + PROP_IPV6, + PROP_UUID, + PROP_TIMEOUT, LAST_PROP }; @@ -81,6 +86,24 @@ nm_dhcp_client_get_iface (NMDHCPClient *self) return NM_DHCP_CLIENT_GET_PRIVATE (self)->iface; } +gboolean +nm_dhcp_client_get_ipv6 (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->ipv6; +} + +const char * +nm_dhcp_client_get_uuid (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->uuid; +} + /********************************************/ static void @@ -193,12 +216,26 @@ daemon_watch_cb (GPid pid, gint status, gpointer user_data) g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], 0, priv->state); } +static void +start_monitor (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + g_return_if_fail (priv->pid > 0); + + /* Set up a timeout on the transaction to kill it after the timeout */ + priv->timeout_id = g_timeout_add_seconds (priv->timeout, + daemon_timeout, + self); + priv->watch_id = g_child_watch_add (priv->pid, + (GChildWatchFunc) daemon_watch_cb, + self); +} + gboolean -nm_dhcp_client_start (NMDHCPClient *self, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout_secs, - guint8 *dhcp_anycast_addr) +nm_dhcp_client_start_ip4 (NMDHCPClient *self, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) { NMDHCPClientPrivate *priv; @@ -207,28 +244,42 @@ nm_dhcp_client_start (NMDHCPClient *self, priv = NM_DHCP_CLIENT_GET_PRIVATE (self); g_return_val_if_fail (priv->pid == -1, FALSE); + g_return_val_if_fail (priv->ipv6 == FALSE, FALSE); + g_return_val_if_fail (priv->uuid != NULL, FALSE); - if (timeout_secs == 0) - timeout_secs = NM_DHCP_TIMEOUT; + g_message ("Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); - g_message ("Activation (%s) Beginning DHCP transaction (timeout in %d seconds)", - priv->iface, timeout_secs); - priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, - uuid, - s_ip4, - dhcp_anycast_addr); - if (priv->pid <= 0) - return FALSE; + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, s_ip4, dhcp_anycast_addr); + if (priv->pid) + start_monitor (self); - /* Set up a timeout on the transaction to kill it after the timeout */ - priv->timeout_id = g_timeout_add_seconds (timeout_secs, - daemon_timeout, - self); - priv->watch_id = g_child_watch_add (priv->pid, - (GChildWatchFunc) daemon_watch_cb, - self); + return priv->pid ? TRUE : FALSE; +} - return TRUE; +gboolean +nm_dhcp_client_start_ip6 (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->pid == -1, FALSE); + g_return_val_if_fail (priv->ipv6 == TRUE, FALSE); + g_return_val_if_fail (priv->uuid != NULL, FALSE); + + g_message ("Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); + + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr); + if (priv->pid > 0) + start_monitor (self); + + return priv->pid ? TRUE : FALSE; } void @@ -816,6 +867,15 @@ get_property (GObject *object, guint prop_id, case PROP_IFACE: g_value_set_string (value, priv->iface); break; + case PROP_IPV6: + g_value_set_boolean (value, priv->ipv6); + break; + case PROP_UUID: + g_value_set_string (value, priv->uuid); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, priv->timeout); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -833,6 +893,17 @@ set_property (GObject *object, guint prop_id, /* construct-only */ priv->iface = g_strdup (g_value_get_string (value)); break; + case PROP_IPV6: + /* construct-only */ + priv->ipv6 = g_value_get_boolean (value); + break; + case PROP_UUID: + /* construct-only */ + priv->uuid = g_value_dup_string (value); + break; + case PROP_TIMEOUT: + priv->timeout = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -878,6 +949,30 @@ nm_dhcp_client_class_init (NMDHCPClientClass *client_class) NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property + (object_class, PROP_IPV6, + g_param_spec_boolean (NM_DHCP_CLIENT_IPV6, + "ipv6", + "IPv6", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_UUID, + g_param_spec_string (NM_DHCP_CLIENT_UUID, + "uuid", + "UUID", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_TIMEOUT, + g_param_spec_uint (NM_DHCP_CLIENT_TIMEOUT, + "timeout", + "Timeout", + 0, G_MAXUINT, 45, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + /* signals */ signals[STATE_CHANGED] = g_signal_new ("state-changed", diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 5cf77737e1..8b5804f418 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -22,6 +22,8 @@ #include #include +#include +#include #include #define NM_TYPE_DHCP_CLIENT (nm_dhcp_client_get_type ()) @@ -32,6 +34,9 @@ #define NM_DHCP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClientClass)) #define NM_DHCP_CLIENT_INTERFACE "iface" +#define NM_DHCP_CLIENT_IPV6 "ipv6" +#define NM_DHCP_CLIENT_UUID "uuid" +#define NM_DHCP_CLIENT_TIMEOUT "timeout" typedef enum { DHC_NBI = 0, /* no broadcast interfaces found */ @@ -76,9 +81,12 @@ typedef struct { guint32 *out_gwaddr); GPid (*ip4_start) (NMDHCPClient *self, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *anycast_addr); + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr); + + GPid (*ip6_start) (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *anycast_addr); void (*stop) (NMDHCPClient *self); @@ -93,11 +101,17 @@ GPid nm_dhcp_client_get_pid (NMDHCPClient *self); const char *nm_dhcp_client_get_iface (NMDHCPClient *self); -gboolean nm_dhcp_client_start (NMDHCPClient *self, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout_secs, - guint8 *dhcp_anycast_addr); +gboolean nm_dhcp_client_get_ipv6 (NMDHCPClient *self); + +const char *nm_dhcp_client_get_uuid (NMDHCPClient *self); + +gboolean nm_dhcp_client_start_ip4 (NMDHCPClient *self, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr); + +gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr); void nm_dhcp_client_stop (NMDHCPClient *self); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 7eec31d312..899410211f 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -447,21 +447,21 @@ dhclient_child_setup (gpointer user_data G_GNUC_UNUSED) } static GPid -real_ip4_start (NMDHCPClient *client, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) +dhclient_start (NMDHCPClient *client, + const char *ip_opt) { NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); GPtrArray *argv = NULL; GPid pid = 0; GError *error = NULL; - const char *iface; + const char *iface, *uuid; char *binary_name; 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); priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient-%s.pid", iface); if (!priv->pid_file) { @@ -479,12 +479,6 @@ real_ip4_start (NMDHCPClient *client, nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); - priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); - if (!priv->conf_file) { - nm_warning ("%s: error creating dhclient configuration file.", iface); - return -1; - } - priv->lease_file = get_leasefile_for_iface (iface, uuid); if (!priv->lease_file) { nm_warning ("%s: not enough memory for dhclient options.", iface); @@ -496,6 +490,8 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-d"); + g_ptr_array_add (argv, (gpointer) ip_opt); + g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); @@ -523,6 +519,33 @@ real_ip4_start (NMDHCPClient *client, return pid; } +static GPid +real_ip4_start (NMDHCPClient *client, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); + const char *iface; + + iface = nm_dhcp_client_get_iface (client); + + priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); + if (!priv->conf_file) { + nm_warning ("%s: error creating dhclient configuration file.", iface); + return -1; + } + + return dhclient_start (client, "-4"); +} + +static GPid +real_ip6_start (NMDHCPClient *client, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr) +{ + return dhclient_start (client, "-6"); +} + static void real_stop (NMDHCPClient *client) { @@ -698,6 +721,7 @@ nm_dhcp_dhclient_class_init (NMDHCPDhclientClass *dhclient_class) object_class->dispose = dispose; client_class->ip4_start = real_ip4_start; + client_class->ip6_start = real_ip6_start; client_class->stop = real_stop; client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; } diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index fb1fd1bf1c..741fe7f76b 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -62,7 +62,6 @@ dhcpcd_child_setup (gpointer user_data G_GNUC_UNUSED) static GPid real_ip4_start (NMDHCPClient *client, - const char *uuid, NMSettingIP4Config *s_ip4, guint8 *dhcp_anycast_addr) { @@ -71,11 +70,12 @@ real_ip4_start (NMDHCPClient *client, GPid pid = 0; GError *error = NULL; char *pid_contents = NULL, *binary_name; - const char *iface; + const char *iface, *uuid; g_return_val_if_fail (priv->pid_file == NULL, -1); iface = nm_dhcp_client_get_iface (client); + uuid = nm_dhcp_client_get_uuid (client); priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhcpcd-%s.pid", iface); if (!priv->pid_file) { @@ -120,6 +120,15 @@ real_ip4_start (NMDHCPClient *client, return pid; } +static GPid +real_ip6_start (NMDHCPClient *client, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr) +{ + g_warning ("The dhcpcd backend does not support IPv6."); + return -1; +} + static void real_stop (NMDHCPClient *client) { @@ -238,6 +247,7 @@ nm_dhcp_dhcpcd_class_init (NMDHCPDhcpcdClass *dhcpcd_class) object_class->dispose = dispose; client_class->ip4_start = real_ip4_start; + client_class->ip6_start = real_ip6_start; client_class->stop = real_stop; client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; } diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 6da14ed145..7d9cca5707 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -47,6 +47,8 @@ #define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" #define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" +#define DHCP_TIMEOUT 45 /* default DHCP timeout, in seconds */ + static NMDHCPManager *singleton = NULL; typedef GSList * (*GetLeaseConfigFunc) (const char *iface, const char *uuid); @@ -124,7 +126,8 @@ get_client_for_pid (NMDHCPManager *manager, GPid pid) static NMDHCPClient * get_client_for_iface (NMDHCPManager *manager, - const char *iface) + const char *iface, + gboolean ip6) { NMDHCPManagerPrivate *priv; GHashTableIter iter; @@ -140,7 +143,8 @@ get_client_for_iface (NMDHCPManager *manager, while (g_hash_table_iter_next (&iter, NULL, &value)) { NMDHCPClient *candidate = NM_DHCP_CLIENT (value); - if (!strcmp (iface, nm_dhcp_client_get_iface (candidate))) + if ( !strcmp (iface, nm_dhcp_client_get_iface (candidate)) + && (nm_dhcp_client_get_ipv6 (candidate) == ip6)) return candidate; } @@ -355,28 +359,29 @@ add_client (NMDHCPManager *self, NMDHCPClient *client) g_hash_table_insert (priv->clients, client, g_object_ref (client)); } -/* Caller owns a reference to the NMDHCPClient on return */ -NMDHCPClient * -nm_dhcp_manager_start_client (NMDHCPManager *self, - const char *iface, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout, - guint8 *dhcp_anycast_addr) +static NMDHCPClient * +client_start (NMDHCPManager *self, + const char *iface, + const char *uuid, + gboolean ipv6, + NMSettingIP4Config *s_ip4, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr) { NMDHCPManagerPrivate *priv; NMDHCPClient *client; - NMSettingIP4Config *setting = NULL; gboolean success = FALSE; g_return_val_if_fail (self, NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (uuid != NULL, NULL); priv = NM_DHCP_MANAGER_GET_PRIVATE (self); /* Kill any old client instance */ - client = get_client_for_iface (self, iface); + client = get_client_for_iface (self, iface, ipv6); if (client) { nm_dhcp_client_stop (client); remove_client (self, client); @@ -385,29 +390,17 @@ nm_dhcp_manager_start_client (NMDHCPManager *self, /* And make a new one */ client = g_object_new (priv->client_type, NM_DHCP_CLIENT_INTERFACE, iface, + NM_DHCP_CLIENT_IPV6, ipv6, + NM_DHCP_CLIENT_UUID, uuid, + NM_DHCP_CLIENT_TIMEOUT, timeout ? timeout : DHCP_TIMEOUT, NULL); g_return_val_if_fail (client != NULL, NULL); add_client (self, client); - if ( s_ip4 - && nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) - && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) - && priv->hostname_provider != NULL) { - - /* We're asked to send the hostname to DHCP server, the hostname - * isn't specified, and a hostname provider is registered: use that - */ - setting = NM_SETTING_IP4_CONFIG (nm_setting_duplicate (NM_SETTING (s_ip4))); - g_object_set (G_OBJECT (setting), - NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, - nm_hostname_provider_get_hostname (priv->hostname_provider), - NULL); - } - - success = nm_dhcp_client_start (client, uuid, setting, timeout, dhcp_anycast_addr); - - if (setting) - g_object_unref (setting); + if (ipv6) + success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); + else + success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr); if (!success) { remove_client (self, client); @@ -418,6 +411,61 @@ nm_dhcp_manager_start_client (NMDHCPManager *self, return client; } +/* Caller owns a reference to the NMDHCPClient on return */ +NMDHCPClient * +nm_dhcp_manager_start_ip4 (NMDHCPManager *self, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr) +{ + NMDHCPManagerPrivate *priv; + NMDHCPClient *client = NULL; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + + if (s_ip4) { + if ( nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) + && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) + && priv->hostname_provider != NULL) { + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_duplicate (NM_SETTING (s_ip4))); + + /* We're asked to send the hostname to DHCP server, the hostname + * isn't specified, and a hostname provider is registered: use that + */ + g_object_set (G_OBJECT (s_ip4), + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + nm_hostname_provider_get_hostname (priv->hostname_provider), + NULL); + } else + g_object_ref (s_ip4); + } + + client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr); + + if (s_ip4) + g_object_unref (s_ip4); + + return client; +} + +/* Caller owns a reference to the NMDHCPClient on return */ +NMDHCPClient * +nm_dhcp_manager_start_ip6 (NMDHCPManager *self, + const char *iface, + const char *uuid, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr) +{ + return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr); +} + static void hostname_provider_destroyed (gpointer data, GObject *destroyed_object) { diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index dab33601ae..690241482b 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -26,6 +26,7 @@ #include #include +#include #include "nm-dhcp-client.h" #include "nm-ip4-config.h" @@ -54,12 +55,19 @@ NMDHCPManager *nm_dhcp_manager_get (void); void nm_dhcp_manager_set_hostname_provider(NMDHCPManager *manager, NMHostnameProvider *provider); -NMDHCPClient * nm_dhcp_manager_start_client (NMDHCPManager *manager, - const char *iface, - const char *uuid, - NMSettingIP4Config *s_ip4, - guint32 timeout, - guint8 *dhcp_anycast_addr); +NMDHCPClient * nm_dhcp_manager_start_ip4 (NMDHCPManager *manager, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr); + +NMDHCPClient * nm_dhcp_manager_start_ip6 (NMDHCPManager *manager, + const char *iface, + const char *uuid, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr); GSList * nm_dhcp_manager_get_lease_config (NMDHCPManager *self, const char *iface, diff --git a/src/nm-device.c b/src/nm-device.c index 586c93949c..2b809470b2 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1215,12 +1215,12 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) /* DHCP manager will cancel any transaction already in progress and we do not want to cancel this activation if we get "down" state from that. */ - priv->dhcp4_client = nm_dhcp_manager_start_client (priv->dhcp_manager, - ip_iface, - uuid, - s_ip4, - priv->dhcp_timeout, - anycast); + priv->dhcp4_client = nm_dhcp_manager_start_ip4 (priv->dhcp_manager, + ip_iface, + uuid, + s_ip4, + priv->dhcp_timeout, + anycast); if (priv->dhcp4_client) { priv->dhcp_state_sigid = g_signal_connect (priv->dhcp4_client, "state-changed", From 3568a98a61019a6b1e3ad0f82b0b8d30ce3f0403 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 13 Jan 2010 17:59:19 -0800 Subject: [PATCH 024/392] dhcp: fix dhcp 4/6 mixup --- src/dhcp-manager/nm-dhcp-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 7d9cca5707..9dc90ac76b 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -398,9 +398,9 @@ client_start (NMDHCPManager *self, add_client (self, client); if (ipv6) - success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); - else success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr); + else + success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); if (!success) { remove_client (self, client); From 2a718bbb1b4e8a128193f3d64851a927de041071 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 13 Jan 2010 17:59:54 -0800 Subject: [PATCH 025/392] core: simplify DHCP setup and cleanup nm_device_set_use_dhcp() and nm_device_get_use_dhcp() were somewhat confusing and don't really reflect the new DHCP architecture with NMDHCPClient. Now that timeout and state signals are specific to the NMDHCPClient it doesn't make sense to check for DHCP use in the callbacks for those signals since they'll never get called if DHCP isn't in use. We might as well just keep the DHCP manager around and check whether a DHCP client instance exists when we need to figure out whether DHCP is in use. --- src/nm-device.c | 138 ++++++++++++++++++++---------------------------- src/nm-device.h | 3 -- 2 files changed, 57 insertions(+), 84 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 2b809470b2..3c4b81c9cf 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -102,9 +102,10 @@ typedef struct { gboolean ip4_ready; gboolean ip6_ready; + NMDHCPManager * dhcp_manager; + /* IP4 configuration info */ NMIP4Config * ip4_config; /* Config from DHCP, PPP, or system config files */ - NMDHCPManager * dhcp_manager; NMDHCPClient * dhcp4_client; guint32 dhcp_timeout; gulong dhcp_state_sigid; @@ -221,6 +222,8 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (dev)->update_hw_address) NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev); + priv->dhcp_manager = nm_dhcp_manager_get (); + priv->initialized = TRUE; return object; @@ -1077,11 +1080,6 @@ handle_dhcp_lease_change (NMDevice *device) NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; gboolean assumed; - if (!nm_device_get_use_dhcp (device)) { - nm_warning ("got DHCP rebind for device that wasn't using DHCP."); - return; - } - config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); if (!config) { nm_warning ("failed to get DHCP config for rebind"); @@ -1146,14 +1144,11 @@ dhcp_state_changed (NMDHCPClient *client, case DHC_END: /* dhclient exited normally */ nm_dhcp4_config_reset (priv->dhcp4_config); - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + /* dhclient quit and can't get/renew a lease; so kill the connection */ + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DHCP_FAILED); - } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { - if (nm_device_get_use_dhcp (device)) { - /* dhclient quit and therefore can't renew our lease, kill the conneciton */ - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - } - } + else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); break; default: break; @@ -1207,11 +1202,15 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); guint8 *anycast = NULL; + /* Begin a DHCP transaction on the interface */ + if (priv->dhcp_anycast_address) anycast = priv->dhcp_anycast_address->data; - /* Begin a DHCP transaction on the interface */ - nm_device_set_use_dhcp (self, TRUE); + /* Clear old exported DHCP options */ + if (priv->dhcp4_config) + g_object_unref (priv->dhcp4_config); + priv->dhcp4_config = nm_dhcp4_config_new (); /* DHCP manager will cancel any transaction already in progress and we do not want to cancel this activation if we get "down" state from that. */ @@ -1431,7 +1430,8 @@ real_act_stage4_get_ip4_config (NMDevice *self, s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - if (nm_device_get_use_dhcp (self)) { + if (priv->dhcp4_client) { + /* DHCP */ *config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); if (*config) { /* Merge user-defined overrides into the IP4Config to be applied */ @@ -1447,6 +1447,7 @@ real_act_stage4_get_ip4_config (NMDevice *self, } else *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; } else { + /* Not DHCP */ const char *method; g_assert (s_ip4); @@ -2102,6 +2103,37 @@ delayed_transitions_clear (NMDevice *self) } } +static void +dhcp4_cleanup (NMDevice *self, gboolean stop) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->dhcp4_config) { + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); + g_object_unref (priv->dhcp4_config); + priv->dhcp4_config = NULL; + } + + if (priv->dhcp4_client) { + /* Stop any ongoing DHCP transaction on this device */ + if (priv->dhcp_state_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_state_sigid); + priv->dhcp_state_sigid = 0; + } + + if (priv->dhcp_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_timeout_sigid); + priv->dhcp_timeout_sigid = 0; + } + + if (stop) + nm_dhcp_client_stop (priv->dhcp4_client); + + g_object_unref (priv->dhcp4_client); + priv->dhcp4_client = NULL; + } +} + /* * nm_device_deactivate_quickly * @@ -2127,12 +2159,9 @@ nm_device_deactivate_quickly (NMDevice *self) delayed_transitions_clear (self); if (nm_device_get_act_request (self)) { - if (nm_device_get_use_dhcp (self)) { - nm_device_set_use_dhcp (self, FALSE); + dhcp4_cleanup (self, TRUE); - /* Notify of invalid DHCP4 config */ - g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); - } else if (priv->dnsmasq_manager) { + if (priv->dnsmasq_manager) { /* Or any shared connection */ if (priv->dnsmasq_state_id) { g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); @@ -2362,64 +2391,6 @@ nm_device_can_interrupt_activation (NMDevice *self) /* IP Configuration stuff */ -gboolean -nm_device_get_use_dhcp (NMDevice *self) -{ - g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); - - return NM_DEVICE_GET_PRIVATE (self)->dhcp_manager ? TRUE : FALSE; -} - -void -nm_device_set_use_dhcp (NMDevice *self, - gboolean use_dhcp) -{ - NMDevicePrivate *priv; - - g_return_if_fail (NM_IS_DEVICE (self)); - - priv = NM_DEVICE_GET_PRIVATE (self); - - if (use_dhcp) { - /* New exported DHCP4 config */ - if (priv->dhcp4_config) - g_object_unref (priv->dhcp4_config); - priv->dhcp4_config = nm_dhcp4_config_new (); - - if (!priv->dhcp_manager) - priv->dhcp_manager = nm_dhcp_manager_get (); - } else { - if (priv->dhcp4_config) { - g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); - g_object_unref (priv->dhcp4_config); - priv->dhcp4_config = NULL; - } - - if (priv->dhcp4_client) { - /* Stop any ongoing DHCP transaction on this device */ - if (priv->dhcp_state_sigid) { - g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_state_sigid); - priv->dhcp_state_sigid = 0; - } - - if (priv->dhcp_timeout_sigid) { - g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_timeout_sigid); - priv->dhcp_timeout_sigid = 0; - } - - nm_dhcp_client_stop (priv->dhcp4_client); - - g_object_unref (priv->dhcp4_client); - priv->dhcp4_client = NULL; - } - - if (priv->dhcp_manager) { - g_object_unref (priv->dhcp_manager); - priv->dhcp_manager = NULL; - } - } -} - NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *self) { @@ -2766,12 +2737,15 @@ dispose (GObject *object) /* Clear any delayed transitions */ delayed_transitions_clear (self); + /* Clean up and stop DHCP */ + dhcp4_cleanup (self, take_down); + + /* Take the device itself down and clear it's IPv4 configuration */ if (priv->managed && take_down) { NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; nm_device_take_down (self, FALSE, NM_DEVICE_STATE_REASON_REMOVED); nm_device_set_ip4_config (self, NULL, FALSE, &ignored); - nm_device_set_use_dhcp (self, FALSE); } clear_act_request (self); @@ -2802,6 +2776,8 @@ finalize (GObject *object) NMDevice *self = NM_DEVICE (object); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + g_object_unref (priv->dhcp_manager); + g_free (priv->udi); g_free (priv->iface); g_free (priv->ip_iface); @@ -2892,7 +2868,7 @@ get_property (GObject *object, guint prop_id, break; case NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG: if ( ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) - && nm_device_get_use_dhcp (self)) + && priv->dhcp4_client) g_value_set_boxed (value, nm_dhcp4_config_get_dbus_path (priv->dhcp4_config)); else g_value_set_boxed (value, "/"); diff --git a/src/nm-device.h b/src/nm-device.h index b81c460d6e..6300be535f 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -140,9 +140,6 @@ int nm_device_get_priority (NMDevice *dev); guint32 nm_device_get_ip4_address (NMDevice *dev); void nm_device_update_ip4_address (NMDevice *dev); -gboolean nm_device_get_use_dhcp (NMDevice *dev); -void nm_device_set_use_dhcp (NMDevice *dev, - gboolean use_dhcp); NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *dev); NMIP4Config * nm_device_get_ip4_config (NMDevice *dev); From 9e805187cdc49acc8f675f36dc6ae1bdbf8d4389 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 13 Jan 2010 18:06:05 -0800 Subject: [PATCH 026/392] core: rename some DHCPv4 specific variables --- src/nm-device.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 3c4b81c9cf..4f4a43d87c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -102,15 +102,16 @@ typedef struct { gboolean ip4_ready; gboolean ip6_ready; + /* Generic DHCP stuff */ NMDHCPManager * dhcp_manager; + guint32 dhcp_timeout; + GByteArray * dhcp_anycast_address; /* IP4 configuration info */ NMIP4Config * ip4_config; /* Config from DHCP, PPP, or system config files */ NMDHCPClient * dhcp4_client; - guint32 dhcp_timeout; - gulong dhcp_state_sigid; - gulong dhcp_timeout_sigid; - GByteArray * dhcp_anycast_address; + gulong dhcp4_state_sigid; + gulong dhcp4_timeout_sigid; NMDHCP4Config * dhcp4_config; /* dnsmasq stuff for shared connections */ @@ -1221,14 +1222,14 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) priv->dhcp_timeout, anycast); if (priv->dhcp4_client) { - priv->dhcp_state_sigid = g_signal_connect (priv->dhcp4_client, - "state-changed", - G_CALLBACK (dhcp_state_changed), - self); - priv->dhcp_timeout_sigid = g_signal_connect (priv->dhcp4_client, - "timeout", - G_CALLBACK (dhcp_timeout), - self); + priv->dhcp4_state_sigid = g_signal_connect (priv->dhcp4_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp4_timeout_sigid = g_signal_connect (priv->dhcp4_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); /* DHCP devices will be notified by the DHCP manager when * stuff happens. @@ -2116,14 +2117,14 @@ dhcp4_cleanup (NMDevice *self, gboolean stop) if (priv->dhcp4_client) { /* Stop any ongoing DHCP transaction on this device */ - if (priv->dhcp_state_sigid) { - g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_state_sigid); - priv->dhcp_state_sigid = 0; + if (priv->dhcp4_state_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp4_state_sigid); + priv->dhcp4_state_sigid = 0; } - if (priv->dhcp_timeout_sigid) { - g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp_timeout_sigid); - priv->dhcp_timeout_sigid = 0; + if (priv->dhcp4_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp4_timeout_sigid); + priv->dhcp4_timeout_sigid = 0; } if (stop) From 439768db3d5079cf0473c7af1ef0aee1c95fbe57 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 13 Jan 2010 22:30:40 -0800 Subject: [PATCH 027/392] dhcp: add the NMDHCP6Config object --- introspection/Makefile.am | 1 + introspection/all.xml | 1 + introspection/nm-dhcp6-config.xml | 20 ++++ src/Makefile.am | 8 +- src/nm-dhcp6-config.c | 192 ++++++++++++++++++++++++++++++ src/nm-dhcp6-config.h | 61 ++++++++++ 6 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 introspection/nm-dhcp6-config.xml create mode 100644 src/nm-dhcp6-config.c create mode 100644 src/nm-dhcp6-config.h diff --git a/introspection/Makefile.am b/introspection/Makefile.am index 0dc286a9cd..a70d28511a 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -23,5 +23,6 @@ EXTRA_DIST = \ nm-vpn-connection.xml \ nm-ppp-manager.xml \ nm-active-connection.xml \ + nm-dhcp4-config.xml \ nm-dhcp4-config.xml diff --git a/introspection/all.xml b/introspection/all.xml index 67f1e54216..d6b2f23674 100644 --- a/introspection/all.xml +++ b/introspection/all.xml @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + diff --git a/introspection/nm-dhcp6-config.xml b/introspection/nm-dhcp6-config.xml new file mode 100644 index 0000000000..93b0f1c8f0 --- /dev/null +++ b/introspection/nm-dhcp6-config.xml @@ -0,0 +1,20 @@ + + + + + + Options and configuration returned by the IPv6 DHCP server. + + + Configuration options returned by a DHCP server, if any. + + + + + + A dictionary mapping property names to variant boxed values + + + + + diff --git a/src/Makefile.am b/src/Makefile.am index 60aa93ee15..7111ac3e5d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -114,6 +114,8 @@ NetworkManager_SOURCES = \ nm-netlink.h \ nm-dhcp4-config.c \ nm-dhcp4-config.h \ + nm-dhcp6-config.c \ + nm-dhcp6-config.h \ nm-rfkill.h nm-access-point-glue.h: $(top_srcdir)/introspection/nm-access-point.xml @@ -149,6 +151,9 @@ nm-active-connection-glue.h: $(top_srcdir)/introspection/nm-active-connection.xm nm-dhcp4-config-glue.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< +nm-dhcp6-config-glue.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-server --output=$@ $< + BUILT_SOURCES = \ nm-access-point-glue.h \ nm-manager-glue.h \ @@ -160,7 +165,8 @@ BUILT_SOURCES = \ nm-ip4-config-glue.h \ nm-ip6-config-glue.h \ nm-active-connection-glue.h \ - nm-dhcp4-config-glue.h + nm-dhcp4-config-glue.h \ + nm-dhcp6-config-glue.h NetworkManager_CPPFLAGS = \ $(DBUS_CFLAGS) \ diff --git a/src/nm-dhcp6-config.c b/src/nm-dhcp6-config.c new file mode 100644 index 0000000000..fb6ccce50a --- /dev/null +++ b/src/nm-dhcp6-config.c @@ -0,0 +1,192 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include +#include + +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-dhcp6-config.h" +#include "nm-dhcp6-config-glue.h" +#include "nm-dbus-glib-types.h" +#include "nm-properties-changed-signal.h" +#include "nm-utils.h" + + +G_DEFINE_TYPE (NMDHCP6Config, nm_dhcp6_config, G_TYPE_OBJECT) + +#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigPrivate)) + +typedef struct { + char *dbus_path; + GHashTable *options; +} NMDHCP6ConfigPrivate; + + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +NMDHCP6Config * +nm_dhcp6_config_new (void) +{ + return NM_DHCP6_CONFIG (g_object_new (NM_TYPE_DHCP6_CONFIG, NULL)); +} + +void +nm_dhcp6_config_add_option (NMDHCP6Config *self, + const char *key, + const char *option) +{ + GValue *svalue; + + g_return_if_fail (NM_IS_DHCP6_CONFIG (self)); + g_return_if_fail (key != NULL); + g_return_if_fail (option != NULL); + + svalue = g_slice_new0 (GValue); + g_value_init (svalue, G_TYPE_STRING); + g_value_set_string (svalue, option); + g_hash_table_insert (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options, g_strdup (key), svalue); + g_object_notify (G_OBJECT (self), NM_DHCP6_CONFIG_OPTIONS); +} + +void +nm_dhcp6_config_reset (NMDHCP6Config *self) +{ + g_return_if_fail (NM_IS_DHCP6_CONFIG (self)); + + g_hash_table_remove_all (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options); + g_object_notify (G_OBJECT (self), NM_DHCP6_CONFIG_OPTIONS); +} + +const char * +nm_dhcp6_config_get_option (NMDHCP6Config *self, const char *key) +{ + GValue *value; + + g_return_val_if_fail (NM_IS_DHCP6_CONFIG (self), NULL); + g_return_val_if_fail (key != NULL, NULL); + + value = g_hash_table_lookup (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options, key); + return value ? g_value_get_string (value) : NULL; +} + +const char * +nm_dhcp6_config_get_dbus_path (NMDHCP6Config *self) +{ + g_return_val_if_fail (NM_IS_DHCP6_CONFIG (self), NULL); + + return NM_DHCP6_CONFIG_GET_PRIVATE (self)->dbus_path; +} + +static void +nm_gvalue_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static void +nm_dhcp6_config_init (NMDHCP6Config *self) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (self); + static guint32 counter = 0; + DBusGConnection *connection; + NMDBusManager *dbus_mgr; + + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP6Config/%d", counter++); + dbus_g_connection_register_g_object (connection, priv->dbus_path, G_OBJECT (self)); + g_object_unref (dbus_mgr); + + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); +} + +static void +finalize (GObject *object) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + g_free (priv->dbus_path); + g_hash_table_destroy (priv->options); + + G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_OPTIONS: + g_value_set_boxed (value, priv->options); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_dhcp6_config_class_init (NMDHCP6ConfigClass *config_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (config_class); + + g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, + "Options", + "DHCP configuration options returned by the server", + DBUS_TYPE_G_MAP_OF_VARIANT, + G_PARAM_READABLE)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDHCP6ConfigClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), + &dbus_glib_nm_dhcp6_config_object_info); +} diff --git a/src/nm-dhcp6-config.h b/src/nm-dhcp6-config.h new file mode 100644 index 0000000000..90eb10ffb5 --- /dev/null +++ b/src/nm-dhcp6-config.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_DHCP6_CONFIG_H +#define NM_DHCP6_CONFIG_H + +#include +#include + +#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ()) +#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6Config)) +#define NM_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) +#define NM_IS_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP6_CONFIG)) +#define NM_IS_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP6_CONFIG)) +#define NM_DHCP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) + +typedef struct { + GObject parent; +} NMDHCP6Config; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*properties_changed) (NMDHCP6Config *config, GHashTable *properties); +} NMDHCP6ConfigClass; + +#define NM_DHCP6_CONFIG_OPTIONS "options" + +GType nm_dhcp6_config_get_type (void); + +NMDHCP6Config *nm_dhcp6_config_new (void); + +const char *nm_dhcp6_config_get_dbus_path (NMDHCP6Config *config); + +void nm_dhcp6_config_add_option (NMDHCP6Config *config, + const char *key, + const char *option); + +void nm_dhcp6_config_reset (NMDHCP6Config *config); + +const char *nm_dhcp6_config_get_option (NMDHCP6Config *config, const char *option); + +#endif /* NM_DHCP6_CONFIG_H */ From f094e0ad9df39030cacb14371c58af4b4d4ae5ce Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Jan 2010 00:39:58 -0800 Subject: [PATCH 028/392] dhcp: dhclient leasefile and pidfile fixes for IPv6 Don't use the same lease and pid files for IPv6 as for IPv4. --- src/dhcp-manager/nm-dhcp-dhclient.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 899410211f..2ab6aba825 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -61,10 +61,11 @@ typedef struct { static char * -get_leasefile_for_iface (const char * iface, const char *uuid) +get_leasefile_for_iface (const char * iface, const char *uuid, gboolean ipv6) { - return g_strdup_printf ("%s/dhclient-%s-%s.lease", + return g_strdup_printf ("%s/dhclient%s-%s-%s.lease", NM_DHCLIENT_LEASE_DIR, + ipv6 ? "6" : "", uuid, iface); } @@ -118,7 +119,7 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) char **line, **split = NULL; GHashTable *hash = NULL; - leasefile = get_leasefile_for_iface (iface, uuid); + leasefile = get_leasefile_for_iface (iface, uuid, FALSE); if (!leasefile) return NULL; @@ -456,14 +457,18 @@ dhclient_start (NMDHCPClient *client, GError *error = NULL; const char *iface, *uuid; char *binary_name; + gboolean ipv6; 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); - priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient-%s.pid", iface); + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", + ipv6 ? "6" : "", + iface); if (!priv->pid_file) { nm_warning ("%s: not enough memory for dhcpcd options.", iface); return -1; @@ -479,7 +484,7 @@ dhclient_start (NMDHCPClient *client, nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); - priv->lease_file = get_leasefile_for_iface (iface, uuid); + priv->lease_file = get_leasefile_for_iface (iface, uuid, ipv6); if (!priv->lease_file) { nm_warning ("%s: not enough memory for dhclient options.", iface); return -1; @@ -501,8 +506,10 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-lf"); /* Set lease file */ g_ptr_array_add (argv, (gpointer) priv->lease_file); - g_ptr_array_add (argv, (gpointer) "-cf"); /* Set interface config file */ - g_ptr_array_add (argv, (gpointer) priv->conf_file); + if (priv->conf_file) { + g_ptr_array_add (argv, (gpointer) "-cf"); /* Set interface config file */ + g_ptr_array_add (argv, (gpointer) priv->conf_file); + } g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); From a9e32f3c3b55a0d6ab3e5ce4baa8dc4977d75301 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Jan 2010 00:45:10 -0800 Subject: [PATCH 029/392] dhcp: add initial DHCPv6 support (managed mode only) --- src/Makefile.am | 1 + src/dhcp-manager/nm-dhcp-client.c | 147 +++++++++- src/dhcp-manager/nm-dhcp-client.h | 10 +- src/nm-device-interface.c | 8 + src/nm-device-interface.h | 2 + src/nm-device.c | 449 +++++++++++++++++++++--------- src/nm-device.h | 2 + 7 files changed, 462 insertions(+), 157 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7111ac3e5d..db255ca357 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,6 +37,7 @@ noinst_LTLIBRARIES = libtest-dhcp.la libtest_dhcp_la_SOURCES = \ nm-ip4-config.c \ + nm-ip6-config.c \ nm-hostname-provider.c \ nm-dbus-manager.c diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 382b7d4a91..03373d7172 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -375,6 +375,7 @@ typedef struct { static DhcState state_table[] = { { DHC_NBI, "nbi" }, { DHC_PREINIT, "preinit" }, + { DHC_PREINIT6,"preinit6" }, { DHC_BOUND4, "bound" }, { DHC_BOUND6, "bound6" }, { DHC_IPV4LL, "ipv4ll" }, @@ -507,7 +508,8 @@ nm_dhcp_client_new_options (NMDHCPClient *self, } priv->state = new_state; - g_message ("DHCP: device %s state changed %s -> %s", + g_message ("DHCPv%c: device %s state changed %s -> %s", + priv->ipv6 ? '6' : '4', priv->iface, state_to_string (old_state), state_to_string (priv->state)); @@ -524,14 +526,14 @@ nm_dhcp_client_new_options (NMDHCPClient *self, typedef struct { GHFunc func; gpointer user_data; -} Dhcp4ForeachInfo; +} DhcpForeachInfo; static void -iterate_dhcp4_config_option (gpointer key, - gpointer value, - gpointer user_data) +iterate_dhcp_config_option (gpointer key, + gpointer value, + gpointer user_data) { - Dhcp4ForeachInfo *info = (Dhcp4ForeachInfo *) user_data; + DhcpForeachInfo *info = (DhcpForeachInfo *) user_data; char *tmp_key = NULL; const char **p; static const char *filter_options[] = { @@ -557,12 +559,12 @@ iterate_dhcp4_config_option (gpointer key, } gboolean -nm_dhcp_client_foreach_dhcp4_option (NMDHCPClient *self, - GHFunc func, - gpointer user_data) +nm_dhcp_client_foreach_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data) { NMDHCPClientPrivate *priv; - Dhcp4ForeachInfo info = { NULL, NULL }; + DhcpForeachInfo info = { NULL, NULL }; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); @@ -577,7 +579,7 @@ nm_dhcp_client_foreach_dhcp4_option (NMDHCPClient *self, info.func = func; info.user_data = user_data; - g_hash_table_foreach (priv->options, iterate_dhcp4_config_option, &info); + g_hash_table_foreach (priv->options, iterate_dhcp_config_option, &info); return TRUE; } @@ -629,14 +631,14 @@ out: } static void -process_domain_search (NMIP4Config *ip4_config, const char *str) +process_domain_search (const char *str, GFunc add_func, gpointer user_data) { char **searches, **s; char *unescaped, *p; int i; g_return_if_fail (str != NULL); - g_return_if_fail (ip4_config != NULL); + g_return_if_fail (add_func != NULL); p = unescaped = g_strdup (str); do { @@ -658,7 +660,7 @@ process_domain_search (NMIP4Config *ip4_config, const char *str) for (s = searches; *s; s++) { if (strlen (*s)) { g_message (" domain search '%s'", *s); - nm_ip4_config_add_search (ip4_config, *s); + add_func (*s, user_data); } } g_strfreev (searches); @@ -667,6 +669,12 @@ out: g_free (unescaped); } +static void +ip4_add_domain_search (gpointer data, gpointer user_data) +{ + nm_ip4_config_add_search (NM_IP4_CONFIG (user_data), (const char *) data); +} + /* Given a table of DHCP options from the client, convert into an IP4Config */ static NMIP4Config * ip4_options_to_config (NMDHCPClient *self) @@ -789,7 +797,7 @@ ip4_options_to_config (NMDHCPClient *self) str = g_hash_table_lookup (priv->options, "new_domain_search"); if (str) - process_domain_search (ip4_config, str); + process_domain_search (str, ip4_add_domain_search, ip4_config); str = g_hash_table_lookup (priv->options, "new_netbios_name_servers"); if (str) { @@ -848,6 +856,115 @@ nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) /********************************************/ +static void +ip6_add_domain_search (gpointer data, gpointer user_data) +{ + nm_ip6_config_add_search (NM_IP6_CONFIG (user_data), (const char *) data); +} + +/* Given a table of DHCP options from the client, convert into an IP6Config */ +static NMIP6Config * +ip6_options_to_config (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + NMIP6Config *ip6_config = NULL; + struct in6_addr tmp_addr; + NMIP6Address *addr = NULL; + char *str = NULL; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->options != NULL, NULL); + + ip6_config = nm_ip6_config_new (); + if (!ip6_config) { + g_warning ("%s: couldn't allocate memory for an IP6Config!", priv->iface); + return NULL; + } + + addr = nm_ip6_address_new (); + if (!addr) { + g_warning ("%s: couldn't allocate memory for an IP6 Address!", priv->iface); + goto error; + } + + str = g_hash_table_lookup (priv->options, "new_ip6_address"); + if (str && (inet_pton (AF_INET6, str, &tmp_addr) > 0)) { + nm_ip6_address_set_address (addr, &tmp_addr); + g_message (" address %s", str); + } else + goto error; + + str = g_hash_table_lookup (priv->options, "new_ip6_prefixlen"); + if (str) { + long unsigned int prefix; + + errno = 0; + prefix = strtoul (str, NULL, 10); + if (errno != 0 || prefix > 128) + goto error; + + nm_ip6_address_set_prefix (addr, (guint32) prefix); + g_message (" prefix %lu", prefix); + } + + nm_ip6_config_take_address (ip6_config, addr); + addr = NULL; + + str = g_hash_table_lookup (priv->options, "new_host_name"); + if (str) + g_message (" hostname '%s'", str); + + str = g_hash_table_lookup (priv->options, "new_dhcp6_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET6, *s, &tmp_addr) > 0) { + nm_ip6_config_add_nameserver (ip6_config, &tmp_addr); + g_message (" nameserver '%s'", *s); + } else + g_warning ("Ignoring invalid nameserver '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_dhcp6_domain_search"); + if (str) + process_domain_search (str, ip6_add_domain_search, ip6_config); + + return ip6_config; + +error: + if (addr) + nm_ip6_address_unref (addr); + g_object_unref (ip6_config); + return NULL; +} + +NMIP6Config * +nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (test && !state_is_bound (priv->state)) { + g_warning ("%s: dhcp client didn't bind to a lease.", priv->iface); + return NULL; + } + + return ip6_options_to_config (self); +} + +/********************************************/ + static void nm_dhcp_client_init (NMDHCPClient *self) { diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 8b5804f418..50c49bbc8a 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -25,6 +25,7 @@ #include #include #include +#include #define NM_TYPE_DHCP_CLIENT (nm_dhcp_client_get_type ()) #define NM_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClient)) @@ -41,6 +42,7 @@ typedef enum { DHC_NBI = 0, /* no broadcast interfaces found */ DHC_PREINIT, /* configuration started */ + DHC_PREINIT6, /* configuration started */ DHC_BOUND4, /* IPv4 lease obtained */ DHC_BOUND6, /* IPv6 lease obtained */ DHC_IPV4LL, /* IPv4LL address obtained */ @@ -119,12 +121,14 @@ void nm_dhcp_client_new_options (NMDHCPClient *self, GHashTable *options, const char *reason); -gboolean nm_dhcp_client_foreach_dhcp4_option (NMDHCPClient *self, - GHFunc func, - gpointer user_data); +gboolean nm_dhcp_client_foreach_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data); NMIP4Config *nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test); +NMIP6Config *nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test); + /* Backend helpers */ void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name); diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index 70cce8b624..f0a4fd1c6b 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -137,6 +137,14 @@ nm_device_interface_init (gpointer g_iface) DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_boxed (NM_DEVICE_INTERFACE_DHCP6_CONFIG, + "DHCP6 Config", + "DHCP6 Config", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READWRITE)); + g_object_interface_install_property (g_iface, g_param_spec_uint (NM_DEVICE_INTERFACE_STATE, diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 0ec5e3da14..306f2dbe6d 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -53,6 +53,7 @@ typedef enum #define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config" #define NM_DEVICE_INTERFACE_DHCP4_CONFIG "dhcp4-config" #define NM_DEVICE_INTERFACE_IP6_CONFIG "ip6-config" +#define NM_DEVICE_INTERFACE_DHCP6_CONFIG "dhcp6-config" #define NM_DEVICE_INTERFACE_STATE "state" #define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ #define NM_DEVICE_INTERFACE_MANAGED "managed" @@ -69,6 +70,7 @@ typedef enum { NM_DEVICE_INTERFACE_PROP_IP4_CONFIG, NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG, NM_DEVICE_INTERFACE_PROP_IP6_CONFIG, + NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG, NM_DEVICE_INTERFACE_PROP_STATE, NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE, NM_DEVICE_INTERFACE_PROP_MANAGED, diff --git a/src/nm-device.c b/src/nm-device.c index 4f4a43d87c..daf3d111cd 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -131,6 +131,11 @@ typedef struct { gulong ip6_config_changed_sigid; gboolean ip6_waiting_for_config; + NMDHCPClient * dhcp6_client; + gulong dhcp6_state_sigid; + gulong dhcp6_timeout_sigid; + NMDHCP6Config * dhcp6_config; + /* inhibit autoconnect feature */ gboolean autoconnect_inhibit; } NMDevicePrivate; @@ -566,49 +571,57 @@ ip6_config_changed (NMIP6Manager *ip6_manager, nm_device_activate_schedule_stage4_ip6_config_get (self); } -static void -nm_device_setup_ip6 (NMDevice *self) +static gboolean +ip6_method_matches (NMConnection *connection, const char *match) { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - NMActRequest *req; - NMConnection *connection; - const char *ip_iface, *method = NULL; NMSettingIP6Config *s_ip6; - - req = nm_device_get_act_request (self); - if (!req) - return; - connection = nm_act_request_get_connection (req); - if (!connection) - return; + const char *method = NULL; s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); if (s_ip6) method = nm_setting_ip6_config_get_method (s_ip6); - if (!method || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + return method && !strcmp (method, match); +} + +static void +addrconf6_setup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection; + const char *ip_iface; + NMSettingIP6Config *s_ip6; + + priv->ip6_waiting_for_config = FALSE; + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + if (!ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) return; if (!priv->ip6_manager) { priv->ip6_manager = nm_ip6_manager_get (); priv->ip6_addrconf_sigid = g_signal_connect (priv->ip6_manager, - "addrconf-complete", - G_CALLBACK (ip6_addrconf_complete), - self); + "addrconf-complete", + G_CALLBACK (ip6_addrconf_complete), + self); priv->ip6_config_changed_sigid = g_signal_connect (priv->ip6_manager, - "config-changed", - G_CALLBACK (ip6_config_changed), - self); + "config-changed", + G_CALLBACK (ip6_config_changed), + self); } - priv->ip6_waiting_for_config = FALSE; - ip_iface = nm_device_get_ip_iface (self); + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); nm_ip6_manager_prepare_interface (priv->ip6_manager, ip_iface, s_ip6); } static void -nm_device_cleanup_ip6 (NMDevice *self) +addrconf6_cleanup (NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); @@ -630,6 +643,13 @@ nm_device_cleanup_ip6 (NMDevice *self) priv->ip6_manager = NULL; } +static NMActStageReturn +real_act_stage1_prepare (NMDevice *self, NMDeviceStateReason *reason) +{ + addrconf6_setup (self); + return NM_ACT_STAGE_RETURN_SUCCESS; +} + /* * nm_device_activate_stage1_device_prepare * @@ -651,8 +671,6 @@ nm_device_activate_stage1_device_prepare (gpointer user_data) nm_info ("Activation (%s) Stage 1 of 5 (Device Prepare) started...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_PREPARE, NM_DEVICE_STATE_REASON_NONE); - nm_device_setup_ip6 (self); - ret = NM_DEVICE_GET_CLASS (self)->act_stage1_prepare (self, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { goto out; @@ -692,13 +710,6 @@ nm_device_activate_schedule_stage1_device_prepare (NMDevice *self) nm_device_get_iface (self)); } -static NMActStageReturn -real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) -{ - /* Nothing to do */ - return NM_ACT_STAGE_RETURN_SUCCESS; -} - static NMActStageReturn real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) { @@ -1071,42 +1082,76 @@ dhcp4_add_option_cb (gpointer key, gpointer value, gpointer user_data) } static void -handle_dhcp_lease_change (NMDevice *device) +dhcp6_add_option_cb (gpointer key, gpointer value, gpointer user_data) +{ + nm_dhcp6_config_add_option (NM_DHCP6_CONFIG (user_data), + (const char *) key, + (const char *) value); +} + +static void +handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - NMIP4Config *config; + NMIP4Config *ip4_config; NMSettingIP4Config *s_ip4; + NMIP6Config *ip6_config; + NMSettingIP6Config *s_ip6; NMConnection *connection; NMActRequest *req; NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; gboolean assumed; - config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); - if (!config) { - nm_warning ("failed to get DHCP config for rebind"); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - return; - } - req = nm_device_get_act_request (device); g_assert (req); connection = nm_act_request_get_connection (req); g_assert (connection); - - s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); - nm_utils_merge_ip4_config (config, s_ip4); - - g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, config); - assumed = nm_act_request_get_assumed (req); - if (nm_device_set_ip4_config (device, config, assumed, &reason)) { - nm_dhcp4_config_reset (priv->dhcp4_config); - nm_dhcp_client_foreach_dhcp4_option (priv->dhcp4_client, - dhcp4_add_option_cb, - priv->dhcp4_config); + + if (ipv6) { + ip6_config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); + if (!ip6_config) { + nm_warning ("failed to get DHCPv6 config for rebind"); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + return; + } + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + nm_utils_merge_ip6_config (ip6_config, s_ip6); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + + if (nm_device_set_ip6_config (device, ip6_config, assumed, &reason)) { + nm_dhcp6_config_reset (priv->dhcp6_config); + nm_dhcp_client_foreach_option (priv->dhcp6_client, + dhcp6_add_option_cb, + priv->dhcp6_config); + } else { + nm_warning ("Failed to update IPv6 config in response to DHCP event."); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + } } else { - nm_warning ("Failed to update IP4 config in response to DHCP event."); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + ip4_config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); + if (!ip4_config) { + nm_warning ("failed to get DHCPv4 config for rebind"); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + return; + } + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + nm_utils_merge_ip4_config (ip4_config, s_ip4); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + + if (nm_device_set_ip4_config (device, ip4_config, assumed, &reason)) { + nm_dhcp4_config_reset (priv->dhcp4_config); + nm_dhcp_client_foreach_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); + } else { + nm_warning ("Failed to update IPv4 config in response to DHCP event."); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + } } } @@ -1118,32 +1163,45 @@ dhcp_state_changed (NMDHCPClient *client, NMDevice *device = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); NMDeviceState dev_state; + gboolean ipv6; - if (!nm_device_get_act_request (device)) - return; - + ipv6 = nm_dhcp_client_get_ipv6 (client); dev_state = nm_device_get_state (device); switch (state) { case DHC_BOUND4: /* lease obtained */ + case DHC_BOUND6: case DHC_RENEW4: /* lease renewed */ + case DHC_RENEW6: /* lease renewed */ case DHC_REBOOT: /* have valid lease, but now obtained a different one */ case DHC_REBIND4: /* new, different lease */ - if (dev_state == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_get (device); - else if (dev_state == NM_DEVICE_STATE_ACTIVATED) - handle_dhcp_lease_change (device); + case DHC_REBIND6: /* new, different lease */ + if (dev_state == NM_DEVICE_STATE_IP_CONFIG) { + if (ipv6) + nm_device_activate_schedule_stage4_ip6_config_get (device); + else + nm_device_activate_schedule_stage4_ip4_config_get (device); + } else if (dev_state == NM_DEVICE_STATE_ACTIVATED) + handle_dhcp_lease_change (device, ipv6); break; case DHC_TIMEOUT: /* timed out contacting DHCP server */ - nm_dhcp4_config_reset (priv->dhcp4_config); - - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_timeout (device); + if (ipv6) { + nm_dhcp6_config_reset (priv->dhcp6_config); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + } else { + nm_dhcp4_config_reset (priv->dhcp4_config); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } break; case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ case DHC_ABEND: /* dhclient exited abnormally */ case DHC_END: /* dhclient exited normally */ - nm_dhcp4_config_reset (priv->dhcp4_config); + if (ipv6) + nm_dhcp6_config_reset (priv->dhcp6_config); + else + nm_dhcp4_config_reset (priv->dhcp4_config); /* dhclient quit and can't get/renew a lease; so kill the connection */ if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) @@ -1164,8 +1222,12 @@ dhcp_timeout (NMDHCPClient *client, gpointer user_data) if (!nm_device_get_act_request (device)) return; - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_activate_schedule_stage4_ip4_config_timeout (device); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + if (nm_dhcp_client_get_ipv6 (client)) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + else + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } } static NMActStageReturn @@ -1213,8 +1275,6 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) g_object_unref (priv->dhcp4_config); priv->dhcp4_config = nm_dhcp4_config_new (); - /* DHCP manager will cancel any transaction already in progress and we do not - want to cancel this activation if we get "down" state from that. */ priv->dhcp4_client = nm_dhcp_manager_start_ip4 (priv->dhcp_manager, ip_iface, uuid, @@ -1265,20 +1325,70 @@ static NMActStageReturn real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - const char *ip_iface = nm_device_get_ip_iface (self); + const char *ip_iface, *uuid; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + NMActRequest *req; + NMConnection *connection; g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); - /* If we are ignoring IPv6 on this interface then we can go right - * to stage 4. - */ - if (!priv->ip6_manager) - return NM_ACT_STAGE_RETURN_SUCCESS; + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); - priv->ip6_waiting_for_config = TRUE; - nm_ip6_manager_begin_addrconf (priv->ip6_manager, ip_iface); + ip_iface = nm_device_get_ip_iface (self); - return NM_ACT_STAGE_RETURN_POSTPONE; + if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + priv->ip6_waiting_for_config = TRUE; + nm_ip6_manager_begin_addrconf (priv->ip6_manager, ip_iface); + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + guint8 *anycast = NULL; + NMSettingIP6Config *s_ip6; + NMSettingConnection *s_con; + + /* Begin a DHCP transaction on the interface */ + + if (priv->dhcp_anycast_address) + anycast = priv->dhcp_anycast_address->data; + + /* Clear old exported DHCP options */ + if (priv->dhcp6_config) + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = nm_dhcp6_config_new (); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + + priv->dhcp6_client = nm_dhcp_manager_start_ip6 (priv->dhcp_manager, + ip_iface, + uuid, + s_ip6, + priv->dhcp_timeout, + anycast); + if (priv->dhcp6_client) { + priv->dhcp6_state_sigid = g_signal_connect (priv->dhcp6_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp6_timeout_sigid = g_signal_connect (priv->dhcp6_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); + + /* DHCP devices will be notified by the DHCP manager when stuff happens */ + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + } + + return ret; } @@ -1439,9 +1549,9 @@ real_act_stage4_get_ip4_config (NMDevice *self, nm_utils_merge_ip4_config (*config, s_ip4); nm_dhcp4_config_reset (priv->dhcp4_config); - nm_dhcp_client_foreach_dhcp4_option (priv->dhcp4_client, - dhcp4_add_option_cb, - priv->dhcp4_config); + nm_dhcp_client_foreach_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); /* Notify of new DHCP4 config */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); @@ -1632,11 +1742,11 @@ real_act_stage4_get_ip6_config (NMDevice *self, NMIP6Config **config, NMDeviceStateReason *reason) { - NMDevicePrivate *priv; + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; NMConnection *connection; NMSettingIP6Config *s_ip6; const char *ip_iface; - const char *method = NULL; g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); @@ -1649,25 +1759,41 @@ real_act_stage4_get_ip6_config (NMDevice *self, g_assert (connection); s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - if (s_ip6) - method = nm_setting_ip6_config_get_method (s_ip6); - if (!method || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, ip_iface); + if (*config) { + /* Merge user-defined overrides into the IP6Config to be applied */ + nm_utils_merge_ip6_config (*config, s_ip6); + ret = NM_ACT_STAGE_RETURN_SUCCESS; + } else { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + } + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + g_assert (priv->dhcp6_client); + + *config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); + if (*config) { + /* Merge user-defined overrides into the IP4Config to be applied */ + nm_utils_merge_ip6_config (*config, s_ip6); + + nm_dhcp6_config_reset (priv->dhcp6_config); + nm_dhcp_client_foreach_option (priv->dhcp6_client, + dhcp6_add_option_cb, + priv->dhcp6_config); + + /* Notify of new DHCP4 config */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + ret = NM_ACT_STAGE_RETURN_SUCCESS; + } else { + *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; + } + } else { *config = NULL; - return NM_ACT_STAGE_RETURN_SUCCESS; + ret = NM_ACT_STAGE_RETURN_SUCCESS; } - priv = NM_DEVICE_GET_PRIVATE (self); - *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, ip_iface); - if (!*config) { - *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; - return NM_ACT_STAGE_RETURN_FAILURE; - } - - /* Merge user-defined overrides into the IP6Config to be applied */ - nm_utils_merge_ip6_config (*config, s_ip6); - - return NM_ACT_STAGE_RETURN_SUCCESS; + return ret; } /* @@ -1743,6 +1869,9 @@ real_act_stage4_ip6_config_timeout (NMDevice *self, g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + /* Notify of invalid DHCP6 config object */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; return NM_ACT_STAGE_RETURN_FAILURE; } @@ -2135,6 +2264,54 @@ dhcp4_cleanup (NMDevice *self, gboolean stop) } } +static void +dhcp6_cleanup (NMDevice *self, gboolean stop) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->dhcp6_config) { + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = NULL; + } + + if (priv->dhcp6_client) { + if (priv->dhcp6_state_sigid) { + g_signal_handler_disconnect (priv->dhcp6_client, priv->dhcp6_state_sigid); + priv->dhcp6_state_sigid = 0; + } + + if (priv->dhcp6_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp6_client, priv->dhcp6_timeout_sigid); + priv->dhcp6_timeout_sigid = 0; + } + + if (stop) + nm_dhcp_client_stop (priv->dhcp6_client); + + g_object_unref (priv->dhcp6_client); + priv->dhcp6_client = NULL; + } +} + +static void +dnsmasq_cleanup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->dnsmasq_manager) + return; + + if (priv->dnsmasq_state_id) { + g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); + priv->dnsmasq_state_id = 0; + } + + nm_dnsmasq_manager_stop (priv->dnsmasq_manager); + g_object_unref (priv->dnsmasq_manager); + priv->dnsmasq_manager = NULL; +} + /* * nm_device_deactivate_quickly * @@ -2159,24 +2336,11 @@ nm_device_deactivate_quickly (NMDevice *self) /* Clear any delayed transitions */ delayed_transitions_clear (self); - if (nm_device_get_act_request (self)) { - dhcp4_cleanup (self, TRUE); - - if (priv->dnsmasq_manager) { - /* Or any shared connection */ - if (priv->dnsmasq_state_id) { - g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); - priv->dnsmasq_state_id = 0; - } - - nm_dnsmasq_manager_stop (priv->dnsmasq_manager); - g_object_unref (priv->dnsmasq_manager); - priv->dnsmasq_manager = NULL; - } - } - + dhcp4_cleanup (self, TRUE); + dhcp6_cleanup (self, TRUE); + addrconf6_cleanup (self); + dnsmasq_cleanup (self); aipd_cleanup (self); - nm_device_cleanup_ip6 (self); /* Call device type-specific deactivation */ if (NM_DEVICE_GET_CLASS (self)->deactivate_quickly) @@ -2395,21 +2559,17 @@ nm_device_can_interrupt_activation (NMDevice *self) NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *self) { - NMDevicePrivate *priv; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); - g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); - - priv = NM_DEVICE_GET_PRIVATE (self); - - if (priv->dhcp_manager) - return priv->dhcp4_config; - return NULL; + return NM_DEVICE_GET_PRIVATE (self)->dhcp4_config; } NMIP4Config * nm_device_get_ip4_config (NMDevice *self) { g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); return NM_DEVICE_GET_PRIVATE (self)->ip4_config; } @@ -2579,10 +2739,20 @@ nm_device_set_ip6_config (NMDevice *self, return success; } +NMDHCP6Config * +nm_device_get_dhcp6_config (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); + + return NM_DEVICE_GET_PRIVATE (self)->dhcp6_config; +} + NMIP6Config * nm_device_get_ip6_config (NMDevice *self) { g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); return NM_DEVICE_GET_PRIVATE (self)->ip6_config; } @@ -2740,8 +2910,11 @@ dispose (GObject *object) /* Clean up and stop DHCP */ dhcp4_cleanup (self, take_down); + dhcp6_cleanup (self, take_down); + addrconf6_cleanup (self); + dnsmasq_cleanup (self); - /* Take the device itself down and clear it's IPv4 configuration */ + /* Take the device itself down and clear its IPv4 configuration */ if (priv->managed && take_down) { NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; @@ -2749,23 +2922,10 @@ dispose (GObject *object) nm_device_set_ip4_config (self, NULL, FALSE, &ignored); } - clear_act_request (self); - activation_source_clear (self, TRUE, AF_INET); activation_source_clear (self, TRUE, AF_INET6); - nm_device_cleanup_ip6 (self); - - if (priv->dnsmasq_manager) { - if (priv->dnsmasq_state_id) { - g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); - priv->dnsmasq_state_id = 0; - } - - nm_dnsmasq_manager_stop (priv->dnsmasq_manager); - g_object_unref (priv->dnsmasq_manager); - priv->dnsmasq_manager = NULL; - } + clear_act_request (self); out: G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); @@ -2883,6 +3043,13 @@ get_property (GObject *object, guint prop_id, } g_value_set_boxed (value, "/"); break; + case NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG: + if ( ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) + && priv->dhcp6_client) + g_value_set_boxed (value, nm_dhcp6_config_get_dbus_path (priv->dhcp6_config)); + else + g_value_set_boxed (value, "/"); + break; case NM_DEVICE_INTERFACE_PROP_STATE: g_value_set_uint (value, priv->state); break; @@ -2961,6 +3128,10 @@ nm_device_class_init (NMDeviceClass *klass) NM_DEVICE_INTERFACE_PROP_IP6_CONFIG, NM_DEVICE_INTERFACE_IP6_CONFIG); + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG, + NM_DEVICE_INTERFACE_DHCP6_CONFIG); + g_object_class_override_property (object_class, NM_DEVICE_INTERFACE_PROP_STATE, NM_DEVICE_INTERFACE_STATE); diff --git a/src/nm-device.h b/src/nm-device.h index 6300be535f..5fcde5c338 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -31,6 +31,7 @@ #include "nm-ip4-config.h" #include "nm-ip6-config.h" #include "nm-dhcp4-config.h" +#include "nm-dhcp6-config.h" #include "nm-connection.h" typedef enum NMActStageReturn @@ -141,6 +142,7 @@ guint32 nm_device_get_ip4_address (NMDevice *dev); void nm_device_update_ip4_address (NMDevice *dev); NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *dev); +NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *dev); NMIP4Config * nm_device_get_ip4_config (NMDevice *dev); NMIP6Config * nm_device_get_ip6_config (NMDevice *dev); From 534509b3c7adfc5b0d00f9c14fa80ba693cec6f0 Mon Sep 17 00:00:00 2001 From: Christian Kirbach Date: Thu, 14 Jan 2010 13:05:06 -0800 Subject: [PATCH 030/392] po: update German translation (bgo #598616) --- po/de.po | 475 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 329 insertions(+), 146 deletions(-) diff --git a/po/de.po b/po/de.po index 3a6c861980..05709384d2 100644 --- a/po/de.po +++ b/po/de.po @@ -7,156 +7,83 @@ # Thomas Gier , 2007. # Andre Klapper , 2007. # Hauke Mehrtens , 2008. +# Christian Kirbach , 2009. # msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-25 21:44+0100\n" -"PO-Revision-Date: 2008-11-22 00:08+0100\n" -"Last-Translator: Hauke Mehrtens \n" +"POT-Creation-Date: 2009-10-15 23:02+0200\n" +"PO-Revision-Date: 2009-10-14 11:27+0200\n" +"Last-Translator: Christian Kirbach \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 -#, c-format -msgid "error processing netlink message: %s" -msgstr "Fehler beim Verarbeiten der netlink Nachricht: %s" - -#: ../src/nm-netlink-monitor.c:251 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "" -"Kann netlink handle zur Überwachung von Netzwerkverbindung nicht belegen: %s" - -#: ../src/nm-netlink-monitor.c:261 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"Kann nicht mit netlink zur Überwachung von Netzwerkverbindung verbinden: %s" - -#: ../src/nm-netlink-monitor.c:269 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"Kann nicht mit netlink Gruppe zur Überwachung der Netzwerkverbindung " -"verbinden: %s" - -#: ../src/nm-netlink-monitor.c:277 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "" -"Kann netlink Cache zur Überwachung der Netzwerkverbindung nicht belegen: %s" - -#: ../src/nm-netlink-monitor.c:418 -#, c-format -msgid "error updating link cache: %s" -msgstr "Fehler beim aktualisieren des Verbindungscaches: %s" - -#: ../src/nm-netlink-monitor.c:484 -msgid "error occurred while waiting for data on socket" -msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" - -#: ../src/NetworkManager.c:293 -#, c-format -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "" -"Ungültige Option. Benutzen Sie Bitte --help um eine Liste der gültigen " -"Optionen zu erhalten.\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 -msgid "# Created by NetworkManager\n" -msgstr "# Erzeugt vom NetzwerkManager\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 -#, c-format -msgid "" -"# Merged from %s\n" -"\n" -msgstr "" -"# Zusammengefügt aus %s\n" -"\n" - -#: ../src/named-manager/nm-named-manager.c:256 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "" -"Achtung: der libc resolver unterstützt wahrscheinlich nicht mehr als 3 " -"Nameserver." - -#: ../src/named-manager/nm-named-manager.c:258 -msgid "The nameservers listed below may not be recognized." -msgstr "Die Nameserver unter diesem werden wahrscheinlich nicht benutzt." - -#: ../system-settings/src/main.c:376 -#, c-format -msgid "Auto %s" -msgstr "Auto %s" - #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "PEM Schlüssel Datei hat keine abschließendes Tag '%s'." +msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag »%s«." #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Das sieht nicht nach einem privatem PEM Schlüssel aus." +msgstr "Dies scheint kein privater PEM-Schlüssel zu sein." #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." msgstr "" -"Es steht nicht genug Speicher zum Speichern der PEM Datei zur Verfügung." +"Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung." #: ../libnm-util/crypto.c:154 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "Fehlerhafte PEM Datei: Proc-Type ist nicht der erste Tag." +msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht der erste Tag." #: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Fehlerhafte PEM Datei: unbekannter Proc-Type Tag '%s'." +msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag »%s«." #: ../libnm-util/crypto.c:172 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "Fehlerhafte PEM Datei: DEK-Info ist nicht der zweite Tag." +msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht der zweite Tag." #: ../libnm-util/crypto.c:183 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Fehlerhafte PEM Datei: kein IV im DEK-Info Tag gefunden." +msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info Tag gefunden." #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Fehlerhafte PEM Datei: falsches Format des IV in DEK-Info Tag." +msgstr "Fehlerhafte PEM-Datei: falsches Format des IV in DEK-Info Tag." #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "" -"Fehlerhafte PEM Datei: unbekannte Verschlüsselung '%s' des privaten " +"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung »%s« des privaten " "Schlüssels." #: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "Konnte privaten Schlüssel nicht dekodieren." +msgstr "Der private Schlüssel konnte nicht dekodiert werden." #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "PEM Zertifikat '%s' hat keine abschließendes Tag '%s'." +msgstr "PEM-Zertifikat »%s« hat kein abschließendes Tag »%s«." #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "Fehler beim dekodieren des Zertifikats." +msgstr "Das Dekodieren des Zertifikats ist fehlgeschlagen." #: ../libnm-util/crypto.c:286 #, c-format @@ -183,21 +110,22 @@ msgstr "Nicht genug Speicher zum Sichern des IV." msgid "IV contains non-hexadecimal digits." msgstr "IV enthält nicht hexadezimale Zeichen." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "Unbekannte Verschlüsselung '%s' des privaten Schlüssels." +msgstr "Unbekannte Verschlüsselung »%s« des privaten Schlüssels." #: ../libnm-util/crypto.c:391 #, c-format msgid "Not enough memory to decrypt private key." -msgstr "Nicht genug Speicher zum entschlüsseln des privaten Schlüssels." +msgstr "Nicht genug Speicher zum Entschlüsseln des privaten Schlüssels." #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." -msgstr "Kann die Art des privaten Schlüssels nicht bestimmen." +msgstr "Die Art des privaten Schlüssels kann nicht bestimmt werden." #: ../libnm-util/crypto.c:530 #, c-format @@ -205,138 +133,393 @@ msgid "Not enough memory to store decrypted private key." msgstr "" "Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Fehler beim Initialisieren der Verschlüsselung." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Fehler beim Initialisieren von MD5: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Ungültige Länge des IV (muss zumindest %zd sein)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." -msgstr "Nicht genug Speicher für den Entschlüsselungs-Puffer." +msgstr "Nicht genug Speicher für den Puffer zur Entschlüsselung." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Fehler beim Initialisieren des Entschlüsselungs-Kontextes: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" -"Fehler beim setzen des symmetrischen Schlüssels für die Entschlüsselung: %" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung: %" "s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "Fehler beim setzen des IV für die Verschlüsselung: %s / %s." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Fehler beim Entschlüsseln des privaten Schlüssels." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format -msgid "Error initializing certificate data: %s" -msgstr "Fehler beim Initialisieren des Zertifikates: %s" - -#: ../libnm-util/crypto_gnutls.c:257 -#, c-format -msgid "Couldn't decode certificate: %s" -msgstr "Konnte Zertifikat nicht dekodieren: %s" - -#: ../libnm-util/crypto_gnutls.c:281 -#, c-format -msgid "Couldn't initialize PKCS#12 decoder: %s" -msgstr "Konnte PKCS#12 Decoder nicht initialisieren: %s" +msgid "Could not allocate memory for encrypting." +msgstr "Es konnte kein Arbeitsspeicher zur Verschlüsselung angefordert werden." #: ../libnm-util/crypto_gnutls.c:294 #, c-format -msgid "Couldn't decode PKCS#12 file: %s" -msgstr "Konnte PKCS#12 nicht decodieren: %s" +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes: %s / %s." -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung: %" +"s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Fehler beim Verschlüsseln der Daten: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Fehler beim Initialisieren des Zertifikats: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Zertifikat konnte nicht dekodiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 konnte nicht decodiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" -msgstr "Konnte PKCS#12 Datei nicht überprüfen: %s" +msgstr "PKCS#12-Datei konnte nicht überprüft werden: %s" #: ../libnm-util/crypto_nss.c:57 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Fehler beim Erstellen der Verschlüsselung: %d." +msgstr "Fehler beim Initialisieren der Verschlüsselung: %d." #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "Fehler beim Erstellen des MD5-Kontextes: %d." +msgstr "Fehler beim Initialisieren des MD5-Kontextes: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 #, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "Fehler beim Erstellen des Verschlüsselungs-Slots." +msgid "Invalid IV length (must be at least %d)." +msgstr "Ungültige Länge des IV (muss zumindest %d sein)." #: ../libnm-util/crypto_nss.c:196 #, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "" -"Fehler beim Setzen des symmetrischen Schlüssels für die Entschlüsselung." +msgid "Failed to initialize the decryption cipher slot." +msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." #: ../libnm-util/crypto_nss.c:206 #, c-format -msgid "Failed to set IV for decryption." -msgstr "Fehler beim Setzten des IV für die Entschlüsselung." +msgid "Failed to set symmetric key for decryption." +msgstr "" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Fehler beim Festlegen des IV für die Entschlüsselung." + +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "Fehler beim Erstellen des Entschlüsselungs-Kontextes." +msgstr "Fehler beim Einrichten des Entschlüsselungs-Kontextes." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Fehler beim Entschlüsseln des privaten Schlüssels: Die entschlüsselten Daten " +"sind zu groß." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "" "Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Fehler beim Verschlüsseln: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Unerwartete Datenmenge nach der Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Konnte Zertifikate nicht dekodieren: %d" +msgstr "Zertifikat konnte nicht dekodiert werden: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" -msgstr "Konnte Passwort nicht zu UCS2 konvertieren: %d" +msgstr "Passwort konnte nicht zu UCS2 konvertiert werden: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" -msgstr "Konnte PKCS#12 Decoder nicht initialisieren: %d" +msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Konnte PKCS#12 Datei nicht decodieren: %d" +msgstr "PKCS#12-Datei konnte nicht decodiert werden: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" -msgstr "Konnte PKCS#12 Datei nicht überprüfen: %d" +msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Zufällige Daten konnten nicht erstellt werden." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "" +"Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "" +"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " +"werden." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " +"werden." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "" +"Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "Fehler beim Verarbeiten der netlink-Nachricht: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung " +"angefordert werden: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"Es kann nicht mit netlink zur Überwachung der Netzwerkverbindung verbunden " +"werden: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"Es kann nicht mit einer netlink-Gruppe zur Überwachung der " +"Netzwerkverbindung verbunden werden: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"Es kann kein netlink-Cache zur Überwachung der Netzwerkverbindung belegt " +"werden: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" + +#: ../src/nm-netlink-monitor.c:558 +#, c-format +msgid "error updating link cache: %s" +msgstr "Fehler beim Aktualisieren des Verbindungs-Cache: %s" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Ungültige Option. Verwenden Sie Bitte »--help«, um eine Liste der gültigen " +"Optionen zu erhalten.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Erstellt von NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Zusammengefügt aus %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "Es Kann kein netlink-Handle angefordert werden: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "Es kann nicht mit netlink verbunden werden: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"HINWEIS: Der libc-Auflöser unterstützt eventuell nicht mehr als 3 Server zur " +"Namensauflösung." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "" +"Die nachfolgend aufgelisteten Server zur Namensauflösung werden eventuell " +"nicht erkannt." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "System" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Verbindungsfreigabe über ein geschütztes WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Verbindungsfreigabe über ein offenes WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Den ständigen Rechnernamen des Systems bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "System-Verbindungen bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten des ständigen Rechnernamens " +"des Systems" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes " +"WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-" +"Netzwerk" #~ msgid "operation took too long" #~ msgstr "Vorgang dauerte zu lange" From d41c35fbf8b772365fcaa60cbf5e56972be6d531 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Jan 2010 14:15:18 -0800 Subject: [PATCH 031/392] netlink: work around kernel cache refill problems Sometimes cause the cache not to refill with all interfaces, meaning NM sometimes got the wrong carrier state from the kernel which prevented NM from taking over existing connections. --- src/nm-netlink-monitor.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index e0bf397652..2c3987c3d5 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -560,6 +560,19 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, return FALSE; } + /* HACK: Apparently to get it working we have to refill the cache twice; + * otherwise some kernels (or maybe libnl?) only send a few of the + * interfaces in the refill request. + */ + if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + g_set_error (error, + NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, + _("error updating link cache: %s"), + nl_geterror ()); + return FALSE; + } + /* Set up the filter */ filter = rtnl_link_alloc (); if (!filter) { From d20c61a1d65ed383016de578de303aab9211221d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Jan 2010 14:30:02 -0800 Subject: [PATCH 032/392] olpc-mesh: fix companion path and active channel property types Companion device should be an object path instead of a string, and the introspection data property type for the active channel was wrong. --- introspection/nm-device-olpc-mesh.xml | 6 ++++-- src/nm-device-olpc-mesh.c | 25 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/introspection/nm-device-olpc-mesh.xml b/introspection/nm-device-olpc-mesh.xml index 7d326b6b95..c30ecfc602 100644 --- a/introspection/nm-device-olpc-mesh.xml +++ b/introspection/nm-device-olpc-mesh.xml @@ -7,12 +7,14 @@ The hardware address of the device. - + + The object path of the companion device. - + + The currently active channel. diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index ad81a5a78b..9c229d5804 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -682,7 +682,10 @@ get_property (GObject *object, guint prop_id, g_value_take_string (value, nm_ether_ntop (&hw_addr)); break; case PROP_COMPANION: - g_value_set_string (value, nm_device_get_path (priv->companion)); + if (priv->companion) + g_value_set_boxed (value, nm_device_get_path (priv->companion)); + else + g_value_set_boxed (value, "/"); break; case PROP_ACTIVE_CHANNEL: g_value_set_uint (value, nm_device_olpc_mesh_get_channel (device)); @@ -749,13 +752,15 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass) "Hardware MAC address", NULL, G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_COMPANION, - g_param_spec_string (NM_DEVICE_OLPC_MESH_COMPANION, - "Companion device", - "Companion device object path", - NULL, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_DEVICE_OLPC_MESH_COMPANION, + "Companion device", + "Companion device object path", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_ACTIVE_CHANNEL, g_param_spec_uint (NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, @@ -801,7 +806,11 @@ companion_notify_cb (NMDeviceWifi *companion, GParamSpec *pspec, gpointer user_d /* disconnect from mesh if someone starts using the companion */ static void -companion_state_changed_cb (NMDeviceWifi *companion, NMDeviceState state, NMDeviceState old_state, NMDeviceStateReason reason, gpointer user_data) +companion_state_changed_cb (NMDeviceWifi *companion, + NMDeviceState state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) { NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); NMDeviceState self_state = nm_device_get_state (NM_DEVICE (self)); @@ -880,6 +889,8 @@ is_companion (NMDeviceOlpcMesh *self, NMDevice *other) g_signal_connect (G_OBJECT (other), "autoconnect-allowed", G_CALLBACK (companion_autoconnect_allowed_cb), self); + g_object_notify (G_OBJECT (self), NM_DEVICE_OLPC_MESH_COMPANION); + return TRUE; } From f9bd97020d429264cbe2b0aadd85566acf6e02f0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Jan 2010 22:57:51 -0800 Subject: [PATCH 033/392] ipv6: push router advertisement flags to listeners --- marshallers/nm-marshal.list | 1 + src/ip6-manager/nm-ip6-manager.c | 78 ++++++++++++++++++++++---------- src/ip6-manager/nm-ip6-manager.h | 15 +++++- src/nm-device.c | 12 +++-- 4 files changed, 76 insertions(+), 30 deletions(-) diff --git a/marshallers/nm-marshal.list b/marshallers/nm-marshal.list index 38669dd32b..36e0fbe6d0 100644 --- a/marshallers/nm-marshal.list +++ b/marshallers/nm-marshal.list @@ -16,6 +16,7 @@ VOID:STRING,STRING,STRING,UINT VOID:OBJECT,UINT,UINT VOID:STRING,INT VOID:STRING,UINT +VOID:STRING,UINT,BOOLEAN VOID:OBJECT,OBJECT,ENUM VOID:POINTER,STRING VOID:STRING,BOXED diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index f41169cb15..20e1a7f939 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -165,10 +165,8 @@ nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMIP6ManagerClass, addrconf_complete), NULL, NULL, - _nm_marshal_VOID__STRING_BOOLEAN, - G_TYPE_NONE, 2, - G_TYPE_STRING, - G_TYPE_BOOLEAN); + _nm_marshal_VOID__STRING_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_BOOLEAN); signals[CONFIG_CHANGED] = g_signal_new ("config-changed", @@ -176,9 +174,8 @@ nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, - G_TYPE_STRING); + _nm_marshal_VOID__STRING_UINT, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT); } static void @@ -233,10 +230,16 @@ nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) GINT_TO_POINTER (ifindex)); } +typedef struct { + NMIP6Device *device; + guint dhcp_opts; +} CallbackInfo; + static gboolean finish_addrconf (gpointer user_data) { - NMIP6Device *device = user_data; + CallbackInfo *info = user_data; + NMIP6Device *device = info->device; NMIP6Manager *manager = device->manager; char *iface_copy; @@ -245,7 +248,7 @@ finish_addrconf (gpointer user_data) if (device->state >= device->target_state) { g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - device->iface, TRUE); + device->iface, info->dhcp_opts, TRUE); } else { nm_info ("Device '%s' IP6 addrconf timed out or failed.", device->iface); @@ -254,7 +257,7 @@ finish_addrconf (gpointer user_data) nm_ip6_manager_cancel_addrconf (manager, device->iface); g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - iface_copy, FALSE); + iface_copy, info->dhcp_opts, FALSE); g_free (iface_copy); } @@ -265,11 +268,12 @@ finish_addrconf (gpointer user_data) static gboolean emit_config_changed (gpointer user_data) { - NMIP6Device *device = user_data; + CallbackInfo *info = user_data; + NMIP6Device *device = info->device; NMIP6Manager *manager = device->manager; device->config_changed_id = 0; - g_signal_emit (manager, signals[CONFIG_CHANGED], 0, device->iface); + g_signal_emit (manager, signals[CONFIG_CHANGED], 0, device->iface, info->dhcp_opts); return FALSE; } @@ -279,9 +283,10 @@ static gboolean rdnss_expired (gpointer user_data) { NMIP6Device *device = user_data; + CallbackInfo info = { device, IP6_DHCP_OPT_NONE }; set_rdnss_timeout (device); - emit_config_changed (device); + emit_config_changed (&info); return FALSE; } @@ -323,6 +328,18 @@ set_rdnss_timeout (NMIP6Device *device) } } +static CallbackInfo * +callback_info_new (NMIP6Device *device, guint dhcp_opts) +{ + CallbackInfo *info; + + info = g_malloc0 (sizeof (CallbackInfo)); + info->device = device; + info->dhcp_opts = dhcp_opts; + + return info; +} + static void nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) { @@ -333,6 +350,8 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) struct in6_addr *addr; struct rtnl_link *link; guint flags; + CallbackInfo *info; + guint dhcp_opts = IP6_DHCP_OPT_NONE; for (rtnladdr = (struct rtnl_addr *)nl_cache_get_first (priv->addr_cache); rtnladdr; @@ -365,8 +384,10 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) if ((flags & IF_RA_RCVD) && device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; -// if (flags & (IF_RA_MANAGED | IF_RA_OTHERCONF)) -// device->need_dhcp = TRUE; + if (flags & IF_RA_MANAGED) + dhcp_opts = IP6_DHCP_OPT_MANAGED; + else if (flags & IF_RA_OTHERCONF) + dhcp_opts = IP6_DHCP_OPT_OTHERCONF; if (!device->addrconf_complete) { if (device->state >= device->target_state || @@ -376,13 +397,20 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) */ if (device->finish_addrconf_id) g_source_remove (device->finish_addrconf_id); - device->finish_addrconf_id = g_idle_add (finish_addrconf, - device); + + info = callback_info_new (device, dhcp_opts); + device->finish_addrconf_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, + finish_addrconf, + info, + (GDestroyNotify) g_free); } } else if (config_changed) { if (!device->config_changed_id) { - device->config_changed_id = g_idle_add (emit_config_changed, - device); + info = callback_info_new (device, dhcp_opts); + device->config_changed_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, + emit_config_changed, + info, + (GDestroyNotify) g_free); } } } @@ -717,6 +745,7 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, { NMIP6ManagerPrivate *priv; NMIP6Device *device; + CallbackInfo *info; g_return_if_fail (NM_IS_IP6_MANAGER (manager)); g_return_if_fail (iface != NULL); @@ -731,9 +760,12 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, device->addrconf_complete = FALSE; /* Set up a timeout on the transaction to kill it after the timeout */ - device->finish_addrconf_id = g_timeout_add_seconds (NM_IP6_TIMEOUT, - finish_addrconf, - device); + info = callback_info_new (device, 0); + device->finish_addrconf_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, + NM_IP6_TIMEOUT, + finish_addrconf, + info, + (GDestroyNotify) g_free); /* Sync flags, etc, from netlink; this will also notice if the * device is already fully configured and schedule the diff --git a/src/ip6-manager/nm-ip6-manager.h b/src/ip6-manager/nm-ip6-manager.h index 33b2b9893a..d0cf4b08a9 100644 --- a/src/ip6-manager/nm-ip6-manager.h +++ b/src/ip6-manager/nm-ip6-manager.h @@ -35,6 +35,12 @@ #define NM_IS_IP6_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP6_MANAGER)) #define NM_IP6_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_MANAGER, NMIP6ManagerClass)) +enum { + IP6_DHCP_OPT_NONE = 0, + IP6_DHCP_OPT_OTHERCONF, + IP6_DHCP_OPT_MANAGED +}; + typedef struct { GObject parent; } NMIP6Manager; @@ -47,13 +53,18 @@ typedef struct { /* addrconf_complete is emitted only during initial configuration to indicate * that the initial configuration is complete. */ - void (*addrconf_complete) (NMIP6Manager *manager, char *iface, gboolean success); + void (*addrconf_complete) (NMIP6Manager *manager, + char *iface, + guint dhcp_opts, + gboolean success); /* config_changed gets emitted only *after* initial configuration is * complete; it's like DHCP renew and indicates that the existing config * of the interface has changed. */ - void (*config_changed) (NMIP6Manager *manager, char *iface); + void (*config_changed) (NMIP6Manager *manager, + char *iface, + guint dhcp_opts); } NMIP6ManagerClass; GType nm_ip6_manager_get_type (void); diff --git a/src/nm-device.c b/src/nm-device.c index daf3d111cd..7700c7a10f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -535,9 +535,10 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family) static void ip6_addrconf_complete (NMIP6Manager *ip6_manager, - const char *iface, - gboolean success, - gpointer user_data) + const char *iface, + guint dhcp_opts, + gboolean success, + gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); @@ -558,8 +559,9 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, static void ip6_config_changed (NMIP6Manager *ip6_manager, - const char *iface, - gpointer user_data) + const char *iface, + guint dhcp_opts, + gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); From 4f537c195c88243c49f6d481d1405c63c44b721b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 15 Jan 2010 12:40:19 -0800 Subject: [PATCH 034/392] libnm-glib: add NMDHCP6Config class --- include/NetworkManager.h | 1 + libnm-glib/Makefile.am | 8 +- libnm-glib/nm-device.c | 103 ++++++++++++++- libnm-glib/nm-device.h | 3 + libnm-glib/nm-dhcp6-config.c | 248 +++++++++++++++++++++++++++++++++++ libnm-glib/nm-dhcp6-config.h | 68 ++++++++++ 6 files changed, 427 insertions(+), 4 deletions(-) create mode 100644 libnm-glib/nm-dhcp6-config.c create mode 100644 libnm-glib/nm-dhcp6-config.h diff --git a/include/NetworkManager.h b/include/NetworkManager.h index c8d5074a1e..b25cfbc2ba 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -42,6 +42,7 @@ #define NM_DBUS_INTERFACE_IP4_CONFIG NM_DBUS_INTERFACE ".IP4Config" #define NM_DBUS_INTERFACE_DHCP4_CONFIG NM_DBUS_INTERFACE ".DHCP4Config" #define NM_DBUS_INTERFACE_IP6_CONFIG NM_DBUS_INTERFACE ".IP6Config" +#define NM_DBUS_INTERFACE_DHCP6_CONFIG NM_DBUS_INTERFACE ".DHCP6Config" #define NM_DBUS_SERVICE_USER_SETTINGS "org.freedesktop.NetworkManagerUserSettings" diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 2aa6124e76..c177fa3cb7 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -20,7 +20,8 @@ BUILT_SOURCES = \ nm-active-connection-bindings.h \ nm-ip4-config-bindings.h \ nm-dhcp4-config-bindings.h \ - nm-ip6-config-bindings.h + nm-ip6-config-bindings.h \ + nm-dhcp6-config-bindings.h lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la @@ -52,6 +53,7 @@ libnminclude_HEADERS = \ nm-active-connection.h \ nm-dhcp4-config.h \ nm-ip6-config.h \ + nm-dhcp6-config.h \ nm-remote-connection.h \ nm-settings-interface.h \ nm-settings-system-interface.h \ @@ -86,6 +88,7 @@ libnm_glib_la_SOURCES = \ nm-active-connection.c \ nm-dhcp4-config.c \ nm-ip6-config.c \ + nm-dhcp6-config.c \ nm-remote-connection.c \ nm-remote-connection-private.h \ nm-settings-interface.c \ @@ -172,6 +175,9 @@ nm-dhcp4-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml nm-ip6-config-bindings.h: $(top_srcdir)/introspection/nm-ip6-config.xml dbus-binding-tool --prefix=nm_ip6_config --mode=glib-client --output=$@ $< +nm-dhcp6-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-client --output=$@ $< + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnm-glib.pc libnm-glib-vpn.pc diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 17caa99d5d..a24eb06efa 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -59,6 +59,8 @@ typedef struct { gboolean null_dhcp4_config; NMIP6Config *ip6_config; gboolean null_ip6_config; + NMDHCP6Config *dhcp6_config; + gboolean null_dhcp6_config; NMDeviceState state; GUdevClient *client; @@ -79,6 +81,7 @@ enum { PROP_STATE, PROP_PRODUCT, PROP_VENDOR, + PROP_DHCP6_CONFIG, LAST_PROP }; @@ -220,6 +223,46 @@ demarshal_ip6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint return TRUE; } +static gboolean +demarshal_dhcp6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + const char *path; + NMDHCP6Config *config = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_dhcp6_config = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_dhcp6_config = TRUE; + else { + config = NM_DHCP6_CONFIG (_nm_object_cache_get (path)); + if (config) + config = g_object_ref (config); + else { + connection = nm_object_get_connection (object); + config = NM_DHCP6_CONFIG (nm_dhcp6_config_new (connection, path)); + } + } + } + + if (priv->dhcp6_config) { + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = NULL; + } + + if (config) + priv->dhcp6_config = config; + + _nm_object_queue_notify (object, NM_DEVICE_DHCP6_CONFIG); + return TRUE; +} + static void register_for_property_changed (NMDevice *device) { @@ -230,9 +273,10 @@ register_for_property_changed (NMDevice *device) { NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver }, { NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities }, { NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed }, - { NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config }, - { NM_DEVICE_DHCP4_CONFIG, demarshal_dhcp4_config, &priv->dhcp4_config }, - { NM_DEVICE_IP6_CONFIG, demarshal_ip6_config, &priv->ip6_config }, + { NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config }, + { NM_DEVICE_DHCP4_CONFIG, demarshal_dhcp4_config, &priv->dhcp4_config }, + { NM_DEVICE_IP6_CONFIG, demarshal_ip6_config, &priv->ip6_config }, + { NM_DEVICE_DHCP6_CONFIG, demarshal_dhcp6_config, &priv->dhcp6_config }, { NULL }, }; @@ -318,6 +362,8 @@ dispose (GObject *object) g_object_unref (priv->dhcp4_config); if (priv->ip6_config) g_object_unref (priv->ip6_config); + if (priv->dhcp6_config) + g_object_unref (priv->dhcp6_config); if (priv->client) g_object_unref (priv->client); @@ -371,6 +417,9 @@ get_property (GObject *object, case PROP_IP6_CONFIG: g_value_set_object (value, nm_device_get_ip6_config (device)); break; + case PROP_DHCP6_CONFIG: + g_value_set_object (value, nm_device_get_dhcp6_config (device)); + break; case PROP_STATE: g_value_set_uint (value, nm_device_get_state (device)); break; @@ -505,6 +554,19 @@ nm_device_class_init (NMDeviceClass *device_class) NM_TYPE_IP6_CONFIG, G_PARAM_READABLE)); + /** + * NMDevice:dhcp6-config: + * + * The #NMDHCP6Config of the device. + **/ + g_object_class_install_property + (object_class, PROP_DHCP6_CONFIG, + g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, + "DHCP6 Config", + "DHCP6 Config", + NM_TYPE_DHCP6_CONFIG, + G_PARAM_READABLE)); + /** * NMDevice:state: * @@ -870,6 +932,41 @@ nm_device_get_ip6_config (NMDevice *device) return priv->ip6_config; } +/** + * nm_device_get_dhcp6_config: + * @device: a #NMDevice + * + * Gets the current #NMDHCP6Config associated with the #NMDevice. + * + * Returns: the #NMDHCPConfig or %NULL if the device is not activated or not + * using DHCP. + **/ +NMDHCP6Config * +nm_device_get_dhcp6_config (NMDevice *device) +{ + NMDevicePrivate *priv; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->dhcp6_config) + return priv->dhcp6_config; + if (priv->null_dhcp6_config) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Dhcp6Config"); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_dhcp6_config (NM_OBJECT (device), NULL, &value, &priv->dhcp6_config); + g_value_unset (&value); + } + + return priv->dhcp6_config; +} + /** * nm_device_get_state: * @device: a #NMDevice diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h index da015d6c46..64694ec833 100644 --- a/libnm-glib/nm-device.h +++ b/libnm-glib/nm-device.h @@ -32,6 +32,7 @@ #include "nm-ip4-config.h" #include "nm-dhcp4-config.h" #include "nm-ip6-config.h" +#include "nm-dhcp6-config.h" #include "nm-connection.h" G_BEGIN_DECLS @@ -51,6 +52,7 @@ G_BEGIN_DECLS #define NM_DEVICE_IP4_CONFIG "ip4-config" #define NM_DEVICE_DHCP4_CONFIG "dhcp4-config" #define NM_DEVICE_IP6_CONFIG "ip6-config" +#define NM_DEVICE_DHCP6_CONFIG "dhcp6-config" #define NM_DEVICE_STATE "state" #define NM_DEVICE_VENDOR "vendor" #define NM_DEVICE_PRODUCT "product" @@ -89,6 +91,7 @@ gboolean nm_device_get_managed (NMDevice *device); NMIP4Config * nm_device_get_ip4_config (NMDevice *device); NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *device); NMIP6Config * nm_device_get_ip6_config (NMDevice *device); +NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *device); NMDeviceState nm_device_get_state (NMDevice *device); const char * nm_device_get_product (NMDevice *device); const char * nm_device_get_vendor (NMDevice *device); diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c new file mode 100644 index 0000000000..49eeda39ec --- /dev/null +++ b/libnm-glib/nm-dhcp6-config.c @@ -0,0 +1,248 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include + +#include "nm-dhcp6-config.h" +#include "NetworkManager.h" +#include "nm-types-private.h" +#include "nm-object-private.h" +#include "nm-utils.h" + +G_DEFINE_TYPE (NMDHCP6Config, nm_dhcp6_config, NM_TYPE_OBJECT) + +#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigPrivate)) + +typedef struct { + DBusGProxy *proxy; + + GHashTable *options; +} NMDHCP6ConfigPrivate; + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +static void +nm_dhcp6_config_init (NMDHCP6Config *config) +{ +} + +static void +copy_options (gpointer key, gpointer data, gpointer user_data) +{ + GHashTable *options = (GHashTable *) user_data; + GValue *value = (GValue *) data; + + g_hash_table_insert (options, g_strdup (key), g_value_dup_string (value)); +} + +static gboolean +demarshal_dhcp6_options (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + GHashTable *new_options; + + g_hash_table_remove_all (priv->options); + + new_options = g_value_get_boxed (value); + if (new_options) + g_hash_table_foreach (new_options, copy_options, priv->options); + + _nm_object_queue_notify (object, NM_DHCP6_CONFIG_OPTIONS); + return TRUE; +} + +static void +register_for_property_changed (NMDHCP6Config *config) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DHCP6_CONFIG_OPTIONS, demarshal_dhcp6_options, &priv->options }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (config), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + DBusGConnection *connection; + NMDHCP6ConfigPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + connection = nm_object_get_connection (object); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_DHCP6_CONFIG); + + register_for_property_changed (NM_DHCP6_CONFIG (object)); + + return G_OBJECT (object); +} + +static void +finalize (GObject *object) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + if (priv->options) + g_hash_table_destroy (priv->options); + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDHCP6Config *self = NM_DHCP6_CONFIG (object); + + switch (prop_id) { + case PROP_OPTIONS: + g_value_set_boxed (value, nm_dhcp6_config_get_options (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_dhcp6_config_class_init (NMDHCP6ConfigClass *config_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (config_class); + + g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMDHCP6Config:options: + * + * The #GHashTable containing options of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, + "Options", + "Options", + G_TYPE_HASH_TABLE, + G_PARAM_READABLE)); +} + +/** + * nm_dhcp6_config_new: + * @connection: the #DBusGConnection + * @object_path: the DBus object path of the device + * + * Creates a new #NMDHCP6Config. + * + * Returns: a new configuration + **/ +GObject * +nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path) +{ + return (GObject *) g_object_new (NM_TYPE_DHCP6_CONFIG, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); +} + +/** + * nm_dhcp6_config_get_options: + * @config: a #NMDHCP6Config + * + * Gets all the options contained in the configuration. + * + * Returns: the #GHashTable containing strings for keys and values. + * This is the internal copy used by the configuration, and must not be modified. + **/ +GHashTable * +nm_dhcp6_config_get_options (NMDHCP6Config *config) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config); + GValue value = { 0, }; + + if (g_hash_table_size (priv->options)) + return priv->options; + + if (!_nm_object_get_property (NM_OBJECT (config), + "org.freedesktop.DBus.Properties", + "Options", + &value)) + goto out; + + demarshal_dhcp6_options (NM_OBJECT (config), NULL, &value, &priv->options); + g_value_unset (&value); + +out: + return priv->options; +} + +/** + * nm_dhcp6_config_get_one_option: + * @config: a #NMDHCP6Config + * @option: the option to retrieve + * + * Gets one option by option name. + * + * Returns: the configuration option's value. This is the internal string used by the + * configuration, and must not be modified. + **/ +const char * +nm_dhcp6_config_get_one_option (NMDHCP6Config *config, const char *option) +{ + g_return_val_if_fail (NM_IS_DHCP6_CONFIG (config), NULL); + + return g_hash_table_lookup (nm_dhcp6_config_get_options (config), option); +} + diff --git a/libnm-glib/nm-dhcp6-config.h b/libnm-glib/nm-dhcp6-config.h new file mode 100644 index 0000000000..91f32fa036 --- /dev/null +++ b/libnm-glib/nm-dhcp6-config.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_DHCP6_CONFIG_H +#define NM_DHCP6_CONFIG_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ()) +#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6Config)) +#define NM_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) +#define NM_IS_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP6_CONFIG)) +#define NM_IS_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP6_CONFIG)) + +typedef struct { + NMObject parent; +} NMDHCP6Config; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDHCP6ConfigClass; + +#define NM_DHCP6_CONFIG_OPTIONS "options" + +GType nm_dhcp6_config_get_type (void); + +GObject *nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path); + +GHashTable * nm_dhcp6_config_get_options (NMDHCP6Config *config); + +const char * nm_dhcp6_config_get_one_option (NMDHCP6Config *config, const char *option); + +G_END_DECLS + +#endif /* NM_DHCP6_CONFIG_H */ From fbe413cbcd4f03246e7d8781cec4300acb4a8984 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 15 Jan 2010 12:50:38 -0800 Subject: [PATCH 035/392] dhcp: ensure DHCP client is stopped on timeout --- src/dhcp-manager/nm-dhcp-client.c | 3 ++- src/nm-device.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 03373d7172..7eb73006d7 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -193,7 +193,8 @@ daemon_timeout (gpointer user_data) NMDHCPClient *self = NM_DHCP_CLIENT (user_data); NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); - g_message ("(%s): DHCP transaction took too long, stopping it.", priv->iface); + g_message ("(%s): DHCPv%c request timed out.", + priv->iface, priv->ipv6 ? '6' : '4'); g_signal_emit (G_OBJECT (self), signals[TIMEOUT], 0); return FALSE; } diff --git a/src/nm-device.c b/src/nm-device.c index 7700c7a10f..5acfb2a0dc 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1224,6 +1224,8 @@ dhcp_timeout (NMDHCPClient *client, gpointer user_data) if (!nm_device_get_act_request (device)) return; + nm_dhcp_client_stop (client); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { if (nm_dhcp_client_get_ipv6 (client)) nm_device_activate_schedule_stage4_ip6_config_timeout (device); From 3f90f3aea728dc57055d9256ade15320c6313959 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Fri, 15 Jan 2010 17:30:37 -0800 Subject: [PATCH 036/392] po: updated Hungarian translation (bgo #596112) --- po/hu.po | 614 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 414 insertions(+), 200 deletions(-) diff --git a/po/hu.po b/po/hu.po index 7bb2ed0240..742cdb15b3 100644 --- a/po/hu.po +++ b/po/hu.po @@ -1,76 +1,418 @@ # Hungarian translation of NetworkManager -# Gabor Kelemen , 2005, 2006, 2007, 2008. # This file is distributed under the same license as the NetworkManager package. # Copyright (C) 2005, Free Software Foundation. Inc. +# +# Gabor Kelemen , 2005, 2006, 2007, 2008, 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.HEAD.hu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-05 18:57+0000\n" -"PO-Revision-Date: 2008-09-25 21:33+0200\n" -"Last-Translator: Gabor Kelemen \n" -"Language-Team: Hungarian \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: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-01-03 14:57+0100\n" +"Last-Translator: Gabor Kelemen \n" +"Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "A PEM kulcsfájl nem rendelkezik „%s” zárócímkével." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Nem tűnik PEM személyes kulcs fájlnak." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Nincs elég memória a PEM fájl adatainak tárolásához." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Rosszul formázott PEM fájl: a Proc-Type nem az első címke." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Rosszul formázott PEM fájl: ismeretlen Proc-Type címke („%s”)." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Rosszul formázott PEM fájl: A DEK-Info nem a második címke." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Rosszul formázott PEM fájl: nem található IV a DEK-Info címkében." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Rosszul formázott PEM fájl: az IV formátuma érvénytelen a DEK-Info címkében." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Rosszul formázott PEM fájl: ismeretlen személyes kulcs titkosító: „%s”." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "A személyes kulcs nem fejthető vissza." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "A(z) „%s” PEM tanúsítvány nem tartalmaz záró „%s” címkét." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "A tanúsítvány visszafejtése meghiúsult." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nincs elég memória a tanúsítvány adatainak tárolásához." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Nincs elég memória a fájl adatainak tárolásához." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Az IV hosszának páros számú bájtnak kell lennie." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nincs elég memória az IV tárolásához." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "Az IV nem hexadecimális számjegyeket tartalmaz." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "A(z) „%s” személyeskulcs-titkosító ismeretlen." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nincs elég memória a személyes kulcs visszafejtéséhez." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "A személyes kulcs típusa nem határozható meg." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nincs elég memória a visszafejtett személyes kulcs tárolásához." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "A titkosító alrendszer előkészítése meghiúsult." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Az MD5 alrendszer előkészítése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Érvénytelen IV hossz (legalább %zd hosszúnak kell lennie)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nincs elég memória a visszafejtett kulcspufferhez." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "A visszafejtési titkosító kontextusának előkészítése meghiúsult: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "A szimmetrikus kulcs beállítása meghiúsult a visszafejtéshez: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Az IV beállítása meghiúsult a visszafejtéshez: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "A személyes kulcs visszafejtése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "A személyes kulcs visszafejtése meghiúsult: váratlan kitöltéshossz." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "A személyes kulcs visszafejtése meghiúsult." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nem sikerült memóriát foglalni a titkosításhoz." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "A titkosító kontextusának előkészítése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "A szimmetrikus kulcs beállítása meghiúsult a titkosításhoz: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Az IV beállítása meghiúsult a titkosításhoz: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Az adatot nem sikerült titkosítani: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Hiba a tanúsítvány adatainak előkészítésekor: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "A tanúsítvány nem fejthető vissza: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "A PKCS#12 dekódoló nem készíthető elő: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "A PKCS#12 fájl nem fejthető vissza: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "A PKCS#12 fájl nem ellenőrizhető: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "A titkosító alrendszer előkészítése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Az MD5 kontextus előkészítése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Érvénytelen IV hossz (legalább %d hosszúnak kell lennie)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "A visszafejtési titkosítóhely előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "A szimmetrikus kulcs nem állítható be a visszafejtéshez." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Az IV nem állítható be a visszafejtéshez." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "A visszafejtési kontextus előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "A személyes kulcs visszafejtése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "A személyes kulcs visszafejtése meghiúsult: a visszafejtett adatok túl nagyok." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "A személyes kulcs visszafejtésének befejezése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "A titkosítóhely előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "A szimmetrikus kulcs nem állítható be a titkosításhoz." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Az IV nem állítható be a titkosításhoz." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "A titkosítási kontextus előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "A titkosítás meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Váratlan mennyiségű adat a titkosítás után." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "A tanúsítvány nem fejthető vissza: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "A jelszó nem alakítható UCS2 formátumra: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "A PKCS#12 dekódoló nem készíthető elő: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "A PKCS#12 fájl nem fejthető vissza: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "A PKCS#12 fájl nem ellenőrizhető: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Nem sikerült a véletlen adatok előállítása." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nincs elég memória titkosítási kulcs készítéséhez." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nem sikerült memóriát foglalni PEM fájl készítéséhez." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nem sikerült memóriát foglalni az IV írásához PEM fájlba." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nem sikerült memóriát foglalni a titkosított kulcs PEM fájlba írásához." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nem sikerült memóriát foglalni a PEM fájl adatainak." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "hiba a netlink üzenet feldolgozásakor: %s" -#: ../src/nm-netlink-monitor.c:250 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "nem lehet netlink kezelőt lefoglalni a kapcsolat állapotának megfigyelése " "érdekében: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "nem lehet kapcsolódni a netlinkhez a kapcsolat állapotának megfigyelése " "érdekében: %s" -#: ../src/nm-netlink-monitor.c:268 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" "nem lehet csatlakozni a netlink csoporthoz a kapcsolat állapotának " "megfigyelése érdekében: %s" -#: ../src/nm-netlink-monitor.c:276 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "nem lehet netlink kapcsolat-gyorsítótárat lefoglalni a kapcsolat állapotának " "megfigyelése érdekében: %s" -#: ../src/nm-netlink-monitor.c:439 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "hiba lépett fel adatokra várakozás közben a foglalaton" + +#: ../src/nm-netlink-monitor.c:558 #, c-format msgid "error updating link cache: %s" msgstr "hiba a kapcsolat gyorsítótárának frissítésekor: %s" -#: ../src/nm-netlink-monitor.c:497 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "hiba lépett fel adatokra várakozás közben a foglalaton" - -#: ../src/NetworkManager.c:250 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Érvénytelen kapcsoló. Az érvényes kapcsolók listájáért használja a --help " "kapcsolót.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# Készítette a NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -79,201 +421,73 @@ msgstr "" "# Összefésülve ebből: %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:240 +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "nem lehet netlink kezelőt lefoglalni: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "nem lehet kapcsolódni a netlinkhez: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nem lehet csatlakozni a netlink csoporthoz: %s" + +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "MEGJEGYZÉS: a libc feloldó nem támogat háromnál több névkiszolgálót." -#: ../src/named-manager/nm-named-manager.c:242 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Az alább felsorolt névkiszolgálók lehet, hogy nem kerülnek felismerésre." -#: ../system-settings/src/main.c:366 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "Automatikus %s" -#: ../libnm-util/crypto.c:125 -#, c-format -msgid "PEM key file had no end tag '%s'." -msgstr "A PEM kulcsfájl nem rendelkezik „%s” zárócímkével." +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "Rendszer" -#: ../libnm-util/crypto.c:135 -#, c-format -msgid "Doesn't look like a PEM private key file." -msgstr "Nem tűnik PEM személyes kulcs fájlnak." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Kapcsolatmegosztás védett WiFi hálózaton" -#: ../libnm-util/crypto.c:143 -#, c-format -msgid "Not enough memory to store PEM file data." -msgstr "Nincs elég memória a PEM fájl adatainak tárolásához." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Kapcsolatmegosztás nyílt WiFi hálózaton" -#: ../libnm-util/crypto.c:159 -#, c-format -msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "Rosszul formázott PEM fájl: a Proc-Type nem az első címke." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Állandó rendszergépnév módosítása" -#: ../libnm-util/crypto.c:167 -#, c-format -msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Rosszul formázott PEM fájl: ismeretlen Proc-Type címke („%s”)." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Rendszerkapcsolatok módosítása" -#: ../libnm-util/crypto.c:177 -#, c-format -msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "Rosszul formázott PEM fájl: A DEK-Info nem a második címke." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "A rendszer házirendje megakadályozza a rendszerbeállítások módosítását" -#: ../libnm-util/crypto.c:188 -#, c-format -msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Rosszul formázott PEM fájl: nem található IV a DEK-Info címkében." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"A rendszer házirendje megakadályozza a rendszer állandó gépnevének " +"módosítását" -#: ../libnm-util/crypto.c:195 -#, c-format -msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Rosszul formázott PEM fájl: az IV formátuma érvénytelen a DEK-Info címkében." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását védett WiFi " +"hálózaton" -#: ../libnm-util/crypto.c:208 -#, c-format -msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "Rosszul formázott PEM fájl: ismeretlen személyes kulcs titkosító: „%s”." - -#: ../libnm-util/crypto.c:227 -#, c-format -msgid "Could not decode private key." -msgstr "A személyes kulcs nem fejthető vissza." - -#: ../libnm-util/crypto.c:271 -#, c-format -msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "A(z) „%s” PEM tanúsítvány nem tartalmaz záró „%s” címkét." - -#: ../libnm-util/crypto.c:281 -#, c-format -msgid "Failed to decode certificate." -msgstr "A tanúsítvány visszafejtése meghiúsult." - -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 -#, c-format -msgid "Not enough memory to store certificate data." -msgstr "Nincs elég memória a tanúsítvány adatainak tárolásához." - -#: ../libnm-util/crypto.c:328 -#, c-format -msgid "IV must be an even number of bytes in length." -msgstr "Az IV hosszának páros számú bájtnak kell lennie." - -#: ../libnm-util/crypto.c:337 -#, c-format -msgid "Not enough memory to store the IV." -msgstr "Nincs elég memória az IV tárolásához." - -#: ../libnm-util/crypto.c:348 -#, c-format -msgid "IV contains non-hexadecimal digits." -msgstr "Az IV nem hexadecimális számjegyeket tartalmaz." - -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:142 -#: ../libnm-util/crypto_nss.c:155 -#, c-format -msgid "Private key cipher '%s' was unknown." -msgstr "A(z) „%s” személyeskulcs-titkosító ismeretlen." - -#: ../libnm-util/crypto.c:395 -#, c-format -msgid "Not enough memory to create private key decryption key." -msgstr "Nincs elég memória a személyes kulcs visszafejtési kulcsának létrehozásához." - -#: ../libnm-util/crypto.c:513 -#, c-format -msgid "Not enough memory to store decrypted private key." -msgstr "Nincs elég memória a visszafejtett személyes kulcs tárolásához." - -#: ../libnm-util/crypto_gnutls.c:43 -msgid "Failed to initialize the crypto engine." -msgstr "A titkosító alrendszer előkészítése meghiúsult." - -#: ../libnm-util/crypto_gnutls.c:88 -#, c-format -msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Az MD5 alrendszer előkészítése meghiúsult: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:151 ../libnm-util/crypto_nss.c:164 -#, c-format -msgid "Not enough memory for decrypted key buffer." -msgstr "Nincs elég memória a visszafejtett kulcspufferhez." - -#: ../libnm-util/crypto_gnutls.c:159 -#, c-format -msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "A visszafejtési titkosító kontextusának előkészítése meghiúsult: %s /%s." - -#: ../libnm-util/crypto_gnutls.c:168 -#, c-format -msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "A szimmetrikus kulcs beállítása meghiúsult a visszafejtéshez: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:177 -#, c-format -msgid "Failed to set IV for decryption: %s / %s." -msgstr "Az IV beállítása meghiúsult a visszafejtéshez: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:186 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "A személyes kulcs visszafejtése meghiúsult: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:224 -#, c-format -msgid "Error initializing certificate data: %s" -msgstr "Hiba a tanúsítvány adatainak előkészítésekor: %s" - -#: ../libnm-util/crypto_gnutls.c:236 -#, c-format -msgid "Couldn't decode certificate: %s" -msgstr "A tanúsítvány nem fejthető vissza: %s" - -#: ../libnm-util/crypto_nss.c:49 -#, c-format -msgid "Failed to initialize the crypto engine: %d." -msgstr "A titkosító alrendszer előkészítése meghiúsult: %d." - -#: ../libnm-util/crypto_nss.c:96 -#, c-format -msgid "Failed to initialize the MD5 context: %d." -msgstr "Az MD5 kontextus előkészítése meghiúsult: %d." - -#: ../libnm-util/crypto_nss.c:172 -#, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "A visszafejtési titkosítóhely előkészítése meghiúsult." - -#: ../libnm-util/crypto_nss.c:182 -#, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "A szimmetrikus kulcs nem állítható be a visszafejtéshez." - -#: ../libnm-util/crypto_nss.c:192 -#, c-format -msgid "Failed to set IV for decryption." -msgstr "Az IV nem állítható be a visszafejtéshez." - -#: ../libnm-util/crypto_nss.c:200 -#, c-format -msgid "Failed to initialize the decryption context." -msgstr "A visszafejtési kontextus előkészítése meghiúsult." - -#: ../libnm-util/crypto_nss.c:213 -#, c-format -msgid "Failed to decrypt the private key: %d." -msgstr "A személyes kulcs visszafejtése meghiúsult: %d." - -#: ../libnm-util/crypto_nss.c:225 -#, c-format -msgid "Failed to finalize decryption of the private key: %d." -msgstr "A személyes kulcs visszafejtésének befejezése meghiúsult: %d." - -#: ../libnm-util/crypto_nss.c:269 -#, c-format -msgid "Couldn't decode certificate: %d" -msgstr "A tanúsítvány nem fejthető vissza: %d" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását nyílt WiFi " +"hálózaton" From c0b951d83baaa5b11c63acedf580b72e4ba02d6c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 17 Jan 2010 23:26:05 -0800 Subject: [PATCH 037/392] po: updated Slovenian translation (bgo #604836) --- po/sl.po | 1702 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 888 insertions(+), 814 deletions(-) diff --git a/po/sl.po b/po/sl.po index d42310fb1d..425fd752e2 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1,918 +1,992 @@ # Slovenian translation of NetworkManager. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. -# # Matic Žgur , 2007. +# Andrej Žnidaršič , 2009. # msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-11-17 05:31+0100\n" -"PO-Revision-Date: 2007-01-09 16:11+0100\n" -"Last-Translator: Matic Žgur \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2009-12-17 07:10+0100\n" +"Last-Translator: Andrej Žnidaršič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" +"X-Poedit-Country: SLOVENIA\n" "X-Poedit-Language: Slovenian\n" +"X-Poedit-SourceCharset: utf-8\n" -#: ../gnome/applet/applet-compat.c:171 -#: ../gnome/applet/applet-dbus-info.c:926 +#: ../libnm-util/crypto.c:120 #, c-format -msgid "Passphrase for wireless network %s" -msgstr "Šifrirna fraza za brezžično omrežje %s" +msgid "PEM key file had no end tag '%s'." +msgstr "Ključna datoteka PEM nima končne oznake '%s'." -#: ../gnome/applet/applet-dbus.c:274 +#: ../libnm-util/crypto.c:130 #, c-format -msgid "Connection to the wireless network '%s' failed." -msgstr "Povezava z brezžičnim omrežjem %s ni uspela" +msgid "Doesn't look like a PEM private key file." +msgstr "Ni videti kot PEM zasebna ključna datoteka." -#: ../gnome/applet/applet-dbus.c:279 -msgid "Connection to the wired network failed." -msgstr "Povezava z žičnim omrežjem ni uspela." - -#: ../gnome/applet/applet.c:182 -msgid "Error displaying connection information:" -msgstr "Napaka pri prikazovanju informacij o povezavi:" - -#: ../gnome/applet/applet.c:200 -msgid "Could not find some required resources (the glade file)!" -msgstr "Ni mogoče najti nekaterih zahtevanih virov (datoteke glade)!" - -#: ../gnome/applet/applet.c:210 -msgid "No active connections!" -msgstr "Ni aktivnih povezav!" - -#: ../gnome/applet/applet.c:227 +#: ../libnm-util/crypto.c:138 #, c-format -msgid "%d Mb/s" -msgstr "%d Mb/s" +msgid "Not enough memory to store PEM file data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov datoteke PEM." -#: ../gnome/applet/applet.c:230 +#: ../libnm-util/crypto.c:154 #, c-format -msgid "Wired Ethernet (%s)" -msgstr "Žični eternet (%s)" +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Slabo oblikovana datoteka PEM: Proc-Type ni prva oznaka." -#: ../gnome/applet/applet.c:232 +#: ../libnm-util/crypto.c:162 #, c-format -msgid "Wireless Ethernet (%s)" -msgstr "Brezžični eternet (%s)" +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Slabo oblikovana datoteka PEM: neznana oznaka Proc-Type '%s'" -#: ../gnome/applet/applet.c:238 -msgid "Unknown" -msgstr "Neznano" - -#: ../gnome/applet/applet.c:330 -#: ../gnome/applet/applet.c:357 -msgid "NetworkManager Applet" -msgstr "Programček NetworkManager" - -#: ../gnome/applet/applet.c:332 -msgid "" -"Copyright © 2004-2006 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." -msgstr "" -"Copyright © 2004-2006 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." - -#: ../gnome/applet/applet.c:334 -#: ../gnome/applet/applet.c:361 -msgid "Notification area applet for managing your network devices and connections." -msgstr "Programček za območje obvestil za upravljanje vaših mrežnih naprav in povezav." - -#: ../gnome/applet/applet.c:337 -#: ../gnome/applet/applet.c:365 -msgid "translator-credits" -msgstr "Matic Žgur " - -#: ../gnome/applet/applet.c:359 -msgid "" -"Copyright © 2004-2005 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." -msgstr "" -"Copyright © 2004-2005 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." - -#: ../gnome/applet/applet.c:421 -msgid "VPN Login Failure" -msgstr "Neuspela prijava VPN" - -#: ../gnome/applet/applet.c:422 +#: ../libnm-util/crypto.c:172 #, c-format -msgid "Could not start the VPN connection '%s' due to a login failure." -msgstr "Ni mogoče začeti povezave VPN '%s' zaradi neuspele prijave." +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Slabo oblikovana datoteka PEM: DEK-Info ni druga oznaka." -#: ../gnome/applet/applet.c:426 -msgid "VPN Start Failure" -msgstr "Neuspel zagon VPN" - -#: ../gnome/applet/applet.c:427 +#: ../libnm-util/crypto.c:183 #, c-format -msgid "Could not start the VPN connection '%s' due to a failure launching the VPN program." -msgstr "Ni mogoče začeti povezave VPN '%s' zaradi neuspelega zagona programa VPN." +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Slabo oblikovana datoteka PEM: IV ni mogoče najti v DEK-Info oznaki." -#: ../gnome/applet/applet.c:431 -#: ../gnome/applet/applet.c:441 -msgid "VPN Connect Failure" -msgstr "Neuspela povezava VPN" - -#: ../gnome/applet/applet.c:432 +#: ../libnm-util/crypto.c:190 #, c-format -msgid "Could not start the VPN connection '%s' due to a connection error." -msgstr "Ni mogoče začeti povezave VPN '%s' zaradi napake pri povezavi." +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Slabo oblikovana datoteka PEM: neveljavna oblika IV v DEK-Info oznaki." -#: ../gnome/applet/applet.c:436 -msgid "VPN Configuration Error" -msgstr "Napaka nastavitev VPN" - -#: ../gnome/applet/applet.c:437 +#: ../libnm-util/crypto.c:203 #, c-format -msgid "The VPN connection '%s' was not correctly configured." -msgstr "Povezava VPN '%s' ni pravilno nastavljena." +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Slabo oblikovana datoteka PEM: neznana cifra zasebnega ključa '%s'." -#: ../gnome/applet/applet.c:442 +#: ../libnm-util/crypto.c:222 #, c-format -msgid "Could not start the VPN connection '%s' because the VPN server did not return an adequate network configuration." -msgstr "Ni mogoče začeti povezave VPN '%s', ker strežnik VPN ni vrnil ustreznih nastavitev." +msgid "Could not decode private key." +msgstr "Zasebnega ključa ni mogoče dekodirati." -#: ../gnome/applet/applet.c:512 -msgid "VPN Login Message" -msgstr "Prijavno sporočilo VPN" - -#: ../gnome/applet/applet.c:737 -#: ../gnome/applet/applet.c:2635 -#: ../gnome/applet/other-network-dialog.c:458 -#: ../gnome/applet/passphrase-dialog.c:228 -msgid "The NetworkManager Applet could not find some required resources (the glade file was not found)." -msgstr "Programček NetworkManager ne more najti nekaterih zahtevanih virov (datoteka glade ni bila najdena)." - -#: ../gnome/applet/applet.c:749 +#: ../libnm-util/crypto.c:267 #, c-format -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "Omrežna naprava \"%s (%s)\" ne podpira skeniranja brezžičnih omrežij." +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM potrdilo '%s' nima končne oznake '%s'." -#: ../gnome/applet/applet.c:757 +#: ../libnm-util/crypto.c:277 #, c-format -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "Omrežna naprava \"%s (%s)\" ne podpira odkrivanja povezav." +msgid "Failed to decode certificate." +msgstr "Dekodiranje potrdila je spodletelo." -#. Note to translators: this is used if no essid is known -#: ../gnome/applet/applet.c:905 -#: ../gnome/applet/applet.c:1103 -msgid "(unknown)" -msgstr "(neznano)" - -#: ../gnome/applet/applet.c:911 +#: ../libnm-util/crypto.c:286 #, c-format -msgid "Preparing device %s for the wired network..." -msgstr "Pripravljanje naprave %s na žično omrežje ..." +msgid "Not enough memory to store certificate data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov potrdila." -#: ../gnome/applet/applet.c:913 +#: ../libnm-util/crypto.c:294 #, c-format -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "Pripravljanje naprave %s na rezžično omrežje '%s' ..." +msgid "Not enough memory to store file data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov datoteke." -#: ../gnome/applet/applet.c:921 +#: ../libnm-util/crypto.c:324 #, c-format -msgid "Configuring device %s for the wired network..." -msgstr "Nastavljanje naprave %s za žično omrežje ..." +msgid "IV must be an even number of bytes in length." +msgstr "IV mora biti dolg sodo število bajtov." -#: ../gnome/applet/applet.c:923 +#: ../libnm-util/crypto.c:333 #, c-format -msgid "Attempting to join the wireless network '%s'..." -msgstr "Poskus pridruževanja brezžičnemu omrežju '%s' ..." +msgid "Not enough memory to store the IV." +msgstr "Za shranjevanje IV ni dovolj pomnilnika." -#: ../gnome/applet/applet.c:931 +#: ../libnm-util/crypto.c:344 #, c-format -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "Čakanje na omrežni ključ za brezžično omrežje '%s' ..." +msgid "IV contains non-hexadecimal digits." +msgstr "IV vsebuje ne-šestnajstiške številke." -#: ../gnome/applet/applet.c:939 -#: ../gnome/applet/applet.c:949 -msgid "Requesting a network address from the wired network..." -msgstr "Zahtevanje omrežnega naslova iz žičnega omrežja ..." - -#: ../gnome/applet/applet.c:941 -#: ../gnome/applet/applet.c:951 +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 #, c-format -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "Zahtevanje omrežnega naslova iz brezžičnega omrežja '%s' ..." +msgid "Private key cipher '%s' was unknown." +msgstr "Cifra zasebnega ključa '%s' je neznana." -#: ../gnome/applet/applet.c:959 -msgid "Finishing connection to the wired network..." -msgstr "Zaključevanje povezave v žično omrežje ..." - -#: ../gnome/applet/applet.c:961 +#: ../libnm-util/crypto.c:391 #, c-format -msgid "Finishing connection to the wireless network '%s'..." -msgstr "Zaključevanje povezave v brezžično omrežje '%s' ..." +msgid "Not enough memory to decrypt private key." +msgstr "Ni dovolj pomnilnika za dešifriranje zasebnega ključa." -#: ../gnome/applet/applet.c:1078 -msgid "NetworkManager is not running" -msgstr "NetworkManager ni zagnan" - -#: ../gnome/applet/applet.c:1086 -#: ../gnome/applet/applet.c:1843 -msgid "Networking disabled" -msgstr "Omrežje onemogočeno" - -#: ../gnome/applet/applet.c:1091 -msgid "No network connection" -msgstr "Nobene omrežne povezave" - -#: ../gnome/applet/applet.c:1096 -msgid "Wired network connection" -msgstr "Žična omrežna povezava" - -#: ../gnome/applet/applet.c:1100 -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Povezan v ad-hoc brezžično omrežje" - -#: ../gnome/applet/applet.c:1102 +#: ../libnm-util/crypto.c:511 #, c-format -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "Brezžična omrežna povezava z '%s' (%d%%)" +msgid "Unable to determine private key type." +msgstr "Ni mogoče določiti vrste zasebnega ključa." -#: ../gnome/applet/applet.c:1123 +#: ../libnm-util/crypto.c:530 #, c-format -msgid "VPN connection to '%s'" -msgstr "Povezave VPN z '%s'" +msgid "Not enough memory to store decrypted private key." +msgstr "Ni dovolj pomnilnika za shranjevanje dešifriranega zasebnega ključa." -#: ../gnome/applet/applet.c:1131 +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Zagon motorja šifriranja je spodletel." + +#: ../libnm-util/crypto_gnutls.c:93 #, c-format -msgid "VPN connecting to '%s'" -msgstr "Povezovanje VPN z '%s'" +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Zagon motorja MD5 je spodletel: %s / %s." -#: ../gnome/applet/applet.c:1556 -msgid "_Connect to Other Wireless Network..." -msgstr "Po_veži se v drugo brezžično omrežje ..." - -#: ../gnome/applet/applet.c:1577 -msgid "Create _New Wireless Network..." -msgstr "_Ustvari novo brezžično omrežje ..." - -#: ../gnome/applet/applet.c:1700 -msgid "_VPN Connections" -msgstr "_Povezave VPN" - -#: ../gnome/applet/applet.c:1745 -msgid "_Configure VPN..." -msgstr "_Nastavi VPN ..." - -#: ../gnome/applet/applet.c:1749 -msgid "_Disconnect VPN..." -msgstr "_Prekini povezavo z VPN ..." - -#: ../gnome/applet/applet.c:1771 -msgid "_Dial Up Connections" -msgstr "_Klicna povezava" - -#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item -#: ../gnome/applet/applet.c:1782 +#: ../libnm-util/crypto_gnutls.c:156 #, c-format -msgid "Connect to %s..." -msgstr "Poveži se v %s ..." +msgid "Invalid IV length (must be at least %zd)." +msgstr "Neveljavna dolžina IV (mora biti vsaj %zd)" -#: ../gnome/applet/applet.c:1788 +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 #, c-format -msgid "Disconnect from %s..." -msgstr "Prekini povezavo z %s ..." +msgid "Not enough memory for decrypted key buffer." +msgstr "Ni dovolj pomnilnika za medpomnilnik ključa dešifriranja." -#: ../gnome/applet/applet.c:1837 -msgid "No network devices have been found" -msgstr "Najdena ni bila nobena omrežna naprava" - -#: ../gnome/applet/applet.c:2029 -msgid "NetworkManager is not running..." -msgstr "NetworkManager ni zagnan ..." - -#. 'Enable Networking' item -#: ../gnome/applet/applet.c:2210 -msgid "Enable _Networking" -msgstr "Omogoči _omrežje" - -#. 'Enable Wireless' item -#: ../gnome/applet/applet.c:2216 -msgid "Enable _Wireless" -msgstr "Omogoči _brezžično omrežje" - -#. 'Connection Information' item -#: ../gnome/applet/applet.c:2222 -msgid "Connection _Information" -msgstr "_Informacije o povezavi" - -#. Help item -#: ../gnome/applet/applet.c:2233 -msgid "_Help" -msgstr "_Pomoč" - -#. About item -#: ../gnome/applet/applet.c:2242 -msgid "_About" -msgstr "_O Programu" - -#: ../gnome/applet/applet.c:2824 -msgid "The NetworkManager applet could not find some required resources. It cannot continue.\n" -msgstr "Programček NetworkManager ne more najti nekaterih zahtevanih virov. Ni mogoče nadaljevati.\n" - -#: ../gnome/applet/wireless-security-option.c:157 -msgid "Open System" -msgstr "Odprti sistem" - -#: ../gnome/applet/wireless-security-option.c:160 -msgid "Shared Key" -msgstr "Deljeni ključ" - -#: ../gnome/applet/wireless-security-option.c:208 -msgid "Automatic (Default)" -msgstr "Samodejno (privzeto)" - -#: ../gnome/applet/wireless-security-option.c:215 -msgid "AES-CCMP" -msgstr "AES-CCMP" - -#: ../gnome/applet/wireless-security-option.c:223 -msgid "TKIP" -msgstr "TKIP" - -#: ../gnome/applet/wireless-security-option.c:231 -msgid "Dynamic WEP" -msgstr "Dinamični WEP" - -#: ../gnome/applet/wso-none.c:53 -msgid "None" -msgstr "Brez" - -#: ../gnome/applet/wso-wep-ascii.c:138 -msgid "WEP 64/128-bit ASCII" -msgstr "WEP 64/128-bit ASCII" - -#: ../gnome/applet/wso-wep-hex.c:135 -msgid "WEP 64/128-bit Hex" -msgstr "WEP 64/128-bit Hex" - -#: ../gnome/applet/wso-wep-passphrase.c:135 -msgid "WEP 128-bit Passphrase" -msgstr "WEP 128-bit šifrirna fraza" - -#: ../gnome/applet/wso-wpa-eap.c:237 -msgid "PEAP" -msgstr "PEAP" - -#: ../gnome/applet/wso-wpa-eap.c:238 -msgid "TLS" -msgstr "TLS" - -#: ../gnome/applet/wso-wpa-eap.c:239 -msgid "TTLS" -msgstr "TTLS" - -#: ../gnome/applet/wso-wpa-eap.c:247 -#: ../src/nm-ap-security-wpa-eap.c:93 -#: ../src/nm-ap-security-wpa-eap.c:117 -msgid "WPA2 Enterprise" -msgstr "Podjetniški WPA2" - -#: ../gnome/applet/wso-wpa-eap.c:249 -#: ../src/nm-ap-security-wpa-eap.c:95 -#: ../src/nm-ap-security-wpa-eap.c:122 -msgid "WPA Enterprise" -msgstr "Podjetniški WPA" - -#: ../gnome/applet/wso-wpa-psk.c:178 -msgid "WPA2 Personal" -msgstr "Osebni WPA2" - -#: ../gnome/applet/wso-wpa-psk.c:180 -msgid "WPA Personal" -msgstr "Osebni WPA" - -#: ../gnome/applet/eggtrayicon.c:134 -msgid "Orientation" -msgstr "Usmerjenost" - -#: ../gnome/applet/eggtrayicon.c:135 -msgid "The orientation of the tray." -msgstr "Usmeritev pladnja." - -#: ../gnome/applet/menu-items.c:88 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format -msgid "Wired Network (%s)" -msgstr "Žično omrežje (%s)" +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Zagon vsebine cifre dešifriranje je spodletel: %s / %s." -#: ../gnome/applet/menu-items.c:91 -msgid "_Wired Network" -msgstr "Ž_ično omrežje" - -#: ../gnome/applet/menu-items.c:162 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "Brezžično omrežje (%s)" -msgstr[1] "Brezžični omrežji (%s)" -msgstr[2] "Brezžična omrežja (%s)" -msgstr[3] "Brezžična omrežja (%s)" +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Nastavljanje simetričnega ključa za dešifriranje je spodletelo: %s / %s. " -#: ../gnome/applet/menu-items.c:164 -msgid "Wireless Network" -msgid_plural "Wireless Networks" -msgstr[0] "Brezžično omrežje" -msgstr[1] "Brezžični omrežji" -msgstr[2] "Brezžična omrežja" -msgstr[3] "Brezžična omrežja" - -#: ../gnome/applet/menu-items.c:343 -msgid " (invalid Unicode)" -msgstr " (neveljaven Unicode)" - -#: ../gnome/applet/other-network-dialog.c:352 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format -msgid "By default, the wireless network's name is set to your computer's name, %s, with no encryption enabled" -msgstr "Privzeto je ime brezžičnega omrežja nastavljeno na ime vašega računalnika, %s, brez omogočenega šifriranja" +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Nastavljanje IV za dešifriranje je spodletelo: %s / %s." -#: ../gnome/applet/other-network-dialog.c:358 -msgid "Create new wireless network" -msgstr "Ustvari novo brezžično omrežje" - -#: ../gnome/applet/other-network-dialog.c:359 -msgid "Enter the name and security settings of the wireless network you wish to create." -msgstr "Vnesite ime in varnostne nastavitve brezžičnega omrežja, ki ga želite ustvariti." - -#: ../gnome/applet/other-network-dialog.c:363 -msgid "Create New Wireless Network" -msgstr "Ustvari novo brezžično omrežje" - -#: ../gnome/applet/other-network-dialog.c:368 -msgid "Existing wireless network" -msgstr "Obstoječe brezžično omrežje" - -#: ../gnome/applet/other-network-dialog.c:369 -msgid "Enter the name of the wireless network to which you wish to connect." -msgstr "Vnesite ime brezžičnega omrežja, v katerega se želite povezati." - -#: ../gnome/applet/other-network-dialog.c:371 -msgid "Connect to Other Wireless Network" -msgstr "Poveži se v drugo brezžično omrežje" - -#: ../gnome/applet/passphrase-dialog.c:215 -msgid "Error connecting to wireless network" -msgstr "Napaka pri povezovanju z brezžičnim omrežjem" - -#: ../gnome/applet/passphrase-dialog.c:216 -msgid "The requested wireless network requires security capabilities unsupported by your hardware." -msgstr "Zahtevano brezžično omrežje zahteva varnostne zmožnosti, ki so nepodprte z vašo strojno opremo." - -#: ../gnome/applet/vpn-password-dialog.c:151 -#: ../gnome/applet/vpn-password-dialog.c:188 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format -msgid "Cannot start VPN connection '%s'" -msgstr "Ni mogoče začeti povezave VPN '%s'" +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Dešifriranje zasebnega ključa je spodletelo: %s / %s." -#: ../gnome/applet/vpn-password-dialog.c:154 +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:266 #, c-format -msgid "Could not find the authentication dialog for VPN connection type '%s'. Contact your system administrator." -msgstr "Ni mogoče najti pogovornega okna za overitev za povezavo VPN vrste '%s'. Kontaktirajte sistemskega administratorja." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Dešifriranje zasebnega ključa je spodletelo: nepričakovana dolžina blazinjenja." -#: ../gnome/applet/vpn-password-dialog.c:191 +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:277 #, c-format -msgid "There was a problem launching the authentication dialog for VPN connection type '%s'. Contact your system administrator." -msgstr "Pri zagonu pogovornega okna za overovitev za povezavo VPN vrste '%s' je prišlo do problema. Kontaktirajte sistemskega administratorja." +msgid "Failed to decrypt the private key." +msgstr "Dešifriranje zasebnega ključa je spodletelo." -#: ../gnome/applet/applet.glade.h:1 -msgid " " -msgstr " " - -#: ../gnome/applet/applet.glade.h:2 -msgid "Active Connection Information" -msgstr "Informacije o aktivni povezavi" - -#: ../gnome/applet/applet.glade.h:4 -#, no-c-format -msgid "" -"Passphrase Required by Wireless Network\n" -"\n" -"A passphrase or encryption key is required to access the wireless network '%s'." -msgstr "" -"Šifrirna fraza, ki jo zahteva brezžično omrežje\n" -"\n" -"Za dostop do brezžičnega omrežja '%s' je zahtevana šifrirna fraza ali šifrirni ključ." - -#: ../gnome/applet/applet.glade.h:8 -#, no-c-format -msgid "" -"Reduced Network Functionality\n" -"\n" -"%s It will not be completely functional." -msgstr "" -"Zmanjšana uporabnost omrežja\n" -"\n" -"%s ne bo popolnoma uporaben." - -#: ../gnome/applet/applet.glade.h:12 -#, no-c-format -msgid "" -"Wireless Network Login Confirmation\n" -"\n" -"You have chosen to log in to the wireless network '%s'. If you are sure that this wireless network is secure, click the checkbox below and NetworkManager will not require confirmation on subsequent log ins." -msgstr "" -"Potrditev prijave v brezžično omrežje\n" -"\n" -"Izbrali ste prijavo v brezžično omrežje '%s'. Če ste prepričani, da je to brezžično omrežje varno, kliknite potrditveno polje spodaj in NetworkManager ne bo več zahteval potrditve za nadaljnje prijave." - -#: ../gnome/applet/applet.glade.h:15 -msgid "Anonymous Identity:" -msgstr "Anonimna identiteta:" - -#: ../gnome/applet/applet.glade.h:16 -msgid "Authentication:" -msgstr "Overovitev:" - -#: ../gnome/applet/applet.glade.h:17 -msgid "Broadcast Address:" -msgstr "Naslov za razpršeno oddajanje:" - -#: ../gnome/applet/applet.glade.h:18 -msgid "CA Certificate File:" -msgstr "Datoteka overiteljevega (CA) certifikata:" - -#: ../gnome/applet/applet.glade.h:19 -msgid "C_onnect" -msgstr "Po_veži se" - -#: ../gnome/applet/applet.glade.h:20 -msgid "Client Certificate File:" -msgstr "Datoteka odjemalčevega certifikata:" - -#: ../gnome/applet/applet.glade.h:21 -msgid "Connection Information" -msgstr "Informacije o povezavi" - -#: ../gnome/applet/applet.glade.h:22 -msgid "Default Route:" -msgstr "Privzeta smer:" - -#: ../gnome/applet/applet.glade.h:23 -msgid "Destination Address:" -msgstr "Ciljni naslov:" - -#: ../gnome/applet/applet.glade.h:24 -msgid "Driver:" -msgstr "Gonilnik:" - -#: ../gnome/applet/applet.glade.h:25 -msgid "EAP Method:" -msgstr "Metoda EAP:" - -#: ../gnome/applet/applet.glade.h:26 -msgid "Hardware Address:" -msgstr "Naslov strojne opreme:" - -#: ../gnome/applet/applet.glade.h:27 -msgid "IP Address:" -msgstr "IP naslov:" - -#: ../gnome/applet/applet.glade.h:28 -msgid "Identity:" -msgstr "Identiteta:" - -#: ../gnome/applet/applet.glade.h:29 -msgid "Interface:" -msgstr "Vmesnik:" - -#: ../gnome/applet/applet.glade.h:30 -msgid "Key Type:" -msgstr "Vrsta ključa:" - -#: ../gnome/applet/applet.glade.h:31 -msgid "Key management:" -msgstr "Upravljanje s ključi:" - -#: ../gnome/applet/applet.glade.h:32 -msgid "Key:" -msgstr "Ključ:" - -#: ../gnome/applet/applet.glade.h:33 -msgid "" -"None\n" -"WEP 128-bit Passphrase\n" -"WEP 64/128-bit Hex\n" -"WEP 64/128-bit ASCII\n" -msgstr "" -"Brez\n" -"WEP 128-bit šifrirna fraza\n" -"WEP 64/128-bit Hex\n" -"WEP 64/128-bit ASCII\n" - -#: ../gnome/applet/applet.glade.h:38 -msgid "" -"Open System\n" -"Shared Key" -msgstr "" -"Odprti sistem\n" -"Deljeni ključ" - -#: ../gnome/applet/applet.glade.h:40 -msgid "Other Wireless Network..." -msgstr "Drugo brezžično omrežje ..." - -#: ../gnome/applet/applet.glade.h:41 -msgid "Passphrase:" -msgstr "Šifrirna fraza:" - -#: ../gnome/applet/applet.glade.h:42 -msgid "Password:" -msgstr "Geslo:" - -#: ../gnome/applet/applet.glade.h:43 -msgid "Primary DNS:" -msgstr "Primarni DNS;" - -#: ../gnome/applet/applet.glade.h:44 -msgid "Private Key File:" -msgstr "Datoteka zasebnega ključa:" - -#: ../gnome/applet/applet.glade.h:45 -msgid "Private Key Password:" -msgstr "Geslo zasebnega ključa:" - -#: ../gnome/applet/applet.glade.h:46 -msgid "Secondary DNS:" -msgstr "Sekundarni DNS:" - -#: ../gnome/applet/applet.glade.h:47 -msgid "Select the CA Certificate File" -msgstr "Izberite datoteko overiteljevega (CA) certifikata" - -#: ../gnome/applet/applet.glade.h:48 -msgid "Select the Client Certificate File" -msgstr "Izberite datoteko odjemalčevega certifikata" - -#: ../gnome/applet/applet.glade.h:49 -msgid "Select the Private Key File" -msgstr "Izberite datoteko zasebnega ključa" - -#: ../gnome/applet/applet.glade.h:50 -msgid "Show key" -msgstr "Pokaži ključ" - -#: ../gnome/applet/applet.glade.h:51 -msgid "Show passphrase" -msgstr "Pokaži šifrirno frazo" - -#: ../gnome/applet/applet.glade.h:52 -msgid "Show password" -msgstr "Pokaži geslo" - -#: ../gnome/applet/applet.glade.h:53 -msgid "Show passwords" -msgstr "Pokaži gesla" - -#: ../gnome/applet/applet.glade.h:54 -msgid "Speed:" -msgstr "Hitrost:" - -#: ../gnome/applet/applet.glade.h:55 -msgid "Subnet Mask:" -msgstr "Maska podomrežja:" - -#: ../gnome/applet/applet.glade.h:56 -msgid "Type:" -msgstr "Vrsta:" - -#: ../gnome/applet/applet.glade.h:57 -msgid "User Name:" -msgstr "Uporabniško ime:" - -#: ../gnome/applet/applet.glade.h:58 -msgid "Wireless Network Key Required" -msgstr "Zahtevan ključ brezžičnega omrežja" - -#: ../gnome/applet/applet.glade.h:59 -msgid "Wireless _adapter:" -msgstr "Brezžični _vmesnik:" - -#: ../gnome/applet/applet.glade.h:60 -msgid "_Always Trust this Wireless Network" -msgstr "Vedno _zaupaj temu brezžičnemu omrežju" - -#: ../gnome/applet/applet.glade.h:61 -msgid "_Don't remind me again" -msgstr "_Ne spomni me več" - -#: ../gnome/applet/applet.glade.h:62 -msgid "_Fallback on this Network" -msgstr "" - -#: ../gnome/applet/applet.glade.h:63 -msgid "_Login to Network" -msgstr "_Prijava v omrežje" - -#: ../gnome/applet/applet.glade.h:64 -msgid "_Network Name:" -msgstr "_Ime omrežja:" - -#: ../gnome/applet/applet.glade.h:65 -msgid "_Wireless Security:" -msgstr "_Zaščita omrežja:" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:417 -msgid "Cannot add VPN connection" -msgstr "Ni mogoče dodati povezave VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:419 -msgid "No suitable VPN software was found on your system. Contact your system administrator." -msgstr "Ustrezna programska oprema za VPN ni bila najdena na vašem sistemu. Kontaktirajte vašega sistemskega administratorja." - -#: ../gnome/vpn-properties/nm-vpn-properties.c:461 -msgid "Cannot import VPN connection" -msgstr "Ni mogoče uvoziti povezave VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:355 #, c-format -msgid "Cannot find suitable software for VPN connection type '%s' to import the file '%s'. Contact your system administrator." -msgstr "Ni mogoče najti ustrezne programske opreme za povezavo VPN vrste '%s' za uvoz datoteke '%s'. Kontaktirajte vašega sistemskega administratorja." +msgid "Could not allocate memory for encrypting." +msgstr "Pomnilnika za šifriranje ni mogoče dodeliti." -#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#: ../libnm-util/crypto_gnutls.c:294 #, c-format -msgid "Error retrieving VPN connection '%s'" -msgstr "Napaka pri pridobivanju povezave VPN '%s'" +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Zagon vsebine šifrirne cifre je spodletel: %s / %s. " -#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#: ../libnm-util/crypto_gnutls.c:303 #, c-format -msgid "Could not find the UI files for VPN connection type '%s'. Contact your system administrator." -msgstr "Ni mogoče najti datotek uporabniškega vmesnika za povezavo VPN vrste \"%s\". Kontaktirajte vašega sistemskega administratorja." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Nastavitev simetričnega ključa za šifriranje je spodletela: %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#: ../libnm-util/crypto_gnutls.c:313 #, c-format -msgid "Delete VPN connection \"%s\"?" -msgstr "Ali želite izbrisati povezavo VPN \"%s\"?" +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Nastavitev IV za šifriranje je spodletela: %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#: ../libnm-util/crypto_gnutls.c:322 #, c-format -msgid "All information about the VPN connection \"%s\" will be lost and you may need your system administrator to provide information to create a new connection." -msgstr "Vse informacije o povezavi VPN \"%s\" bodo izgubljene in mogoče boste potrebovali vašega sistemskega administratorja, da vam priskrbi informacije za ustvarjanje nove povezave." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Šifriranje podatkov je spodletelo: %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:924 -msgid "Unable to load" -msgstr "Ni mogoče naložiti" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:926 -msgid "Cannot find some needed resources (the glade file)!" -msgstr "Ni mogoče najti nekaterih potrebnih virov (datoteke glade)!" - -#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), -#. NULL, -#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -#. GTK_STOCK_CANCEL, -#. GTK_RESPONSE_REJECT, -#. GTK_STOCK_APPLY, -#. GTK_RESPONSE_ACCEPT, -#. NULL)); -#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 -msgid "Create VPN Connection" -msgstr "Ustvari povezavo VPN" - -#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); -#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); -#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); -#. make the druid window modal wrt. our main window -#. gtk_window_set_modal (druid_window, TRUE); -#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); -#. Edit dialog -#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 -msgid "Edit VPN Connection" -msgstr "Uredi povezavo VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 -msgid "Add a new VPN connection" -msgstr "Dodaj novo povezavo VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 -msgid "Delete the selected VPN connection" -msgstr "Izbriši izbrano povezavo VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 -msgid "E_xport" -msgstr "I_zvozi" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 -msgid "Edit the selected VPN connection" -msgstr "Uredi izbrano povezavo VPN" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 -msgid "Export the VPN settings to a file" -msgstr "Izvozi nastavitve VPN v datoteko" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 -msgid "Export the selected VPN connection to a file" -msgstr "Izvozi izbrano povezavo VPN v datoteko" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 -msgid "Manage Virtual Private Network Connections" -msgstr "Upravljanje povezav navideznega zasebnega omrežja (VPN)" - -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 -msgid "VPN Connections" -msgstr "Povezave VPN" - -#: ../src/nm-ap-security-wep.c:52 -msgid "40-bit WEP" -msgstr "40-bitni WEP" - -#: ../src/nm-ap-security-wep.c:54 -msgid "104-bit WEP" -msgstr "104-bitni WEP" - -#: ../src/nm-ap-security-wpa-psk.c:50 -msgid "WPA TKIP" -msgstr "WPA TKIP" - -#: ../src/nm-ap-security-wpa-psk.c:52 -msgid "WPA CCMP" -msgstr "WPA CCMP" - -#: ../src/nm-ap-security-wpa-psk.c:54 -msgid "WPA Automatic" -msgstr "Samodejni WPA" - -#: ../src/nm-ap-security-wpa-psk.c:59 -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" - -#: ../src/nm-ap-security-wpa-psk.c:61 -msgid "WPA2 CCMP" -msgstr "WPA2 CCMP" - -#: ../src/nm-ap-security-wpa-psk.c:63 -msgid "WPA2 Automatic" -msgstr "Samodejni WPA2" - -#: ../src/nm-ap-security.c:338 -msgid "none" -msgstr "brez" - -#: ../src/nm-netlink-monitor.c:174 +#: ../libnm-util/crypto_gnutls.c:362 #, c-format -msgid "unable to create netlink socket for monitoring wired ethernet devices - %s" -msgstr "ni mogoče ustvariti netlink vtiča (netlink socket) za nadzor žičnih eternet naprav - %s" +msgid "Error initializing certificate data: %s" +msgstr "Napaka med zaganjanjem podatkov potrdila: %s" -#: ../src/nm-netlink-monitor.c:192 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format -msgid "unable to bind to netlink socket for monitoring wired ethernet devices - %s" -msgstr "ni mogoče vzpostaviti vezi z netlink vtičem (netlink socket) za nadzor žičnih eternet naprav - %s" +msgid "Couldn't decode certificate: %s" +msgstr "Potrdila ni mogoča dekodirati: %s" -#: ../src/nm-netlink-monitor.c:427 -msgid "operation took too long" -msgstr "operacija je trajala predolgo" +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %s" -#: ../src/nm-netlink-monitor.c:524 -msgid "received data from wrong type of sender" -msgstr "prejeti podatki od pošiljatelja napačne vrste" +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Datoteke PKCS#12 ni mogoče dekodirati: %s" -#: ../src/nm-netlink-monitor.c:537 -msgid "received data from unexpected sender" -msgstr "prejeti podatki od nepričakovanega pošiljatelja" +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Datoteke PKCS#12 ni mogoče preveriti: %s" -#: ../src/nm-netlink-monitor.c:666 -msgid "too much data was sent over socket and some of it was lost" -msgstr "preveč podatkov je bilo poslano preko vtiča in nekaj se jih je izgubilo" +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Zagon motorja šifriranja je spodletel: %d." -#: ../src/nm-netlink-monitor.c:776 +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Zagon vsebine MD5 je spodletel: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Neveljavna dolžina IV (mora biti vsaj %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Zagon polja cifre dešifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Nastavljanje simetričnega ključa za opis je spodletelo." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Nastavljanje IV za dešifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Zagon vsebine dešifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Dešifriranje zasebnega ključa je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Dešifriranje zasebnega ključa je spodletelo: dešifrirani podatki so preveliki." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Končanje dešifriranja zasebnega ključa je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Zagon polja cifre šifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Nastavljanje simetričnega ključa za šifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Nastavljanje IV za šifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Zaganjanje vsebine šifriranja je spodletelo." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Šifriranje je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Nepričakovana količina podatkov po šifriranju." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Potrdila ni mogoče dekodirati: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Gesla ni mogoče pretvoriti v UCS2: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Datoteke PCKS#12 ni mogoče dekodirati: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Datoteke PCKS#12 ni mogoče preveriti: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Naključnih podatkov ni mogoče ustvariti." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Ni dovolj pomnilnika za ustvarjanje šifrirnega ključa." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Ni mogoče dodeliti pomnilnika za ustvarjanje datoteke PEM." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ni mogoče dodeliti pomnilnika za zapis IV v datoteko PEM." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Ni mogoče dodeliti pomnilnika za zapis šifriranega ključa v datoteko PEM." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Ni mogoče dodeliti pomnilnika za podatke datoteke PEM." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "napaka med obdelovanjem sporočila netlink: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ni se mogoče povezati z netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ni se mogoče povezati s skupino netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ni mogoče dodeliti predpomnilnika netlink povezav za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 msgid "error occurred while waiting for data on socket" msgstr "med čakanjem na podatke na vtiču je prišlo do napake" -#: ../gnome/applet/applet-dbus-devices.c:930 +#: ../src/nm-netlink-monitor.c:558 #, c-format -msgid "You are now connected to the Ad-Hoc wireless network '%s'." -msgstr "Zdaj ste povezani v ad-hoc brezžično omrežje '%s'." +msgid "error updating link cache: %s" +msgstr "napaka med posodabljanjem predpomnilnika povezave: %s" -#: ../gnome/applet/applet-dbus-devices.c:935 +#: ../src/NetworkManager.c:330 #, c-format -msgid "You are now connected to the wireless network '%s'." -msgstr "Zdaj ste povezani z brezžičnim omrežjem '%s'." +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Neveljavna možnost. Uporabite --help za seznam veljavnih možnosti.\n" -#: ../gnome/applet/applet-dbus-devices.c:942 -msgid "You are now connected to the wired network." -msgstr "Zdaj ste povezani z žičnim omrežjem." +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "#Ustvaril upravljalnik omrežij\n" -#: ../gnome/applet/applet-dbus-devices.c:948 -msgid "Connection Established" -msgstr "Povezava vzpostavljena" +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Združeno iz %s\n" +"\n" -#: ../gnome/applet/applet-dbus-devices.c:997 -msgid "Disconnected" -msgstr "Prekinjena povezava" +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "Ročnika netlink ni mogoče dodeliti: %s" -#: ../gnome/applet/applet-dbus-devices.c:998 -msgid "The network connection has been disconnected." -msgstr "Omrežna povezava je bila prekinjena." +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "z netlink se ni mogoče povezati: %s" -#: ../src/nm-ap-security-leap.c:66 -#: ../src/nm-ap-security-leap.c:82 -msgid "LEAP" -msgstr "LEAP" +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "skupini netlink se ni mogoče pridružiti: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "OPOMBA: libc razreševalnik morda ne podpira več kot 3 imenske strežnike." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Imenski strežniki našteti spodaj morda ne bodo prepoznani." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Samodejno %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#| msgid "Open System" +msgid "System" +msgstr "Sistem" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Deljene povezave preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Deljene povezave preko odprtega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Spremeni trajno sistemsko ime gostitelja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +#| msgid "No active connections!" +msgid "Modify system connections" +msgstr "Spremeni sistemske povezave" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemska določila onemogočajo spreminjanje sistemskih nastavitev" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemska pravila preprečujejo spremembo imena gostitelja trajnega sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistemska pravila preprečujejo deljenje povezav preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistemska pravila preprečujejo deljenje povezav preko odprtega WiFi omrežja" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Šifrirna fraza za brezžično omrežje %s" +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Povezava z brezžičnim omrežjem %s ni uspela" +#~ msgid "Connection to the wired network failed." +#~ msgstr "Povezava z žičnim omrežjem ni uspela." +#~ msgid "Error displaying connection information:" +#~ msgstr "Napaka pri prikazovanju informacij o povezavi:" +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Ni mogoče najti nekaterih zahtevanih virov (datoteke glade)!" +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Žični eternet (%s)" +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Brezžični eternet (%s)" +#~ msgid "Unknown" +#~ msgstr "Neznano" +#~ msgid "NetworkManager Applet" +#~ msgstr "Programček NetworkManager" +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Programček za območje obvestil za upravljanje vaših mrežnih naprav in " +#~ "povezav." +#~ msgid "translator-credits" +#~ msgstr "Matic Žgur " +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "VPN Login Failure" +#~ msgstr "Neuspela prijava VPN" +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi neuspele prijave." +#~ msgid "VPN Start Failure" +#~ msgstr "Neuspel zagon VPN" +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Ni mogoče začeti povezave VPN '%s' zaradi neuspelega zagona programa VPN." +#~ msgid "VPN Connect Failure" +#~ msgstr "Neuspela povezava VPN" +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi napake pri povezavi." +#~ msgid "VPN Configuration Error" +#~ msgstr "Napaka nastavitev VPN" +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "Povezava VPN '%s' ni pravilno nastavljena." +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Ni mogoče začeti povezave VPN '%s', ker strežnik VPN ni vrnil ustreznih " +#~ "nastavitev." +#~ msgid "VPN Login Message" +#~ msgstr "Prijavno sporočilo VPN" +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov " +#~ "(datoteka glade ni bila najdena)." +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "" +#~ "Omrežna naprava \"%s (%s)\" ne podpira skeniranja brezžičnih omrežij." +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Omrežna naprava \"%s (%s)\" ne podpira odkrivanja povezav." +#~ msgid "(unknown)" +#~ msgstr "(neznano)" +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Pripravljanje naprave %s na žično omrežje ..." +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Pripravljanje naprave %s na rezžično omrežje '%s' ..." +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Nastavljanje naprave %s za žično omrežje ..." +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Poskus pridruževanja brezžičnemu omrežju '%s' ..." +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Čakanje na omrežni ključ za brezžično omrežje '%s' ..." +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Zahtevanje omrežnega naslova iz žičnega omrežja ..." +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Zahtevanje omrežnega naslova iz brezžičnega omrežja '%s' ..." +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Zaključevanje povezave v žično omrežje ..." +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Zaključevanje povezave v brezžično omrežje '%s' ..." +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager ni zagnan" +#~ msgid "Networking disabled" +#~ msgstr "Omrežje onemogočeno" +#~ msgid "No network connection" +#~ msgstr "Nobene omrežne povezave" +#~ msgid "Wired network connection" +#~ msgstr "Žična omrežna povezava" +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Povezan v ad-hoc brezžično omrežje" +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Brezžična omrežna povezava z '%s' (%d%%)" +#~ msgid "VPN connection to '%s'" +#~ msgstr "Povezave VPN z '%s'" +#~ msgid "VPN connecting to '%s'" +#~ msgstr "Povezovanje VPN z '%s'" +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "Po_veži se v drugo brezžično omrežje ..." +#~ msgid "Create _New Wireless Network..." +#~ msgstr "_Ustvari novo brezžično omrežje ..." +#~ msgid "_VPN Connections" +#~ msgstr "_Povezave VPN" +#~ msgid "_Configure VPN..." +#~ msgstr "_Nastavi VPN ..." +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Prekini povezavo z VPN ..." +#~ msgid "_Dial Up Connections" +#~ msgstr "_Klicna povezava" +#~ msgid "Connect to %s..." +#~ msgstr "Poveži se v %s ..." +#~ msgid "Disconnect from %s..." +#~ msgstr "Prekini povezavo z %s ..." +#~ msgid "No network devices have been found" +#~ msgstr "Najdena ni bila nobena omrežna naprava" +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager ni zagnan ..." +#~ msgid "Enable _Networking" +#~ msgstr "Omogoči _omrežje" +#~ msgid "Enable _Wireless" +#~ msgstr "Omogoči _brezžično omrežje" +#~ msgid "Connection _Information" +#~ msgstr "_Informacije o povezavi" +#~ msgid "_Help" +#~ msgstr "_Pomoč" +#~ msgid "_About" +#~ msgstr "_O Programu" +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov. Ni " +#~ "mogoče nadaljevati.\n" +#~ msgid "Shared Key" +#~ msgstr "Deljeni ključ" +#~ msgid "Automatic (Default)" +#~ msgstr "Samodejno (privzeto)" +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" +#~ msgid "TKIP" +#~ msgstr "TKIP" +#~ msgid "Dynamic WEP" +#~ msgstr "Dinamični WEP" +#~ msgid "None" +#~ msgstr "Brez" +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bit ASCII" +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bit Hex" +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP 128-bit šifrirna fraza" +#~ msgid "PEAP" +#~ msgstr "PEAP" +#~ msgid "TLS" +#~ msgstr "TLS" +#~ msgid "TTLS" +#~ msgstr "TTLS" +#~ msgid "WPA2 Enterprise" +#~ msgstr "Podjetniški WPA2" +#~ msgid "WPA Enterprise" +#~ msgstr "Podjetniški WPA" +#~ msgid "WPA2 Personal" +#~ msgstr "Osebni WPA2" +#~ msgid "WPA Personal" +#~ msgstr "Osebni WPA" +#~ msgid "Orientation" +#~ msgstr "Usmerjenost" +#~ msgid "The orientation of the tray." +#~ msgstr "Usmeritev pladnja." +#~ msgid "Wired Network (%s)" +#~ msgstr "Žično omrežje (%s)" +#~ msgid "_Wired Network" +#~ msgstr "Ž_ično omrežje" +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Brezžično omrežje (%s)" +#~ msgstr[1] "Brezžični omrežji (%s)" +#~ msgstr[2] "Brezžična omrežja (%s)" +#~ msgstr[3] "Brezžična omrežja (%s)" +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Brezžično omrežje" +#~ msgstr[1] "Brezžični omrežji" +#~ msgstr[2] "Brezžična omrežja" +#~ msgstr[3] "Brezžična omrežja" +#~ msgid " (invalid Unicode)" +#~ msgstr " (neveljaven Unicode)" +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "Privzeto je ime brezžičnega omrežja nastavljeno na ime vašega " +#~ "računalnika, %s, brez omogočenega šifriranja" +#~ msgid "Create new wireless network" +#~ msgstr "Ustvari novo brezžično omrežje" +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Vnesite ime in varnostne nastavitve brezžičnega omrežja, ki ga želite " +#~ "ustvariti." +#~ msgid "Create New Wireless Network" +#~ msgstr "Ustvari novo brezžično omrežje" +#~ msgid "Existing wireless network" +#~ msgstr "Obstoječe brezžično omrežje" +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "Vnesite ime brezžičnega omrežja, v katerega se želite povezati." +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Poveži se v drugo brezžično omrežje" +#~ msgid "Error connecting to wireless network" +#~ msgstr "Napaka pri povezovanju z brezžičnim omrežjem" +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "" +#~ "Zahtevano brezžično omrežje zahteva varnostne zmožnosti, ki so nepodprte " +#~ "z vašo strojno opremo." +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "Ni mogoče začeti povezave VPN '%s'" +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "Ni mogoče najti pogovornega okna za overitev za povezavo VPN vrste '%s'. " +#~ "Kontaktirajte sistemskega administratorja." +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Pri zagonu pogovornega okna za overovitev za povezavo VPN vrste '%s' je " +#~ "prišlo do problema. Kontaktirajte sistemskega administratorja." +#~ msgid " " +#~ msgstr " " +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Informacije o aktivni povezavi" +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Šifrirna fraza, ki jo zahteva " +#~ "brezžično omrežje\n" +#~ "\n" +#~ "Za dostop do brezžičnega omrežja '%s' je zahtevana šifrirna fraza ali " +#~ "šifrirni ključ." +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Zmanjšana uporabnost omrežja\n" +#~ "\n" +#~ "%s ne bo popolnoma uporaben." +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Potrditev prijave v brezžično " +#~ "omrežje\n" +#~ "\n" +#~ "Izbrali ste prijavo v brezžično omrežje '%s'. Če ste prepričani, da je to " +#~ "brezžično omrežje varno, kliknite potrditveno polje spodaj in " +#~ "NetworkManager ne bo več zahteval potrditve za nadaljnje prijave." +#~ msgid "Anonymous Identity:" +#~ msgstr "Anonimna identiteta:" +#~ msgid "Authentication:" +#~ msgstr "Overovitev:" +#~ msgid "Broadcast Address:" +#~ msgstr "Naslov za razpršeno oddajanje:" +#~ msgid "CA Certificate File:" +#~ msgstr "Datoteka overiteljevega (CA) certifikata:" +#~ msgid "C_onnect" +#~ msgstr "Po_veži se" +#~ msgid "Client Certificate File:" +#~ msgstr "Datoteka odjemalčevega certifikata:" +#~ msgid "Connection Information" +#~ msgstr "Informacije o povezavi" +#~ msgid "Default Route:" +#~ msgstr "Privzeta smer:" +#~ msgid "Destination Address:" +#~ msgstr "Ciljni naslov:" +#~ msgid "Driver:" +#~ msgstr "Gonilnik:" +#~ msgid "EAP Method:" +#~ msgstr "Metoda EAP:" +#~ msgid "Hardware Address:" +#~ msgstr "Naslov strojne opreme:" +#~ msgid "IP Address:" +#~ msgstr "IP naslov:" +#~ msgid "Identity:" +#~ msgstr "Identiteta:" +#~ msgid "Interface:" +#~ msgstr "Vmesnik:" +#~ msgid "Key Type:" +#~ msgstr "Vrsta ključa:" +#~ msgid "Key management:" +#~ msgstr "Upravljanje s ključi:" +#~ msgid "Key:" +#~ msgstr "Ključ:" +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "Brez\n" +#~ "WEP 128-bit šifrirna fraza\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Odprti sistem\n" +#~ "Deljeni ključ" +#~ msgid "Other Wireless Network..." +#~ msgstr "Drugo brezžično omrežje ..." +#~ msgid "Passphrase:" +#~ msgstr "Šifrirna fraza:" +#~ msgid "Password:" +#~ msgstr "Geslo:" +#~ msgid "Primary DNS:" +#~ msgstr "Primarni DNS;" +#~ msgid "Private Key File:" +#~ msgstr "Datoteka zasebnega ključa:" +#~ msgid "Private Key Password:" +#~ msgstr "Geslo zasebnega ključa:" +#~ msgid "Secondary DNS:" +#~ msgstr "Sekundarni DNS:" +#~ msgid "Select the CA Certificate File" +#~ msgstr "Izberite datoteko overiteljevega (CA) certifikata" +#~ msgid "Select the Client Certificate File" +#~ msgstr "Izberite datoteko odjemalčevega certifikata" +#~ msgid "Select the Private Key File" +#~ msgstr "Izberite datoteko zasebnega ključa" +#~ msgid "Show key" +#~ msgstr "Pokaži ključ" +#~ msgid "Show passphrase" +#~ msgstr "Pokaži šifrirno frazo" +#~ msgid "Show password" +#~ msgstr "Pokaži geslo" +#~ msgid "Show passwords" +#~ msgstr "Pokaži gesla" +#~ msgid "Speed:" +#~ msgstr "Hitrost:" +#~ msgid "Subnet Mask:" +#~ msgstr "Maska podomrežja:" +#~ msgid "Type:" +#~ msgstr "Vrsta:" +#~ msgid "User Name:" +#~ msgstr "Uporabniško ime:" +#~ msgid "Wireless Network Key Required" +#~ msgstr "Zahtevan ključ brezžičnega omrežja" +#~ msgid "Wireless _adapter:" +#~ msgstr "Brezžični _vmesnik:" +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "Vedno _zaupaj temu brezžičnemu omrežju" +#~ msgid "_Don't remind me again" +#~ msgstr "_Ne spomni me več" +#~ msgid "_Login to Network" +#~ msgstr "_Prijava v omrežje" +#~ msgid "_Network Name:" +#~ msgstr "_Ime omrežja:" +#~ msgid "_Wireless Security:" +#~ msgstr "_Zaščita omrežja:" +#~ msgid "Cannot add VPN connection" +#~ msgstr "Ni mogoče dodati povezave VPN" +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "Ustrezna programska oprema za VPN ni bila najdena na vašem sistemu. " +#~ "Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Cannot import VPN connection" +#~ msgstr "Ni mogoče uvoziti povezave VPN" +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Ni mogoče najti ustrezne programske opreme za povezavo VPN vrste '%s' za " +#~ "uvoz datoteke '%s'. Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "Napaka pri pridobivanju povezave VPN '%s'" +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "Ni mogoče najti datotek uporabniškega vmesnika za povezavo VPN vrste \"%s" +#~ "\". Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "Ali želite izbrisati povezavo VPN \"%s\"?" +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "Vse informacije o povezavi VPN \"%s\" bodo izgubljene in mogoče boste " +#~ "potrebovali vašega sistemskega administratorja, da vam priskrbi " +#~ "informacije za ustvarjanje nove povezave." +#~ msgid "Unable to load" +#~ msgstr "Ni mogoče naložiti" +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "Ni mogoče najti nekaterih potrebnih virov (datoteke glade)!" +#~ msgid "Create VPN Connection" +#~ msgstr "Ustvari povezavo VPN" +#~ msgid "Edit VPN Connection" +#~ msgstr "Uredi povezavo VPN" +#~ msgid "Add a new VPN connection" +#~ msgstr "Dodaj novo povezavo VPN" +#~ msgid "Delete the selected VPN connection" +#~ msgstr "Izbriši izbrano povezavo VPN" +#~ msgid "E_xport" +#~ msgstr "I_zvozi" +#~ msgid "Edit the selected VPN connection" +#~ msgstr "Uredi izbrano povezavo VPN" +#~ msgid "Export the VPN settings to a file" +#~ msgstr "Izvozi nastavitve VPN v datoteko" +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "Izvozi izbrano povezavo VPN v datoteko" +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "Upravljanje povezav navideznega zasebnega omrežja (VPN)" +#~ msgid "VPN Connections" +#~ msgstr "Povezave VPN" +#~ msgid "40-bit WEP" +#~ msgstr "40-bitni WEP" +#~ msgid "104-bit WEP" +#~ msgstr "104-bitni WEP" +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" +#~ msgid "WPA Automatic" +#~ msgstr "Samodejni WPA" +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" +#~ msgid "WPA2 Automatic" +#~ msgstr "Samodejni WPA2" +#~ msgid "none" +#~ msgstr "brez" +#~ msgid "operation took too long" +#~ msgstr "operacija je trajala predolgo" +#~ msgid "received data from wrong type of sender" +#~ msgstr "prejeti podatki od pošiljatelja napačne vrste" +#~ msgid "received data from unexpected sender" +#~ msgstr "prejeti podatki od nepričakovanega pošiljatelja" +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "preveč podatkov je bilo poslano preko vtiča in nekaj se jih je izgubilo" +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "Zdaj ste povezani v ad-hoc brezžično omrežje '%s'." +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "Zdaj ste povezani z brezžičnim omrežjem '%s'." +#~ msgid "You are now connected to the wired network." +#~ msgstr "Zdaj ste povezani z žičnim omrežjem." +#~ msgid "Connection Established" +#~ msgstr "Povezava vzpostavljena" +#~ msgid "Disconnected" +#~ msgstr "Prekinjena povezava" +#~ msgid "The network connection has been disconnected." +#~ msgstr "Omrežna povezava je bila prekinjena." +#~ msgid "LEAP" +#~ msgstr "LEAP" From de2205a24ea6eb1ef0a26646857418a8a67b5a1f Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Tue, 19 Jan 2010 20:37:46 -0800 Subject: [PATCH 038/392] core: ensure failed /etc/hosts update writes out well-formatted file (lp#471498) --- src/NetworkManagerPolicy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 5b860aae0a..5c5ae4027b 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -315,9 +315,9 @@ update_etc_hosts (const char *hostname) /* Hmm, /etc/hosts was empty for some reason */ if (!added) { - g_string_append (new_contents, "# Do not remove the following line, or various programs"); - g_string_append (new_contents, "# that require network functionality will fail."); - g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost"); + g_string_append (new_contents, "# Do not remove the following line, or various programs\n"); + g_string_append (new_contents, "# that require network functionality will fail.\n"); + g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost\n"); } error = NULL; From 7603f6dde4817c5135de06c4265d28cdbc256644 Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Tue, 19 Jan 2010 21:23:37 -0800 Subject: [PATCH 039/392] libnm-util: fix NMDeviceBt hardware address property --- libnm-glib/nm-device-bt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c index 5792add501..0451f2b0f6 100644 --- a/libnm-glib/nm-device-bt.c +++ b/libnm-glib/nm-device-bt.c @@ -95,8 +95,8 @@ nm_device_bt_get_hw_address (NMDeviceBt *device) priv = NM_DEVICE_BT_GET_PRIVATE (device); if (!priv->hw_address) { priv->hw_address = _nm_object_get_string_property (NM_OBJECT (device), - NM_DBUS_INTERFACE_DEVICE_WIRED, - DBUS_PROP_HW_ADDRESS); + NM_DBUS_INTERFACE_DEVICE_BLUETOOTH, + DBUS_PROP_HW_ADDRESS); } return priv->hw_address; From 51a95abef38c50f6913c228a08575457436ca43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Wed, 20 Jan 2010 13:37:52 -0800 Subject: [PATCH 040/392] backends: add backend for Pardus --- configure.ac | 10 ++++- src/backends/Makefile.am | 4 ++ src/backends/NetworkManagerPardus.c | 57 +++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 src/backends/NetworkManagerPardus.c diff --git a/configure.ac b/configure.ac index 28734d6e77..d0d873dab2 100644 --- a/configure.ac +++ b/configure.ac @@ -83,7 +83,7 @@ dnl Make sha1.c happy on big endian systems dnl AC_C_BIGENDIAN -AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo or mandriva])) +AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva or pardus])) if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") @@ -94,6 +94,7 @@ if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva") + AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") if test "z$with_distro" = "z"; then with_distro=`lsb_release -is` fi @@ -105,7 +106,7 @@ if test "z$with_distro" = "z"; then exit 1 else case $with_distro in - redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva) ;; + redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus) ;; *) echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" exit 1 @@ -158,6 +159,11 @@ if test x"$with_distro" = xmandriva; then AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva]) fi +AM_CONDITIONAL(TARGET_PARDUS, test x"$with_distro" = xpardus) +if test x"$with_distro" = xpardus; then + AC_DEFINE(TARGET_PARDUS, 1, [Define if you have Pardus]) +fi + AC_MSG_CHECKING([Linux Wireless Extensions >= 18]) AC_TRY_COMPILE([#ifndef __user #define __user diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am index 65c96b591e..0e037c41d1 100644 --- a/src/backends/Makefile.am +++ b/src/backends/Makefile.am @@ -49,6 +49,10 @@ if TARGET_MANDRIVA libnmbackend_la_SOURCES += NetworkManagerMandriva.c endif +if TARGET_PARDUS +libnmbackend_la_SOURCES += NetworkManagerPardus.c +endif + libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GLIB_LIBS) libnmbackend_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ diff --git a/src/backends/NetworkManagerPardus.c b/src/backends/NetworkManagerPardus.c new file mode 100644 index 0000000000..52703e23d2 --- /dev/null +++ b/src/backends/NetworkManagerPardus.c @@ -0,0 +1,57 @@ +/* NetworkManager -- Network link manager + * + * Ozan Caglayan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2004 RedHat, Inc. + * (C) Copyright 2009 TUBITAK/UEKAE + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "NetworkManagerSystem.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_system_update_dns (void) +{ + /* I'm not running nscd */ +} + From 79db4928544bd20a1cb259847d3606d0ca03dbdd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 16:30:06 -0800 Subject: [PATCH 041/392] ifcfg-rh: ensure IPv6 addresses are cleared when none get written out --- system-settings/plugins/ifcfg-rh/writer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 767c352435..7f9d806b8c 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1253,6 +1253,9 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", ip_str2->str, FALSE); g_string_free (ip_str1, TRUE); g_string_free (ip_str2, TRUE); + } else { + svSetValue (ifcfg, "IPV6ADDR", NULL, FALSE); + svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", NULL, FALSE); } /* Write out DNS - 'DNS' key is used both for IPv4 and IPv6 */ From 14aef3678a3d82d70b90460df84e47d71bb68cfc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 16:34:23 -0800 Subject: [PATCH 042/392] ifcfg-rh: handle missing PREFIX by generating one Based on what the initscripts do with ipcalc, which was tripping a few people up when they forgot to do PREFIX/NETMASK. --- system-settings/plugins/ifcfg-rh/reader.c | 23 +++- .../tests/network-scripts/Makefile.am | 5 +- .../ifcfg-test-wired-static-no-prefix-16 | 14 +++ .../ifcfg-test-wired-static-no-prefix-24 | 14 +++ .../ifcfg-test-wired-static-no-prefix-8 | 14 +++ .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 110 ++++++++++++++++++ 6 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 62cba2068a..afe35bdf8c 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -604,9 +604,28 @@ read_full_ip4_address (shvarFile *ifcfg, nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp)); } + /* Try to autodetermine the prefix for the address' class */ + if (!nm_ip4_address_get_prefix (addr)) { + guint32 tmp_addr, prefix = 0; + + tmp_addr = nm_ip4_address_get_address (addr); + if (((ntohl(tmp_addr) & 0xFF000000) >> 24) <= 127) + prefix = 8; + else if (((ntohl(tmp_addr) & 0xFF000000) >> 24) <= 191) + prefix = 16; + else + prefix = 24; + + nm_ip4_address_set_prefix (addr, prefix); + + value = svGetValue (ifcfg, ip_tag, FALSE); + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: missing %s, assuming %s/%u", + prefix_tag, value, prefix); + g_free (value); + } + /* Validate the prefix */ - if ( !nm_ip4_address_get_prefix (addr) - || nm_ip4_address_get_prefix (addr) > 32) { + if (nm_ip4_address_get_prefix (addr) > 32) { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Missing or invalid IP4 prefix '%d'", nm_ip4_address_get_prefix (addr)); 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 78ac04d487..b5c94dd3b5 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -54,7 +54,10 @@ EXTRA_DIST = \ ifcfg-test-wired-static-routes-legacy \ route-test-wired-static-routes-legacy \ ifcfg-test-wired-ipv6-manual \ - route6-test-wired-ipv6-manual + route6-test-wired-ipv6-manual \ + ifcfg-test-wired-static-no-prefix-8 \ + ifcfg-test-wired-static-no-prefix-16 \ + ifcfg-test-wired-static-no-prefix-24 check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 new file mode 100644 index 0000000000..0799903887 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=172.16.3.4 +GATEWAY=172.16.3.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 new file mode 100644 index 0000000000..688143cd2e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +GATEWAY=192.168.1.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 new file mode 100644 index 0000000000..0433c62a86 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=10.11.12.13 +GATEWAY=10.0.0.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 88ce1fffe9..8855a32191 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -717,6 +717,113 @@ test_read_wired_static (const char *file, const char *expected_id) g_object_unref (connection); } +#define TEST_IFCFG_STATIC_NO_PREFIX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-no-prefix" + +static void +test_read_wired_static_no_prefix (guint32 expected_prefix) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + char *unmanaged = FALSE; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + NMIP4Address *ip4_addr; + char *file, *expected_id; + const char *tmp; + + file = g_strdup_printf (TEST_IFCFG_STATIC_NO_PREFIX "-%u", expected_prefix); + ASSERT (file != NULL, + "wired-static-no-prefix-read", "failed to create path to file"); + + expected_id = g_strdup_printf ("System test-wired-static-no-prefix-%u", expected_prefix); + ASSERT (expected_id != NULL, + "wired-static-no-prefix-read", "failed to expected connection ID"); + + connection = connection_from_file (file, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-static-no-prefix-read", "failed to read %s: %s", file, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-static-no-prefix-verify", "failed to verify %s: %s", file, error->message); + + ASSERT (unmanaged == FALSE, + "wired-static-no-prefix-verify", "failed to verify %s: unexpected unmanaged value", file); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-static-no-prefix-verify-connection", "failed to verify %s: missing %s setting", + file, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-static-no-prefix-verify-connection", "failed to verify %s: missing %s / %s key", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-static-no-prefix-verify-connection", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + g_free (expected_id); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: missing %s setting", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: missing IP4 address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + g_free (file); + g_object_unref (connection); +} + #define TEST_IFCFG_WIRED_DHCP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp" static void @@ -7695,6 +7802,9 @@ int main (int argc, char **argv) test_read_minimal (); test_read_wired_static (TEST_IFCFG_WIRED_STATIC, "System test-wired-static"); test_read_wired_static (TEST_IFCFG_WIRED_STATIC_BOOTPROTO, "System test-wired-static-bootproto"); + test_read_wired_static_no_prefix (8); + test_read_wired_static_no_prefix (16); + test_read_wired_static_no_prefix (24); test_read_wired_dhcp (); test_read_wired_global_gateway (); test_read_wired_never_default (); From 79303517eed975dec5e302dc4ca3fc14beae3082 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 16:37:49 -0800 Subject: [PATCH 043/392] ifcfg-rh: formatting fix --- system-settings/plugins/ifcfg-rh/writer.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 7f9d806b8c..4ded5c6813 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1206,20 +1206,16 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { svSetValue (ifcfg, "IPV6INIT", "no", FALSE); return TRUE; - } - else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); - } - else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); - } - else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); - } - else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); /* TODO */ } From 3cd457a26a267b7429af219c2bb04076333dadc2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 16:38:21 -0800 Subject: [PATCH 044/392] release: bump version to 0.7.999 (0.8-rc3) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d0d873dab2..778f18a7b5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.7.998, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.7.999, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) AM_MAINTAINER_MODE From 8720a74c2ee64a0bede6040555b130dc33795a3b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 16:53:04 -0800 Subject: [PATCH 045/392] build: pkg-config file fixes --- libnm-glib/libnm-glib-vpn.pc.in | 2 +- libnm-glib/libnm-glib.pc.in | 2 +- libnm-util/libnm-util.pc.in | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libnm-glib/libnm-glib-vpn.pc.in b/libnm-glib/libnm-glib-vpn.pc.in index 51aec6877a..73b7a9c71c 100644 --- a/libnm-glib/libnm-glib-vpn.pc.in +++ b/libnm-glib/libnm-glib-vpn.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: libnm-glib-vpn Description: Convenience library for NetworkManager VPN plugins Version: @VERSION@ -Requires: NetworkManager >= 0.7.995 glib-2.0 dbus-glib-1 +Requires: NetworkManager >= 0.7.999 glib-2.0 dbus-glib-1 Cflags: -I${includedir}/libnm-glib Libs: -L${libdir} -lnm-glib-vpn diff --git a/libnm-glib/libnm-glib.pc.in b/libnm-glib/libnm-glib.pc.in index d1b85a5d1d..5c3471b16e 100644 --- a/libnm-glib/libnm-glib.pc.in +++ b/libnm-glib/libnm-glib.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: libnm-glib Description: Convenience library for clients of NetworkManager Version: @VERSION@ -Requires: NetworkManager >= 0.7.995 glib-2.0 dbus-glib-1 +Requires: NetworkManager >= 0.7.999 glib-2.0 dbus-glib-1 Cflags: -I${includedir}/libnm-glib Libs: -L${libdir} -lnm-glib diff --git a/libnm-util/libnm-util.pc.in b/libnm-util/libnm-util.pc.in index 7a915ed01c..a6e8ee5959 100644 --- a/libnm-util/libnm-util.pc.in +++ b/libnm-util/libnm-util.pc.in @@ -3,10 +3,10 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: libnm_util +Name: libnm-util Description: Convenience library for clients of NetworkManager Version: @VERSION@ -Requires: glib-2.0 +Requires: glib-2.0 dbus-glib-1 Cflags: -I${includedir}/NetworkManager Libs: -L${libdir} -lnm-util From 133c86ee92135b66975aae60b3318e4d79376130 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Jan 2010 17:30:48 -0800 Subject: [PATCH 046/392] introspection: fix inclusion of Dhcp6Config XML --- introspection/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introspection/Makefile.am b/introspection/Makefile.am index a70d28511a..212da3ab93 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -24,5 +24,5 @@ EXTRA_DIST = \ nm-ppp-manager.xml \ nm-active-connection.xml \ nm-dhcp4-config.xml \ - nm-dhcp4-config.xml + nm-dhcp6-config.xml From 7a594f2bdc3b3f01811f872e4fd159f4c221d602 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Jan 2010 12:57:31 -0800 Subject: [PATCH 047/392] crypto: de-init NSS after calling PR_GetError() PR_Cleanup() can clear out the error, and we don't want to loose it. --- libnm-util/crypto_nss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c index 97dba1ffc2..490d5fe909 100644 --- a/libnm-util/crypto_nss.c +++ b/libnm-util/crypto_nss.c @@ -51,11 +51,11 @@ crypto_init (GError **error) PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 1); ret = NSS_NoDB_Init (NULL); if (ret != SECSuccess) { - PR_Cleanup (); g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERR_INIT_FAILED, _("Failed to initialize the crypto engine: %d."), PR_GetError ()); + PR_Cleanup (); return FALSE; } From 6400f5cb77b9d48698f5da0c565e48c9abfdf969 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Jan 2010 15:11:50 -0800 Subject: [PATCH 048/392] misc: license fixups All libs are LGPL, all binaries are GPL. --- libnm-glib/nm-exported-connection.c | 21 ++++++++------- libnm-glib/nm-settings-connection-interface.c | 21 ++++++++------- libnm-glib/nm-settings-interface.c | 21 ++++++++------- libnm-glib/nm-settings-interface.h | 21 ++++++++------- libnm-glib/nm-settings-service.c | 21 ++++++++------- libnm-glib/nm-settings-system-interface.c | 21 ++++++++------- libnm-glib/nm-settings-system-interface.h | 21 ++++++++------- libnm-util/nm-setting-olpc-mesh.c | 3 +-- libnm-util/nm-setting-olpc-mesh.h | 27 ++++++++++++++++++- src/modem-manager/nm-modem-cdma.c | 19 +++++++++++++ src/modem-manager/nm-modem-cdma.h | 19 +++++++++++++ src/modem-manager/nm-modem-gsm.c | 19 +++++++++++++ src/modem-manager/nm-modem-gsm.h | 19 +++++++++++++ src/modem-manager/nm-modem-manager.c | 20 ++++++++++++++ src/modem-manager/nm-modem-manager.h | 20 ++++++++++++++ src/modem-manager/nm-modem-types.h | 18 +++++++++++++ src/modem-manager/nm-modem.c | 19 +++++++++++++ src/modem-manager/nm-modem.h | 19 +++++++++++++ src/nm-device-olpc-mesh.c | 6 ++--- src/nm-device-olpc-mesh.h | 6 ++--- src/nm-hostname-provider.c | 18 +++++++++++++ src/nm-hostname-provider.h | 18 +++++++++++++ 22 files changed, 318 insertions(+), 79 deletions(-) diff --git a/libnm-glib/nm-exported-connection.c b/libnm-glib/nm-exported-connection.c index 47fd8644d8..8ca64e797c 100644 --- a/libnm-glib/nm-exported-connection.c +++ b/libnm-glib/nm-exported-connection.c @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager system settings service * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. * (C) Copyright 2008 - 2009 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-connection-interface.c b/libnm-glib/nm-settings-connection-interface.c index 5dcd4494b4..868ad047a7 100644 --- a/libnm-glib/nm-settings-connection-interface.c +++ b/libnm-glib/nm-settings-connection-interface.c @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. * Copyright (C) 2007 - 2009 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-interface.c b/libnm-glib/nm-settings-interface.c index f320953058..a1d548ed15 100644 --- a/libnm-glib/nm-settings-interface.c +++ b/libnm-glib/nm-settings-interface.c @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. * Copyright (C) 2007 - 2008 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h index 3a1768904c..70a47abe94 100644 --- a/libnm-glib/nm-settings-interface.h +++ b/libnm-glib/nm-settings-interface.h @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. * Copyright (C) 2007 - 2009 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-service.c b/libnm-glib/nm-settings-service.c index de93d9932f..6266d10dac 100644 --- a/libnm-glib/nm-settings-service.c +++ b/libnm-glib/nm-settings-service.c @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager system settings service * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. * (C) Copyright 2008 - 2009 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-system-interface.c b/libnm-glib/nm-settings-system-interface.c index a2fcbf6a24..0f59377a53 100644 --- a/libnm-glib/nm-settings-system-interface.c +++ b/libnm-glib/nm-settings-system-interface.c @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. * Copyright (C) 2007 - 2008 Red Hat, Inc. diff --git a/libnm-glib/nm-settings-system-interface.h b/libnm-glib/nm-settings-system-interface.h index 64bf91bb9e..ebe835762d 100644 --- a/libnm-glib/nm-settings-system-interface.h +++ b/libnm-glib/nm-settings-system-interface.h @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. * Copyright (C) 2007 - 2009 Red Hat, Inc. diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c index 325e043f76..1653bb0768 100644 --- a/libnm-util/nm-setting-olpc-mesh.c +++ b/libnm-util/nm-setting-olpc-mesh.c @@ -1,5 +1,4 @@ -/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ - +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * Dan Williams * Tambet Ingo diff --git a/libnm-util/nm-setting-olpc-mesh.h b/libnm-util/nm-setting-olpc-mesh.h index 9477dd91db..84abd1264a 100644 --- a/libnm-util/nm-setting-olpc-mesh.h +++ b/libnm-util/nm-setting-olpc-mesh.h @@ -1,4 +1,29 @@ -/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Dan Williams + * Tambet Ingo + * Sjoerd Simons + * Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + * (C) Copyright 2009 One Laptop per Child + */ #ifndef NM_SETTING_OLPC_MESH_H #define NM_SETTING_OLPC_MESH_H diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index 07f1cf83bd..5e8405bcf4 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.c @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #include diff --git a/src/modem-manager/nm-modem-cdma.h b/src/modem-manager/nm-modem-cdma.h index 25dd9dcb1d..7c98ab287a 100644 --- a/src/modem-manager/nm-modem-cdma.h +++ b/src/modem-manager/nm-modem-cdma.h @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #ifndef NM_MODEM_CDMA_H #define NM_MODEM_CDMA_H diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index 8484d0ae4f..e77b9e70f8 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #include #include "nm-dbus-glib-types.h" diff --git a/src/modem-manager/nm-modem-gsm.h b/src/modem-manager/nm-modem-gsm.h index 4e45811641..84794739f9 100644 --- a/src/modem-manager/nm-modem-gsm.h +++ b/src/modem-manager/nm-modem-gsm.h @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #ifndef NM_MODEM_GSM_H #define NM_MODEM_GSM_H diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index 3b9f6438a6..94e1a111b3 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -1,4 +1,24 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + * Copyright (C) 2009 Canonical Ltd. + */ #include #include "nm-modem-manager.h" diff --git a/src/modem-manager/nm-modem-manager.h b/src/modem-manager/nm-modem-manager.h index 34e99f1ec8..f9d8ded015 100644 --- a/src/modem-manager/nm-modem-manager.h +++ b/src/modem-manager/nm-modem-manager.h @@ -1,4 +1,24 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + * Copyright (C) 2009 Canonical Ltd. + */ #ifndef NM_MODEM_MANAGER_H #define NM_MODEM_MANAGER_H diff --git a/src/modem-manager/nm-modem-types.h b/src/modem-manager/nm-modem-types.h index a251d2a953..e805cb2135 100644 --- a/src/modem-manager/nm-modem-types.h +++ b/src/modem-manager/nm-modem-types.h @@ -1,4 +1,22 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Novell, Inc. + */ #ifndef NM_MODEM_TYPES_H #define NM_MODEM_TYPES_H diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index d7187ab6ff..4788673c1f 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #include #include "nm-modem.h" diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h index fefc6347ca..0a722764c2 100644 --- a/src/modem-manager/nm-modem.h +++ b/src/modem-manager/nm-modem.h @@ -1,4 +1,23 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ #ifndef NM_MODEM_H #define NM_MODEM_H diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 9c229d5804..8be4632c11 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -15,9 +15,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2005 - 2008 Red Hat, Inc. * (C) Copyright 2008 Collabora Ltd. diff --git a/src/nm-device-olpc-mesh.h b/src/nm-device-olpc-mesh.h index 9ec051f468..adf3d2d956 100644 --- a/src/nm-device-olpc-mesh.h +++ b/src/nm-device-olpc-mesh.h @@ -16,9 +16,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2005 Red Hat, Inc. * (C) Copyright 2008 Collabora Ltd. diff --git a/src/nm-hostname-provider.c b/src/nm-hostname-provider.c index 19498efcf3..1cd1ca6cba 100644 --- a/src/nm-hostname-provider.c +++ b/src/nm-hostname-provider.c @@ -1,4 +1,22 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Novell, Inc. + */ #include "nm-hostname-provider.h" diff --git a/src/nm-hostname-provider.h b/src/nm-hostname-provider.h index 5cfb373583..7fe5c00623 100644 --- a/src/nm-hostname-provider.h +++ b/src/nm-hostname-provider.h @@ -1,4 +1,22 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Novell, Inc. + */ #ifndef NM_HOSTNAME_PROVIDER_H #define NM_HOSTNAME_PROVIDER_H From 02bebfd1f41f907e4344e2baa47688e24541d8de Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Jan 2010 15:19:28 -0800 Subject: [PATCH 049/392] misc: more license fixes --- libnm-glib/nm-exported-connection.h | 21 +++++++++++---------- libnm-glib/nm-settings-service.h | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/libnm-glib/nm-exported-connection.h b/libnm-glib/nm-exported-connection.h index dfca0d529d..53dc3b024e 100644 --- a/libnm-glib/nm-exported-connection.h +++ b/libnm-glib/nm-exported-connection.h @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager system settings service * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * (C) Copyright 2009 Red Hat, Inc. */ diff --git a/libnm-glib/nm-settings-service.h b/libnm-glib/nm-settings-service.h index 7a06edcf29..9f4b95fcc5 100644 --- a/libnm-glib/nm-settings-service.h +++ b/libnm-glib/nm-settings-service.h @@ -1,19 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager system settings service * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. * * (C) Copyright 2009 Red Hat, Inc. */ From 13af29f693509ec13d2a3ceae4832f3b7d1bf7b3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 22 Jan 2010 12:04:52 -0800 Subject: [PATCH 050/392] ifcfg-rh: read and write DHCPv6 connections --- system-settings/plugins/ifcfg-rh/reader.c | 5 ++++- system-settings/plugins/ifcfg-rh/writer.c | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index afe35bdf8c..1b8ae93925 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1382,7 +1382,7 @@ make_ip6_setting (shvarFile *ifcfg, char *value = NULL; char *str_value; char *route6_path = NULL; - gboolean bool_value, ipv6forwarding, ipv6_autoconf; + gboolean bool_value, ipv6forwarding, ipv6_autoconf, dhcp6 = FALSE; char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; guint32 i; shvarFile *network_ifcfg; @@ -1459,9 +1459,12 @@ make_ip6_setting (shvarFile *ifcfg, /* Find out method property */ ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE); ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding); + dhcp6 = svTrueValue (ifcfg, "DHCPV6C", FALSE); if (ipv6_autoconf) method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + else if (dhcp6) + method = NM_SETTING_IP6_CONFIG_METHOD_DHCP; else { /* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */ str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 4ded5c6813..330bbf044e 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1205,18 +1205,27 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_assert (value); if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { svSetValue (ifcfg, "IPV6INIT", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); return TRUE; } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", "yes", FALSE); } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); /* TODO */ } From 35c4b97d7dbf143f2ce39ca313c18f2e014a9d8f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Jan 2010 16:20:09 -0800 Subject: [PATCH 051/392] dhcp6: first stab at autoconf otherconf/managed mode support --- src/dhcp-manager/nm-dhcp-client.c | 5 +- src/dhcp-manager/nm-dhcp-client.h | 6 +- src/dhcp-manager/nm-dhcp-dhclient.c | 13 +- src/dhcp-manager/nm-dhcp-dhcpcd.c | 3 +- src/dhcp-manager/nm-dhcp-manager.c | 12 +- src/dhcp-manager/nm-dhcp-manager.h | 3 +- src/nm-device.c | 194 ++++++++++++++++++++-------- 7 files changed, 164 insertions(+), 72 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 7eb73006d7..a47f929a53 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -261,7 +261,8 @@ nm_dhcp_client_start_ip4 (NMDHCPClient *self, gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, NMSettingIP6Config *s_ip6, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + gboolean info_only) { NMDHCPClientPrivate *priv; @@ -276,7 +277,7 @@ nm_dhcp_client_start_ip6 (NMDHCPClient *self, g_message ("Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", priv->iface, priv->timeout); - priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr); + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr, info_only); if (priv->pid > 0) start_monitor (self); diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 50c49bbc8a..2ebb5a745c 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -88,7 +88,8 @@ typedef struct { GPid (*ip6_start) (NMDHCPClient *self, NMSettingIP6Config *s_ip6, - guint8 *anycast_addr); + guint8 *anycast_addr, + gboolean info_only); void (*stop) (NMDHCPClient *self); @@ -113,7 +114,8 @@ gboolean nm_dhcp_client_start_ip4 (NMDHCPClient *self, gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, NMSettingIP6Config *s_ip6, - guint8 *dhcp_anycast_addr); + guint8 *dhcp_anycast_addr, + gboolean info_only); void nm_dhcp_client_stop (NMDHCPClient *self); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 2ab6aba825..1c5625798a 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -449,7 +449,8 @@ dhclient_child_setup (gpointer user_data G_GNUC_UNUSED) static GPid dhclient_start (NMDHCPClient *client, - const char *ip_opt) + const char *ip_opt, + const char *mode_opt) { NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); GPtrArray *argv = NULL; @@ -497,6 +498,9 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) ip_opt); + if (mode_opt) + g_ptr_array_add (argv, (gpointer) mode_opt); + g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); @@ -542,15 +546,16 @@ real_ip4_start (NMDHCPClient *client, return -1; } - return dhclient_start (client, "-4"); + return dhclient_start (client, "-4", NULL); } static GPid real_ip6_start (NMDHCPClient *client, NMSettingIP6Config *s_ip6, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + gboolean info_only) { - return dhclient_start (client, "-6"); + return dhclient_start (client, "-6", info_only ? "-S" : "-N"); } static void diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 741fe7f76b..27fb31bcc4 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -123,7 +123,8 @@ real_ip4_start (NMDHCPClient *client, static GPid real_ip6_start (NMDHCPClient *client, NMSettingIP6Config *s_ip6, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + gboolean info_only) { g_warning ("The dhcpcd backend does not support IPv6."); return -1; diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 9dc90ac76b..241199f401 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -367,7 +367,8 @@ client_start (NMDHCPManager *self, NMSettingIP4Config *s_ip4, NMSettingIP6Config *s_ip6, guint32 timeout, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + gboolean info_only) { NMDHCPManagerPrivate *priv; NMDHCPClient *client; @@ -398,7 +399,7 @@ client_start (NMDHCPManager *self, add_client (self, client); if (ipv6) - success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr); + success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr, info_only); else success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); @@ -446,7 +447,7 @@ nm_dhcp_manager_start_ip4 (NMDHCPManager *self, g_object_ref (s_ip4); } - client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr); + client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr, FALSE); if (s_ip4) g_object_unref (s_ip4); @@ -461,9 +462,10 @@ nm_dhcp_manager_start_ip6 (NMDHCPManager *self, const char *uuid, NMSettingIP6Config *s_ip6, guint32 timeout, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + gboolean info_only) { - return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr); + return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr, info_only); } static void diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 690241482b..648f4cd0dd 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -67,7 +67,8 @@ NMDHCPClient * nm_dhcp_manager_start_ip6 (NMDHCPManager *manager, const char *uuid, NMSettingIP6Config *s_ip6, guint32 timeout, - guint8 *dhcp_anycast_addr); + guint8 *dhcp_anycast_addr, + gboolean info_only); GSList * nm_dhcp_manager_get_lease_config (NMDHCPManager *self, const char *iface, diff --git a/src/nm-device.c b/src/nm-device.c index 5acfb2a0dc..7a2f83d96f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -130,6 +130,7 @@ typedef struct { gulong ip6_addrconf_sigid; gulong ip6_config_changed_sigid; gboolean ip6_waiting_for_config; + guint32 ip6_dhcp_opt; NMDHCPClient * dhcp6_client; gulong dhcp6_state_sigid; @@ -167,6 +168,11 @@ static gboolean nm_device_set_ip6_config (NMDevice *dev, gboolean assumed, NMDeviceStateReason *reason); +static NMActStageReturn dhcp6_start (NMDevice *self, + NMConnection *connection, + guint32 dhcp_opt, + NMDeviceStateReason *reason); + static void device_interface_init (NMDeviceInterface *device_interface_class) { @@ -542,18 +548,62 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, { NMDevice *self = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection; + NMActStageReturn ret; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + NMDeviceState state; if (strcmp (nm_device_get_ip_iface (self), iface) != 0) return; - if (!nm_device_get_act_request (self)) + req = nm_device_get_act_request (self); + if (!req) + return; + connection = nm_act_request_get_connection (req); + g_assert (connection); + + if (!priv->ip6_waiting_for_config) return; - if (priv->ip6_waiting_for_config) { - priv->ip6_waiting_for_config = FALSE; - if (success) - nm_device_activate_schedule_stage4_ip6_config_get (self); - else - nm_device_activate_schedule_stage4_ip6_config_timeout (self); + priv->ip6_waiting_for_config = FALSE; + + if (!success) { + nm_device_activate_schedule_stage4_ip6_config_timeout (self); + return; + } + + priv->ip6_dhcp_opt = dhcp_opts; + + /* If addrconf is all that's required, we're done */ + if (dhcp_opts == IP6_DHCP_OPT_NONE) { + nm_device_activate_schedule_stage4_ip6_config_get (self); + return; + } + + /* If the router said to use DHCP for managed or otherconf, do it */ + + /* Don't re-start DHCPv6 if it's already in progress */ + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if ((state != NM_DEVICE_STATE_IP_CONFIG) || priv->dhcp6_client) + return; + + nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) starting DHCPv6" + " as requested by IPv6 router...", + priv->iface); + + ret = dhcp6_start (self, connection, dhcp_opts, &reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_SUCCESS: + /* Shouldn't get this, but handle it anyway */ + g_warn_if_reached (); + nm_device_activate_schedule_stage4_ip6_config_get (self); + break; + case NM_ACT_STAGE_RETURN_POSTPONE: + /* Success; wait for DHCPv6 to complete */ + break; + default: + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + break; } } @@ -596,6 +646,7 @@ addrconf6_setup (NMDevice *self) NMSettingIP6Config *s_ip6; priv->ip6_waiting_for_config = FALSE; + priv->ip6_dhcp_opt = IP6_DHCP_OPT_NONE; req = nm_device_get_act_request (self); g_assert (req); @@ -662,6 +713,7 @@ static gboolean nm_device_activate_stage1_device_prepare (gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); const char *iface; NMActStageReturn ret; NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; @@ -669,6 +721,8 @@ nm_device_activate_stage1_device_prepare (gpointer user_data) /* Clear the activation source ID now that this stage has run */ activation_source_clear (self, FALSE, 0); + priv->ip4_ready = priv->ip6_ready = FALSE; + iface = nm_device_get_iface (self); nm_info ("Activation (%s) Stage 1 of 5 (Device Prepare) started...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_PREPARE, NM_DEVICE_STATE_REASON_NONE); @@ -1325,11 +1379,78 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) return ret; } +static NMActStageReturn +dhcp6_start (NMDevice *self, + NMConnection *connection, + guint32 dhcp_opt, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + guint8 *anycast = NULL; + NMSettingIP6Config *s_ip6; + NMSettingConnection *s_con; + const char *uuid; + const char *ip_iface; + + if (!connection) { + NMActRequest *req; + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + } + + /* Begin a DHCP transaction on the interface */ + + if (priv->dhcp_anycast_address) + anycast = priv->dhcp_anycast_address->data; + + /* Clear old exported DHCP options */ + if (priv->dhcp6_config) + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = nm_dhcp6_config_new (); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + + ip_iface = nm_device_get_ip_iface (self); + priv->dhcp6_client = nm_dhcp_manager_start_ip6 (priv->dhcp_manager, + ip_iface, + uuid, + s_ip6, + priv->dhcp_timeout, + anycast, + (dhcp_opt == IP6_DHCP_OPT_OTHERCONF) ? TRUE : FALSE); + if (priv->dhcp6_client) { + priv->dhcp6_state_sigid = g_signal_connect (priv->dhcp6_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp6_timeout_sigid = g_signal_connect (priv->dhcp6_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); + + /* DHCP devices will be notified by the DHCP manager when stuff happens */ + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + + return ret; +} + static NMActStageReturn real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - const char *ip_iface, *uuid; + const char *ip_iface; NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; NMActRequest *req; NMConnection *connection; @@ -1347,50 +1468,8 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) priv->ip6_waiting_for_config = TRUE; nm_ip6_manager_begin_addrconf (priv->ip6_manager, ip_iface); ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { - guint8 *anycast = NULL; - NMSettingIP6Config *s_ip6; - NMSettingConnection *s_con; - - /* Begin a DHCP transaction on the interface */ - - if (priv->dhcp_anycast_address) - anycast = priv->dhcp_anycast_address->data; - - /* Clear old exported DHCP options */ - if (priv->dhcp6_config) - g_object_unref (priv->dhcp6_config); - priv->dhcp6_config = nm_dhcp6_config_new (); - - s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); - g_assert (s_con); - uuid = nm_setting_connection_get_uuid (s_con); - - s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - - priv->dhcp6_client = nm_dhcp_manager_start_ip6 (priv->dhcp_manager, - ip_iface, - uuid, - s_ip6, - priv->dhcp_timeout, - anycast); - if (priv->dhcp6_client) { - priv->dhcp6_state_sigid = g_signal_connect (priv->dhcp6_client, - "state-changed", - G_CALLBACK (dhcp_state_changed), - self); - priv->dhcp6_timeout_sigid = g_signal_connect (priv->dhcp6_client, - "timeout", - G_CALLBACK (dhcp_timeout), - self); - - /* DHCP devices will be notified by the DHCP manager when stuff happens */ - ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else { - *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; - ret = NM_ACT_STAGE_RETURN_FAILURE; - } - } + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) + ret = dhcp6_start (self, connection, IP6_DHCP_OPT_MANAGED, reason); return ret; } @@ -1406,7 +1485,6 @@ static gboolean nm_device_activate_stage3_ip_config_start (gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); const char *iface; NMActStageReturn ret; NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; @@ -1414,8 +1492,6 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data) /* Clear the activation source ID now that this stage has run */ activation_source_clear (self, FALSE, 0); - priv->ip4_ready = priv->ip6_ready = FALSE; - iface = nm_device_get_iface (self); nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) started...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_NONE); @@ -1772,10 +1848,13 @@ real_act_stage4_get_ip6_config (NMDevice *self, ret = NM_ACT_STAGE_RETURN_SUCCESS; } else { *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; } - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { - g_assert (priv->dhcp6_client); + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) + g_assert (priv->dhcp6_client); /* sanity check */ + /* Autoconf might have triggered DHCPv6 too */ + if (priv->dhcp6_client) { *config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); if (*config) { /* Merge user-defined overrides into the IP4Config to be applied */ @@ -1797,6 +1876,7 @@ real_act_stage4_get_ip6_config (NMDevice *self, ret = NM_ACT_STAGE_RETURN_SUCCESS; } +out: return ret; } From 72f936db31f7b6e973d54b82410ce95fdaa6ceed Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Jan 2010 17:13:35 -0800 Subject: [PATCH 052/392] policy: fall back to original hostname before trying reverse DNS Having the original hostname checks in the settings-service code didn't allow the policy enough granularity to differentiate between a plugin-provided hostname and the original hostname. We want to fall back to the original hostname if there isn't a persistent hostname (from a plugin) and if there isn't a DHCP-provided hostname. Moving the original hostname checks to the policy makes that possible. Clarify the precedence order at the same time, and minimally validate the DHCP hostname as well. --- src/NetworkManagerPolicy.c | 61 ++++++++++++++++----- src/system-settings/nm-sysconfig-settings.c | 18 ------ 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 5c5ae4027b..548ad01079 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -74,6 +74,8 @@ struct NMPolicy { NMDevice *default_device; LookupThread *lookup; + + char *orig_hostname; /* hostname at NM start time */ }; static gboolean @@ -416,15 +418,16 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) policy->lookup = NULL; } - /* A configured hostname (via the system-settings service) overrides - * all automatic hostname determination. If there is no configured hostname, - * the best device's automatically determined hostname (from DHCP, VPN, PPP, - * etc) is used. If there is no automatically determined hostname, reverse - * DNS lookup using the best device's IP address is started to determined the - * the hostname. + /* Hostname precedence order: + * + * 1) a configured hostname (from system-settings) + * 2) automatic hostname from the default device's config (DHCP, VPN, etc) + * 3) the original hostname when NM started + * 4) reverse-DNS of the best device's IPv4 address + * */ - /* Try a configured hostname first */ + /* Try a persistent hostname first */ g_object_get (G_OBJECT (policy->manager), NM_MANAGER_HOSTNAME, &configured_hostname, NULL); if (configured_hostname) { set_system_hostname (configured_hostname, "from system configuration"); @@ -437,25 +440,42 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) best = get_best_device (policy->manager, &best_req); if (!best) { - /* No best device; fall back to localhost.localdomain */ - set_system_hostname (NULL, "no default device"); + /* No best device; fall back to original hostname or if there wasn't + * one, 'localhost.localdomain' + */ + set_system_hostname (policy->orig_hostname, "no default device"); return; } /* Grab a hostname out of the device's DHCP4 config */ dhcp4_config = nm_device_get_dhcp4_config (best); if (dhcp4_config) { - const char *dhcp4_hostname; + const char *dhcp4_hostname, *p; - dhcp4_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name"); + p = dhcp4_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name"); if (dhcp4_hostname && strlen (dhcp4_hostname)) { - set_system_hostname (dhcp4_hostname, "from DHCP"); - return; + /* Sanity check */ + while (*p) { + if (!isblank (*p++)) { + set_system_hostname (dhcp4_hostname, "from DHCP"); + return; + } + } + nm_warning ("%s: DHCP-provided hostname '%s' looks invalid; not using it", + __func__, dhcp4_hostname); } } - /* No configured hostname, no automatically determined hostname either. Start - * reverse DNS of the current IP address to try and find it. + /* If no automatically-configured hostname, try using the hostname from + * when NM started up. + */ + if (policy->orig_hostname) { + set_system_hostname (policy->orig_hostname, "from system startup"); + return; + } + + /* No configured hostname, no automatically determined hostname, and + * no bootup hostname. Start reverse DNS of the current IP address. */ ip4_config = nm_device_get_ip4_config (best); if ( !ip4_config @@ -988,6 +1008,7 @@ nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) NMPolicy *policy; static gboolean initialized = FALSE; gulong id; + char hostname[HOST_NAME_MAX + 2]; g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); g_return_val_if_fail (initialized == FALSE, NULL); @@ -996,6 +1017,14 @@ nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) policy->manager = g_object_ref (manager); policy->update_state_id = 0; + /* Grab hostname on startup and use that if nothing provides one */ + memset (hostname, 0, sizeof (hostname)); + if (gethostname (&hostname[0], HOST_NAME_MAX) == 0) { + /* only cache it if it's a valid hostname */ + if (strlen (hostname) && strcmp (hostname, "localhost") && strcmp (hostname, "localhost.localdomain")) + policy->orig_hostname = g_strdup (hostname); + } + policy->vpn_manager = g_object_ref (vpn_manager); id = g_signal_connect (policy->vpn_manager, "connection-activated", G_CALLBACK (vpn_connection_activated), policy); @@ -1086,6 +1115,8 @@ nm_policy_destroy (NMPolicy *policy) } g_slist_free (policy->dev_signal_ids); + g_free (policy->orig_hostname); + g_object_unref (policy->manager); g_free (policy); } diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 7580319db0..0498fe7160 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -90,7 +90,6 @@ typedef struct { gboolean connections_loaded; GHashTable *connections; GSList *unmanaged_specs; - char *orig_hostname; } NMSysconfigSettingsPrivate; static void settings_system_interface_init (NMSettingsSystemInterface *klass); @@ -254,7 +253,6 @@ nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); GSList *iter; char *hostname = NULL; - gboolean have_hostname_providers = FALSE; /* Hostname returned is the hostname returned from the first plugin * that provides one. @@ -264,8 +262,6 @@ nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, &caps, NULL); if (caps & NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME) { - have_hostname_providers = TRUE; - g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME, &hostname, NULL); if (hostname && strlen (hostname)) return hostname; @@ -273,10 +269,6 @@ nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) } } - /* If no plugin provided a hostname, try the original hostname of the machine */ - if (!have_hostname_providers && priv->orig_hostname) - hostname = g_strdup (priv->orig_hostname); - return hostname; } @@ -1378,7 +1370,6 @@ finalize (GObject *object) g_slist_foreach (priv->plugins, (GFunc) g_object_unref, NULL); g_slist_free (priv->plugins); - g_free (priv->orig_hostname); g_free (priv->config_file); G_OBJECT_CLASS (nm_sysconfig_settings_parent_class)->finalize (object); @@ -1476,7 +1467,6 @@ static void nm_sysconfig_settings_init (NMSysconfigSettings *self) { NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); - char hostname[HOST_NAME_MAX + 2]; priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); @@ -1488,13 +1478,5 @@ nm_sysconfig_settings_init (NMSysconfigSettings *self) self); } else g_warning ("%s: failed to create PolicyKit authority.", __func__); - - /* Grab hostname on startup and use that if no plugins provide one */ - memset (hostname, 0, sizeof (hostname)); - if (gethostname (&hostname[0], HOST_NAME_MAX) == 0) { - /* only cache it if it's a valid hostname */ - if (strlen (hostname) && strcmp (hostname, "localhost") && strcmp (hostname, "localhost.localdomain")) - priv->orig_hostname = g_strdup (hostname); - } } From 2d982646b423a0ba0366beb7d075d1a7f9542291 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Jan 2010 17:16:58 -0800 Subject: [PATCH 053/392] trivial: clearer hostname fallback message --- src/NetworkManagerPolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 548ad01079..7034520fb0 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -461,7 +461,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) return; } } - nm_warning ("%s: DHCP-provided hostname '%s' looks invalid; not using it", + nm_warning ("%s: DHCP-provided hostname '%s' looks invalid; ignoring it", __func__, dhcp4_hostname); } } From 75898f075b10ece1715e5a923ec6025f2eb85ffc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Jan 2010 17:28:35 -0800 Subject: [PATCH 054/392] bluetooth: minor cleanup for device connect --- src/nm-device-bt.c | 59 +++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 444c7ff056..b2374d9a0f 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -567,6 +567,7 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) NMActRequest *req; NMDBusManager *dbus_mgr; DBusGConnection *g_connection; + gboolean dun = FALSE; req = nm_device_get_act_request (device); g_assert (req); @@ -581,43 +582,31 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) g_connection = nm_dbus_manager_get_connection (dbus_mgr); g_object_unref (dbus_mgr); - if (priv->bt_type == NM_BT_CAPABILITY_DUN) { - priv->type_proxy = dbus_g_proxy_new_for_name (g_connection, - BLUEZ_SERVICE, - nm_device_get_udi (device), - BLUEZ_SERIAL_INTERFACE); - if (!priv->type_proxy) { - // FIXME: set a reason code - return NM_ACT_STAGE_RETURN_FAILURE; - } - - dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", - nm_device_bt_connect_cb, - device, - NULL, - 20000, - G_TYPE_STRING, BLUETOOTH_DUN_UUID, - G_TYPE_INVALID); - } else if (priv->bt_type == NM_BT_CAPABILITY_NAP) { - priv->type_proxy = dbus_g_proxy_new_for_name (g_connection, - BLUEZ_SERVICE, - nm_device_get_udi (device), - BLUEZ_NETWORK_INTERFACE); - if (!priv->type_proxy) { - // FIXME: set a reason code - return NM_ACT_STAGE_RETURN_FAILURE; - } - - dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", - nm_device_bt_connect_cb, - device, - NULL, - 20000, - G_TYPE_STRING, BLUETOOTH_NAP_UUID, - G_TYPE_INVALID); - } else + if (priv->bt_type == NM_BT_CAPABILITY_DUN) + dun = TRUE; + else if (priv->bt_type == NM_BT_CAPABILITY_NAP) + dun = FALSE; + else g_assert_not_reached (); + priv->type_proxy = dbus_g_proxy_new_for_name (g_connection, + BLUEZ_SERVICE, + nm_device_get_udi (device), + dun ? BLUEZ_SERIAL_INTERFACE : BLUEZ_NETWORK_INTERFACE); + if (!priv->type_proxy) { + // FIXME: set a reason code + return NM_ACT_STAGE_RETURN_FAILURE; + } + + /* Connect to the BT device */ + dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", + nm_device_bt_connect_cb, + device, + NULL, + 20000, + G_TYPE_STRING, dun ? BLUETOOTH_DUN_UUID : BLUETOOTH_NAP_UUID, + G_TYPE_INVALID); + /* Watch for BT device property changes */ dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, G_TYPE_NONE, From 0a5a0146f8b80dbfe871b050b7c7f4faada12f8c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 28 Jan 2010 11:21:53 -0800 Subject: [PATCH 055/392] bluetooth: finish DUN implementation --- include/NetworkManager.h | 3 + src/modem-manager/nm-modem-cdma.c | 101 +++--- src/modem-manager/nm-modem-gsm.c | 101 +++--- src/modem-manager/nm-modem.c | 35 +- src/modem-manager/nm-modem.h | 4 +- src/nm-device-bt.c | 570 +++++++++++++++++++----------- src/nm-device-bt.h | 7 + src/nm-device-cdma.c | 21 +- src/nm-device-gsm.c | 21 +- src/nm-manager.c | 32 ++ 10 files changed, 581 insertions(+), 314 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index c8d5074a1e..eb3c1a743a 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -365,6 +365,9 @@ typedef enum { /* The supplicant is now available */ NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE, + /* The modem could not be found */ + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND, + /* Unused */ NM_DEVICE_STATE_REASON_LAST = 0xFFFF } NMDeviceStateReason; diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index d712df6903..f2a04dc076 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.c @@ -24,8 +24,7 @@ #include "nm-dbus-glib-types.h" #include "nm-modem-cdma.h" #include "nm-modem-types.h" -#include "nm-device-interface.h" -#include "nm-device-private.h" +#include "nm-device.h" #include "nm-dbus-manager.h" #include "nm-setting-connection.h" #include "nm-setting-cdma.h" @@ -38,6 +37,8 @@ G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM) typedef struct { DBusGProxyCall *call; + + GHashTable *connect_properties; } NMModemCdmaPrivate; @@ -110,6 +111,11 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data priv->call = NULL; + if (priv->connect_properties) { + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = NULL; + } + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); else { @@ -121,6 +127,37 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data } } +static void +do_connect (NMModemCdma *self) +{ + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM_SIMPLE); + priv->call = dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, priv->connect_properties, + G_TYPE_INVALID); +} + +static void +stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModemCdma *self = NM_MODEM_CDMA (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) + do_connect (self); + else { + nm_warning ("CDMA modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); + } +} + static GHashTable * create_connect_properties (NMConnection *connection) { @@ -138,45 +175,6 @@ create_connect_properties (NMConnection *connection) return properties; } -static void -do_connect (NMModem *modem) -{ - NMModemCdma *self = NM_MODEM_CDMA (modem); - NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); - NMConnection *connection; - DBusGProxy *proxy; - GHashTable *properties; - - connection = nm_act_request_get_connection (nm_device_get_act_request (NM_DEVICE (modem))); - g_assert (connection); - - properties = create_connect_properties (connection); - proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); - priv->call = dbus_g_proxy_begin_call_with_timeout (proxy, - "Connect", stage1_prepare_done, - self, NULL, 120000, - DBUS_TYPE_G_MAP_OF_VARIANT, properties, - G_TYPE_INVALID); - g_hash_table_destroy (properties); -} - -static void -stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - GError *error = NULL; - - if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) - do_connect (NM_MODEM (device)); - else { - nm_warning ("CDMA modem enable failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - g_error_free (error); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); - } -} - static NMActStageReturn real_act_stage1_prepare (NMModem *modem, NMActRequest *req, @@ -184,6 +182,8 @@ real_act_stage1_prepare (NMModem *modem, const char **out_setting_name, NMDeviceStateReason *reason) { + NMModemCdma *self = NM_MODEM_CDMA (modem); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); NMConnection *connection; connection = nm_act_request_get_connection (req); @@ -194,8 +194,12 @@ real_act_stage1_prepare (NMModem *modem, gboolean enabled = nm_modem_get_mm_enabled (modem); DBusGProxy *proxy; + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = create_connect_properties (connection); + if (enabled) - do_connect (modem); + do_connect (self); else { proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM); dbus_g_proxy_begin_call_with_timeout (proxy, @@ -314,6 +318,18 @@ nm_modem_cdma_init (NMModemCdma *self) { } +static void +dispose (GObject *object) +{ + NMModemCdma *self = NM_MODEM_CDMA (object); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + + G_OBJECT_CLASS (nm_modem_cdma_parent_class)->dispose (object); +} + static void nm_modem_cdma_class_init (NMModemCdmaClass *klass) { @@ -323,6 +339,7 @@ nm_modem_cdma_class_init (NMModemCdmaClass *klass) g_type_class_add_private (object_class, sizeof (NMModemCdmaPrivate)); /* Virtual methods */ + object_class->dispose = dispose; modem_class->get_user_pass = real_get_user_pass; modem_class->get_setting_name = real_get_setting_name; modem_class->get_best_auto_connection = real_get_best_auto_connection; diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index bddfd809d0..60d8b4f8dc 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -22,8 +22,7 @@ #include #include "nm-dbus-glib-types.h" #include "nm-modem-gsm.h" -#include "nm-device-private.h" -#include "nm-device-interface.h" +#include "nm-device.h" #include "nm-setting-connection.h" #include "nm-setting-gsm.h" #include "nm-modem-types.h" @@ -54,6 +53,8 @@ G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) typedef struct { DBusGProxyCall *call; + + GHashTable *connect_properties; } NMModemGsmPrivate; @@ -161,6 +162,11 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data priv->call = NULL; + if (priv->connect_properties) { + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = NULL; + } + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); else { @@ -192,6 +198,37 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data } } +static void +do_connect (NMModemGsm *self) +{ + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, priv->connect_properties, + G_TYPE_INVALID); +} + +static void +stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModemGsm *self = NM_MODEM_GSM (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) + do_connect (self); + else { + nm_warning ("GSM modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); + } +} + static GHashTable * create_connect_properties (NMConnection *connection) { @@ -248,43 +285,6 @@ create_connect_properties (NMConnection *connection) return properties; } -static void -do_connect (NMModem *modem) -{ - NMConnection *connection; - DBusGProxy *proxy; - GHashTable *properties; - - connection = nm_act_request_get_connection (nm_device_get_act_request (NM_DEVICE (modem))); - g_assert (connection); - - properties = create_connect_properties (connection); - proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); - dbus_g_proxy_begin_call_with_timeout (proxy, - "Connect", stage1_prepare_done, - modem, NULL, 120000, - DBUS_TYPE_G_MAP_OF_VARIANT, properties, - G_TYPE_INVALID); - g_hash_table_destroy (properties); -} - -static void -stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - GError *error = NULL; - - if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) - do_connect (NM_MODEM (device)); - else { - nm_warning ("GSM modem enable failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - g_error_free (error); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); - } -} - static NMActStageReturn real_act_stage1_prepare (NMModem *modem, NMActRequest *req, @@ -292,6 +292,8 @@ real_act_stage1_prepare (NMModem *modem, const char **out_setting_name, NMDeviceStateReason *reason) { + NMModemGsm *self = NM_MODEM_GSM (modem); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); NMConnection *connection; connection = nm_act_request_get_connection (req); @@ -302,8 +304,12 @@ real_act_stage1_prepare (NMModem *modem, gboolean enabled = nm_modem_get_mm_enabled (modem); DBusGProxy *proxy; + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = create_connect_properties (connection); + if (enabled) - do_connect (modem); + do_connect (self); else { proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM); dbus_g_proxy_begin_call_with_timeout (proxy, @@ -423,6 +429,18 @@ nm_modem_gsm_init (NMModemGsm *self) { } +static void +dispose (GObject *object) +{ + NMModemGsm *self = NM_MODEM_GSM (object); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + + G_OBJECT_CLASS (nm_modem_gsm_parent_class)->dispose (object); +} + static void nm_modem_gsm_class_init (NMModemGsmClass *klass) { @@ -432,6 +450,7 @@ nm_modem_gsm_class_init (NMModemGsmClass *klass) g_type_class_add_private (object_class, sizeof (NMModemGsmPrivate)); /* Virtual methods */ + object_class->dispose = dispose; modem_class->get_user_pass = real_get_user_pass; modem_class->get_setting_name = real_get_setting_name; modem_class->get_best_auto_connection = real_get_best_auto_connection; @@ -439,7 +458,5 @@ nm_modem_gsm_class_init (NMModemGsmClass *klass) modem_class->act_stage1_prepare = real_act_stage1_prepare; modem_class->deactivate_quickly = real_deactivate_quickly; -// device_class->act_stage2_config = real_act_stage2_config; - dbus_g_error_domain_register (NM_GSM_ERROR, NULL, NM_TYPE_GSM_ERROR); } diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 228dcba7f9..3d32e1914a 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -35,10 +35,7 @@ #include "nm-serial-device-glue.h" -static void device_interface_init (NMDeviceInterface *iface_class); - -G_DEFINE_TYPE_EXTENDED (NMModem, nm_modem, NM_TYPE_DEVICE, 0, - G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) +G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT) #define NM_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM, NMModemPrivate)) @@ -668,14 +665,6 @@ real_deactivate_quickly (NMModem *self, NMDevice *device) g_warning ("Invalid IP method"); break; } - - /* Stop the modem and any ongoing connection... */ - if (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { - dbus_g_proxy_call_no_reply (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), - "Enable", - G_TYPE_BOOLEAN, FALSE, - G_TYPE_INVALID); - } } void @@ -824,11 +813,15 @@ set_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d query_mm_enabled (NM_MODEM (user_data)); } -static void -real_set_enabled (NMDeviceInterface *device, gboolean enabled) +void +nm_modem_set_mm_enabled (NMModem *self, gboolean enabled) { - NMModem *self = NM_MODEM (device); - NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + NMModemPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); + + priv = NM_MODEM_GET_PRIVATE (self); /* FIXME: For now this just toggles the ModemManager enabled state. In the * future we want to tie this into rfkill state instead so that the user can @@ -838,10 +831,10 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) if (priv->mm_enabled != enabled) { DBusGProxy *proxy; - proxy = nm_modem_get_proxy (NM_MODEM (device), MM_DBUS_INTERFACE_MODEM); + proxy = nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM); dbus_g_proxy_begin_call (proxy, "Enable", set_mm_enabled_done, - device, NULL, + self, NULL, G_TYPE_BOOLEAN, enabled, G_TYPE_INVALID); } @@ -880,12 +873,6 @@ modem_properties_changed (DBusGProxy *proxy, /*****************************************************************************/ -static void -device_interface_init (NMDeviceInterface *iface_class) -{ - iface_class->set_enabled = real_set_enabled; -} - static void nm_modem_init (NMModem *self) { diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h index c5e34ad039..a2aed57e00 100644 --- a/src/modem-manager/nm-modem.h +++ b/src/modem-manager/nm-modem.h @@ -148,7 +148,9 @@ gboolean nm_modem_connection_secrets_updated (NMModem *modem, const DBusGObjectInfo *nm_modem_get_serial_dbus_info (void); -gboolean nm_modem_get_mm_enabled (NMModem *self); +gboolean nm_modem_get_mm_enabled (NMModem *self); + +void nm_modem_set_mm_enabled (NMModem *self, gboolean enabled); G_END_DECLS diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index b2374d9a0f..ab2572536e 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -52,13 +52,12 @@ typedef struct { guint32 capabilities; DBusGProxy *type_proxy; + DBusGProxy *dev_proxy; - NMPPPManager *ppp_manager; char *rfcomm_iface; - guint32 in_bytes; - guint32 out_bytes; + NMModem *modem; + guint32 timeout_id; - NMIP4Config *pending_ip4_config; guint32 bt_type; /* BT type of the current connection */ } NMDeviceBtPrivate; @@ -122,31 +121,6 @@ nm_bt_error_get_type (void) } -NMDevice * -nm_device_bt_new (const char *udi, - const char *bdaddr, - const char *name, - guint32 capabilities, - gboolean managed) -{ - g_return_val_if_fail (udi != NULL, NULL); - g_return_val_if_fail (bdaddr != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (capabilities != NM_BT_CAPABILITY_NONE, NULL); - - return (NMDevice *) g_object_new (NM_TYPE_DEVICE_BT, - NM_DEVICE_INTERFACE_UDI, udi, - NM_DEVICE_INTERFACE_IFACE, bdaddr, - NM_DEVICE_INTERFACE_DRIVER, "bluez", - NM_DEVICE_BT_HW_ADDRESS, bdaddr, - NM_DEVICE_BT_NAME, name, - NM_DEVICE_BT_CAPABILITIES, capabilities, - NM_DEVICE_INTERFACE_MANAGED, managed, - NM_DEVICE_INTERFACE_TYPE_DESC, "Bluetooth", - NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_BT, - NULL); -} - guint32 nm_device_bt_get_capabilities (NMDeviceBt *self) { g_return_val_if_fail (self != NULL, NM_BT_CAPABILITY_NONE); @@ -281,16 +255,26 @@ real_get_generic_capabilities (NMDevice *dev) /* IP method PPP */ static void -ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_data) +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (NM_DEVICE_BT (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) { NMDevice *device = NM_DEVICE (user_data); - switch (status) { - case NM_PPP_STATUS_DISCONNECT: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_DISCONNECT); - break; - case NM_PPP_STATUS_DEAD: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED); + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); break; default: break; @@ -298,68 +282,126 @@ ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_ } static void -ppp_ip4_config (NMPPPManager *ppp_manager, - const char *iface, - NMIP4Config *config, - gpointer user_data) +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) { - NMDevice *device = NM_DEVICE (user_data); + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMActRequest *req; - /* Ignore PPP IP4 events that come in after initial configuration */ - if (nm_device_get_state (device) != NM_DEVICE_STATE_IP_CONFIG) - return; + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); - nm_device_set_ip_iface (device, iface); - NM_DEVICE_BT_GET_PRIVATE (device)->pending_ip4_config = g_object_ref (config); - nm_device_activate_schedule_stage4_ip4_config_get (device); + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); } static void -ppp_stats (NMPPPManager *ppp_manager, - guint32 in_bytes, - guint32 out_bytes, - gpointer user_data) +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) { - NMDeviceBt *self = NM_DEVICE_BT (user_data); - NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; - if (priv->in_bytes != in_bytes || priv->out_bytes != out_bytes) { - priv->in_bytes = in_bytes; - priv->out_bytes = out_bytes; + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_CONFIG); - g_signal_emit (self, signals[PPP_STATS], 0, in_bytes, out_bytes); + if (success) { + NMActRequest *req; + NMActStageReturn ret; + NMDeviceStateReason stage2_reason = NM_DEVICE_STATE_REASON_NONE; + + req = nm_device_get_act_request (device); + g_assert (req); + + ret = nm_modem_act_stage2_config (modem, req, &stage2_reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_POSTPONE: + break; + case NM_ACT_STAGE_RETURN_SUCCESS: + nm_device_activate_schedule_stage3_ip_config_start (device); + break; + case NM_ACT_STAGE_RETURN_FAILURE: + default: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, stage2_reason); + break; + } + } else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + + if (priv->modem) + nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); } } static gboolean -get_ppp_credentials (NMConnection *connection, - const char **username, - const char **password) +modem_stage1 (NMDeviceBt *self, NMModem *modem, NMDeviceStateReason *reason) { - NMSettingGsm *s_gsm; - NMSettingCdma *s_cdma = NULL; + NMActRequest *req; + NMActStageReturn ret; - s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); - if (s_gsm) { - if (username) - *username = nm_setting_gsm_get_username (s_gsm); - if (password) - *password = nm_setting_gsm_get_password (s_gsm); - } else { - /* Try CDMA then */ - s_cdma = (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); - if (s_cdma) { - if (username) - *username = nm_setting_cdma_get_username (s_cdma); - if (password) - *password = nm_setting_cdma_get_password (s_cdma); - } + g_return_val_if_fail (reason != NULL, FALSE); + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + ret = nm_modem_act_stage1_prepare (modem, req, reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_POSTPONE: + case NM_ACT_STAGE_RETURN_SUCCESS: + /* Success, wait for the 'prepare-result' signal */ + return TRUE; + case NM_ACT_STAGE_RETURN_FAILURE: + default: + break; } - return (s_cdma || s_gsm) ? TRUE : FALSE; + return FALSE; } - static void real_connection_secrets_updated (NMDevice *device, NMConnection *connection, @@ -369,111 +411,134 @@ real_connection_secrets_updated (NMDevice *device, NMDeviceBt *self = NM_DEVICE_BT (device); NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); NMActRequest *req; - const char *username = NULL, *password = NULL; - gboolean success = FALSE; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; - if (caller != SECRETS_CALLER_PPP) - return; - - g_return_if_fail (priv->ppp_manager); + g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); req = nm_device_get_act_request (device); g_assert (req); - success = get_ppp_credentials (nm_act_request_get_connection (req), - &username, - &password); - if (success) { - nm_ppp_manager_update_secrets (priv->ppp_manager, - nm_device_get_ip_iface (device), - username ? username : "", - password ? password : "", - NULL); + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); return; } - /* Shouldn't ever happen */ - nm_ppp_manager_update_secrets (priv->ppp_manager, - nm_device_get_ip_iface (device), - NULL, - NULL, - "missing GSM/CDMA setting; no secrets could be found."); -} + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; -static NMActStageReturn -ppp_stage3_start (NMDevice *device, NMDeviceStateReason *reason) -{ - NMDeviceBt *self = NM_DEVICE_BT (device); - NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); - NMActRequest *req; - const char *ppp_name = NULL; - GError *err = NULL; - NMActStageReturn ret; - gboolean success; - - req = nm_device_get_act_request (device); - g_assert (req); - - success = get_ppp_credentials (nm_act_request_get_connection (req), - &ppp_name, - NULL); - if (!success) { - // FIXME: set reason to something plausible - return NM_ACT_STAGE_RETURN_FAILURE; - } - - priv->ppp_manager = nm_ppp_manager_new (priv->rfcomm_iface); - if (nm_ppp_manager_start (priv->ppp_manager, req, ppp_name, 20, &err)) { - g_signal_connect (priv->ppp_manager, "state-changed", - G_CALLBACK (ppp_state_changed), - device); - g_signal_connect (priv->ppp_manager, "ip4-config", - G_CALLBACK (ppp_ip4_config), - device); - g_signal_connect (priv->ppp_manager, "stats", - G_CALLBACK (ppp_stats), - device); - - ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else { - nm_warning ("%s", err->message); - g_error_free (err); - - g_object_unref (priv->ppp_manager); - priv->ppp_manager = NULL; - - *reason = NM_DEVICE_STATE_REASON_PPP_START_FAILED; - ret = NM_ACT_STAGE_RETURN_FAILURE; - } - - return ret; -} - -static NMActStageReturn -ppp_stage4 (NMDevice *device, NMIP4Config **config, NMDeviceStateReason *reason) -{ - NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); - NMConnection *connection; - NMSettingIP4Config *s_ip4; - - *config = priv->pending_ip4_config; - priv->pending_ip4_config = NULL; - - /* Merge user-defined overrides into the IP4Config to be applied */ - connection = nm_act_request_get_connection (nm_device_get_act_request (device)); - g_assert (connection); - s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - nm_utils_merge_ip4_config (*config, s_ip4); - - return NM_ACT_STAGE_RETURN_SUCCESS; + /* Otherwise, on success for GSM/CDMA secrets we need to schedule modem stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + if (!modem_stage1 (self, priv->modem, &reason)) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, reason); } /*****************************************************************************/ +gboolean +nm_device_bt_modem_added (NMDeviceBt *self, + NMModem *modem, + const char *driver) +{ + NMDeviceBtPrivate *priv; + const char *modem_iface; + char *base; + NMDeviceState state; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); + g_return_val_if_fail (modem != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); + + priv = NM_DEVICE_BT_GET_PRIVATE (self); + modem_iface = nm_modem_get_iface (modem); + g_return_val_if_fail (modem_iface != NULL, FALSE); + + if (!priv->rfcomm_iface) + return FALSE; + + base = g_path_get_basename (priv->rfcomm_iface); + if (strcmp (base, modem_iface)) { + g_free (base); + return FALSE; + } + g_free (base); + + /* Got the modem */ + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + /* Can only accept the modem in stage2, but since the interface matched + * what we were expecting, don't let anything else claim the modem either. + */ + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if (state != NM_DEVICE_STATE_CONFIG) { + nm_warning ("(%s): modem found but device not in correct state (%d)", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_state (NM_DEVICE (self))); + return TRUE; + } + + nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) modem found.", + nm_device_get_iface (NM_DEVICE (self))); + + if (priv->modem) { + g_warn_if_reached (); + g_object_unref (priv->modem); + } + + priv->modem = g_object_ref (modem); + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), self); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), self); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), self); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), self); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), self); + + /* Kick off the modem connection */ + if (!modem_stage1 (self, modem, &reason)) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, reason); + + return TRUE; +} + +gboolean +nm_device_bt_modem_removed (NMDeviceBt *self, NMModem *modem) +{ + NMDeviceBtPrivate *priv; + NMDeviceState state; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); + g_return_val_if_fail (modem != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); + + priv = NM_DEVICE_BT_GET_PRIVATE (self); + + if (modem != priv->modem) + return FALSE; + + state = nm_device_get_state (NM_DEVICE (self)); + nm_modem_device_state_changed (priv->modem, + NM_DEVICE_STATE_DISCONNECTED, + state, + NM_DEVICE_STATE_REASON_USER_REQUESTED); + + g_object_unref (priv->modem); + priv->modem = NULL; + return TRUE; +} + static void -nm_device_bt_connect_cb (DBusGProxy *proxy, - DBusGProxyCall *call_id, - void *user_data) +bluez_connect_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + void *user_data) { NMDeviceBt *self = NM_DEVICE_BT (user_data); NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); @@ -481,8 +546,8 @@ nm_device_bt_connect_cb (DBusGProxy *proxy, char *device; if (dbus_g_proxy_end_call (proxy, call_id, &error, - G_TYPE_STRING, &device, - G_TYPE_INVALID) == FALSE) { + G_TYPE_STRING, &device, + G_TYPE_INVALID) == FALSE) { nm_warning ("Error connecting with bluez: %s", error && error->message ? error->message : "(unknown)"); g_clear_error (&error); @@ -510,6 +575,20 @@ nm_device_bt_connect_cb (DBusGProxy *proxy, /* Stage 3 gets scheduled when Bluez says we're connected */ } +static gboolean +modem_find_timeout (gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + + priv->timeout_id = 0; + + nm_device_state_changed (NM_DEVICE (user_data), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND); + return FALSE; +} + static void bluez_property_changed (DBusGProxy *proxy, const char *property, @@ -528,18 +607,29 @@ bluez_property_changed (DBusGProxy *proxy, state = nm_device_get_state (device); connected = g_value_get_boolean (value); if (connected) { - /* Bluez says we're connected now. Start IP config. */ - if (state == NM_DEVICE_STATE_CONFIG) { gboolean pan = (priv->bt_type == NM_BT_CAPABILITY_NAP); gboolean dun = (priv->bt_type == NM_BT_CAPABILITY_DUN); nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " - "successful. Connected via %s.", + "successful. Will connect via %s.", nm_device_get_iface (device), dun ? "DUN" : (pan ? "PAN" : "unknown")); - nm_device_activate_schedule_stage3_ip_config_start (device); + if (pan) { + /* Bluez says we're connected now. Start IP config. */ + nm_device_activate_schedule_stage3_ip_config_start (device); + } else if (dun) { + /* Wait for ModemManager to find the modem */ + if (priv->timeout_id) + g_source_remove (priv->timeout_id); + priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); + + nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " + "waiting for modem to appear.", + nm_device_get_iface (device)); + } else + g_assert_not_reached (); } } else { gboolean fail = FALSE; @@ -589,6 +679,25 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) else g_assert_not_reached (); + priv->dev_proxy = dbus_g_proxy_new_for_name (g_connection, + BLUEZ_SERVICE, + nm_device_get_udi (device), + BLUEZ_DEVICE_INTERFACE); + if (!priv->dev_proxy) { + // FIXME: set a reason code + return NM_ACT_STAGE_RETURN_FAILURE; + } + + /* Watch for BT device property changes */ + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_VALUE, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->dev_proxy, "PropertyChanged", + G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->dev_proxy, "PropertyChanged", + G_CALLBACK (bluez_property_changed), device, NULL); + priv->type_proxy = dbus_g_proxy_new_for_name (g_connection, BLUEZ_SERVICE, nm_device_get_udi (device), @@ -600,23 +709,13 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) /* Connect to the BT device */ dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", - nm_device_bt_connect_cb, + bluez_connect_cb, device, NULL, 20000, G_TYPE_STRING, dun ? BLUETOOTH_DUN_UUID : BLUETOOTH_NAP_UUID, G_TYPE_INVALID); - /* Watch for BT device property changes */ - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, - G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_VALUE, - G_TYPE_INVALID); - dbus_g_proxy_add_signal (priv->type_proxy, "PropertyChanged", - G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->type_proxy, "PropertyChanged", - G_CALLBACK (bluez_property_changed), device, NULL); - return NM_ACT_STAGE_RETURN_POSTPONE; } @@ -626,9 +725,12 @@ real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); NMActStageReturn ret; - if (priv->bt_type == NM_BT_CAPABILITY_DUN) - ret = ppp_stage3_start (device, reason); - else + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + ret = nm_modem_stage3_ip4_config_start (NM_DEVICE_BT_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_bt_parent_class), + reason); + } else ret = NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage3_ip4_config_start (device, reason); return ret; @@ -642,9 +744,13 @@ real_act_stage4_get_ip4_config (NMDevice *device, NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); NMActStageReturn ret; - if (priv->bt_type == NM_BT_CAPABILITY_DUN) - ret = ppp_stage4 (device, config, reason); - else + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + ret = nm_modem_stage4_get_ip4_config (NM_DEVICE_BT_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_bt_parent_class), + config, + reason); + } else ret = NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage4_get_ip4_config (device, config, reason); return ret; @@ -655,17 +761,20 @@ real_deactivate_quickly (NMDevice *device) { NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); - if (priv->pending_ip4_config) { - g_object_unref (priv->pending_ip4_config); - priv->pending_ip4_config = NULL; - } - - priv->in_bytes = priv->out_bytes = 0; - if (priv->bt_type == NM_BT_CAPABILITY_DUN) { - if (priv->ppp_manager) { - g_object_unref (priv->ppp_manager); - priv->ppp_manager = NULL; + + if (priv->modem) { + nm_modem_deactivate_quickly (priv->modem, device); + + /* Since we're killing the Modem object before it'll get the + * state change signal, simulate the state change here. + */ + nm_modem_device_state_changed (priv->modem, + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_ACTIVATED, + NM_DEVICE_STATE_REASON_USER_REQUESTED); + g_object_unref (priv->modem); + priv->modem = NULL; } if (priv->type_proxy) { @@ -689,6 +798,16 @@ real_deactivate_quickly (NMDevice *device) } } + if (priv->dev_proxy) { + g_object_unref (priv->dev_proxy); + priv->dev_proxy = NULL; + } + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + priv->bt_type = NM_BT_CAPABILITY_NONE; g_free (priv->rfcomm_iface); @@ -698,6 +817,39 @@ real_deactivate_quickly (NMDevice *device) NM_DEVICE_CLASS (nm_device_bt_parent_class)->deactivate_quickly (device); } +/*****************************************************************************/ + +NMDevice * +nm_device_bt_new (const char *udi, + const char *bdaddr, + const char *name, + guint32 capabilities, + gboolean managed) +{ + NMDevice *device; + + g_return_val_if_fail (udi != NULL, NULL); + g_return_val_if_fail (bdaddr != NULL, NULL); + g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (capabilities != NM_BT_CAPABILITY_NONE, NULL); + + device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_BT, + NM_DEVICE_INTERFACE_UDI, udi, + NM_DEVICE_INTERFACE_IFACE, bdaddr, + NM_DEVICE_INTERFACE_DRIVER, "bluez", + NM_DEVICE_BT_HW_ADDRESS, bdaddr, + NM_DEVICE_BT_NAME, name, + NM_DEVICE_BT_CAPABILITIES, capabilities, + NM_DEVICE_INTERFACE_MANAGED, managed, + NM_DEVICE_INTERFACE_TYPE_DESC, "Bluetooth", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_BT, + NULL); + if (device) + g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + + return device; +} + static void nm_device_bt_init (NMDeviceBt *self) { @@ -755,9 +907,21 @@ finalize (GObject *object) { NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + if (priv->type_proxy) g_object_unref (priv->type_proxy); + if (priv->dev_proxy) + g_object_unref (priv->dev_proxy); + + if (priv->modem) + g_object_unref (priv->modem); + + g_free (priv->rfcomm_iface); g_free (priv->bdaddr); g_free (priv->name); diff --git a/src/nm-device-bt.h b/src/nm-device-bt.h index 67ef6f5f25..d3187d766f 100644 --- a/src/nm-device-bt.h +++ b/src/nm-device-bt.h @@ -22,6 +22,7 @@ #define NM_DEVICE_BT_H #include +#include "nm-modem.h" G_BEGIN_DECLS @@ -60,6 +61,12 @@ guint32 nm_device_bt_get_capabilities (NMDeviceBt *device); const char *nm_device_bt_get_hw_address (NMDeviceBt *device); +gboolean nm_device_bt_modem_added (NMDeviceBt *device, + NMModem *modem, + const char *driver); + +gboolean nm_device_bt_modem_removed (NMDeviceBt *device, NMModem *modem); + G_END_DECLS #endif /* NM_GSM_DEVICE_H */ diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 4e8acb9ed8..4ab684d3ca 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -33,7 +33,10 @@ #include "nm-device-cdma-glue.h" -G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE) +static void device_interface_init (NMDeviceInterface *iface_class); + +G_DEFINE_TYPE_EXTENDED (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) #define NM_DEVICE_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaPrivate)) @@ -276,6 +279,16 @@ real_get_generic_capabilities (NMDevice *device) return NM_DEVICE_CAP_NM_SUPPORTED; } +static void +real_set_enabled (NMDeviceInterface *device, gboolean enabled) +{ + NMDeviceCdma *self = NM_DEVICE_CDMA (device); + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (self); + + if (priv->modem) + nm_modem_set_mm_enabled (priv->modem, enabled); +} + /*****************************************************************************/ NMDevice * @@ -308,6 +321,12 @@ nm_device_cdma_new (NMModemCdma *modem, const char *driver) return device; } +static void +device_interface_init (NMDeviceInterface *iface_class) +{ + iface_class->set_enabled = real_set_enabled; +} + static void nm_device_cdma_init (NMDeviceCdma *self) { diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c index bd717c2ca1..efe46ba164 100644 --- a/src/nm-device-gsm.c +++ b/src/nm-device-gsm.c @@ -33,7 +33,10 @@ #include "nm-device-gsm-glue.h" -G_DEFINE_TYPE (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE) +static void device_interface_init (NMDeviceInterface *iface_class); + +G_DEFINE_TYPE_EXTENDED (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) #define NM_DEVICE_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GSM, NMDeviceGsmPrivate)) @@ -276,6 +279,16 @@ real_get_generic_capabilities (NMDevice *device) return NM_DEVICE_CAP_NM_SUPPORTED; } +static void +real_set_enabled (NMDeviceInterface *device, gboolean enabled) +{ + NMDeviceGsm *self = NM_DEVICE_GSM (device); + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (self); + + if (priv->modem) + nm_modem_set_mm_enabled (priv->modem, enabled); +} + /*****************************************************************************/ NMDevice * @@ -308,6 +321,12 @@ nm_device_gsm_new (NMModemGsm *modem, const char *driver) return device; } +static void +device_interface_init (NMDeviceInterface *iface_class) +{ + iface_class->set_enabled = real_set_enabled; +} + static void nm_device_gsm_init (NMDeviceGsm *self) { diff --git a/src/nm-manager.c b/src/nm-manager.c index 210c6ee7da..f49c670b2c 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -320,6 +320,7 @@ modem_added (NMModemManager *modem_manager, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMDevice *replace_device, *device = NULL; const char *ip_iface; + GSList *iter; ip_iface = nm_modem_get_iface (modem); @@ -332,6 +333,25 @@ modem_added (NMModemManager *modem_manager, TRUE); } + /* Give Bluetooth DUN devices first chance to claim the modem */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + if (NM_IS_DEVICE_BT (iter->data)) { + if (nm_device_bt_modem_added (NM_DEVICE_BT (iter->data), modem, driver)) + return; + } + } + + /* If it was a Bluetooth modem and no bluetooth device claimed it, ignore + * it. The rfcomm port (and thus the modem) gets created automatically + * by the Bluetooth code during the connection process. + */ + if (driver && !strcmp (driver, "bluetooth")) { + g_message ("%s: ignoring modem '%s' (no associated Bluetooth device)", + __func__, ip_iface); + return; + } + + /* Otherwise make a new top-level NMDevice for it */ if (NM_IS_MODEM_GSM (modem)) device = nm_device_gsm_new (NM_MODEM_GSM (modem), driver); else if (NM_IS_MODEM_CDMA (modem)) @@ -444,7 +464,17 @@ modem_removed (NMModemManager *modem_manager, NMManager *self = NM_MANAGER (user_data); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMDevice *found; + GSList *iter; + /* Give Bluetooth DUN devices first chance to handle the modem removal */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + if (NM_IS_DEVICE_BT (iter->data)) { + if (nm_device_bt_modem_removed (NM_DEVICE_BT (iter->data), modem)) + return; + } + } + + /* Otherwise remove the standalone modem */ found = nm_manager_get_device_by_udi (self, nm_modem_get_path (modem)); if (found) priv->devices = remove_one_device (self, priv->devices, found, FALSE, TRUE); @@ -1736,12 +1766,14 @@ find_device_by_iface (NMManager *self, const gchar *iface) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); GSList *iter; + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { NMDevice *device = NM_DEVICE (iter->data); const gchar *d_iface = nm_device_get_ip_iface (device); if (!strcmp (d_iface, iface)) return device; } + return NULL; } From 86e48439025379b033daf1ea92b43d0d2df06d23 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 28 Jan 2010 12:15:00 -0800 Subject: [PATCH 056/392] introspection: sync device state reason codes with NetworkManager.h --- introspection/nm-device.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index c23b596c4b..49b77a5ba0 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -392,7 +392,12 @@ The 802.1x supplicant is now available. - + + + The modem could not be found. + + + From 21965b14315358740c99e702d9dcdf99b0cebf9a Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Sat, 30 Jan 2010 14:05:37 -0800 Subject: [PATCH 057/392] po: updated Telugu translation (bgo #608426) --- po/te.po | 265 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 215 insertions(+), 50 deletions(-) diff --git a/po/te.po b/po/te.po index 5dd39f9965..7b3ace2288 100644 --- a/po/te.po +++ b/po/te.po @@ -1,15 +1,15 @@ -# translation of NetworkManager.po.master.te.po to Telugu +# translation of NetworkManager.master.te.po to Telugu # Telugu translation of NetworkManager. # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. # -# Krishna Babu K , 2009. +# Krishna Babu K , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.po.master.te\n" +"Project-Id-Version: NetworkManager.master.te\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-06-12 03:24+0000\n" -"PO-Revision-Date: 2009-06-12 17:50+0530\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-01-29 15:20+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" #: ../libnm-util/crypto.c:120 #, c-format @@ -103,8 +104,9 @@ msgstr "IV నిల్వవుంచుటకు సరిపోవునం msgid "IV contains non-hexadecimal digits." msgstr "IV నాన్-హెక్సాడెసిమల్ సంఖ్యలను కలిగివుంది." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "వ్యక్తిగత కీ సైఫర్ '%s' అనునది తెలియనిది." @@ -124,72 +126,111 @@ msgstr "వ్యక్తిగత కీ రకమును నిర్ణయ msgid "Not enough memory to store decrypted private key." msgstr "డీక్రిప్టు చేసిన వ్యక్తిగత కీను నిల్వవుంచుటకు సరిపోవునంత మెమొరీలేదు." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "క్రిప్టో యింజన్‌ను సిద్దముచేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 యింజన్ సిద్దము చేయుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "చెల్లని IV పొడవు (తప్పక కనీసం %zd అయివుండాలి)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "డిక్రిప్టెడ్ కీ బఫర్ కొరకు సరిపోవునంత మెమొరి లేదు." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "డిక్రిప్షన్ సైఫర్ కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "వివరణ కొరకు సిమెట్రిక్ కీను అమర్చుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "వివరణ కొరకు IV అమర్చుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: అనుకోని పాడింగ్ పొడవు." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 #, c-format msgid "Failed to decrypt the private key." msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ఎన్క్రిప్టింగ్ కొరకు మెమొరీ కేటాయించలేక పోయింది." + +#: ../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 "ఎన్క్రిప్షన్ సైఫర్ కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %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 "ఎన్క్రిప్షన్ కొరకు సిమెట్రిక్ కీను అమర్చుటలో విఫలమైంది: %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 "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది: %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 "డాటాను ఎన్క్రిప్టు చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "దృవీకరణపత్రం డాటాను సిద్దపరచుటలో దోషము: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 డీకోడర్‌ను సిద్దపరచలేక పోయింది: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 ఫైలును డీకోడ్ పరచలేక పోయింది: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ఫైలును నిర్ధారించలేక పోయింది: %s" #: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "క్రిప్టో యింజన్ సిద్దము చేయుటలో విఫలమైంది: %d." @@ -199,105 +240,186 @@ msgstr "క్రిప్టో యింజన్ సిద్దము చే msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "చెల్లని IV పొడవు (తప్పక కనీసం %d వుండాలి)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "డిక్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దము చేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "వివరణ కొరకు సిమెట్రిక్ కీ అమర్చుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "వివరణ కొరకు IV అమర్చుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "వివరణ సందర్భమును సిద్దపరచుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../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 "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: డిక్రిప్టు చేసిన డాటా మరీ పెద్దది." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "వ్యక్తిగత కీ యొక్క డిక్రిప్షన్ ఖరారు చేయుటలో విఫలమైంది: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:363 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "ఎన్క్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు సిమ్మెట్రిక్ కీను అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "ఎన్క్రిప్షన్ సందర్భమును సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "ఎన్క్రిప్టు చేయుటకు విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ఎన్క్రిప్టు చేసిన తర్వాత అనుకోని డాటా మొత్తము." + +#: ../libnm-util/crypto_nss.c:446 #, c-format msgid "Couldn't decode certificate: %d" msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:481 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "సంకేతపదమును UCS2కు మార్చలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:509 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 డీకోడర్‌ను సిద్దము చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:518 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ఫైలు డీకోడ్ చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:527 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ఫైలు నిర్దారించలేక పోయింది: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:556 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." + +#: ../libnm-util/nm-utils.c:1633 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "మెమొరీను PEM ఫైలు సృష్టీకరణ కొరకు కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "నెట్‌లింక్ సందేశమును ప్రోసెసింగ్ చేయుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకుకు అనుసంధానము కాలేకపోయింది: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు సమూహమును కలుపలేక పోయింది:%s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు క్యాచీని కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" + +#: ../src/nm-netlink-monitor.c:558 #, c-format msgid "error updating link cache: %s" msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" - -#: ../src/NetworkManager.c:329 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# నెట్వర్కునిర్వాహిక ద్వారా సృష్టించబడింది\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -306,28 +428,71 @@ msgstr "" "# %sనుండి కలుపబడింది\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "నెట్‌లింక్ సంభాలికను కేటాయించలేక పోయింది: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "నెట్‌లింక్‌కు అనుసంధానము కాలేకపోయింది: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" + +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." -#: ../src/system-settings/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2168 +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 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:2 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" msgstr "సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents modification of the persistent system hostname" +msgstr "నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "రక్షిత 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 నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + From f6c383ff14412ea264fa8740dec84f92a89bd385 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Feb 2010 17:29:58 -0800 Subject: [PATCH 058/392] policy: be more selective when adding hostname to /etc/hosts (debian #567411) If the user has already mapped the hostname to some other address, assume the user knows what they are doing (since they probably do) and leave that mapping alone, and create a minimal 127.0.0.1 entry. If there was no hostname mapping, add it to the 127.0.0.1 entry like NM did before. --- src/NetworkManagerPolicy.c | 124 ++++++++++++++++++++++++++++++++++--- 1 file changed, 116 insertions(+), 8 deletions(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 7034520fb0..1b7801c510 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -252,13 +252,84 @@ get_best_device (NMManager *manager, NMActRequest **out_req) return best; } +static gboolean +is_localhost_mapping (const char *str) +{ + return (!strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) && strstr (str, "localhost")); +} + +static gboolean +find_token (const char *line, const char *token) +{ + const char *start = line, *p = line; + + g_return_val_if_fail (line != NULL, FALSE); + g_return_val_if_fail (token != NULL, FALSE); + g_return_val_if_fail (strlen (token) > 0, FALSE); + + /* Walk through the line to find the next whitespace character */ + while (p <= line + strlen (line)) { + if (isblank (*p) || (*p == '\0')) { + /* Token starts with 'start' and ends with 'end' */ + if ((p > start) && *start && !strncmp (start, token, (p - start))) + return TRUE; /* found */ + + /* not found; advance start and continue looking */ + start = p + 1; + } + p++; + } + + return FALSE; +} + +#if 0 +/* Testcase for find_token; break it out and add it to the testsuite */ + +typedef struct { + const char *line; + const char *token; + gboolean expected; +} Foo; + +static Foo foo[] = { + { "127.0.0.1\tfoobar\tblah", "blah", TRUE }, + { "", "blah", FALSE }, + { "1.1.1.1\tbork\tfoo", "blah", FALSE }, + { "127.0.0.1 foobar\tblah", "blah", TRUE }, + { "127.0.0.1 foobar blah", "blah", TRUE }, + { "192.168.1.1 blah borkbork", "blah", TRUE }, + { "192.168.1.1 foobar\tblah borkbork", "blah", TRUE }, + { "192.168.1.1\tfoobar\tblah\tborkbork", "blah", TRUE }, + { "192.168.1.1 \tfoobar \tblah \tborkbork\t ", "blah", TRUE }, + { "\t\t\t\t \t\t\tasdfadf a\t\t\t\t\t \t\t\t\t\t ", "blah", FALSE }, + { NULL, NULL, FALSE } +}; + +int main(int argc, char **argv) +{ + Foo *iter = &foo[0]; + + while (iter->line) { + if (find_token (iter->line, iter->token) != iter->expected) { + g_message ("Failed: '%s' <= '%s' (%d)", iter->line, iter->token, iter->expected); + return 1; + } + iter++; + } + + g_message ("Success"); + return 0; +} +#endif + #define FALLBACK_HOSTNAME "localhost.localdomain" static gboolean update_etc_hosts (const char *hostname) { char *contents = NULL; - char **lines = NULL, **line; + char **lines = NULL, **line, **host_mapping = NULL; GError *error = NULL; gboolean initial_comments = TRUE; gboolean added = FALSE; @@ -285,25 +356,62 @@ update_etc_hosts (const char *hostname) return FALSE; } - /* Replace any 127.0.0.1 entry that is at the beginning of the file or right - * after initial comments. If there is no 127.0.0.1 entry at the beginning - * or after initial comments, add one there and ignore any other 127.0.0.1 - * entries. + /* Two-pass modification of /etc/hosts: + * + * 1) Look for a non-comment, non-localhost line that contains the current + * hostname. Mark that line. + * + * 2) For each line in the existing /etc/hosts, add it to the new /etc/hosts + * unless it starts with 127.0.0.1 and is right after the initial comments + * (if any) and contains "localhost". */ + + /* Find any existing hostname mapping */ for (line = lines; lines && *line; line++) { + /* Look for any line that (a) contains the current hostname, and + * (b) does not start with '127.0.0.1' and contain 'localhost'. + */ + if ( strlen (*line) + && (*line[0] != '#') + && find_token (*line, hostname) + && !is_localhost_mapping (*line)) { + host_mapping = line; + break; + } + } + + /* Construct the new hosts file; replace any 127.0.0.1 entry that is at the + * beginning of the file or right after initial comments and contains + * the string 'localhost'. If there is no 127.0.0.1 entry at the beginning + * or after initial comments that contains 'localhost', add one there + * and ignore any other 127.0.0.1 entries that contain 'localhost'. + */ + for (line = lines, initial_comments = TRUE; lines && *line; line++) { gboolean add_line = TRUE; /* This is the first line after the initial comments */ - if (initial_comments && (*line[0] != '#')) { + if (strlen (*line) && initial_comments && (*line[0] != '#')) { initial_comments = FALSE; - g_string_append_printf (new_contents, "127.0.0.1\t%s", hostname); + + /* If some other line contained the hostname, make a simple + * localhost mapping and assume the user knows what they are doing + * with their manual hostname entry. Otherwise if the hostname + * wasn't found somewhere else, add it to the localhost mapping line + * to make sure it's mapped to something. + */ + if (host_mapping) + g_string_append (new_contents, "127.0.0.1"); + else + g_string_append_printf (new_contents, "127.0.0.1\t%s", hostname); + if (strcmp (hostname, FALLBACK_HOSTNAME)) g_string_append_printf (new_contents, "\t" FALLBACK_HOSTNAME); + g_string_append (new_contents, "\tlocalhost\n"); added = TRUE; /* Don't add the entry if it's supposed to be the actual localhost reverse mapping */ - if (!strncmp (*line, "127.0.0.1", strlen ("127.0.0.1")) && strstr (*line, "localhost")) + if (is_localhost_mapping (*line)) add_line = FALSE; } From 74dfcf6ad794a79da2cb4762438e510ae60c8c8b Mon Sep 17 00:00:00 2001 From: Tournaris Pavlos Date: Tue, 2 Feb 2010 09:48:40 -0800 Subject: [PATCH 059/392] po: update Greek translation (bgo #608810) --- po/el.po | 103 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 30 deletions(-) diff --git a/po/el.po b/po/el.po index 8a36618ff1..7890d9b9ce 100644 --- a/po/el.po +++ b/po/el.po @@ -4,21 +4,22 @@ # Nikos Charonitakis , 2005. # Kostas Papadimas , 2005-2007. # Dimitris Glezos , 2006. -# Jennie Petoumenou , 2008. +# Jennie Petoumenou , 2008, 2009. +# Tournaris Pavlos , 2009. msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." -"cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2008-12-07 22:31+0000\n" -"PO-Revision-Date: 2008-12-18 16:53+0100\n" -"Last-Translator: Jennie Petoumenou \n" -"Language-Team: Greek \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-08-27 03:24+0000\n" +"PO-Revision-Date: 2009-09-10 11:08+0200\n" +"Last-Translator: Tournaris Pavlos \n" +"Language-Team: Greek \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 0.2\n" +"X-Generator: Lokalize 0.3\n" #: ../libnm-util/crypto.c:120 #, c-format @@ -28,7 +29,7 @@ msgstr "Το αρχείο κλειδιού PEM δεν είχε ετικέτα τ #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Δεν μοιάζει με αρχείο ιδιωτικού κλειδιού PEM." +msgstr "Δε μοιάζει με αρχείο ιδιωτικού κλειδιού PEM." #: ../libnm-util/crypto.c:138 #, c-format @@ -75,7 +76,7 @@ msgstr "Αδύνατη η αποκωδικοποίηση του ιδιωτικο #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "Το πιστοποιητικό PEM '%s' δεν διέθετε ετικέτα τέλους '%s'." +msgstr "Το πιστοποιητικό PEM '%s' δε διέθετε ετικέτα τέλους '%s'." #: ../libnm-util/crypto.c:277 #, c-format @@ -96,7 +97,7 @@ msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "Το μήκος του IV πρέπει να αντιστοιχεί σε άρτιο αριθμό bytes." +msgstr "Το μήκος του IV πρέπει να αντιστοιχεί σε άρτιο αριθμό byte." #: ../libnm-util/crypto.c:333 #, c-format @@ -199,9 +200,10 @@ msgid "Couldn't verify PKCS#12 file: %s" msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %s" #: ../libnm-util/crypto_nss.c:57 +#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Απέτυχε η αρχικοποίηση της μηχανής crypto: %d." +msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας: %d." #: ../libnm-util/crypto_nss.c:111 #, c-format @@ -256,67 +258,62 @@ msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοπο #: ../libnm-util/crypto_nss.c:356 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Αδύνατη η αρχικοποίηση του αρχείου PKCS#12: %d" +msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %d" #: ../libnm-util/crypto_nss.c:365 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 #, c-format msgid "error processing netlink message: %s" msgstr "σφάλμα κατά την επεξεργασία μηνύματος netlink: %s" -#: ../src/nm-netlink-monitor.c:251 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "αδύνατη η δέσμευση χειριστή netlink για την παρακολούθηση της κατάστασης της " "σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:261 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "αδύνατη η σύνδεση με το netlink για την παρακολούθηση της κατάστασης της " "σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" "αδύνατη η ένταξη στην ομάδα του netlink για την παρακολούθηση της κατάστασης " "της σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "αδύνατη η εκχώρηση λανθάνουσας μνήμης στη σύνδεση netlink για την " "παρακολούθηση της κατάστασης της σύνδεσης δικτύου: %s" -#: ../src/nm-netlink-monitor.c:418 -#, c-format -msgid "error updating link cache: %s" -msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" - -#: ../src/nm-netlink-monitor.c:484 +#: ../src/nm-netlink-monitor.c:494 msgid "error occurred while waiting for data on socket" msgstr "σφάλμα κατά την αναμονή για δεδομένα στην υποδοχή" -#: ../src/NetworkManager.c:293 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Άκυρη επιλογή. Παρακαλώ χρησιμοποιήστε --help για να δείτε τη λίστα των " "έγκυρων επιλογών.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# Δημιουργήθηκε από το NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -325,18 +322,64 @@ msgstr "" "# Συγχωνεύθηκαν από το %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ΣΗΜΕΙΩΣΗ: Ο libc resolver μπορεί να μην υποστηρίζει περισσότερους από 3 " "εξυπηρετητές ονομάτων." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Οι κάτωθι εξυπηρετητές ονομάτων ίσως να μην αναγνωρίζονται." -#: ../system-settings/src/main.c:380 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "Αυτόματο %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +msgid "System" +msgstr "Σύστημα" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω ανοιχτού ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Αλλαγή πάγιου ονόματος συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Τροποποίηση συνδέσεων συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση των ρυθμίσεων συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση του πάγιου ονόματος " +"συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω " +"προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω ανοιχτού " +"ασύρματου δικτύου" + +#~ msgid "error updating link cache: %s" +#~ msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" From 2a7a4ebaf6112ff82e91a5cf3b3639db022b8a1a Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 8 Feb 2010 09:34:28 -0800 Subject: [PATCH 060/392] ifupdown: interpret allow-hotplug as autoconnect (debian #568784) --- system-settings/plugins/ifupdown/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 18afce4f4a..ae09840eb1 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -355,7 +355,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) ifparser_init (); block = ifparser_getfirst (); while (block) { - if(!strcmp ("auto", block->type)) + if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) g_hash_table_insert (auto_ifaces, block->name, GUINT_TO_POINTER (1)); else if (!strcmp ("iface", block->type) && strcmp ("lo", block->name)) { NMIfupdownConnection *exported; From 21242568a6191a6c8067bf5af42135d21c5dac41 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Feb 2010 13:16:14 -0800 Subject: [PATCH 061/392] gsm: handle PIN requests during modem enable too (bgo #609197) Fix a regression after f61af8e139a35cfa52e443fdc66ad4c05851085f where a PIN request while enabling the modem wouldn't properly make NM request secrets from the settings service. --- src/modem-manager/nm-modem-gsm.c | 121 +++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 21 deletions(-) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index e77b9e70f8..f3e4d23b63 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -173,6 +173,41 @@ clear_pin (NMDevice *device) g_object_set (G_OBJECT (setting), NM_SETTING_GSM_PIN, NULL, NULL); } +static void +request_secrets (NMDevice *device, + const char *setting_name, + const char *hint1, + const char *hint2, + gboolean always_ask) +{ + NMActRequest *req; + NMConnection *connection; + guint32 tries = 0; + + g_return_if_fail (device != NULL); + g_return_if_fail (hint1 || hint2); + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + + if (!always_ask) + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); + + nm_act_request_get_secrets (req, + setting_name ? setting_name : NM_SETTING_GSM_SETTING_NAME, + (tries || always_ask) ? TRUE : FALSE, + SECRETS_CALLER_GSM, + hint1, + hint2); + + if (!always_ask) + g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); +} + static void stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -198,15 +233,9 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d error && error->message ? error->message : "(unknown)"); } - if (required_secret) { - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - nm_act_request_get_secrets (nm_device_get_act_request (device), - NM_SETTING_GSM_SETTING_NAME, - retry_secret, - SECRETS_CALLER_GSM, - required_secret, - NULL); - } else + if (required_secret) + request_secrets (device, NULL, required_secret, NULL, retry_secret); + else nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); g_error_free (error); @@ -287,6 +316,59 @@ do_connect (NMModem *modem) g_hash_table_destroy (properties); } +static void +stage1_pin_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { + /* Success; go back and try the enable again */ + nm_device_activate_schedule_stage1_device_prepare (device); + } else { + nm_warning ("GSM PIN unlock failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + + clear_pin (device); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED); + } +} + +static void +handle_enable_pin_required (NMDevice *device) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingGsm *s_gsm; + const char *pin = NULL; + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* See if we have a PIN already */ + s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); + if (s_gsm) + pin = nm_setting_gsm_get_pin (s_gsm); + + /* If we do, send it */ + if (pin) { + NMModem *modem = NM_MODEM (device); + + dbus_g_proxy_begin_call_with_timeout (nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_GSM_CARD), + "SendPin", stage1_pin_done, + modem, NULL, 10000, + G_TYPE_STRING, pin, + G_TYPE_INVALID); + } else { + /* Otherwise try to get the PIN */ + request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, FALSE); + } +} + static void stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -299,8 +381,13 @@ stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_da nm_warning ("GSM modem enable failed: (%d) %s", error ? error->code : -1, error && error->message ? error->message : "(unknown)"); + + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + handle_enable_pin_required (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); + g_error_free (error); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); } } @@ -312,7 +399,6 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) const char *setting_name; GPtrArray *hints = NULL; const char *hint1 = NULL, *hint2 = NULL; - guint32 tries; req = nm_device_get_act_request (device); g_assert (req); @@ -337,6 +423,8 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) return NM_ACT_STAGE_RETURN_POSTPONE; } + /* Get the required secrets */ + if (hints) { if (hints->len > 0) hint1 = g_ptr_array_index (hints, 0); @@ -344,16 +432,7 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) hint2 = g_ptr_array_index (hints, 1); } - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - - tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); - nm_act_request_get_secrets (req, - setting_name, - tries ? TRUE : FALSE, - SECRETS_CALLER_GSM, - hint1, - hint2); - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + request_secrets (device, setting_name, hint1, hint2, FALSE); if (hints) g_ptr_array_free (hints, TRUE); From 096f87e16034e216f06da97c04deb3821f68b95f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 9 Feb 2010 23:50:26 -0800 Subject: [PATCH 062/392] modem: ignore Enabled property changes while activating Due to various ordering issues in ModemManager, when the Enable() call fails because a PIN is required, MM will disable the modem and *then* complete the dbus call. That means that NM gets the Enable property change before the Enable() call completes, and NM would then transition the device to DISCONNECTED. What we really want to do is get the response from MM and then figure out whether to fail activation or get secrets, not go to DISCONNECTED. To fix this, ignore Enabled property changes to FALSE while activating so we can handle it ourselves. There are still a few fixes left in nm-applet to make the secrets request for PINs work on-the-fly, but saved in the connection works fine. --- src/modem-manager/nm-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 4788673c1f..5b001eec52 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -622,7 +622,7 @@ modem_properties_changed (DBusGProxy *proxy, if (priv->mm_enabled == FALSE) { state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); - if (IS_ACTIVATING_STATE (state) || (state == NM_DEVICE_STATE_ACTIVATED)) { + if (state == NM_DEVICE_STATE_ACTIVATED) { nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); From b4d0114ff623b6560d7f22f49d0f64ecf159e642 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 11 Feb 2010 11:28:59 -0800 Subject: [PATCH 063/392] gsm: split password and PIN try counters To ensure that getting one wrong doesn't force a request for another. --- src/modem-manager/nm-modem-gsm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index f3e4d23b63..fcc811fc4c 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -51,6 +51,7 @@ typedef enum { #define GSM_SECRETS_TRIES "gsm-secrets-tries" +#define PIN_TRIES "pin-tries" G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) @@ -178,6 +179,7 @@ request_secrets (NMDevice *device, const char *setting_name, const char *hint1, const char *hint2, + const char *tries_tag, gboolean always_ask) { NMActRequest *req; @@ -195,7 +197,7 @@ request_secrets (NMDevice *device, nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); if (!always_ask) - tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), tries_tag)); nm_act_request_get_secrets (req, setting_name ? setting_name : NM_SETTING_GSM_SETTING_NAME, @@ -205,7 +207,7 @@ request_secrets (NMDevice *device, hint2); if (!always_ask) - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + g_object_set_data (G_OBJECT (connection), tries_tag, GUINT_TO_POINTER (++tries)); } static void @@ -221,9 +223,10 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d const char *required_secret = NULL; gboolean retry_secret = FALSE; - if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) { + clear_pin (device); required_secret = NM_SETTING_GSM_PIN; - else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) { + } else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) { clear_pin (device); required_secret = NM_SETTING_GSM_PIN; retry_secret = TRUE; @@ -234,7 +237,7 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d } if (required_secret) - request_secrets (device, NULL, required_secret, NULL, retry_secret); + request_secrets (device, NULL, required_secret, NULL, PIN_TRIES, retry_secret); else nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); @@ -365,7 +368,7 @@ handle_enable_pin_required (NMDevice *device) G_TYPE_INVALID); } else { /* Otherwise try to get the PIN */ - request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, FALSE); + request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, PIN_TRIES, FALSE); } } @@ -424,7 +427,6 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) } /* Get the required secrets */ - if (hints) { if (hints->len > 0) hint1 = g_ptr_array_index (hints, 0); @@ -432,7 +434,7 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) hint2 = g_ptr_array_index (hints, 1); } - request_secrets (device, setting_name, hint1, hint2, FALSE); + request_secrets (device, setting_name, hint1, hint2, GSM_SECRETS_TRIES, FALSE); if (hints) g_ptr_array_free (hints, TRUE); @@ -562,6 +564,7 @@ real_deactivate_quickly (NMDevice *device) connection = nm_act_request_get_connection (req); g_assert (connection); g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, NULL); + g_object_set_data (G_OBJECT (connection), PIN_TRIES, NULL); } if (NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly) From 183c256bad931a757e3252ecd433a001d5470104 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 11 Feb 2010 22:53:49 -0800 Subject: [PATCH 064/392] modem: deactivate device if modem is disabled underneath NM --- src/nm-device-cdma.c | 14 ++++++++++++-- src/nm-device-gsm.c | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 3ee797dc00..bc73e9dab0 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -300,6 +300,15 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) } } +static void +modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceCdma *self = NM_DEVICE_CDMA (user_data); + NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (self); + + real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); +} + /*****************************************************************************/ NMDevice * @@ -319,14 +328,15 @@ nm_device_cdma_new (NMModemCdma *modem, const char *driver) NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, NULL); if (device) { - NM_DEVICE_CDMA_GET_PRIVATE (device)->modem = g_object_ref (modem); g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + NM_DEVICE_CDMA_GET_PRIVATE (device)->modem = g_object_ref (modem); g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); + g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), device); } return device; diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c index b99243d881..1bb7017533 100644 --- a/src/nm-device-gsm.c +++ b/src/nm-device-gsm.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -300,6 +300,15 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) } } +static void +modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceGsm *self = NM_DEVICE_GSM (user_data); + NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (self); + + real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); +} + /*****************************************************************************/ NMDevice * @@ -319,14 +328,15 @@ nm_device_gsm_new (NMModemGsm *modem, const char *driver) NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, NULL); if (device) { - NM_DEVICE_GSM_GET_PRIVATE (device)->modem = g_object_ref (modem); g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + NM_DEVICE_GSM_GET_PRIVATE (device)->modem = g_object_ref (modem); g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); + g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), device); } return device; From c218be1165958ee41b295d0d6ceeb2b20e0e1243 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 12 Feb 2010 11:11:45 -0800 Subject: [PATCH 065/392] keyfile: add testcase for MAC address case To make sure you can specify the MAC in either upper and lowercase. --- .../keyfile/tests/keyfiles/Makefile.am | 3 +- .../keyfiles/Test_Wired_Connection_MAC_Case | 32 +++++++ .../plugins/keyfile/tests/test-keyfile.c | 87 +++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am index ed2acb96f1..a4ba7bf01d 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -1,7 +1,8 @@ EXTRA_DIST = \ Test_Wired_Connection \ Test_GSM_Connection \ - Test_Wireless_Connection + Test_Wireless_Connection \ + Test_Wired_Connection_MAC_Case check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case new file mode 100644 index 0000000000..29aef49494 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case @@ -0,0 +1,32 @@ + +[connection] +id=Test Wired Connection MAC Case +uuid=4e80a56d-c99f-4aad-a6dd-b449bc398c57 +type=802-3-ethernet +autoconnect=true +timestamp=6654332 + +[802-3-ethernet] +mac-address=00:11:aa:BB:CC:55 +speed=0 +duplex=full +auto-negotiate=true +mtu=1400 + +[ipv4] +method=manual +dns=4.2.2.1;4.2.2.2; +addresses1=192.168.0.5;24;192.168.0.1; +addresses2=1.2.3.4;16;1.2.1.1; +ignore-auto-routes=false +ignore-auto-dns=false + +[ipv6] +method=manual +dns=1111:dddd::aaaa;1::cafe; +dns-search=super-domain.com;redhat.com;gnu.org; +addresses1=abcd:1234:ffff::cdde/64 +addresses2=1:2:3:4:5:6:7:8/96 +routes1=a:b:c:d::/64;f:e:d:c:1:2:3:4;99; +ignore-auto-routes=false +ignore-auto-dns=false diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 58ec940301..29fe19d2fd 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -708,6 +708,91 @@ test_write_wired_connection (void) g_object_unref (connection); } +#define TEST_WIRED_MAC_CASE_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection_MAC_Case" + +static void +test_read_wired_mac_case (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + GError *error = NULL; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0xaa, 0xbb, 0xcc, 0x55 }; + const char *tmp; + const char *expected_id = "Test Wired Connection MAC Case"; + const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; + + connection = connection_from_file (TEST_WIRED_MAC_CASE_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRED_MAC_CASE_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRED_MAC_CASE_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "connection-verify-wired", "failed to verify %s: missing %s setting", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "connection-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + g_object_unref (connection); +} + static void test_read_valid_wireless_connection (void) { @@ -957,6 +1042,8 @@ int main (int argc, char **argv) test_read_valid_wired_connection (); test_write_wired_connection (); + test_read_wired_mac_case (); + test_read_valid_wireless_connection (); test_write_wireless_connection (); From 95da6625b7e13673f4dbc8f1b98f809cf7ef8e16 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 15 Feb 2010 17:26:55 -0800 Subject: [PATCH 066/392] system-settings: register setting errors so D-Bus errors are meaningful The errors weren't registered with dbus-glib yet for some reason, so errors returned when adding invalid connections or updating or whatever weren't meaningful at all. We register them in the system settings service (and not libnm-util) becuase libnm-util doesn't really have anything to do wtih D-Bus, so we put the error registration with the code that exports the connections over the bus. --- src/system-settings/nm-sysconfig-settings.c | 39 ++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 0498fe7160..7c6328b550 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -33,12 +33,25 @@ #include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "../nm-device-ethernet.h" #include "nm-dbus-glib-types.h" #include "nm-sysconfig-settings.h" @@ -1461,6 +1474,24 @@ nm_sysconfig_settings_class_init (NMSysconfigSettingsClass *class) dbus_g_error_domain_register (NM_SYSCONFIG_SETTINGS_ERROR, NM_DBUS_IFACE_SETTINGS_SYSTEM, NM_TYPE_SYSCONFIG_SETTINGS_ERROR); + + /* And register all the settings errors with D-Bus */ + dbus_g_error_domain_register (NM_SETTING_802_1X_ERROR, NULL, NM_TYPE_SETTING_802_1X_ERROR); + dbus_g_error_domain_register (NM_SETTING_BLUETOOTH_ERROR, NULL, NM_TYPE_SETTING_BLUETOOTH_ERROR); + dbus_g_error_domain_register (NM_SETTING_CDMA_ERROR, NULL, NM_TYPE_SETTING_CDMA_ERROR); + dbus_g_error_domain_register (NM_SETTING_CONNECTION_ERROR, NULL, NM_TYPE_SETTING_CONNECTION_ERROR); + dbus_g_error_domain_register (NM_SETTING_GSM_ERROR, NULL, NM_TYPE_SETTING_GSM_ERROR); + dbus_g_error_domain_register (NM_SETTING_IP4_CONFIG_ERROR, NULL, NM_TYPE_SETTING_IP4_CONFIG_ERROR); + dbus_g_error_domain_register (NM_SETTING_IP6_CONFIG_ERROR, NULL, NM_TYPE_SETTING_IP6_CONFIG_ERROR); + dbus_g_error_domain_register (NM_SETTING_OLPC_MESH_ERROR, NULL, NM_TYPE_SETTING_OLPC_MESH_ERROR); + dbus_g_error_domain_register (NM_SETTING_PPP_ERROR, NULL, NM_TYPE_SETTING_PPP_ERROR); + dbus_g_error_domain_register (NM_SETTING_PPPOE_ERROR, NULL, NM_TYPE_SETTING_PPPOE_ERROR); + dbus_g_error_domain_register (NM_SETTING_SERIAL_ERROR, NULL, NM_TYPE_SETTING_SERIAL_ERROR); + dbus_g_error_domain_register (NM_SETTING_VPN_ERROR, NULL, NM_TYPE_SETTING_VPN_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRED_ERROR, NULL, NM_TYPE_SETTING_WIRED_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRELESS_SECURITY_ERROR, NULL, NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRELESS_ERROR, NULL, NM_TYPE_SETTING_WIRELESS_ERROR); + dbus_g_error_domain_register (NM_SETTING_ERROR, NULL, NM_TYPE_SETTING_ERROR); } static void From d0f5c92ed9278ddc7707af3024f275ecd6b18978 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 17 Feb 2010 16:43:03 -0800 Subject: [PATCH 067/392] ifcfg-rh: provide an easy way to get connection UUID/path for tools ifup/ifdown, nmcli, and possibly other tools need a way to get the internally generated connection UUID and possibly it's path given just the ifcfg file path. Not all ifcfg files have the UUID in the file, so ifcfg-rh generates one. But external tools don't know what that UUID is or what the logic that NM uses to generate it is. Help them out a bit so that ifup/ifdown can easily poke NM given just the ifcfg file. --- system-settings/plugins/ifcfg-rh/Makefile.am | 14 ++ .../plugins/ifcfg-rh/nm-ifcfg-rh.conf | 18 +++ .../plugins/ifcfg-rh/nm-ifcfg-rh.xml | 31 +++++ system-settings/plugins/ifcfg-rh/plugin.c | 124 +++++++++++++++++- 4 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml diff --git a/system-settings/plugins/ifcfg-rh/Makefile.am b/system-settings/plugins/ifcfg-rh/Makefile.am index 9998236fb7..3ace4e1989 100644 --- a/system-settings/plugins/ifcfg-rh/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/Makefile.am @@ -1,5 +1,11 @@ SUBDIRS=. tests +nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml + dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< + +BUILT_SOURCES = \ + nm-ifcfg-rh-glue.h + pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-rh.la noinst_LTLIBRARIES = libifcfg-rh-io.la @@ -59,3 +65,11 @@ libnm_settings_plugin_ifcfg_rh_la_LIBADD = \ $(GMODULE_LIBS) \ $(GIO_LIBS) +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = nm-ifcfg-rh.conf + +EXTRA_DIST = \ + $(dbusservice_DATA) + +CLEANFILES = $(BUILT_SOURCES) + diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf new file mode 100644 index 0000000000..cade31dd26 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml new file mode 100644 index 0000000000..5279345297 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml @@ -0,0 +1,31 @@ + + + + + + Utility methods for handling NM integration with standard Red Hat ifcfg files. + + + + + Given an ifcfg file, return various internal information about it. + + + + + The full path to an ifcfg file. + + + + + The UUID of the NM connection backed by this ifcfg file. If the ifcfg file does not contain a UUID tag, this UUID is generated by NM, otherwise the UUID from the ifcfg file is used. + + + + + The object path of the NM connected backed by this ifcfg file. + + + + + diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 309fff63e8..5c78eda840 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -33,7 +33,9 @@ #include #include +#include #include +#include #include @@ -47,6 +49,17 @@ #include "writer.h" #include "utils.h" +#define DBUS_SERVICE_NAME "com.redhat.ifcfgrh1" +#define DBUS_OBJECT_PATH "/com/redhat/ifcfgrh1" + +static gboolean impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, + const char *in_ifcfg, + const char **out_uuid, + const char **out_path, + GError **error); + +#include "nm-ifcfg-rh-glue.h" + static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); static void connection_changed_handler (SCPluginIfcfg *plugin, @@ -77,6 +90,8 @@ typedef struct { GFileMonitor *monitor; guint monitor_id; + + DBusGConnection *bus; } SCPluginIfcfgPrivate; @@ -506,6 +521,54 @@ sc_network_changed_cb (NMInotifyHelper *ih, g_free (new_hostname); } +static gboolean +impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, + const char *in_ifcfg, + const char **out_uuid, + const char **out_path, + GError **error) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + NMIfcfgConnection *connection; + NMSettingConnection *s_con; + const char *uuid; + const char *path; + + if (!g_path_is_absolute (in_ifcfg)) { + g_set_error (error, 0, 0, "ifcfg path '%s' is not absolute", in_ifcfg); + return FALSE; + } + + connection = g_hash_table_lookup (priv->connections, in_ifcfg); + if (!connection) { + g_set_error (error, 0, 0, "ifcfg file '%s' unknown", in_ifcfg); + return FALSE; + } + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); + if (!s_con) { + g_set_error_literal (error, 0, 0, "unable to retrieve the connection setting"); + return FALSE; + } + + uuid = nm_setting_connection_get_uuid (s_con); + if (!uuid) { + g_set_error_literal (error, 0, 0, "unable to get the UUID"); + return FALSE; + } + + path = nm_connection_get_path (NM_CONNECTION (connection)); + if (!path) { + g_set_error_literal (error, 0, 0, "unable to get the connection D-Bus path"); + return FALSE; + } + + *out_uuid = uuid; + *out_path = path; + + return TRUE; +} + static void init (NMSystemConfigInterface *config) { @@ -516,12 +579,52 @@ sc_plugin_ifcfg_init (SCPluginIfcfg *plugin) { SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); NMInotifyHelper *ih; + GError *error = NULL; + gboolean success = FALSE; ih = nm_inotify_helper_get (); priv->ih_event_id = g_signal_connect (ih, "event", G_CALLBACK (sc_network_changed_cb), plugin); priv->sc_network_wd = nm_inotify_helper_add_watch (ih, SC_NETWORK_FILE); priv->hostname = plugin_get_hostname (plugin); + + priv->bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); + if (!priv->bus) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't connect to D-Bus: %s", + error->message); + g_clear_error (&error); + } else { + DBusConnection *tmp; + DBusGProxy *proxy; + int result; + + tmp = dbus_g_connection_get_connection (priv->bus); + dbus_connection_set_exit_on_disconnect (tmp, FALSE); + + proxy = dbus_g_proxy_new_for_name (priv->bus, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + + if (!dbus_g_proxy_call (proxy, "RequestName", &error, + G_TYPE_STRING, DBUS_SERVICE_NAME, + G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, + G_TYPE_INVALID, + G_TYPE_UINT, &result, + G_TYPE_INVALID)) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't acquire D-Bus service: %s", + error->message); + g_clear_error (&error); + } else if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't acquire ifcfgrh1 D-Bus service (already taken)"); + } else + success = TRUE; + } + + if (!success) { + dbus_g_connection_unref (priv->bus); + priv->bus = NULL; + } } static void @@ -531,6 +634,11 @@ dispose (GObject *object) SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); NMInotifyHelper *ih; + if (priv->bus) { + dbus_g_connection_unref (priv->bus); + priv->bus = NULL; + } + ih = nm_inotify_helper_get (); g_signal_handler_disconnect (ih, priv->ih_event_id); @@ -631,6 +739,9 @@ sc_plugin_ifcfg_class_init (SCPluginIfcfgClass *req_class) g_object_class_override_property (object_class, NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (req_class), + &dbus_glib_nm_ifcfg_rh_object_info); } static void @@ -647,10 +758,19 @@ G_MODULE_EXPORT GObject * nm_system_config_factory (void) { static SCPluginIfcfg *singleton = NULL; + SCPluginIfcfgPrivate *priv; - if (!singleton) + if (!singleton) { singleton = SC_PLUGIN_IFCFG (g_object_new (SC_TYPE_PLUGIN_IFCFG, NULL)); - else + if (singleton) { + priv = SC_PLUGIN_IFCFG_GET_PRIVATE (singleton); + if (priv->bus) + dbus_g_connection_register_g_object (priv->bus, + DBUS_OBJECT_PATH, + G_OBJECT (singleton)); + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Acquired D-Bus service %s", DBUS_SERVICE_NAME); + } + } else g_object_ref (singleton); return G_OBJECT (singleton); From 6b7ec3894ad15a4a2e711f1e1845eccfed5355c6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 17 Feb 2010 17:23:18 -0800 Subject: [PATCH 068/392] ifcfg-rh: dbus method return values need to be allocated --- system-settings/plugins/ifcfg-rh/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 5c78eda840..a272728621 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -563,8 +563,8 @@ impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, return FALSE; } - *out_uuid = uuid; - *out_path = path; + *out_uuid = g_strdup (uuid); + *out_path = g_strdup (path); return TRUE; } From 37e8ae824eb27a647d53696d14cc630849536653 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Feb 2010 07:43:11 -0800 Subject: [PATCH 069/392] ifupdown: don't tell NM about connections until we check 'managed' (lp:450458) Otherwise it causes connections that we don't want exported to leak out and be shown in the connection editor even though the device isn't supposed to be managed. --- system-settings/plugins/ifupdown/plugin.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index ae09840eb1..d725bd90e2 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -374,7 +374,6 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) if (exported) { g_hash_table_insert (priv->iface_connections, block->name, exported); g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); - g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, exported); } } else if (!strcmp ("mapping", block->type)) { g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); @@ -442,6 +441,19 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) } g_list_free (keys); + /* Now if we're running in managed mode, let NM know there are new connections */ + if (!priv->unmanage_well_known) { + GList *con_list = g_hash_table_get_values (priv->iface_connections); + GList *cl_iter; + + for (cl_iter = con_list; cl_iter; cl_iter = g_list_next (cl_iter)) { + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + NM_EXPORTED_CONNECTION (cl_iter->data)); + } + g_list_free (con_list); + } + PLUGIN_PRINT("SCPlugin-Ifupdown", "end _init."); } From b5bad00bc392e05e99e5f296ae8a67cf51021697 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Feb 2010 08:02:15 -0800 Subject: [PATCH 070/392] system-settings: remove unneeded include --- src/system-settings/nm-sysconfig-settings.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 7c6328b550..53369067dc 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include From 6136bca71fff3cdbecc4f4ebc35d8a03bc2cce60 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Feb 2010 08:10:18 -0800 Subject: [PATCH 071/392] ifcfg-rh: add missing file to fix distcheck --- system-settings/plugins/ifcfg-rh/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/Makefile.am b/system-settings/plugins/ifcfg-rh/Makefile.am index 3ace4e1989..3f0bf222fd 100644 --- a/system-settings/plugins/ifcfg-rh/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/Makefile.am @@ -69,7 +69,8 @@ dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = nm-ifcfg-rh.conf EXTRA_DIST = \ - $(dbusservice_DATA) + $(dbusservice_DATA) \ + nm-ifcfg-rh.xml CLEANFILES = $(BUILT_SOURCES) From d75aa067e35d5dcc570d781270a553837b613d73 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Feb 2010 08:12:35 -0800 Subject: [PATCH 072/392] release: bump version to 0.8 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 778f18a7b5..124f47c713 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.7.999, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.8, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) AM_MAINTAINER_MODE From fa9e9b4227e12ac55e55f2a874f1d4756d0c7500 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Feb 2010 10:17:08 -0800 Subject: [PATCH 073/392] examples: add some python examples --- Makefile.am | 34 ++++++++-------- configure.ac | 2 + examples/Makefile.am | 1 + examples/python/Makefile.am | 4 ++ examples/python/add-system-connection.py | 31 ++++++++++++++ examples/python/nm-state.py | 52 ++++++++++++++++++++++++ 6 files changed, 107 insertions(+), 17 deletions(-) create mode 100644 examples/Makefile.am create mode 100644 examples/python/Makefile.am create mode 100644 examples/python/add-system-connection.py create mode 100644 examples/python/nm-state.py diff --git a/Makefile.am b/Makefile.am index cda6437ccf..ca819b4634 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,20 +1,20 @@ -SUBDIRS = marshallers - -SUBDIRS += \ - libnm-util \ - libnm-glib \ - src \ - include \ - introspection \ - callouts \ - system-settings \ - tools \ - policy \ - initscript \ - test \ - po \ - man \ - docs +SUBDIRS = \ + marshallers \ + libnm-util \ + libnm-glib \ + src \ + include \ + introspection \ + callouts \ + system-settings \ + tools \ + policy \ + initscript \ + test \ + po \ + man \ + docs \ + examples EXTRA_DIST = \ CONTRIBUTING \ diff --git a/configure.ac b/configure.ac index 124f47c713..6c70b458cf 100644 --- a/configure.ac +++ b/configure.ac @@ -494,6 +494,8 @@ docs/Makefile docs/libnm-glib/Makefile docs/libnm-util/Makefile NetworkManager.pc +examples/Makefile +examples/python/Makefile ]) AC_OUTPUT diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000000..c2ddf781cc --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=python diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am new file mode 100644 index 0000000000..a64727a7fd --- /dev/null +++ b/examples/python/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = \ + nm-state.py \ + add-system-connection.py + diff --git a/examples/python/add-system-connection.py b/examples/python/add-system-connection.py new file mode 100644 index 0000000000..e9fbe4e6f1 --- /dev/null +++ b/examples/python/add-system-connection.py @@ -0,0 +1,31 @@ +#!/bin/env python + +import dbus + +s_wired = dbus.Dictionary({'duplex': 'full'}) +s_con = dbus.Dictionary({ + 'type': '802-3-ethernet', + 'uuid': '7371bb78-c1f7-42a3-a9db-5b9566e8ca07', + 'id': 'MyConnection'}) + +addr1 = dbus.Array([dbus.UInt32(50462986L), dbus.UInt32(0L), dbus.UInt32(16908554L)], signature=dbus.Signature('u')) +s_ip4 = dbus.Dictionary({ + 'addresses': dbus.Array([addr1], signature=dbus.Signature('au')), + 'method': 'manual'}) + +s_ip6 = dbus.Dictionary({'method': 'ignore'}) + +con = dbus.Dictionary({ + '802-3-ethernet': s_wired, + 'connection': s_con, + 'ipv4': s_ip4, + 'ipv6': s_ip6}) + + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManagerSystemSettings", "/org/freedesktop/NetworkManagerSettings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings") + +settings.AddConnection(con) + diff --git a/examples/python/nm-state.py b/examples/python/nm-state.py new file mode 100644 index 0000000000..86aa321906 --- /dev/null +++ b/examples/python/nm-state.py @@ -0,0 +1,52 @@ +#!/bin/env python + +import dbus + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") + +# Get device-specific state +devices = manager.GetDevices() +for d in devices: + dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d) + prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Get the device's current state and interface name + state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") + name = prop_iface.Get("org.freedesktop.NetworkManager.Device", "Interface") + + # and print them out + if state == 8: # activated + print "Device %s is activated" % name + else: + print "Device %s is not activated" % name + + +# Get active connection state +manager_prop_iface = dbus.Interface(proxy, "org.freedesktop.DBus.Properties") +active = manager_prop_iface.Get("org.freedesktop.NetworkManager", "ActiveConnections") +for a in active: + ac_proxy = bus.get_object("org.freedesktop.NetworkManager", a) + prop_iface = dbus.Interface(ac_proxy, "org.freedesktop.DBus.Properties") + state = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "State") + + # Connections in NM are a collection of settings that describe everything + # needed to connect to a specific network. Lets get those details so we + # can find the user-readable name of the connection. + con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection") + con_service = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "ServiceName") + + # ask the provider of the connection for its details + service_proxy = bus.get_object(con_service, con_path) + con_iface = dbus.Interface(service_proxy, "org.freedesktop.NetworkManagerSettings.Connection") + con_details = con_iface.GetSettings() + con_name = con_details['connection']['id'] + + if state == 2: # activated + print "Connection '%s' is activated" % con_name + else: + print "Connection '%s' is activating" % con_name + + From 4b8709629ed37a6ffbde47481854de43ebb69984 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 19 Feb 2010 01:44:17 -0800 Subject: [PATCH 074/392] bluetooth: NEED_AUTH state is valid here Since during the modem preparation we might need secrets for unlocking the device or for GSM/CDMA network password. --- src/nm-device-bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index ab2572536e..7e0f459dd6 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -310,7 +310,7 @@ modem_prepare_result (NMModem *modem, NMDeviceState state; state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); - g_return_if_fail (state == NM_DEVICE_STATE_CONFIG); + g_return_if_fail (state == NM_DEVICE_STATE_CONFIG || state == NM_DEVICE_STATE_NEED_AUTH); if (success) { NMActRequest *req; From 2183af36b6cb06d7d686f8e7913b63983cd3a172 Mon Sep 17 00:00:00 2001 From: Robert Piasek Date: Mon, 22 Feb 2010 10:34:23 +0000 Subject: [PATCH 075/392] gentoo: fix use nscd -i to clear cache (gentoo #301720) --- src/backends/NetworkManagerGentoo.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index 7fa12078a1..aa4b40c373 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -34,6 +34,7 @@ #include "NetworkManagerGeneric.h" #include "NetworkManagerSystem.h" #include "NetworkManagerUtils.h" +#include "nm-utils.h" /* * nm_system_enable_loopback @@ -57,11 +58,9 @@ void nm_system_enable_loopback (void) */ void nm_system_update_dns (void) { - #ifdef NM_NO_NAMED - if (nm_spawn_process ("/etc/init.d/nscd status") == 0) - nm_spawn_process ("/etc/init.d/nscd restart"); - #else - nm_spawn_process("/usr/bin/killall -q nscd"); - #endif + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_info ("Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } } From 754774a4e36543e4a0f901a43887b0e3dc59e401 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Feb 2010 16:55:02 -0800 Subject: [PATCH 076/392] examples: add license headers --- examples/python/add-system-connection.py | 17 +++++++++++++++++ examples/python/nm-state.py | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/examples/python/add-system-connection.py b/examples/python/add-system-connection.py index e9fbe4e6f1..3cf350e799 100644 --- a/examples/python/add-system-connection.py +++ b/examples/python/add-system-connection.py @@ -1,4 +1,21 @@ #!/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 Red Hat, Inc. +# import dbus diff --git a/examples/python/nm-state.py b/examples/python/nm-state.py index 86aa321906..fddd2da629 100644 --- a/examples/python/nm-state.py +++ b/examples/python/nm-state.py @@ -1,4 +1,21 @@ #!/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 Red Hat, Inc. +# import dbus From bace73c5dc3ee758b1d33dcc6c53510d8f5e3182 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Feb 2010 16:55:11 -0800 Subject: [PATCH 077/392] examples: add Tambet's VPN auto-activate example --- examples/python/vpn.py | 152 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 examples/python/vpn.py diff --git a/examples/python/vpn.py b/examples/python/vpn.py new file mode 100644 index 0000000000..4b4057fc2b --- /dev/null +++ b/examples/python/vpn.py @@ -0,0 +1,152 @@ +#!/usr/bin/python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2009 Novell, Inc. +# Copyright (C) 2009 Red Hat, Inc. +# + +# Run this script without any arguments to list the available connection uuids. + +# The uuid of the connection to activate +CONNECTION_UUID="ac6dc9b2-85ef-4311-83d8-add5d7db3f59" + +# UID to use. Note that NM only allows the owner of the connection to activate it. +#UID=1000 +UID=0 + +import sys +import os +import dbus +from dbus.mainloop.glib import DBusGMainLoop +import gobject + +DBusGMainLoop(set_as_default=True) + +def get_connections(): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', '/org/freedesktop/NetworkManagerSettings') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings') + return iface.ListConnections() + + +def get_connection_by_uuid(uuid): + bus = dbus.SystemBus() + for c in get_connections(): + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', c) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + if settings['connection']['uuid'] == uuid: + return c + + return None + + +def list_uuids(): + bus = dbus.SystemBus() + for c in get_connections(): + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', c) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + conn = settings['connection'] + print "%s - %s (%s)" % (conn['uuid'], conn['id'], conn['type']) + + +def get_active_connection_path(uuid): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + active_connections = iface.Get('org.freedesktop.NetworkManager', 'ActiveConnections') + all_connections = get_connections() + + for a in active_connections: + proxy = bus.get_object('org.freedesktop.NetworkManager', a) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + path = iface.Get('org.freedesktop.NetworkManager.Connection.Active', 'Connection') + + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', path) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + + if settings['connection']['uuid'] == uuid: + return a + + return None + + +def get_wifi_device_path(): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager') + devices = iface.GetDevices() + for d in devices: + proxy = bus.get_object('org.freedesktop.NetworkManager', d) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + devtype = iface.Get('org.freedesktop.NetworkManager.Device', 'DeviceType') + if devtype == 2: + return d + return None + +def activate_connection(connection_path, device_path): + + def reply_handler(opath): + print "Success: device activating" + sys.exit(0) + + def error_handler(*args): + print "Error activating device: %s" % args + sys.exit(1) + + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager') + iface.ActivateConnection('org.freedesktop.NetworkManagerUserSettings', + connection_path, + device_path, + "/", + reply_handler=reply_handler, + error_handler=error_handler) + + +# Change the UID first if required +if UID != 0: + os.setuid(UID) + +# Are we configured? +if not len(CONNECTION_UUID): + print "missing connection UUID" + sys.exit(0) + +connection_path = get_connection_by_uuid(CONNECTION_UUID) +if not connection_path: + # Configured VPN connection is not known to NM, check CONNECTION_UUID. + print "couldn't find the connection" + sys.exit(1) + +device_path = get_wifi_device_path() +if not device_path: + print "no wifi device found" + sys.exit(1) + +# Is it already activated? +if get_active_connection_path(CONNECTION_UUID): + print "already connected" + sys.exit(0) + +print "Activating connection..." +activate_connection(connection_path, device_path) +loop = gobject.MainLoop() +loop.run() + From c2ec07f17d69a590b45797de5c8a0f26a4c45eaa Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Thu, 25 Feb 2010 09:52:30 -0800 Subject: [PATCH 078/392] cli: add initial pieces of nmcli --- .gitignore | 1 + Makefile.am | 1 + cli/Makefile.am | 2 + cli/src/Makefile.am | 36 ++ cli/src/connections.c | 1261 +++++++++++++++++++++++++++++++++++++ cli/src/connections.h | 27 + cli/src/devices.c | 950 ++++++++++++++++++++++++++++ cli/src/devices.h | 27 + cli/src/network-manager.c | 186 ++++++ cli/src/network-manager.h | 27 + cli/src/nmcli.c | 283 +++++++++ cli/src/nmcli.h | 77 +++ cli/src/utils.c | 126 ++++ cli/src/utils.h | 28 + configure.ac | 2 + po/POTFILES.in | 5 + 16 files changed, 3039 insertions(+) create mode 100644 cli/Makefile.am create mode 100644 cli/src/Makefile.am create mode 100644 cli/src/connections.c create mode 100644 cli/src/connections.h create mode 100644 cli/src/devices.c create mode 100644 cli/src/devices.h create mode 100644 cli/src/network-manager.c create mode 100644 cli/src/network-manager.h create mode 100644 cli/src/nmcli.c create mode 100644 cli/src/nmcli.h create mode 100644 cli/src/utils.c create mode 100644 cli/src/utils.h diff --git a/.gitignore b/.gitignore index 6a9d0a657f..b4652f62dd 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ m4/lt*.m4 policy/org.freedesktop.network-manager-settings.system.policy +cli/src/nmcli diff --git a/Makefile.am b/Makefile.am index ca819b4634..7e34571218 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ SUBDIRS = \ introspection \ callouts \ system-settings \ + cli \ tools \ policy \ initscript \ diff --git a/cli/Makefile.am b/cli/Makefile.am new file mode 100644 index 0000000000..f268924437 --- /dev/null +++ b/cli/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am new file mode 100644 index 0000000000..2a1bd120f5 --- /dev/null +++ b/cli/src/Makefile.am @@ -0,0 +1,36 @@ +bin_PROGRAMS = \ + nmcli + +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib + +nmcli_SOURCES = \ + connections.c \ + connections.h \ + devices.c \ + devices.h \ + network-manager.c \ + network-manager.h \ + nmcli.c \ + nmcli.h \ + utils.c \ + utils.h + +nmcli_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ + -DG_DISABLE_DEPRECATED + +nmcli_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la + + diff --git a/cli/src/connections.c b/cli/src/connections.c new file mode 100644 index 0000000000..ae09fe0b5f --- /dev/null +++ b/cli/src/connections.c @@ -0,0 +1,1261 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "connections.h" + + +typedef struct { + NmCli *nmc; + int argc; + char **argv; +} ArgsInfo; + +extern GMainLoop *loop; /* glib main loop variable */ + +static ArgsInfo args_info; + +/* static function prototypes */ +static void usage (void); +static void quit (void); +static void show_connection (NMConnection *data, gpointer user_data); +static NMConnection *find_connection (GSList *list, const char *filter_type, const char *filter_val); +static gboolean find_device_for_connection (NmCli *nmc, NMConnection *connection, const char *iface, const char *ap, + NMDevice **device, const char **spec_object, GError **error); +static const char *active_connection_state_to_string (NMActiveConnectionState state); +static void active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpointer user_data); +static void activate_connection_cb (gpointer user_data, const char *path, GError *error); +static void get_connections_cb (NMSettingsInterface *settings, gpointer user_data); +static NMCResultCode do_connections_list (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connections_status (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connection_up (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connection_down (NmCli *nmc, int argc, char **argv); + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli con { COMMAND | help }\n" + " COMMAND := { list | status | up | down }\n\n" + " list [id | uuid | system | user]\n" + " status\n" + " up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" + " down id | uuid \n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static void +show_connection (NMConnection *data, gpointer user_data) +{ + NMConnection *connection = (NMConnection *) data; + NMSettingConnection *s_con; + const char *id; + const char *uuid; + const char *con_type; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + id = nm_setting_connection_get_id (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + print_table_line (0, con_type, 17, uuid, 38, id, 0, NULL); + } +} + +static NMConnection * +find_connection (GSList *list, const char *filter_type, const char *filter_val) +{ + NMSettingConnection *s_con; + NMConnection *connection; + GSList *iterator; + const char *id; + const char *uuid; + + iterator = list; + while (iterator) { + connection = NM_CONNECTION (iterator->data); + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + id = nm_setting_connection_get_id (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + if (filter_type) { + if ((strcmp (filter_type, "id") == 0 && strcmp (filter_val, id) == 0) || + (strcmp (filter_type, "uuid") == 0 && strcmp (filter_val, uuid) == 0)) { + return connection; + } + } + } + iterator = g_slist_next (iterator); + } + + return NULL; +} + +static NMCResultCode +do_connections_list (NmCli *nmc, int argc, char **argv) +{ + gboolean valid_param_specified = FALSE; + + nmc->should_wait = FALSE; + + if (argc == 0) { + valid_param_specified = TRUE; + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("Connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); + + if (nmc->print_output > NMC_PRINT_TERSE) + printf (_("System connections:\n")); + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, NULL); + + if (nmc->print_output > NMC_PRINT_TERSE) + printf (_("User connections:\n")); + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, NULL); + } + else { + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + NMConnection *con1; + NMConnection *con2; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + valid_param_specified = TRUE; + + con1 = find_connection (nmc->system_connections, selector, *argv); + con2 = find_connection (nmc->user_connections, selector, *argv); + if (con1) nm_connection_dump (con1); + if (con2) nm_connection_dump (con2); + if (!con1 && !con2) { + g_string_printf (nmc->return_text, _("Error: %s - no such connection."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + else if (strcmp (*argv, "system") == 0) { + valid_param_specified = TRUE; + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("System-wide connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); + + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, NULL); + } + else if (strcmp (*argv, "user") == 0) { + valid_param_specified = TRUE; + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("User connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); + + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, NULL); + } + else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + } + + if (!valid_param_specified) { + g_string_printf (nmc->return_text, _("Error: no valid parameter specified.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + +error: + return nmc->return_value; +} + +static void +show_active_connection (gpointer data, gpointer user_data) +{ + NMActiveConnection *active = NM_ACTIVE_CONNECTION (data); + GSList *con_list = (GSList *) user_data; + GSList *iter; + const char *active_path; + NMConnectionScope active_service_scope; + NMSettingConnection *s_con; + const GPtrArray *devices; + GString *dev_str; + int i; + + dev_str = g_string_new (NULL); + + active_path = nm_active_connection_get_connection (active); + active_service_scope = nm_active_connection_get_scope (active); + + /* Get devices of the active connection */ + devices = nm_active_connection_get_devices (active); + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + + g_string_append (dev_str, nm_device_get_iface (device)); + g_string_append_c (dev_str, ','); + } + if (dev_str->len > 0) + g_string_truncate (dev_str, dev_str->len - 1); /* Cut off last ',' */ + + for (iter = con_list; iter; iter = g_slist_next (iter)) { + NMConnection *connection = (NMConnection *) iter->data; + const char *con_path = nm_connection_get_path (connection); + NMConnectionScope con_scope = nm_connection_get_scope (connection); + + if (!strcmp (active_path, con_path) && active_service_scope == con_scope) { + /* this connection is active */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con != NULL); + // FIXME: Fix the output + print_table_line (0, nm_active_connection_get_default (active) ? _("yes") : _("no"), 8, + nm_active_connection_get_service_name (active), 45, +// nm_active_connection_get_specific_object (active), 0, +// nm_active_connection_get_connection (active), 0, + dev_str->str, 10, + nm_setting_connection_get_uuid (s_con), 38, + nm_setting_connection_get_id (s_con), 0, NULL); + + } + } + + g_string_free (dev_str, TRUE); +} + +static NMCResultCode +do_connections_status (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *active_cons; + + nmc->should_wait = FALSE; + + /* create NMClient */ + if (!nmc->get_client (nmc)) + return nmc->return_value; + + active_cons = nm_client_get_active_connections (nmc->client); + + // FIXME: Fix the output + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("Active connections"), _("Default"), 8, _("Service"), 45, _("Devices"), 10, _("UUID"), 38, _("Name"), 20, NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("Default"), 8, _("Service"), 45, _("Devices"), 10, _("UUID"), 38, _("Name"), 0, NULL); + + if (active_cons && active_cons->len) { + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc->system_connections); + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc->user_connections); + } + + return NMC_RESULT_SUCCESS; +} + +/* -------------------- + * These function should be moved to libnm-glib in the end. + */ +static gboolean +check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingWired *s_wired; + const char *connection_type; + gboolean is_pppoe = FALSE; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + if ( strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME) + && strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a wired or PPPoE connection."); + return FALSE; + } + + if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + is_pppoe = TRUE; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + /* Wired setting is optional for PPPoE */ + if (!is_pppoe && !s_wired) { + g_set_error (error, 0, 0, + "The connection was not a valid wired connection."); + return FALSE; + } + + if (s_wired) { + const GByteArray *mac; + const char *device_mac_str; + struct ether_addr *device_mac; + + device_mac_str = nm_device_ethernet_get_hw_address (device); + device_mac = ether_aton (device_mac_str); + if (!device_mac) { + g_set_error (error, 0, 0, "Invalid device MAC address."); + return FALSE; + } + + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection's MAC address did not match this device."); + return FALSE; + } + } + + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a WiFi connection."); + return FALSE; + } + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + if (!s_wireless) { + g_set_error (error, 0, 0, + "The connection was not a valid WiFi connection."); + return FALSE; + } + + if (s_wireless) { + const GByteArray *mac; + const char *device_mac_str; + struct ether_addr *device_mac; + + device_mac_str = nm_device_wifi_get_hw_address (device); + device_mac = ether_aton (device_mac_str); + if (!device_mac) { + g_set_error (error, 0, 0, "Invalid device MAC address."); + return FALSE; + } + + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection's MAC address did not match this device."); + return FALSE; + } + } + + // FIXME: check channel/freq/band against bands the hardware supports + // FIXME: check encryption against device capabilities + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +check_bt_compatible (NMDeviceBt *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + const GByteArray *array; + char *str; + const char *device_hw_str; + int addr_match = FALSE; + const char *bt_type_str; + guint32 bt_type, bt_capab; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a Bluetooth connection."); + return FALSE; + } + + s_bt = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH)); + if (!s_bt) { + g_set_error (error, 0, 0, + "The connection was not a valid Bluetooth connection."); + return FALSE; + } + + array = nm_setting_bluetooth_get_bdaddr (s_bt); + if (!array || (array->len != ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection did not contain a valid Bluetooth address."); + return FALSE; + } + + bt_type_str = nm_setting_bluetooth_get_connection_type (s_bt); + g_assert (bt_type_str); + + bt_type = NM_BT_CAPABILITY_NONE; + if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_DUN)) + bt_type = NM_BT_CAPABILITY_DUN; + else if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_PANU)) + bt_type = NM_BT_CAPABILITY_NAP; + + bt_capab = nm_device_bt_get_capabilities (device); + if (!(bt_type & bt_capab)) { + g_set_error (error, 0, 0, + "The connection was not compatible with the device's capabilities."); + return FALSE; + } + + device_hw_str = nm_device_bt_get_hw_address (device); + + str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + array->data[0], array->data[1], array->data[2], + array->data[3], array->data[4], array->data[5]); + addr_match = !strcmp (device_hw_str, str); + g_free (str); + + return addr_match; +} + +#if 0 +static gboolean +check_olpc_mesh_compatible (NMDeviceOlpcMesh *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingOlpcMesh *s_mesh; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_OLPC_MESH_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a Mesh connection."); + return FALSE; + } + + s_mesh = NM_SETTING_OLPC_MESH (nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH)); + if (!s_mesh) { + g_set_error (error, 0, 0, + "The connection was not a valid Mesh connection."); + return FALSE; + } + + return TRUE; +} +#endif + +static gboolean +nm_device_is_connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + if (NM_IS_DEVICE_ETHERNET (device)) + return check_ethernet_compatible (NM_DEVICE_ETHERNET (device), connection, error); + else if (NM_IS_DEVICE_WIFI (device)) + return check_wifi_compatible (NM_DEVICE_WIFI (device), connection, error); + else if (NM_IS_DEVICE_BT (device)) + return check_bt_compatible (NM_DEVICE_BT (device), connection, error); +// else if (NM_IS_DEVICE_OLPC_MESH (device)) +// return check_olpc_mesh_compatible (NM_DEVICE_OLPC_MESH (device), connection, error); + + g_set_error (error, 0, 0, "unhandled device type '%s'", G_OBJECT_TYPE_NAME (device)); + return FALSE; +} + + +/** + * nm_client_get_active_connection_by_path: + * @client: a #NMClient + * @object_path: the object path to search for + * + * Gets a #NMActiveConnection from a #NMClient. + * + * Returns: the #NMActiveConnection for the given @object_path or %NULL if none is found. + **/ +static NMActiveConnection * +nm_client_get_active_connection_by_path (NMClient *client, const char *object_path) +{ + const GPtrArray *actives; + int i; + NMActiveConnection *active = NULL; + + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + g_return_val_if_fail (object_path, NULL); + + actives = nm_client_get_active_connections (client); + if (!actives) + return NULL; + + for (i = 0; i < actives->len; i++) { + NMActiveConnection *candidate = g_ptr_array_index (actives, i); + if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), object_path)) { + active = candidate; + break; + } + } + + return active; +} +/* -------------------- */ + +static NMActiveConnection * +get_default_active_connection (NmCli *nmc, NMDevice **device) +{ + NMActiveConnection *default_ac = NULL; + NMDevice *non_default_device = NULL; + NMActiveConnection *non_default_ac = NULL; + const GPtrArray *connections; + int i; + + g_return_val_if_fail (nmc != NULL, NULL); + g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (*device == NULL, NULL); + + connections = nm_client_get_active_connections (nmc->client); + for (i = 0; connections && (i < connections->len); i++) { + NMActiveConnection *candidate = g_ptr_array_index (connections, i); + const GPtrArray *devices; + + devices = nm_active_connection_get_devices (candidate); + if (!devices || !devices->len) + continue; + + if (nm_active_connection_get_default (candidate)) { + if (!default_ac) { + *device = g_ptr_array_index (devices, 0); + default_ac = candidate; + } + } else { + if (!non_default_ac) { + non_default_device = g_ptr_array_index (devices, 0); + non_default_ac = candidate; + } + } + } + + /* Prefer the default connection if one exists, otherwise return the first + * non-default connection. + */ + if (!default_ac && non_default_ac) { + default_ac = non_default_ac; + *device = non_default_device; + } + return default_ac; +} + +/* Find a device to activate the connection on. + * IN: connection: connection to activate + * iface: device interface name to use (optional) + * ap: access point to use (optional; valid just for 802-11-wireless) + * OUT: device: found device + * spec_object: specific_object path of NMAccessPoint + * RETURNS: TRUE when a device is found, FALSE otherwise. + */ +static gboolean +find_device_for_connection (NmCli *nmc, NMConnection *connection, const char *iface, const char *ap, + NMDevice **device, const char **spec_object, GError **error) +{ + NMSettingConnection *s_con; + const char *con_type; + int i, j; + + g_return_val_if_fail (nmc != NULL, FALSE); + g_return_val_if_fail (device != NULL && *device == NULL, FALSE); + g_return_val_if_fail (spec_object != NULL && *spec_object == NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + + if (strcmp (con_type, "vpn") == 0) { + /* VPN connections */ + NMActiveConnection *active = NULL; + if (iface) { + const GPtrArray *connections = nm_client_get_active_connections (nmc->client); + for (i = 0; connections && (i < connections->len) && !active; i++) { + NMActiveConnection *candidate = g_ptr_array_index (connections, i); + const GPtrArray *devices = nm_active_connection_get_devices (candidate); + if (!devices || !devices->len) + continue; + + for (j = 0; devices && (j < devices->len); j++) { + NMDevice *dev = g_ptr_array_index (devices, j); + if (!strcmp (iface, nm_device_get_iface (dev))) { + active = candidate; + *device = dev; + break; + } + } + } + if (!active) { + g_set_error (error, 0, 0, _("no active connection on device '%s'"), iface); + return FALSE; + } + *spec_object = nm_object_get_path (NM_OBJECT (active)); + return TRUE; + } else { + active = get_default_active_connection (nmc, device); + if (!active) { + g_set_error (error, 0, 0, _("no active connection or device")); + return FALSE; + } + *spec_object = nm_object_get_path (NM_OBJECT (active)); + return TRUE; + } + } else { + /* Other connections */ + NMDevice *found_device = NULL; + const GPtrArray *devices = nm_client_get_devices (nmc->client); + + for (i = 0; devices && (i < devices->len) && !found_device; i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + + if (iface) { + const char *dev_iface = nm_device_get_iface (dev); + if ( !strcmp (dev_iface, iface) + && nm_device_is_connection_compatible (dev, connection, NULL)) { + found_device = dev; + } + } else { + if (nm_device_is_connection_compatible (dev, connection, NULL)) { + found_device = dev; + } + } + + if (found_device && ap && !strcmp (con_type, "802-11-wireless") && NM_IS_DEVICE_WIFI (dev)) { + char *hwaddr_up = g_ascii_strup (ap, -1); + const GPtrArray *aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (dev)); + found_device = NULL; /* Mark as not found; set to the device again later, only if AP matches */ + + for (j = 0; aps && (j < aps->len); j++) { + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + if (!strcmp (hwaddr_up, candidate_hwaddr)) { + found_device = dev; + *spec_object = nm_object_get_path (NM_OBJECT (candidate_ap)); + break; + } + } + g_free (hwaddr_up); + } + } + + if (found_device) { + *device = found_device; + return TRUE; + } else { + if (iface) + g_set_error (error, 0, 0, "device '%s' not compatible with connection '%s'", iface, nm_setting_connection_get_id (s_con)); + else + g_set_error (error, 0, 0, "no device found for connection '%s'", nm_setting_connection_get_id (s_con)); + return FALSE; + } + } +} + +static const char * +active_connection_state_to_string (NMActiveConnectionState state) +{ + switch (state) { + case NM_ACTIVE_CONNECTION_STATE_ACTIVATING: + return _("activating"); + case NM_ACTIVE_CONNECTION_STATE_ACTIVATED: + return _("activated"); + case NM_ACTIVE_CONNECTION_STATE_UNKNOWN: + default: + return _("unknown"); + } +} + +static const char * +vpn_connection_state_to_string (NMVPNConnectionState state) +{ + switch (state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + return _("VPN connecting (prepare)"); + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + return _("VPN connecting (need authentication)"); + case NM_VPN_CONNECTION_STATE_CONNECT: + return _("VPN connecting"); + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + return _("VPN connecting (getting IP configuration)"); + case NM_VPN_CONNECTION_STATE_ACTIVATED: + return _("VPN connected"); + case NM_VPN_CONNECTION_STATE_FAILED: + return _("VPN connection failed"); + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + return _("VPN disconnected"); + default: + return _("unknown"); + } +} + +static const char * +vpn_connection_state_reason_to_string (NMVPNConnectionStateReason reason) +{ + switch (reason) { + case NM_VPN_CONNECTION_STATE_REASON_UNKNOWN: + return _("unknown reason"); + case NM_VPN_CONNECTION_STATE_REASON_NONE: + return _("none"); + case NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED: + return _("the user was disconnected"); + case NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED: + return _("the base network connection was interrupted"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED: + return _("the VPN service stopped unexpectedly"); + case NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID: + return _("the VPN service returned invalid configuration"); + case NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT: + return _("the connection attempt timed out"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT: + return _("the VPN service did not start in time"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED: + return _("the VPN service failed to start"); + case NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS: + return _("no valid VPN secrets"); + case NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED: + return _("invalid VPN secrets"); + case NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED: + return _("the connection was removed"); + default: + return _("unknown"); + } +} + +static void +active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMActiveConnectionState state; + + state = nm_active_connection_get_state (active); + + printf (_("state: %s\n"), active_connection_state_to_string (state)); + + if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + printf (_("Connection activated\n")); + quit (); + } else if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) { + g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + } +} + +static void +vpn_connection_state_cb (NMVPNConnection *vpn, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + + switch (state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + case NM_VPN_CONNECTION_STATE_CONNECT: + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + printf (_("state: %s (%d)\n"), vpn_connection_state_to_string (state), state); + break; + + case NM_VPN_CONNECTION_STATE_ACTIVATED: + printf (_("Connection activated\n")); + quit (); + break; + + case NM_VPN_CONNECTION_STATE_FAILED: + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + g_string_printf (nmc->return_text, _("Error: Connection activation failed: %s."), vpn_connection_state_reason_to_string (reason)); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + break; + + default: + break; + } +} + +static gboolean +timeout_cb (gpointer user_data) +{ + /* Time expired -> exit nmcli */ + + NmCli *nmc = (NmCli *) user_data; + + g_string_printf (nmc->return_text, _("Error: Timeout %d sec expired."), nmc->timeout); + nmc->return_value = NMC_RESULT_ERROR_TIMEOUT_EXPIRED; + quit (); + return FALSE; +} + +static void +foo_active_connections_changed_cb (NMClient *client, + GParamSpec *pspec, + gpointer user_data) +{ + /* Call again activate_connection_cb with dummy arguments; + * the correct ones are taken from its first call. + */ + activate_connection_cb (NULL, NULL, NULL); +} + +static void +activate_connection_cb (gpointer user_data, const char *path, GError *error) +{ + NmCli *nmc = (NmCli *) user_data; + NMActiveConnection *active; + NMActiveConnectionState state; + static gulong handler_id = 0; + static NmCli *orig_nmc; + static const char *orig_path; + static GError *orig_error; + + if (nmc) + { + /* Called first time; store actual arguments */ + orig_nmc = nmc; + orig_path = path; + orig_error = error; + } + + /* Disconnect the handler not to be run any more */ + if (handler_id != 0) { + g_signal_handler_disconnect (orig_nmc->client, handler_id); + handler_id = 0; + } + + if (orig_error) { + g_string_printf (orig_nmc->return_text, _("Error: Connection activation failed: %s"), orig_error->message); + orig_nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + } else { + active = nm_client_get_active_connection_by_path (orig_nmc->client, orig_path); + if (!active) { + /* The active connection path is not in active connections list yet; wait for active-connections signal. */ + /* This is basically the case for VPN connections. */ + if (nmc) { + /* Called first time, i.e. by nm_client_activate_connection() */ + handler_id = g_signal_connect (orig_nmc->client, "notify::active-connections", + G_CALLBACK (foo_active_connections_changed_cb), NULL); + return; + } else { + g_string_printf (orig_nmc->return_text, _("Error: Obtaining active connection for '%s' failed."), orig_path); + orig_nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + return; + } + } + + state = nm_active_connection_get_state (active); + + printf (_("Active connection state: %s\n"), active_connection_state_to_string (state)); + printf (_("Active connection path: %s\n"), orig_path); + + if (!orig_nmc->should_wait || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + /* don't want to wait or already activated */ + quit (); + } else { + if (NM_IS_VPN_CONNECTION (active)) + g_signal_connect (NM_VPN_CONNECTION (active), "vpn-state-changed", G_CALLBACK (vpn_connection_state_cb), orig_nmc); + else + g_signal_connect (active, "notify::state", G_CALLBACK (active_connection_state_cb), orig_nmc); + + /* Start timer not to loop forever when signals are not emitted */ + g_timeout_add_seconds (orig_nmc->timeout, timeout_cb, orig_nmc); + } + } +} + +static NMCResultCode +do_connection_up (NmCli *nmc, int argc, char **argv) +{ + NMDevice *device = NULL; + const char *spec_object = NULL; + gboolean device_found; + NMConnection *connection = NULL; + NMSettingConnection *s_con; + gboolean is_system; + const char *con_path; + const char *con_type; + const char *iface = NULL; + const char *ap = NULL; + gboolean id_specified = FALSE; + gboolean wait = TRUE; + GError *error = NULL; + + /* Set default timeout for connection activation. It can take quite a long time. + * Using 90 seconds. + */ + nmc->timeout = 90; + + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + id_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + if ((connection = find_connection (nmc->system_connections, selector, *argv)) == NULL) + connection = find_connection (nmc->user_connections, selector, *argv); + + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection: %s."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } + else if (strcmp (*argv, "iface") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + iface = *argv; + } + else if (strcmp (*argv, "ap") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + ap = *argv; + } + else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } else if (strcmp (*argv, "--timeout") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + errno = 0; + nmc->timeout = strtol (*argv, NULL, 10); + if (errno || nmc->timeout < 0) { + g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!id_specified) { + g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + is_system = (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) ? TRUE : FALSE; + con_path = nm_connection_get_path (connection); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + + device_found = find_device_for_connection (nmc, connection, iface, ap, &device, &spec_object, &error); + + if (!device_found) { + if (error) + g_string_printf (nmc->return_text, _("Error: No suitable device found: %s."), error->message); + else + g_string_printf (nmc->return_text, _("Error: No suitable device found.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + goto error; + } + + nmc->should_wait = wait; + nm_client_activate_connection (nmc->client, + is_system ? NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS, + con_path, + device, + spec_object, + activate_connection_cb, + nmc); + + return nmc->return_value; +error: + nmc->should_wait = FALSE; + return nmc->return_value; +} + +static NMCResultCode +do_connection_down (NmCli *nmc, int argc, char **argv) +{ + NMConnection *connection = NULL; + NMActiveConnection *active = NULL; + const GPtrArray *active_cons; + const char *con_path; + const char *active_path; + NMConnectionScope active_service_scope, con_scope; + gboolean id_specified = FALSE; + gboolean wait = TRUE; + int i; + + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + id_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + if ((connection = find_connection (nmc->system_connections, selector, *argv)) == NULL) + connection = find_connection (nmc->user_connections, selector, *argv); + + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection: %s."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } + else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } + else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!id_specified) { + g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + con_path = nm_connection_get_path (connection); + con_scope = nm_connection_get_scope (connection); + + active_cons = nm_client_get_active_connections (nmc->client); + for (i = 0; active_cons && (i < active_cons->len); i++) { + NMActiveConnection *candidate = g_ptr_array_index (active_cons, i); + + active_path = nm_active_connection_get_connection (candidate); + active_service_scope = nm_active_connection_get_scope (candidate); + if (!strcmp (active_path, con_path) && active_service_scope == con_scope) { + active = candidate; + break; + } + } + + if (active) + nm_client_deactivate_connection (nmc->client, active); + else { + fprintf (stderr, _("Warning: Connection not active\n")); + } + +error: + nmc->should_wait = FALSE; + return nmc->return_value; +} + +/* callback called when connections are obtained from the settings service */ +static void +get_connections_cb (NMSettingsInterface *settings, gpointer user_data) +{ + ArgsInfo *args = (ArgsInfo *) user_data; + static gboolean system_cb_called = FALSE; + static gboolean user_cb_called = FALSE; + + if (NM_IS_REMOTE_SETTINGS_SYSTEM (settings)) { + system_cb_called = TRUE; + args->nmc->system_connections = nm_settings_interface_list_connections (settings); + } + else { + user_cb_called = TRUE; + args->nmc->user_connections = nm_settings_interface_list_connections (settings); + } + + /* return and wait for the callback of the second settings is called */ + if ((args->nmc->system_settings_running && !system_cb_called) || + (args->nmc->user_settings_running && !user_cb_called)) + return; + + if (args->argc == 0) { + args->nmc->return_value = do_connections_list (args->nmc, args->argc, args->argv); + } else { + + if (matches (*args->argv, "list") == 0) { + args->nmc->return_value = do_connections_list (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "status") == 0) { + args->nmc->return_value = do_connections_status (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "up") == 0) { + args->nmc->return_value = do_connection_up (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "down") == 0) { + args->nmc->return_value = do_connection_down (args->nmc, args->argc-1, args->argv+1); + } + else if (matches (*args->argv, "help") == 0) { + usage (); + args->nmc->should_wait = FALSE; + } else { + usage (); + g_string_printf (args->nmc->return_text, _("Error: 'con' command '%s' is not valid."), *args->argv); + args->nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + args->nmc->should_wait = FALSE; + } + } + + if (!args->nmc->should_wait) + quit (); +} + + +/* Entry point function for connections-related commands: 'nmcli con' */ +NMCResultCode +do_connections (NmCli *nmc, int argc, char **argv) +{ + DBusGConnection *bus; + GError *error = NULL; + + nmc->should_wait = TRUE; + + args_info.nmc = nmc; + args_info.argc = argc; + args_info.argv = argv; + + /* connect to DBus' system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); + if (error || !bus) { + g_string_printf (nmc->return_text, _("Error: could not connect to D-Bus.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* get system settings */ + if (!(nmc->system_settings = nm_remote_settings_system_new (bus))) { + g_string_printf (nmc->return_text, _("Error: Could not get system settings.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + + } + + /* get user settings */ + if (!(nmc->user_settings = nm_remote_settings_new (bus, NM_CONNECTION_SCOPE_USER))) { + g_string_printf (nmc->return_text, _("Error: Could not get user settings.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* find out whether setting services are running */ + g_object_get (nmc->system_settings, NM_REMOTE_SETTINGS_SERVICE_RUNNING, &nmc->system_settings_running, NULL); + g_object_get (nmc->user_settings, NM_REMOTE_SETTINGS_SERVICE_RUNNING, &nmc->user_settings_running, NULL); + + if (!nmc->system_settings_running && !nmc->user_settings_running) { + g_string_printf (nmc->return_text, _("Error: Can't obtain connections: settings services are not running.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* connect to signal "connections-read" - emitted when connections are fetched and ready */ + if (nmc->system_settings_running) + g_signal_connect (nmc->system_settings, NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + G_CALLBACK (get_connections_cb), &args_info); + + if (nmc->user_settings_running) + g_signal_connect (nmc->user_settings, NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + G_CALLBACK (get_connections_cb), &args_info); + + dbus_g_connection_unref (bus); + + /* The rest will be done in get_connection_cb() callback. + * We need to wait for signals that connections are read. + */ + return NMC_RESULT_SUCCESS; +} diff --git a/cli/src/connections.h b/cli/src/connections.h new file mode 100644 index 0000000000..a1ed1c1cf3 --- /dev/null +++ b/cli/src/connections.h @@ -0,0 +1,27 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_CONNECTIONS_H +#define NMC_CONNECTIONS_H + +#include "nmcli.h" + +NMCResultCode do_connections (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_CONNECTIONS_H */ diff --git a/cli/src/devices.c b/cli/src/devices.c new file mode 100644 index 0000000000..d6c0b43dc5 --- /dev/null +++ b/cli/src/devices.c @@ -0,0 +1,950 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "devices.h" + + +/* static function prototypes */ +static void usage (void); +static const char *device_state_to_string (NMDeviceState state); +static NMCResultCode do_devices_status (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_devices_list (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_device_disconnect (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_device_wifi (NmCli *nmc, int argc, char **argv); + + +extern GMainLoop *loop; /* glib main loop variable */ + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli dev { COMMAND | help }\n\n" + " COMMAND := { status | list | disconnect | wifi }\n\n" + " status\n" + " list [iface ]\n" + " disconnect iface [--nowait] [--timeout ]\n" + " wifi [list [iface ] | apinfo iface hwaddr ]\n\n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static const char * +device_state_to_string (NMDeviceState state) +{ + switch (state) { + case NM_DEVICE_STATE_UNMANAGED: + return _("unmanaged"); + case NM_DEVICE_STATE_UNAVAILABLE: + return _("unavailable"); + case NM_DEVICE_STATE_DISCONNECTED: + return _("disconnected"); + case NM_DEVICE_STATE_PREPARE: + return _("connecting (prepare)"); + case NM_DEVICE_STATE_CONFIG: + return _("connecting (configuring)"); + case NM_DEVICE_STATE_NEED_AUTH: + return _("connecting (need authentication)"); + case NM_DEVICE_STATE_IP_CONFIG: + return _("connecting (getting IP configuration)"); + case NM_DEVICE_STATE_ACTIVATED: + return _("connected"); + case NM_DEVICE_STATE_FAILED: + return _("connection failed"); + default: + return _("unknown"); + } +} + +/* Return device type - use setting names to match with connection types */ +static const char * +get_device_type (NMDevice * device) +{ + if (NM_IS_DEVICE_ETHERNET (device)) + return NM_SETTING_WIRED_SETTING_NAME; + else if (NM_IS_DEVICE_WIFI (device)) + return NM_SETTING_WIRELESS_SETTING_NAME; + else if (NM_IS_GSM_DEVICE (device)) + return NM_SETTING_GSM_SETTING_NAME; + else if (NM_IS_CDMA_DEVICE (device)) + return NM_SETTING_CDMA_SETTING_NAME; + else if (NM_IS_DEVICE_BT (device)) + return NM_SETTING_BLUETOOTH_SETTING_NAME; +// else if (NM_IS_DEVICE_OLPC_MESH (device)) +// return NM_SETTING_OLPC_MESH_SETTING_NAME; + else + return _("Unknown"); +} + +static char * +ap_wpa_rsn_flags_to_string (guint32 flags) +{ + char *flags_str[16]; /* Enough space for flags and terminating NULL */ + char *ret_str; + int i = 0; + + if (flags & NM_802_11_AP_SEC_PAIR_WEP40) + flags_str[i++] = g_strdup ("pair_wpe40"); + if (flags & NM_802_11_AP_SEC_PAIR_WEP104) + flags_str[i++] = g_strdup ("pair_wpe104"); + if (flags & NM_802_11_AP_SEC_PAIR_TKIP) + flags_str[i++] = g_strdup ("pair_tkip"); + if (flags & NM_802_11_AP_SEC_PAIR_CCMP) + flags_str[i++] = g_strdup ("pair_ccmp"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP40) + flags_str[i++] = g_strdup ("group_wpe40"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP104) + flags_str[i++] = g_strdup ("group_wpe104"); + if (flags & NM_802_11_AP_SEC_GROUP_TKIP) + flags_str[i++] = g_strdup ("group_tkip"); + if (flags & NM_802_11_AP_SEC_GROUP_CCMP) + flags_str[i++] = g_strdup ("group_ccmp"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_PSK) + flags_str[i++] = g_strdup ("psk"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + flags_str[i++] = g_strdup ("802.1X"); + + if (i == 0) + flags_str[i++] = g_strdup (_("(none)")); + + flags_str[i] = NULL; + + ret_str = g_strjoinv (" ", flags_str); + + i = 0; + while (flags_str[i]) + g_free (flags_str[i++]); + + return ret_str; +} + +static void +print_header (const char *label, const char *iface, const char *connection) +{ + GString *string; + + string = g_string_sized_new (79); + g_string_append_printf (string, "- %s: ", label); + if (iface) + g_string_append_printf (string, "%s ", iface); + if (connection) + g_string_append_printf (string, " [%s] ", connection); + + while (string->len < 80) + g_string_append_c (string, '-'); + + printf ("%s\n", string->str); + + g_string_free (string, TRUE); +} + +static gchar * +ip4_address_as_string (guint32 ip) +{ + struct in_addr tmp_addr; + char buf[INET_ADDRSTRLEN+1]; + + memset (&buf, '\0', sizeof (buf)); + tmp_addr.s_addr = ip; + + if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + g_warning (_("%s: error converting IP4 address 0x%X"), + __func__, ntohl (tmp_addr.s_addr)); + return NULL; + } +} + +static void +detail_access_point (gpointer data, gpointer user_data) +{ + NMAccessPoint *ap = NM_ACCESS_POINT (data); + const char *active_bssid = (const char *) user_data; + GString *str; + gboolean active = FALSE; + guint32 flags, wpa_flags, rsn_flags; + const GByteArray * ssid; + char *tmp; + + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + + if (active_bssid) { + const char *current_bssid = nm_access_point_get_hw_address (ap); + if (current_bssid && !strcmp (current_bssid, active_bssid)) + active = TRUE; + } + + str = g_string_new (NULL); + g_string_append_printf (str, + _("%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d"), + (nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA) ? ("Infra") : _("Ad-Hoc"), + nm_access_point_get_hw_address (ap), + nm_access_point_get_frequency (ap), + nm_access_point_get_max_bitrate (ap) / 1000, + nm_access_point_get_strength (ap)); + + if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags != NM_802_11_AP_SEC_NONE) + && (rsn_flags != NM_802_11_AP_SEC_NONE)) + g_string_append (str, _(", Encrypted: ")); + + if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags == NM_802_11_AP_SEC_NONE) + && (rsn_flags == NM_802_11_AP_SEC_NONE)) + g_string_append (str, _(" WEP")); + if (wpa_flags != NM_802_11_AP_SEC_NONE) + g_string_append (str, _(" WPA")); + if (rsn_flags != NM_802_11_AP_SEC_NONE) + g_string_append (str, _(" WPA2")); + if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + g_string_append (str, _(" Enterprise")); + + /* FIXME: broadcast/hidden */ + + ssid = nm_access_point_get_ssid (ap); + tmp = g_strdup_printf (" %s%s", active ? "*" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); + + print_table_line (0, tmp, 25, str->str, 0, NULL); + + g_string_free (str, TRUE); + g_free (tmp); +} + +struct cb_info { + NMClient *client; + const GPtrArray *active; +}; + +static void +show_device_info (gpointer data, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (data); +// struct cb_info *info = user_data; + char *tmp; + NMDeviceState state; + const char *dev_type; + guint32 caps; + guint32 speed; + const GArray *array; + gboolean is_default = FALSE; + const char *id = NULL; + + state = nm_device_get_state (device); + print_header (_("Device"), nm_device_get_iface (device), id); + + /* General information */ + dev_type = get_device_type (device); + print_table_line (0, _("Type"), 25, dev_type, 0, NULL); + print_table_line (0, _("Driver"), 25, nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"), 0, NULL); + print_table_line (0, _("State"), 25, device_state_to_string (state), 0, NULL); + if (is_default) + print_table_line (0, _("Default"), 25, _("yes"), 0, NULL); + else + print_table_line (0, _("Default"), 25, _("no"), 0, NULL); + + tmp = NULL; + if (NM_IS_DEVICE_ETHERNET (device)) + tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device))); + else if (NM_IS_DEVICE_WIFI (device)) + tmp = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device))); + + if (tmp) { + print_table_line (0, _("HW Address"), 25, tmp, 0, NULL); + g_free (tmp); + } + + /* Capabilities */ + caps = nm_device_get_capabilities (device); + printf (_("\n Capabilities:\n")); + if (caps & NM_DEVICE_CAP_CARRIER_DETECT) + print_table_line (2, _("Carrier Detect"), 23, _("yes"), 0, NULL); + + speed = 0; + if (NM_IS_DEVICE_ETHERNET (device)) { + /* Speed in Mb/s */ + speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device)); + } else if (NM_IS_DEVICE_WIFI (device)) { + /* Speed in b/s */ + speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); + speed /= 1000; + } + + if (speed) { + char *speed_string; + + speed_string = g_strdup_printf (_("%u Mb/s"), speed); + print_table_line (2, _("Speed"), 23, speed_string, 0, NULL); + g_free (speed_string); + } + + /* Wireless specific information */ + if ((NM_IS_DEVICE_WIFI (device))) { + guint32 wcaps; + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + + printf (_("\n Wireless Properties\n")); + + wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); + + if (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) + print_table_line (2, _("WEP Encryption"), 23, _("yes"), 0, NULL); + if (wcaps & NM_WIFI_DEVICE_CAP_WPA) + print_table_line (2, _("WPA Encryption"), 23, _("yes"), 0, NULL); + if (wcaps & NM_WIFI_DEVICE_CAP_RSN) + print_table_line (2, _("WPA2 Encryption"), 23, _("yes"), 0, NULL); + if (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) + print_table_line (2, _("TKIP cipher"), 23, _("yes"), 0, NULL); + if (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) + print_table_line (2, _("CCMP cipher"), 23, _("yes"), 0, NULL); + + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + printf (_("\n Wireless Access Points %s\n"), active_ap ? _("(* = current AP)") : ""); + + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid); + } else if (NM_IS_DEVICE_ETHERNET (device)) { + printf (_("\n Wired Properties\n")); + + if (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) + print_table_line (2, _("Carrier"), 23, _("on"), 0, NULL); + else + print_table_line (2, _("Carrier"), 23, _("off"), 0, NULL); + } + + /* IP Setup info */ + if (state == NM_DEVICE_STATE_ACTIVATED) { + NMIP4Config *cfg = nm_device_get_ip4_config (device); + GSList *iter; + + printf (_("\n IPv4 Settings:\n")); + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + char *tmp2; + + tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); + print_table_line (2, _("Address"), 23, tmp, 0, NULL); + g_free (tmp); + + tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); + tmp = g_strdup_printf ("%d (%s)", prefix, tmp2); + g_free (tmp2); + print_table_line (2, _("Prefix"), 23, tmp, 0, NULL); + g_free (tmp); + + tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + print_table_line (2, _("Gateway"), 23, tmp, 0, NULL); + g_free (tmp); + printf ("\n"); + } + + array = nm_ip4_config_get_nameservers (cfg); + if (array) { + int i; + + for (i = 0; i < array->len; i++) { + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + print_table_line (2, _("DNS"), 23, tmp, 0, NULL); + g_free (tmp); + } + } + } + + printf ("\n\n"); +} + +static void +show_device_status (NMDevice *device, NmCli *nmc) +{ + const char *iface; + const char *type; + const char *state; + + iface = nm_device_get_iface (device); + type = get_device_type (device); + state = device_state_to_string (nm_device_get_state (device)); + + print_table_line (0, iface, 10, type, 17, state, 0, NULL); +} + +static NMCResultCode +do_devices_status (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + int i; + + while (argc > 0) { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("Status of devices"), _("Device"), 10, _("Type"), 17, _("State"), 12, NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("Device"), 10, _("Type"), 17, _("State"), 0, NULL); + + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + show_device_status (device, nmc); + } + + return NMC_RESULT_SUCCESS; + +error: + return nmc->return_value; +} + +static NMCResultCode +do_devices_list (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + NMDevice *device = NULL; + const char *iface = NULL; + gboolean iface_specified = FALSE; + int i; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + iface_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + iface = *argv; + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (iface_specified) { + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) + device = candidate; + } + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + show_device_info (device, nmc->client); + } else { + if (devices) + g_ptr_array_foreach ((GPtrArray *) devices, show_device_info, nmc->client); + } + +error: + return nmc->return_value; +} + +static void +device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMDeviceState state; + + state = nm_device_get_state (device); + + if (state == NM_DEVICE_STATE_DISCONNECTED) { + g_string_printf (nmc->return_text, _("Success: Device '%s' successfully disconnected."), nm_device_get_iface (device)); + quit (); + } +} + +static gboolean +timeout_cb (gpointer user_data) +{ + /* Time expired -> exit nmcli */ + + NmCli *nmc = (NmCli *) user_data; + + g_string_printf (nmc->return_text, _("Error: Timeout %d sec expired."), nmc->timeout); + nmc->return_value = NMC_RESULT_ERROR_TIMEOUT_EXPIRED; + quit (); + return FALSE; +} + +static void +disconnect_device_cb (NMDevice *device, GError *error, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMDeviceState state; + + if (error) { + g_string_printf (nmc->return_text, _("Error: Device '%s' (%s) disconnecting failed: %s"), + nm_device_get_iface (device), + nm_object_get_path (NM_OBJECT (device)), + error->message ? error->message : _("(unknown)")); + nmc->return_value = NMC_RESULT_ERROR_DEV_DISCONNECT; + quit (); + } else { + state = nm_device_get_state (device); + printf (_("Device state: %d (%s)\n"), state, device_state_to_string (state)); + + if (!nmc->should_wait || state == NM_DEVICE_STATE_DISCONNECTED) { + /* Don't want to wait or device already disconnected */ + quit (); + } else { + g_signal_connect (device, "notify::state", G_CALLBACK (device_state_cb), nmc); + /* Start timer not to loop forever if "notify::state" signal is not issued */ + g_timeout_add_seconds (nmc->timeout, timeout_cb, nmc); + } + + } +} + +static NMCResultCode +do_device_disconnect (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + NMDevice *device = NULL; + const char *iface = NULL; + gboolean iface_specified = FALSE; + gboolean wait = TRUE; + int i; + + /* Set default timeout for disconnect operation */ + nmc->timeout = 10; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + iface_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + iface = *argv; + } else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } else if (strcmp (*argv, "--timeout") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + errno = 0; + nmc->timeout = strtol (*argv, NULL, 10); + if (errno || nmc->timeout < 0) { + g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!iface_specified) { + g_string_printf (nmc->return_text, _("Error: iface has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) + device = candidate; + } + + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + nmc->should_wait = wait; + nm_device_disconnect (device, disconnect_device_cb, nmc); + +error: + return nmc->return_value; +} + +static void +show_acces_point_info (NMDevice *device) +{ + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid); +} + +static NMCResultCode +do_device_wifi_list (NmCli *nmc, int argc, char **argv) +{ + //TODO: cleanup + const GPtrArray *devices; + NMDevice *device = NULL; + const char *iface = NULL; + gboolean iface_specified = FALSE; + int i; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + iface_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + iface = *argv; + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (iface_specified) { + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) + device = candidate; + } + + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + if ((NM_IS_DEVICE_WIFI (device))) { + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("WiFi scan list"), NULL); + + show_acces_point_info (device); + } else { + g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("WiFi scan list"), NULL); + + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (dev); + + if ((NM_IS_DEVICE_WIFI (dev))) { + if (nmc->print_output > NMC_PRINT_TERSE) + print_table_line (0, _("Device:"), 0, dev_iface, 0, NULL); + + show_acces_point_info (dev); + } + } + } + +error: + return nmc->return_value; +} + +static NMCResultCode +do_device_wifi_apinfo (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + const GPtrArray *aps; + NMAccessPoint *ap = NULL; + const char *iface = NULL; + const char *hwaddr_user = NULL; + const char *hwaddr; + gboolean stop = FALSE; + guint32 flags, wpa_flags, rsn_flags, freq, bitrate; + guint8 strength; + const GByteArray *ssid; + NM80211Mode mode; + char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; + int i, j; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + iface = *argv; + } else if (strcmp (*argv, "hwaddr") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + hwaddr_user = *argv; + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!hwaddr_user) { + g_string_printf (nmc->return_text, _("Error: hwaddr has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + for (i = 0; !stop && devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (device); + + if (iface) { + if (!strcmp (iface, dev_iface)) + stop = TRUE; + else + continue; + } + + aps = NULL; + if ((NM_IS_DEVICE_WIFI (device))) + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + for (j = 0; aps && (j < aps->len); j++) { + char *hwaddr_up; + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + hwaddr_up = g_ascii_strup (hwaddr_user, -1); + if (!strcmp (hwaddr_up, candidate_hwaddr)) + ap = candidate_ap; + g_free (hwaddr_up); + } + } + + if (!ap) { + g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* get AP properties */ + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + ssid = nm_access_point_get_ssid (ap); + hwaddr = nm_access_point_get_hw_address (ap); + freq = nm_access_point_get_frequency (ap); + mode = nm_access_point_get_mode (ap); + bitrate = nm_access_point_get_max_bitrate (ap); + strength = nm_access_point_get_strength (ap); + + /* print them */ + ssid_str = g_strdup_printf ("%s", ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); + freq_str = g_strdup_printf (_("%u MHz"), freq); + bitrate_str = g_strdup_printf (_("%u MB/s"), bitrate/1000); + strength_str = g_strdup_printf ("%u", strength); + wpa_flags_str = ap_wpa_rsn_flags_to_string (wpa_flags); + rsn_flags_str = ap_wpa_rsn_flags_to_string (rsn_flags); + + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("AP parameters"), NULL); + else if (nmc->print_output == NMC_PRINT_NORMAL) + print_table_line (0, _("AP parameters"), 0, NULL); + + print_table_line (0, _("SSID:"), 25, ssid_str, 0, NULL); + print_table_line (0, _("BSSID:"), 25, hwaddr, 0, NULL); + print_table_line (0, _("Frequency:"), 25, freq_str, 0, NULL); + print_table_line (0, _("Mode:"), 25, mode == NM_802_11_MODE_ADHOC ? _("Ad-hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"), 0, NULL); + print_table_line (0, _("Maximal bitrate:"), 25, bitrate_str, 0, NULL); + print_table_line (0, _("Strength:"), 25, strength_str, 0, NULL); + print_table_line (0, _("Flags:"), 25, flags == NM_802_11_AP_FLAGS_PRIVACY ? _("privacy") : _("(none)"), 0, NULL); + print_table_line (0, _("WPA flags:"), 25, wpa_flags_str, 0, NULL); + print_table_line (0, _("RSN flags:"), 25, rsn_flags_str, 0, NULL); + + g_free (ssid_str); + g_free (freq_str); + g_free (bitrate_str); + g_free (strength_str); + g_free (wpa_flags_str); + g_free (rsn_flags_str); + +error: + return nmc->return_value; +} + +static NMCResultCode +do_device_wifi (NmCli *nmc, int argc, char **argv) +{ + if (argc == 0) + nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); + else if (argc > 0) { + if (matches (*argv, "list") == 0) { + nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); + } + else if (matches (*argv, "apinfo") == 0) { + nmc->return_value = do_device_wifi_apinfo (nmc, argc-1, argv+1); + } + else { + g_string_printf (nmc->return_text, _("Error: 'dev wifi' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + + return nmc->return_value; +} + + +NMCResultCode +do_devices (NmCli *nmc, int argc, char **argv) +{ + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + if (argc == 0) + nmc->return_value = do_devices_status (nmc, argc-1, argv+1); + + if (argc > 0) { + if (matches (*argv, "status") == 0) { + nmc->return_value = do_devices_status (nmc, argc-1, argv+1); + } + else if (matches (*argv, "list") == 0) { + nmc->return_value = do_devices_list (nmc, argc-1, argv+1); + } + else if (matches (*argv, "disconnect") == 0) { + nmc->return_value = do_device_disconnect (nmc, argc-1, argv+1); + } + else if (matches (*argv, "wifi") == 0) { + nmc->return_value = do_device_wifi (nmc, argc-1, argv+1); + } + else if (strcmp (*argv, "help") == 0) { + usage (); + } + else { + g_string_printf (nmc->return_text, _("Error: 'dev' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + +error: + return nmc->return_value; +} diff --git a/cli/src/devices.h b/cli/src/devices.h new file mode 100644 index 0000000000..152dd20776 --- /dev/null +++ b/cli/src/devices.h @@ -0,0 +1,27 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_DEVICES_H +#define NMC_DEVICES_H + +#include "nmcli.h" + +NMCResultCode do_devices (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_DEVICES_H */ diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c new file mode 100644 index 0000000000..b5c3bd5418 --- /dev/null +++ b/cli/src/network-manager.c @@ -0,0 +1,186 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include "utils.h" +#include "network-manager.h" + + +extern GMainLoop *loop; + +/* static function prototypes */ +static void usage (void); +static void quit (void); +static const char *nm_state_to_string (NMState state); +static NMCResultCode show_nm_status (NmCli *nmc); + + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli nm { COMMAND | help }\n\n" + " COMMAND := { status | sleep | wakeup | wifi | wwan }\n\n" + " status\n" + " sleep\n" + " wakeup\n" + " wifi [on|off]\n" + " wwan [on|off]\n\n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static const char * +nm_state_to_string (NMState state) +{ + switch (state) { + case NM_STATE_ASLEEP: + return _("asleep"); + case NM_STATE_CONNECTING: + return _("connecting"); + case NM_STATE_CONNECTED: + return _("connected"); + case NM_STATE_DISCONNECTED: + return _("disconnected"); + case NM_STATE_UNKNOWN: + default: + return _("unknown"); + } +} + +static NMCResultCode +show_nm_status (NmCli *nmc) +{ + gboolean nm_running; + NMState state; + const char *wireless_hw_enabled_str, *wireless_enabled_str; + const char *wwan_hw_enabled_str, *wwan_enabled_str; + + g_return_val_if_fail (nmc->client != NULL, NMC_RESULT_ERROR_UNKNOWN); + + nm_running = nm_client_get_manager_running (nmc->client); + state = nm_client_get_state (nmc->client); + if (nm_running) { + wireless_hw_enabled_str = nm_client_wireless_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + wireless_enabled_str = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + wwan_hw_enabled_str = nm_client_wwan_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + wwan_enabled_str = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + } else { + wireless_hw_enabled_str = wireless_enabled_str = wwan_hw_enabled_str = wwan_enabled_str = _("unknown"); + } + + if (nmc->print_output == NMC_PRINT_PRETTY) + print_table_header (_("NetworkManager status"), NULL); + + print_table_line (0, _("NM running:"), 25, nm_running ? _("running") : _("not running"), 0, NULL); + print_table_line (0, _("NM state:"), 25, nm_state_to_string (state), 0, NULL); + print_table_line (0, _("NM wireless hardware:"), 25, wireless_hw_enabled_str, 0, NULL); + print_table_line (0, _("NM wireless:"), 25, wireless_enabled_str, 0, NULL); + print_table_line (0, _("NM WWAN hardware:"), 25, wwan_hw_enabled_str, 0, NULL); + print_table_line (0, _("NM WWAN:"), 25, wwan_enabled_str, 0, NULL); + + return NMC_RESULT_SUCCESS; +} + + +/* entry point function for global network manager related commands 'nmcli nm' */ +NMCResultCode +do_network_manager (NmCli *nmc, int argc, char **argv) +{ + gboolean enable_wifi; + gboolean enable_wwan; + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto end; + + if (argc == 0) { + nmc->return_value = show_nm_status (nmc); + } + + if (argc > 0) { + if (matches (*argv, "status") == 0) { + nmc->return_value = show_nm_status (nmc); + } + else if (matches (*argv, "sleep") == 0) { + nm_client_sleep (nmc->client, TRUE); + } + else if (matches (*argv, "wakeup") == 0) { + nm_client_sleep (nmc->client, FALSE); + } + else if (matches (*argv, "wifi") == 0) { + if (next_arg (&argc, &argv) != 0) { + /* no argument, show current state */ + print_table_line (0, _("NM wireless:"), 25, nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"), 0, NULL); + } else { + if (!strcmp (*argv, "on")) + enable_wifi = TRUE; + else if (!strcmp (*argv, "off")) + enable_wifi = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'wifi' parameter: '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto end; + } + nm_client_wireless_set_enabled (nmc->client, enable_wifi); + } + } + else if (matches (*argv, "wwan") == 0) { + if (next_arg (&argc, &argv) != 0) { + /* no argument, show current state */ + print_table_line (0, _("NM WWAN:"), 25, nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"), 0, NULL); + } else { + if (!strcmp (*argv, "on")) + enable_wwan = TRUE; + else if (!strcmp (*argv, "off")) + enable_wwan = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'wwan' parameter: '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto end; + } + nm_client_wwan_set_enabled (nmc->client, enable_wwan); + } + } + else if (strcmp (*argv, "help") == 0) { + usage (); + } + else { + g_string_printf (nmc->return_text, _("Error: 'nm' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + +end: + quit (); + return nmc->return_value; +} diff --git a/cli/src/network-manager.h b/cli/src/network-manager.h new file mode 100644 index 0000000000..93cc1b077f --- /dev/null +++ b/cli/src/network-manager.h @@ -0,0 +1,27 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_NETWORK_MANAGER_H +#define NMC_NETWORK_MANAGER_H + +#include "nmcli.h" + +NMCResultCode do_network_manager (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_NETWORK_MANAGER_H */ diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c new file mode 100644 index 0000000000..f2ed7156b0 --- /dev/null +++ b/cli/src/nmcli.c @@ -0,0 +1,283 @@ +/* nmcli - command-line tool to control NetworkManager + * + * Jiri Klimes + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* Generated configuration file */ +#include "config.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nmcli.h" +#include "utils.h" +#include "connections.h" +#include "devices.h" +#include "network-manager.h" + +#define NMCLI_VERSION "0.1" + + +typedef struct { + NmCli *nmc; + int argc; + char **argv; +} ArgsInfo; + +/* --- Global variables --- */ +GMainLoop *loop = NULL; + + +static void +usage (const char *prog_name) +{ + fprintf (stderr, + _("Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n\n" + "OPTIONS\n" + " -t[erse] terse output\n" + " -p[retty] pretty output\n" + " -v[ersion] show program version\n" + " -h[elp] print this help\n\n" + "OBJECT\n" + " nm NetworkManager status\n" + " con NetworkManager connections\n" + " dev devices managed by NetworkManager\n\n"), + prog_name); +} + +static NMCResultCode +do_help (NmCli *nmc, int argc, char **argv) +{ + usage ("nmcli"); + return NMC_RESULT_SUCCESS; +} + +static const struct cmd { + const char *cmd; + NMCResultCode (*func) (NmCli *nmc, int argc, char **argv); +} nmcli_cmds[] = { + { "nm", do_network_manager }, + { "con", do_connections }, + { "dev", do_devices }, + { "help", do_help }, + { 0 } +}; + +static NMCResultCode +do_cmd (NmCli *nmc, const char *argv0, int argc, char **argv) +{ + const struct cmd *c; + + for (c = nmcli_cmds; c->cmd; ++c) { + if (matches (argv0, c->cmd) == 0) + return c->func (nmc, argc-1, argv+1); + } + + g_string_printf (nmc->return_text, _("Object '%s' is unknown, try 'nmcli help'."), argv0); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; +} + +static NMCResultCode +parse_command_line (NmCli *nmc, int argc, char **argv) +{ + char *base; + + base = strrchr (argv[0], '/'); + if (base == NULL) + base = argv[0]; + else + base++; + + /* parse options */ + while (argc > 1) { + char *opt = argv[1]; + /* '--' ends options */ + if (strcmp (opt, "--") == 0) { + argc--; argv++; + break; + } + if (opt[0] != '-') + break; + if (opt[1] == '-') + opt++; + if (matches (opt, "-terse") == 0) { + nmc->print_output = NMC_PRINT_TERSE; + } else if (matches (opt, "-pretty") == 0) { + nmc->print_output = NMC_PRINT_PRETTY; + } else if (matches (opt, "-version") == 0) { + printf (_("nmcli tool, version %s\n"), NMCLI_VERSION); + return NMC_RESULT_SUCCESS; + } else if (matches (opt, "-help") == 0) { + usage (base); + return NMC_RESULT_SUCCESS; + } else { + g_string_printf (nmc->return_text, _("Option '%s' is unknown, try 'nmcli -help'."), opt); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + argc--; + argv++; + } + + if (argc > 1) + return do_cmd (nmc, argv[1], argc-1, argv+1); + + usage (base); + return nmc->return_value; +} + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message (_("Caught signal %d, shutting down..."), signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +static NMClient * +nmc_get_client (NmCli *nmc) +{ + if (!nmc->client) { + nmc->client = nm_client_new (); + if (!nmc->client) { + g_string_printf (nmc->return_text, _("Error: Could not connect to NetworkManager.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + + return nmc->client; +} + +/* Initialize NmCli structure - set default values */ +static void +nmc_init (NmCli *nmc) +{ + nmc->client = NULL; + nmc->get_client = &nmc_get_client; + + nmc->return_value = NMC_RESULT_SUCCESS; + nmc->return_text = g_string_new (_("Success")); + + nmc->timeout = 10; + + nmc->system_settings = NULL; + nmc->user_settings = NULL; + + nmc->system_settings_running = FALSE; + nmc->user_settings_running = FALSE; + + nmc->system_connections = NULL; + nmc->user_connections = NULL; + + nmc->should_wait = FALSE; + nmc->print_output = NMC_PRINT_NORMAL; +} + +static void +nmc_cleanup (NmCli *nmc) +{ + if (nmc->client) g_object_unref (nmc->client); + + g_string_free (nmc->return_text, TRUE); + + if (nmc->system_settings) g_object_unref (nmc->system_settings); + if (nmc->user_settings) g_object_unref (nmc->user_settings); + + g_slist_free (nmc->system_connections); + g_slist_free (nmc->user_connections); +} + +static gboolean +start (gpointer data) +{ + ArgsInfo *info = (ArgsInfo *) data; + info->nmc->return_value = parse_command_line (info->nmc, info->argc, info->argv); + + if (!info->nmc->should_wait) + g_main_loop_quit (loop); + + return FALSE; +} + + +int +main (int argc, char *argv[]) +{ + NmCli nmc; + ArgsInfo args_info = { &nmc, argc, argv }; + + /* Set locale to use environment variables */ + setlocale (LC_ALL, ""); + +#ifdef GETTEXT_PACKAGE + /* Set i18n stuff */ + bindtextdomain (GETTEXT_PACKAGE, NMCLI_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); +#endif + + g_type_init (); + + nmc_init (&nmc); + g_idle_add (start, &args_info); + + loop = g_main_loop_new (NULL, FALSE); /* create main loop */ + setup_signals (); /* setup UNIX signals */ + g_main_loop_run (loop); /* run main loop */ + + /* Print result descripting text */ + if (nmc.return_value != NMC_RESULT_SUCCESS) { + fprintf (stderr, "%s\n", nmc.return_text->str); + } + + g_main_loop_unref (loop); + nmc_cleanup (&nmc); + + return nmc.return_value; +} diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h new file mode 100644 index 0000000000..2daa4154e6 --- /dev/null +++ b/cli/src/nmcli.h @@ -0,0 +1,77 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_NMCLI_H +#define NMC_NMCLI_H + +#include +#include + + +/* nmcli exit codes */ +typedef enum { + /* Indicates successful execution */ + NMC_RESULT_SUCCESS = 0, + + /* Unknown / unspecified error */ + NMC_RESULT_ERROR_UNKNOWN, + + /* A timeout expired */ + NMC_RESULT_ERROR_TIMEOUT_EXPIRED, + + /* Error in connection activation */ + NMC_RESULT_ERROR_CON_ACTIVATION, + + /* Error in connection deactivation */ + NMC_RESULT_ERROR_CON_DEACTIVATION, + + /* Error in device disconnect */ + NMC_RESULT_ERROR_DEV_DISCONNECT +} NMCResultCode; + +typedef enum { + NMC_PRINT_TERSE = 0, + NMC_PRINT_NORMAL, + NMC_PRINT_PRETTY +} NMCPrintOutput; + +/* NmCli - main structure */ +typedef struct _NmCli { + NMClient *client; + NMClient *(*get_client) (struct _NmCli *nmc); + + NMCResultCode return_value; + GString *return_text; + + int timeout; + + NMRemoteSettingsSystem *system_settings; + NMRemoteSettings *user_settings; + + gboolean system_settings_running; + gboolean user_settings_running; + + GSList *system_connections; + GSList *user_connections; + + gboolean should_wait; + NMCPrintOutput print_output; +} NmCli; + +#endif /* NMC_NMCLI_H */ diff --git a/cli/src/utils.c b/cli/src/utils.c new file mode 100644 index 0000000000..cd99b10fde --- /dev/null +++ b/cli/src/utils.c @@ -0,0 +1,126 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include + +#include + +#include "utils.h" + +int +matches (const char *cmd, const char *pattern) +{ + int len = strlen (cmd); + if (len > strlen (pattern)) + return -1; + return memcmp (pattern, cmd, len); +} + +int +next_arg (int *argc, char ***argv) +{ + if (*argc <= 1) { + return -1; + } + else { + (*argc)--; + (*argv)++; + } + return 0; +} + +void +print_table_header (const char *name, ...) +{ + va_list ap; + GString *str; + char *col, *line = NULL; + int col_width, width1, width2, table_width = 0; + + str = g_string_new (NULL); + + va_start (ap, name); + while ((col = va_arg (ap, char *)) != NULL) { + col_width = va_arg (ap, int); + width1 = strlen (col); + width2 = g_utf8_strlen (col, -1); /* Width of the string (in screen colums) */ + g_string_append_printf (str, "%-*s", col_width + width1 - width2, col); + g_string_append_c (str, ' '); /* Column separator */ + table_width += col_width + width1 - width2 + 1; + } + va_end (ap); + + if (table_width <= 0) + table_width = g_utf8_strlen (name, -1) + 4; + + /* Print the table header */ + line = g_strnfill (table_width, '='); + printf ("%s\n", line); + width1 = strlen (name); + width2 = g_utf8_strlen (name, -1); + printf ("%*s\n", (table_width + width2)/2 + width1 - width2, name); + printf ("%s\n", line); + if (str->len > 0) { + g_string_truncate (str, str->len-1); /* Chop off last column separator */ + printf ("%s\n", str->str); + g_free (line); + line = g_strnfill (table_width, '-'); + printf ("%s\n", line); + } + + g_free (line); + g_string_free (str, TRUE); +} + +void +print_table_line (int indent, ...) +{ + va_list ap; + GString *str; + char *col, *indent_str; + int col_width, width1, width2; + + str = g_string_new (NULL); + + va_start (ap, indent); + while ((col = va_arg (ap, char *)) != NULL) { + col_width = va_arg (ap, int); + width1 = strlen (col); + width2 = g_utf8_strlen (col, -1); /* Width of the string (in screen colums) */ + g_string_append_printf (str, "%-*s", col_width + width1 - width2, col); + g_string_append_c (str, ' '); /* Column separator */ + } + va_end (ap); + + /* Print the line */ + if (str->len > 0) + { + g_string_truncate (str, str->len-1); /* Chop off last column separator */ + if (indent > 0) { + indent_str = g_strnfill (indent, ' '); + g_string_prepend (str, indent_str); + g_free (indent_str); + } + printf ("%s\n", str->str); + } + + g_string_free (str, TRUE); +} + diff --git a/cli/src/utils.h b/cli/src/utils.h new file mode 100644 index 0000000000..468550e212 --- /dev/null +++ b/cli/src/utils.h @@ -0,0 +1,28 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_UTILS_H +#define NMC_UTILS_H + +int matches (const char *cmd, const char *pattern); +int next_arg (int *argc, char ***argv); +void print_table_header (const char *name, ...); +void print_table_line (int indent, ...); + +#endif /* NMC_UTILS_H */ diff --git a/configure.ac b/configure.ac index ecd70854f1..a31c6c4d3d 100644 --- a/configure.ac +++ b/configure.ac @@ -472,6 +472,8 @@ system-settings/plugins/keyfile/Makefile system-settings/plugins/keyfile/io/Makefile system-settings/plugins/keyfile/tests/Makefile system-settings/plugins/keyfile/tests/keyfiles/Makefile +cli/Makefile +cli/src/Makefile test/Makefile initscript/Makefile initscript/RedHat/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index 44235ea8ab..701dc795e1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,11 @@ [encoding: UTF-8] # List of source files containing translatable strings. # Please keep this file sorted alphabetically. +cli/src/connections.c +cli/src/devices.c +cli/src/network-manager.c +cli/src/nmcli.c +cli/src/utils.c libnm-util/crypto.c libnm-util/crypto_gnutls.c libnm-util/crypto_nss.c From 409aaa43e061fcf03976354ab5d08814f13da496 Mon Sep 17 00:00:00 2001 From: Runa Bhattacharjee Date: Thu, 25 Feb 2010 12:53:03 -0800 Subject: [PATCH 079/392] po: update Bengali translation (bgo #610442) --- po/bn_IN.po | 284 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 227 insertions(+), 57 deletions(-) diff --git a/po/bn_IN.po b/po/bn_IN.po index 9a71891b95..4ace70d6d2 100644 --- a/po/bn_IN.po +++ b/po/bn_IN.po @@ -1,17 +1,17 @@ -# translation of NetworkManager.po.master.po to Bengali INDIA +# translation of NetworkManager.master.po to Bengali INDIA # Bengali (India) translation of NetworkManager. # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. # -# Runa Bhattacharjee , 2009. +# Runa Bhattacharjee , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.po.master\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: 2009-06-04 03:24+0000\n" -"PO-Revision-Date: 2009-06-05 18:45+0530\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-02-19 17:25+0530\n" "Last-Translator: Runa Bhattacharjee \n" -"Language-Team: Bengali INDIA \n" +"Language-Team: Bengali INDIA \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -103,8 +103,9 @@ msgstr "IV সংরক্ষণের জন্য পর্যাপ্ত ম msgid "IV contains non-hexadecimal digits." msgstr "IV-র মধ্যে হেক্সাডেসিম্যাল-ভিন্ন অন্যান্য সংখ্যা উপস্থিত রয়েছে।" -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ব্যক্তিগত-কি'র সাইফার '%s' অজানা।" @@ -124,72 +125,111 @@ msgstr "ব্যক্তিগত-কি'র ধরন নির্ধার msgid "Not enough memory to store decrypted private key." msgstr "ডিক্রিপ্ট করা ব্যক্তিগত-কি সংরক্ষণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে ব্যর্থ।" -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 ইঞ্জিন আরম্ভ করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV-র অবৈধ দৈর্ঘ্য (অন্তত %zd হওয়া আবশ্যক)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "ডিক্রিপ্ট করা কি-বাফারের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "ডিক্রিপশন সাইফারের কনটেক্সট আরম্ভ করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "ডিক্রিপশনের জন্য সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "ডিক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: প্যাডিংয়ের দৈর্ঘ্য বৈধ নয়।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 #, c-format msgid "Failed to decrypt the private key." msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ।" -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "এনক্রিপ্ট করার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../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 "এনক্রিপশন সাইফারের কনটেক্সট আরম্ভ করতে ব্যর্থ: %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 "এনক্রিপশনের জন্য সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ: %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 "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ: %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 "তথ্য এনক্রিপ্ট করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "সার্টিফিকেটের তথ্য আরম্ভ করতে সমস্যা: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "সার্টিফিকেট ডি-কোড করতে ব্যর্থ: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 ডিকোডার আরম্ভ করতে ব্যর্থ: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %s" #: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে ব্যর্থ: %d।" @@ -199,105 +239,186 @@ msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 কনটেক্সট আরম্ভ করতে ব্যর্থ: %d।" -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "IV-র অবৈধ দৈর্ঘ্য (অন্তত %d হওয়া আবশ্যক)।" + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "ডিক্রিপশন সাইফার স্লট আরম্ভ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "ডিক্রিপশনের উদ্দেশ্যে সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "ডিক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "ডিক্রিপশন কনটেক্সট আরম্ভ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: %d।" -#: ../libnm-util/crypto_nss.c:239 +#: ../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 "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: ডিক্রিপ্ট করা তথ্য অত্যাধিক বড়।" + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "ব্যক্তিগত-কি'র ডিক্রিপশন সমাপ্ত করতে ব্যর্থ: %d।" -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:363 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "এনক্রিপশন সাইফার স্লট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "এনক্রিপশনের উদ্দেশ্যে সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "এনক্রিপশন কনটেক্সট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "এনক্রিপ্ট করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "এনক্রিপ্ট করার পরে অপ্রত্যাশিত পরিমাণ তথ্য উপলব্ধ হয়েছে।" + +#: ../libnm-util/crypto_nss.c:446 #, c-format msgid "Couldn't decode certificate: %d" msgstr "সার্টিফিকেট ডিকোড করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:481 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "পাসওয়ার্ডকে UCS2-তে রূপান্তর করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:509 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ডিকোডার আরম্ভ করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:518 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:527 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:556 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "র‍্যান্ড তথ্য নির্মাণ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "এনক্রিপশন-কি নির্মাণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/nm-utils.c:1633 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ফাইল নির্মাণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ফাইলের মধ্যে IV লেখার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ফাইলের মধ্যে এনক্রিপ্ট করা কি লেখার জন্য মেমরি বরাদ্দ করা যায়নি।" + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ফাইলের তথ্যে সংরক্ষণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "netlink বার্তা প্রক্রিয়াকরণে ত্রুটি: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink-র সাথে সংযোগ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink দলে যোগ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink লিংক ক্যাশে বরাদ্দ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "তথ্যের জন্য সকেটে অপেক্ষাকালে সমস্যা" + +#: ../src/nm-netlink-monitor.c:558 #, c-format msgid "error updating link cache: %s" msgstr "লিংক ক্যাশে আপডেট করতে সমস্যা: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "তথ্যের জন্য সকেটে অপেক্ষাকালে সমস্যা" - -#: ../src/NetworkManager.c:296 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "অবৈধ বিকল্প। বৈধ বিকল্পগুলির তালিকা দেখার জন্য অনুগ্রহ করে --help প্রয়োগ করুন।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager দ্বারা নির্মিত\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -306,28 +427,77 @@ msgstr "" "# %s থেকে মার্জ করা হয়েছে\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "উল্লেখ্য: libc resolver দ্বারা ৩-টির বেশি নেম-সার্ভার সমর্থিত না হওয়ার সম্ভাবনা রয়েছে।" +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "netlink-র সাথে সংযোগ করতে ব্যর্থ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "netlink দলে যোগ করতে ব্যর্থ: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"উল্লেখ্য: libc resolver দ্বারা ৩-টির বেশি নেম-সার্ভার সমর্থিত না হওয়ার সম্ভাবনা " +"রয়েছে।" + +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "নিম্নলিখিত নেম-সার্ভারগুলি সনাক্ত না হওয়ার সম্ভাবনা রয়েছে।" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2149 -msgid "System" -msgstr "সিস্টেম" - -#: ../system-settings/src/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "স্বয়ংক্রিয় %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "সিস্টেম" + #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "নিরাপদ ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "উন্মুক্ত ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করুন" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" msgstr "সিস্টেমের সংযোগ পরিবর্তন করুন" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের বৈশিষ্ট্য পরিবর্তন করা সম্ভব নয়" +msgstr "" +"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের বৈশিষ্ট্য পরিবর্তন করা সম্ভব " +"নয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করা সম্ভব " +"নয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "সিস্টেমের নিয়মনীতির কারণে, নিরাপদ ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "সিস্টেমের নিয়মনীতির কারণে, উন্মুক্ত ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে" From 0f70d95b221fe9eaf6a50d1aad1b6be502f579f4 Mon Sep 17 00:00:00 2001 From: Miguel Anxo Bouzada Date: Thu, 25 Feb 2010 12:55:29 -0800 Subject: [PATCH 080/392] po: update Galican translation (bgo #611059) --- po/gl.po | 476 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 455 insertions(+), 21 deletions(-) diff --git a/po/gl.po b/po/gl.po index 5193a4b118..ca5d3d53cd 100644 --- a/po/gl.po +++ b/po/gl.po @@ -2,53 +2,487 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # -# Ignacio Casal Quinteiro , 2007. -# Ignacio Casal Quinteiro , 2008. +# Ignacio Casal Quinteiro , 2007, 2008. +# Miguel Anxo Bouzada , 2010. msgid "" msgstr "" "Project-Id-Version: gl\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-02-13 16:21+0100\n" -"PO-Revision-Date: 2008-02-13 16:23+0100\n" -"Last-Translator: Ignacio Casal Quinteiro \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-02-25 11:06+0100\n" +"Last-Translator: Miguel Anxo Bouzada \n" "Language-Team: Galego \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:188 ../src/nm-netlink-monitor.c:448 +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "O ficheiro de chave PEM non ten a etiqueta de final «%s»." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Non parece un ficheiro de chave privada PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Non hai memoria abondo para almacenar o ficheiro PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Ficheiro PEM malformado: Proc-Type non é a primeira etiqueta." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Ficheiro PEM malformado: a etiqueta Proc-Type «%s »é descoñecida." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Ficheiro PEM malformado: Proc-Type non é a segunda etiqueta." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Ficheiro PEM malformado: non se atopou ningún IV na etiqueta DEK-Info" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Ficheiro PEM malformado: formato de IV incorrecto na etiqueta DEK-Info" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Ficheiro PEM malformado: o cifrado da chave privada «%s» é descoñecido" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Non puido ser decodificada a chave privada." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "O certificado PEM «%s» non ten unha etiqueta de final «%s»." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Fallou ao decodificar o certificado" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Non hai memoria abondo para almacenar os datos do certificado" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Non hai memoriaabondo para almacenar os datos do ficheiro" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV debe ter un número par de bytes en lonxitude." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Non hai memoria abondo para almacenar o IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contén díxitos non hexadecimais." + +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "O cifrado «%s» da chave privada é descoñecido." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Non hai memoria abondo para descifrar esta chave privada." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Non foi posíbel determinar o tipo de chave privada" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Non hai memoria abondo para almacenar a chave privada descifrada." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Produciuse un erro ao iniciar o motor de cifrado" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Produciuse un erro ao iniciar a arquitectura MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Lonxitude de IV incorrecta (debe ser polo menos %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Non hai memoria abondo para o búfer da chave descifrada." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Produciuse un erro ao establecer IV para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Produciuse un erro ao descifrar a chave privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:266 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Produciuse un fallo ao descifrar a chave privada: lonxitude de desprazamento non esperada." + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:277 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Produciuse un erro ao descifrar a chave privada" + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Non foi posíbel asignar a memoria para cifrar." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Produciuse un erro ao inicializar o contexto da chave de cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Produciuse un erro ao establecer IV para o cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Produciuse un erro ao cifrar os datos: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Produciuse un erro ao iniciar a certificación dos datos: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Non se puido decodificar o certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Non foi posíbel iniciar o decodificador PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Non foi posíbel decodificar o ficheiro PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Non foi posíbel verificar o ficheiro PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Produciuse un erro ao iniciar o motor de cifrado:%d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Produciuse un erro ao iniciar o contexto MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Lonxitude de IV incorrecta (debe ser polo menos %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Produciuse un erro ao iniciar a rañura de cifrado para o descifrado" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Produciuse un erro ao establecer IV para o descifrado." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Produciuse un erro ao iniciar o contexto de descifrado." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Produciuse un erro ao descifrar a chave privada: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Produciuse un erro ao descifrar a chave privada: os datos descifrados son moi grandes." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Produciuse un erro ao finalizar o descifrado da chave privada: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Produciuse un erro ao inicializar a rañura da cifra de cifrado." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Produciuse un erro ao establecer IV para o cifrado." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Produciuse un erro ao inicializar o contexto de cifrado." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Produciuse un erro ao cifrar: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Tamaño non agardado de datos despois de cifrar." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Non foi posíbel decodificar o certificado: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Non foi posíbel converter a chave a UCS2: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Non foi posíbel iniciar o decodificador PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Non fo posíbel decodificar o ficheiro PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Non foi posíbel verficar o ficheiro PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Non foi posíbel xerar datos aleatorios." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Sen memoria abondo para crear a chave de cifrado." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Non foi posíbel asignar memoria para a creación do ficheiro PEM," + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Non foi posíbel asignar memoria para escribir IV no ficheiro PEM." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Non foi posíbel asignar memoria para escribir a chave cifrada no ficheiro PEM." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Non foi posíbel asignar memoria para os datos do ficheiro PEM." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" -msgstr "erro procesando a mensaxe netlink: %s" +msgstr "produciuse un erro procesando a mensaxe netlink: %s" -#: ../src/nm-netlink-monitor.c:245 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "non se pode crear o manexador netlink para monitorizar o estado da ligazón: %s" +msgstr "non é posíbel crear o manexador netlink para monitorizar o estado da ligazón: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "non se pode conectar ao netlink para monitorizar o estado da lingazón: %s" +msgstr "non é posíbel conectar ao netlink para monitorizar o estado da lingazón: %s" -#: ../src/nm-netlink-monitor.c:263 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" -msgstr "non se pode unir ao grupo netlink para monitorizar o estado da ligazón: %s" +msgstr "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: %s" -#: ../src/nm-netlink-monitor.c:271 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "non se pode asignar a ligazón á caché netlink para monitorizar o estado da ligazón: %s" +msgstr "non é posíbel asignar a ligazón á caché netlink para monitorizar o estado da ligazón: %s" -#: ../src/nm-netlink-monitor.c:471 -#, c-format +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 msgid "error occurred while waiting for data on socket" -msgstr "ocorreu un erro agardando por datos nun socket" +msgstr "producouse un erro agardando por datos nun socket" -#: ../src/NetworkManager.c:255 +#: ../src/nm-netlink-monitor.c:558 +#, c-format +#| msgid "error processing netlink message: %s" +msgid "error updating link cache: %s" +msgstr "produciuse un erro ao actualizar a caché de ligazóns: %s" + +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Opción inválida. Use --help para ver a lista de opcións válidas.\n" +msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Creado por NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Fusionado desde %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "non é posíbel asignar un manexador para a ligazon de rede: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "non é posíbel conectar coa ligazón de rede: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "non é posíbel unir ao grupo da ligazón de rede: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTE: o importador libc non permite máis de 3 nomes de servidores." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi aberta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar o nome persistente do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar as conexións do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "A política do sistema impide a modificación da configuración do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "A política do sistema impide a modificación do nome do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi aberta" From 2281b87cc4b566d289314bc2eae0c9aa9584a7fb Mon Sep 17 00:00:00 2001 From: Rajesh Ranjan Date: Thu, 25 Feb 2010 13:04:12 -0800 Subject: [PATCH 081/392] po: add Hindi translation (bgo #610914) --- po/LINGUAS | 1 + po/hi.po | 477 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 478 insertions(+) create mode 100644 po/hi.po diff --git a/po/LINGUAS b/po/LINGUAS index 4ab6fac7b4..51d84b2a92 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -22,6 +22,7 @@ fr gl gu he +hi hr hu id diff --git a/po/hi.po b/po/hi.po new file mode 100644 index 0000000000..291b17a802 --- /dev/null +++ b/po/hi.po @@ -0,0 +1,477 @@ +# translation of NetworkManager.master.po to Hindi +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Rajesh Ranjan , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-02-24 03:25+0000\n" +"PO-Revision-Date: 2010-02-24 12:47+0530\n" +"Last-Translator: Rajesh Ranjan \n" +"Language-Team: Hindi \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM कुंजी फाइल के पास कोई अंत टैग '%s' नहीं है." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "एक PEM निजी कुंजी फाइल की तरह का नहीं दिखता है." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM फाइल डेटा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "विरूपित PEM फाइल: Proc-Type पहला टैग नहीं था." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "विरूपित PEM फाइल: अज्ञात Proc-Type टैग '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "विरूपित PEM फाइल: DEK-Info दूसरा टैग नहीं था." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "विरूपित PEM फाइल: कोई IV DEK-Info टैग में नहीं मिला." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "विरूपित PEM फाइल: IV का अवैध प्रारूप DEK-Info टैग में." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "विरूपित PEM फाइल: अज्ञात निजी कुंजी साइफर '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "निजी कुंजी को विगोपित नहीं कर सका." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM प्रमाणपत्र '%s' के पास कोई अंत टैग '%s' नहीं है." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "प्रमाणपत्र विगोपित करने में विफल." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "प्रमाणपत्र आँकड़ा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "फाइल आँकड़ा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV की लंबाई में बाइट संख्या सम संख्या होनी चाहिए." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV गैर हेक्साडेसीमेल अंक समाहित करता है." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "निजी कुंजी साइफर '%s' अज्ञात था." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "निजी कुंजी गोपित करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "निजी कुंजी प्रकार निर्धारित करने में असमर्थ." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "विगोपित निजी कुंजी जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "क्रिप्टो ईंजन आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ईंजन आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "अवैध IV लंबाई (कम से कम %zd होना चाहिए)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "विगोपित कुंजी बफर के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "विगोपन साइफर संदर्भ को आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "IV को गोपन के लिए सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "निजी कुंजी गोपित करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "निजी कुंजी गोपित करने में विफल: अप्रत्याशित पैडिंग लंबाई." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "निजी कुंजी गोपित करने में विफल." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "गोपन के लिए स्मृति आबंटित नहीं कर सका." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "गोपन साइफर संदर्भ को आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "IV को गोपन के लिए सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "आँकड़ा गोपित करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "प्रमाणपत्र आँकड़ा आरंभीकृत करने में विफल: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "प्रमाणपत्र विगोपित नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 विगोपक आरंभीकृत नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 फाइल विगोपित नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 फाइल जाँच नहीं सका: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "क्रिप्टो ईंजन आरंभीकृत करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 संदर्भ आरंभीकृत करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "अवैध IV लंबाई (जरूर कम से कम %d होना चाहिए)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "विगोपन साइफर स्लॉट को आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "IV को गोपन के लिए सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "गोपन संदर्भ आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "निजी कुंजी गोपित करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "निजी कुंजी गोपित करने में विफल: विगोपित आँकड़ा काफी बड़ा है." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "निजी कुंजी के विगोपन को अंतिम रूप देने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "गोपन साइफर स्लाट आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "IV को गोपन के लिए सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "गोपन संदर्भ आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "गोपित करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "गोपन के बाद आँकड़ा की अप्रत्याशित मात्रा." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "प्रमाणपत्र डिकोड नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "कूटशब्द को UCS2 में बदल नहीं सका: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 डिकोडर को आरंभीकृत नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 फाइल विगोपित नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 फाइल जाँच नहीं सका: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "क्रमहीन आँकड़ा बना नहीं सका." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "गोपन कुंजी बनाने के लिए पर्याप्त मात्रा में स्मृति नहीं." + +#: ../libnm-util/nm-utils.c:1632 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM फाइल निर्माण के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:1644 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV से PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:1656 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "गोपित कुंजी को PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:1675 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM फाइल आँकड़ा के लिए स्मृति नहीं आबंटित कर सका." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink संदेश की प्रक्रिया में त्रुटि: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "लिंक स्थिति मॉनिटर करने के लिए नेटलिंक नियंत्रण का आबंटित नहीं कर सका: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "नेटलिंक को मॉनिटरिंग लिंक स्थिति के लिए कनेक्ट करने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "मॉनिटरिंग लिंक स्थिति के लिए नेटलिंक में शामिल होने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "नेटलिंक कैश को मॉनिटरिंग लिंक स्थिति के लिए आबंटित करने में असमर्थ: %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 "सॉकेट पर आँकड़ा के लिए प्रतीक्षा करने के दौरान त्रुटि" + +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "लिंक कैश अद्यतन करने में त्रुटि: %s" + +#: ../src/NetworkManager.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "अवैध विकल्प. कृपया --help का उपयोग वैध विकल्प देने के लिए करें.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:297 +msgid "# Created by NetworkManager\n" +msgstr "# संजाल प्रबंधक द्वारा निर्मित\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:313 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"#%s से मिलाया गया\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "नेटलिंक हैंडल आबंटित करने में असमर्थ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "नेटलिंक में कनेक्ट करने में असमर्थ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "नेटलिंक समूह में शामिल होने में असमर्थ: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "नोट: libc समाधानकर्ता 3 नेमसर्वर से अधिक का समर्थन नहीं कर सकता है." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "नीचे सूची में दिया गया नेमसर्वर पहचाना नहीं जा सकता है." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "स्वतः %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3220 +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 संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" + From 0f0daf7852a0dc71a1a270e7936d2819789e7155 Mon Sep 17 00:00:00 2001 From: Jirka Klimes Date: Thu, 25 Feb 2010 16:52:10 -0800 Subject: [PATCH 082/392] core: determine classful IPv4 prefix if no DHCP netmask is provided (bgo #603098) --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 1 + libnm-util/nm-utils.c | 25 ++++++++++++++++++++++- libnm-util/nm-utils.h | 3 ++- src/dhcp-manager/nm-dhcp-dhclient.c | 15 ++++++++------ system-settings/plugins/ifcfg-rh/reader.c | 11 ++-------- 6 files changed, 39 insertions(+), 18 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 2aa4c4ed6e..55db3313c0 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "2:0:1" + -version-info "3:0:2" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 17ce1749ff..3307b92ac1 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -345,6 +345,7 @@ global: nm_utils_ip4_addresses_to_gvalue; nm_utils_ip4_netmask_to_prefix; nm_utils_ip4_prefix_to_netmask; + nm_utils_ip4_get_default_prefix; nm_utils_ip4_routes_from_gvalue; nm_utils_ip4_routes_to_gvalue; nm_utils_ip6_addresses_from_gvalue; diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 8ec872d807..31aae7c02b 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -21,7 +21,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2005 - 2009 Red Hat, Inc. + * (C) Copyright 2005 - 2010 Red Hat, Inc. */ #include @@ -1209,6 +1209,29 @@ nm_utils_ip4_prefix_to_netmask (guint32 prefix) } +/** + * nm_utils_ip4_get_default_prefix: + * @ip: an IPv4 address (in network byte order) + * + * When the Internet was originally set up, various ranges of IP addresses were + * segmented into three network classes: A, B, and C. This function will return + * a prefix that is associated with the IP address specified defining where it + * falls in the predefined classes. + * + * Returns: the default class prefix for the given IP + **/ +/* The function is originally from ipcalc.c of Red Hat's initscripts. */ +guint32 +nm_utils_ip4_get_default_prefix (guint32 ip) +{ + if (((ntohl (ip) & 0xFF000000) >> 24) <= 127) + return 8; /* Class A - 255.0.0.0 */ + else if (((ntohl (ip) & 0xFF000000) >> 24) <= 191) + return 16; /* Class B - 255.255.0.0 */ + + return 24; /* Class C - 255.255.255.0 */ +} + GSList * nm_utils_ip6_addresses_from_gvalue (const GValue *value) { diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h index bbb304f4db..8308a233ac 100644 --- a/libnm-util/nm-utils.h +++ b/libnm-util/nm-utils.h @@ -20,7 +20,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2005 - 2008 Red Hat, Inc. + * (C) Copyright 2005 - 2010 Red Hat, Inc. */ #ifndef NM_UTILS_H @@ -192,6 +192,7 @@ void nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value); guint32 nm_utils_ip4_netmask_to_prefix (guint32 netmask); guint32 nm_utils_ip4_prefix_to_netmask (guint32 prefix); +guint32 nm_utils_ip4_get_default_prefix (guint32 ip); GSList *nm_utils_ip6_addresses_from_gvalue (const GValue *value); void nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 1c5625798a..ac8f29a109 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -237,13 +237,16 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) /* Netmask */ data = g_hash_table_lookup (hash, "option subnet-mask"); - if (!data) - data = "255.255.255.0"; /* FIXME: assume class C? */ - if (!inet_pton (AF_INET, data, &tmp)) { - g_warning ("%s: couldn't parse IP4 subnet mask '%s'", __func__, data); - goto error; + if (data) { + if (!inet_pton (AF_INET, data, &tmp)) { + g_warning ("%s: couldn't parse IP4 subnet mask '%s'", __func__, data); + goto error; + } + prefix = nm_utils_ip4_netmask_to_prefix (tmp.s_addr); + } else { + /* Get default netmask for the IP according to appropriate class. */ + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); } - prefix = nm_utils_ip4_netmask_to_prefix (tmp.s_addr); nm_ip4_address_set_prefix (addr, prefix); /* Gateway */ diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 1b8ae93925..a445d5b177 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -606,16 +606,9 @@ read_full_ip4_address (shvarFile *ifcfg, /* Try to autodetermine the prefix for the address' class */ if (!nm_ip4_address_get_prefix (addr)) { - guint32 tmp_addr, prefix = 0; - - tmp_addr = nm_ip4_address_get_address (addr); - if (((ntohl(tmp_addr) & 0xFF000000) >> 24) <= 127) - prefix = 8; - else if (((ntohl(tmp_addr) & 0xFF000000) >> 24) <= 191) - prefix = 16; - else - prefix = 24; + guint32 prefix = 0; + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); nm_ip4_address_set_prefix (addr, prefix); value = svGetValue (ifcfg, ip_tag, FALSE); From c43f8b8836fb9966ac3e784e1ef9265791855af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 26 Feb 2010 15:05:03 +0100 Subject: [PATCH 083/392] core: cli options cleanup; fix usage of '--plugins' '--plugins' option now takes preference over [plugins] from config file. This change fixes a bug caused by accepting default config file when no '--config' was specified and thus effectively disabling '--plugins'. --- src/NetworkManager.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/NetworkManager.c b/src/NetworkManager.c index a6639b8c8e..597927aee9 100644 --- a/src/NetworkManager.c +++ b/src/NetworkManager.c @@ -439,9 +439,8 @@ main (int argc, char *argv[]) GOptionContext *opt_ctx = NULL; gboolean become_daemon = FALSE; gboolean g_fatal_warnings = FALSE; - char *pidfile = NULL, *user_pidfile = NULL; - char *config = NULL, *plugins = NULL, *dhcp = NULL; - char *state_file = NM_DEFAULT_SYSTEM_STATE_FILE; + char *pidfile = NULL, *state_file = NULL, *dhcp = NULL; + char *config = NULL, *plugins = NULL, *conf_plugins = NULL; gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE; gboolean success; NMPolicy *policy = NULL; @@ -456,7 +455,7 @@ main (int argc, char *argv[]) GOptionEntry options[] = { { "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL }, { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL }, - { "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &user_pidfile, "Specify the location of a PID file", "filename" }, + { "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &pidfile, "Specify the location of a PID file", "filename" }, { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, "State file location", "/path/to/state.file" }, { "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" }, { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ,", "plugin1,plugin2" }, @@ -495,7 +494,8 @@ main (int argc, char *argv[]) exit (1); } - pidfile = g_strdup (user_pidfile ? user_pidfile : NM_DEFAULT_PID_FILE); + pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE); + state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE); /* check pid file */ if (check_pidfile (pidfile)) @@ -503,7 +503,7 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { - if (!parse_config_file (config, &plugins, &dhcp, &error)) { + if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { g_warning ("Config file %s invalid: (%d) %s.", config, error ? error->code : -1, @@ -511,17 +511,22 @@ main (int argc, char *argv[]) exit (1); } } else { - config = NM_DEFAULT_SYSTEM_CONF_FILE; - if (!parse_config_file (config, &plugins, &dhcp, &error)) { + config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { g_warning ("Default config file %s invalid: (%d) %s.", config, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); + g_free (config); config = NULL; /* Not a hard failure */ } } + /* Plugins specified with '--plugins' override those of config file */ + plugins = plugins ? plugins : g_strdup (conf_plugins); + g_free (conf_plugins); + g_clear_error (&error); /* Parse the state file */ @@ -678,7 +683,13 @@ done: if (pidfile && wrote_pidfile) unlink (pidfile); + + /* Free options */ g_free (pidfile); + g_free (state_file); + g_free (config); + g_free (plugins); + g_free (dhcp); nm_info ("exiting (%s)", success ? "success" : "error"); exit (success ? 0 : 1); From 2a646aafa37ac02001f5d746e2971b254daa8f20 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Mar 2010 12:09:16 -0800 Subject: [PATCH 084/392] core: try getting system config from NetworkManager.conf first And fall back to nm-system-settings.conf if that doesn't exist. --- src/NetworkManager.c | 45 ++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/src/NetworkManager.c b/src/NetworkManager.c index 597927aee9..17a96a9d16 100644 --- a/src/NetworkManager.c +++ b/src/NetworkManager.c @@ -54,9 +54,10 @@ #include "nm-vpn-manager.h" #include "nm-logging.h" -#define NM_DEFAULT_PID_FILE LOCALSTATEDIR"/run/NetworkManager.pid" -#define NM_DEFAULT_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/nm-system-settings.conf" -#define NM_DEFAULT_SYSTEM_STATE_FILE LOCALSTATEDIR"/lib/NetworkManager/NetworkManager.state" +#define NM_DEFAULT_PID_FILE LOCALSTATEDIR"/run/NetworkManager.pid" +#define NM_DEFAULT_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/NetworkManager.conf" +#define NM_OLD_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/nm-system-settings.conf" +#define NM_DEFAULT_SYSTEM_STATE_FILE LOCALSTATEDIR"/lib/NetworkManager/NetworkManager.state" /* * Globals @@ -511,15 +512,35 @@ main (int argc, char *argv[]) exit (1); } } else { - config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); - if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { - g_warning ("Default config file %s invalid: (%d) %s.", - config, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); - g_free (config); - config = NULL; - /* Not a hard failure */ + gboolean parsed = FALSE; + + /* Try NetworkManager.conf first */ + if (g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { + config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &error); + if (!parsed) { + g_warning ("Default config file %s invalid: (%d) %s.", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_free (config); + config = NULL; + /* Not a hard failure */ + } + } + + /* Try old nm-system-settings.conf next */ + if (!parsed) { + config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); + if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { + g_warning ("Default config file %s invalid: (%d) %s.", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_free (config); + config = NULL; + /* Not a hard failure */ + } } } From 1aae1ad0090085b33ee930a9f922f7ac5c057982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 1 Mar 2010 12:35:20 -0800 Subject: [PATCH 085/392] man: manpage updates; add pages for system settings config file --- .gitignore | 2 +- configure.ac | 2 + man/Makefile.am | 4 ++ man/NetworkManager.8.in | 51 +++++++++++---- man/NetworkManager.conf.5.in | 105 +++++++++++++++++++++++++++++++ man/nm-system-settings.conf.5.in | 26 ++++++++ 6 files changed, 176 insertions(+), 14 deletions(-) create mode 100644 man/NetworkManager.conf.5.in create mode 100644 man/nm-system-settings.conf.5.in diff --git a/.gitignore b/.gitignore index b4652f62dd..7900fe2ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,7 @@ docs/libnm-util/libnm-util-*.txt COPYING INSTALL *.pc -man/*.[18] +man/*.[185] po/*.gmo callouts/nm-dhcp-client.action diff --git a/configure.ac b/configure.ac index a31c6c4d3d..f5872c1b0c 100644 --- a/configure.ac +++ b/configure.ac @@ -495,6 +495,8 @@ initscript/Mandriva/networkmanager introspection/Makefile man/Makefile man/NetworkManager.8 +man/NetworkManager.conf.5 +man/nm-system-settings.conf.5 man/nm-tool.1 po/Makefile.in policy/Makefile diff --git a/man/Makefile.am b/man/Makefile.am index c3000d78aa..670d9a741a 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,8 +1,12 @@ man_MANS = \ NetworkManager.8 \ + NetworkManager.conf.5 \ + nm-system-settings.conf.5 \ nm-tool.1 EXTRA_DIST = \ $(man_MANS) \ NetworkManager.8.in \ + NetworkManager.conf.5.in \ + nm-system-settings.conf.5.in \ nm-tool.1.in diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in index 426cc7ba92..48683902ef 100644 --- a/man/NetworkManager.8.in +++ b/man/NetworkManager.8.in @@ -1,14 +1,14 @@ .\" NetworkManager(8) manual page .\" -.\" Copyright (C) 2005 - 2009 Red Hat, Inc. +.\" Copyright (C) 2005 - 2010 Red Hat, Inc. .\" Copyright (C) 2005 - 2009 Novell, Inc. .\" Copyright (C) 2005 Robert Love .\" -.TH NETWORKMANAGER "8" +.TH NETWORKMANAGER "8" "January 29, 2010" .SH NAME NetworkManager \- network management daemon .SH SYNOPSIS -.B NetworkManager [\-\-no-daemon] +.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] .SH DESCRIPTION The \fINetworkManager\fP daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network @@ -18,7 +18,7 @@ connection for that device becomes available, unless that behavior is disabled. Information about networking is exported via a D-Bus interface to any interested application, providing a rich API with which to inspect and control network settings and operation. -.TP +.P NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory in alphabetical order in response to network events. Each script should be (a) a regular file, (b) owned by root, (c) not writable by group or @@ -29,12 +29,12 @@ and second an action. .I "up" The interface has been activated. The environment contains more information about the interface; CONNECTION_UUID contains the UUID of the connection. Other -variables are IP4_ADDRESS_N where N is a number from 0 to (# IPv4 addresses - 1), +variables are IP4_ADDRESS_N where N is a number from 0 to (# IPv4 addresses \- 1), in the format "address/prefix gateway". IP4_NUM_ADDRESSES contains the number addresses the script may expect. IP4_NAMESERVERS contains a space-separated list of the DNS servers, and IP4_DOMAINS contains a space-separated list of the search domains. Routes use the format IP4_ROUTE_N where N is a number from 0 -to (# IPv4 routes - 1), in the format "address/prefix next-hop metric", and +to (# IPv4 routes \- 1), in the format "address/prefix next-hop metric", and IP4_NUM_ROUTES contains the number of routes to expect. If the connection used DHCP for address configuration, the received DHCP configuration is passed in the environment using standard DHCP option names, prefixed with "DHCP4_", like @@ -43,11 +43,11 @@ environment using standard DHCP option names, prefixed with "DHCP4_", like .I "down" The interface has been deactivated. .TP -.I "vpn-up" +.I "vpn\-up" A VPN connection has been activated. The environment contains the connection UUID in the variable CONNECTION_UUID. .TP -.I "vpn-down" +.I "vpn\-down" A VPN connection has been deactivated. .TP .I "hostname" @@ -55,21 +55,46 @@ The system hostname has been updated. Use gethostname(2) to retrieve it. .SH OPTIONS The following options are supported: .TP -.I "--no-daemon" +.I "\-\-no-daemon" Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog. +.TP +.I "\-\-pid\-file=" +Specify location of a PID file. The PID file is used for storing PID of the +running proccess and prevents running multiple instances. +.TP +.I "\-\-state\-file=" +Specify file for storing state of the NetworkManager persistently. If not specified, +the default value of '/lib/NetworkManager/NetworkManager.state' is +used; where is dependent on your distribution (usually it's /var). +.TP +.I "\-\-config=" +Specify configuration file to set up various settings for NetworkManager. If not +specified, the default value of '/NetworkManager/NetworkManager.conf' +is used with a fallback to the older 'nm\-system\-settings.conf' if located in +the same directory; where is dependent on your distribution (usually +it's /etc). See \fBNetworkManager.conf\fP(5) for more information on configuration +file. +.TP +.I "\-\-plugins=,, ... +List plugins used to manage system-wide connection settings. This list has +preference over plugins specified in the configuration file. Currently supported +plugins are: keyfile, ifcfg\-rh, ifcfg\-suse, ifupdown. +See \fBNetworkManager.conf\fP(5) for more information on the plugins. .SH DEBUGGING The following environment variables are supported to help debugging. When used -in conjunction with the "--no-daemon" option (thus echoing PPP and DHCP helper +in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helper output to stdout) these can quickly help pinpoint the source of connection issues. .TP .I "NM_SERIAL_DEBUG" -When set to anything, causes NetworkManager to log all serial communication to -and from serial devices like mobile broadband 3G modems. +(0.7.x only) When set to anything, causes NetworkManager to log all serial +communication to and from serial devices like mobile broadband 3G modems. .TP .I "NM_PPP_DEBUG" When set to anything, causes NetworkManager to turn on PPP debugging in pppd, which logs all PPP and PPTP frames and client/server exchanges. .SH SEE ALSO -.BR nm-tool (1) +.BR nm\-tool (1), +.BR NetworkManager.conf (5), + diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in new file mode 100644 index 0000000000..7eb48b6947 --- /dev/null +++ b/man/NetworkManager.conf.5.in @@ -0,0 +1,105 @@ +.\" NetworkManager.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "NetworkManager.conf" "5" "1 February 2010" "" +.SH NAME +NetworkManager.conf \- NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/NetworkManager.conf +.br +or +.br +\fI\fP/NetworkManager/NetworkManager.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I NetworkManager.conf +is a configuration file for NetworkManager. As the name suggests, it configures +how NetworkManager handles system-wide connection settings. The location of +the file may be changed through use of the "\-\-config=" argument for +\fBNetworkManager\fP (8). + +It is not necessary to restart NetworkManager (for version 0.8) or nm\-system\-settings +(for version 0.7) when making changes, as the configuration file is watched for changes +and reloaded automatically when necessary. +.SH "FILE FORMAT" +.P +The configuration file format is so-called key file (sort of ini-style format). +It consists of sections (groups) of key-value pairs. Lines beginning with a '#' and blank +lines are considered comments. Sections are started by a header line containing +the section enclosed in '[' and ']', and ended implicitly by the start of +the next section or the end of the file. Each key-value pair must be contained +in a section. +.br +Minimal system settings configuration file looks like this: +.P +.nf +[main] +plugins=keyfile +.fi +.P +Description of sections and available keys follows: +.SS [main] +This section is the only mandatory section of the configuration file. +.TP +.B plugins=\fIplugin1\fP,\fIplugin2\fP, ... +List plugin names separated by ','. Plugins are used to read/write system-wide +connection. When more plugins are specified, the connections are read from all +listed plugins. When writing connections, the plugins will be asked to save the +connection in the order listed here. If the first plugin cannot write out that +connection type, or can't write out any connections, the next plugin is tried. +If none of the plugins can save the connection, the error is returned to the user. +.P +.RS +.B "Available plugins:" +.br +.TP +.I keyfile +plugin is the generic plugin that supports all the connection types and +capabilities that NetworkManager has. It writes files out in a .ini-style format in +/etc/NetworkManager/system-connections. For security, it will ignore files +that are readable or writeable by any user or group other than +.I root +since private keys and passphrases may be stored in plaintext inside the file. +.TP +.I ifcfg\-rh +plugin is used on the Fedora and Red Hat Enterprise Linux distributions +to read and write configuration from the standard /etc/sysconfig/network-scripts/ifcfg-* files. +It currently supports reading wired, WiFi, and 802.1x connections, but does not yet support reading +or writing mobile broadband, PPPoE, or VPN connections. To allow reading and writing of these +add \fIkeyfile\fP plugin to your configuration as well. +.TP +.I ifupdown +plugin is used on the Debian and Ubuntu distributions, and reads connections from +/etc/network/interfaces. Since it cannot write connections out (that support isn't planned), +it is usually paired with the \fIkeyfile\fP plugin to enable saving and editing of new connections. +The \fIifupdown\fP plugin supports basic wired and WiFi connections, including WPA-PSK. +.TP +.I ifcfg\-suse +plugin is only provided for simple backward compatibility with SUSE and OpenSUSE configuration. +Most setups should be using the \fIkeyfile\fP plugin instead. The \fIifcfg\-suse\fP plugin supports +reading wired and WiFi connections, but does not support saving any connection types. +.RE +.SS [keyfile] +This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. +.TP +.B hostname=\fI\fP +Set a persistent hostname when using the \fIkeyfile\fP plugin. +.SS [ifupdown] +This section contains ifupdown-specific options and thus only has effect when using \fIifupdown\fP plugin. +.TP +.B managed=\fIfalse\fP | \fItrue\fP +Controls whether interfaces listed in the 'interfaces' file are managed by NetworkManager. +If set to \fItrue\fP, then interfaces listed in /etc/network/interfaces are managed by NetworkManager. +If set to \fIfalse\fP, then any interface listed in /etc/network/interfaces will be +ignored by NetworkManager. Remember that NetworkManager controls the default route, +so because the interface is ignored, NetworkManager may assign the default route to +some other interface. +When the option is missing, \fIfalse\fP value is taken as default. +.SH "SEE ALSO" +.BR http://live.gnome.org/NetworkManager/SystemSettings +.sp +.BR NetworkManager (8), +.BR nm\-tool (1). diff --git a/man/nm-system-settings.conf.5.in b/man/nm-system-settings.conf.5.in new file mode 100644 index 0000000000..e48d0c8e65 --- /dev/null +++ b/man/nm-system-settings.conf.5.in @@ -0,0 +1,26 @@ +.\" nm-system-settings.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "nm-system-settings.conf" "5" "1 February 2010" "" +.SH NAME +nm\-system\-settings.conf \- Deprecated NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/nm\-system\-settings.conf +.br +or +.br +\fI\fP/NetworkManager/nm\-system\-settings.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I nm\-system\-settings.conf +is a deprecated configuration file for \fBNetworkManager\fP (5). While this +file can still be used, NetworkManager now defaults to reading the config +file \fP/NetworkManager/NetworkManager.conf\fP instead, falling back +to nm\-system\-settings.conf if NetworkManager.conf does not exist. +.SH "SEE ALSO" +.BR NetworkManager (8), +.BR NetworkManager.conf (5), +.BR nm\-tool (1). From af83949cd41638d0afc9b5b49423157875c7633d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Mar 2010 12:45:51 -0800 Subject: [PATCH 086/392] trivial: .gitignore update --- .gitignore | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 7900fe2ee1..ac036ec646 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.o *.lo *.la +*.bz2 Makefile Makefile.in* configure @@ -22,24 +23,47 @@ autom4te.cache intltool-* gtk-doc.make TAGS -docs/libnm-glib/html/ -docs/libnm-glib/tmpl/ -docs/libnm-glib/xml/ -docs/libnm-glib/libnm-glib-*.txt -docs/libnm-util/html/ -docs/libnm-util/tmpl/ -docs/libnm-util/xml/ -docs/libnm-util/libnm-util-*.txt COPYING INSTALL *.pc man/*.[185] po/*.gmo +po/.intltool-merge-cache + +docs/libnm-glib/*.stamp +docs/libnm-glib/html/ +docs/libnm-glib/tmpl/ +docs/libnm-glib/xml/ +docs/libnm-glib/libnm-glib-*.txt +docs/libnm-glib/libnm-glib.args +docs/libnm-glib/libnm-glib.hierarchy +docs/libnm-glib/libnm-glib.interfaces +docs/libnm-glib/libnm-glib.prerequisites +docs/libnm-glib/libnm-glib.signals + +docs/libnm-util/*.stamp +docs/libnm-util/html/ +docs/libnm-util/tmpl/ +docs/libnm-util/xml/ +docs/libnm-util/libnm-util-*.txt +docs/libnm-util/libnm-util-decl-list.txt.bak +docs/libnm-util/libnm-util-decl.txt.bak +docs/libnm-util/libnm-util.args +docs/libnm-util/libnm-util.hierarchy +docs/libnm-util/libnm-util.interfaces +docs/libnm-util/libnm-util.prerequisites +docs/libnm-util/libnm-util.signals +docs/libnm-util/libnm-util.types + +docs/generate-settings-spec +docs/settings-spec.html +docs/spec.html callouts/nm-dhcp-client.action callouts/nm-avahi-autoipd.action callouts/nm-dispatcher.action callouts/org.freedesktop.nm_dispatcher.service +callouts/nm-modem-probe dispatcher-daemon/NetworkManagerDispatcher initscript/*/NetworkManagerDispatcher initscript/*/networkmanager-dispatcher @@ -53,8 +77,10 @@ nm-marshal.[ch] libnm-glib/libnm-glib-test src/NetworkManager src/nm-crash-logger +src/supplicant-manager/tests/test-supplicant-config system-settings/src/nm-system-settings system-settings/src/org.freedesktop.NetworkManagerSystemSettings.service +test/libnm-glib-test test/libnm_glib_test test/nm-online test/nm-tool @@ -62,8 +88,16 @@ test/nmtestdevices libnm-util/test-crypto libnm-util/tests/test-crypto libnm-util/tests/test-settings-defaults +libnm-util/tests/test-general +libnm-util/tests/test-need-secrets +libnm-util/tests/test-setting-8021x src/tests/test-dhcp-options + system-settings/plugins/keyfile/tests/test-keyfile +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_* m4/gtk-doc.m4 m4/intltool.m4 From f5f1da66b50a6b94a4f1744e0edd3d84dd0dd496 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Mar 2010 17:04:47 -0800 Subject: [PATCH 087/392] core: fix auto determination of classful IPv4 address and add testcase (bgo #603098) The original patch didn't actually fix the main DHCP option code, just the dhclient leasefile reading code. Add some testcases for good measure. --- src/dhcp-manager/nm-dhcp-client.c | 11 +++- src/tests/test-dhcp-options.c | 106 +++++++++++++++++++++++------- 2 files changed, 91 insertions(+), 26 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index a47f929a53..41b4301197 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -686,7 +686,7 @@ ip4_options_to_config (NMDHCPClient *self) struct in_addr tmp_addr; NMIP4Address *addr = NULL; char *str = NULL; - guint32 gwaddr = 0; + guint32 gwaddr = 0, prefix = 0; gboolean have_classless = FALSE; g_return_val_if_fail (self != NULL, NULL); @@ -716,9 +716,14 @@ ip4_options_to_config (NMDHCPClient *self) str = g_hash_table_lookup (priv->options, "new_subnet_mask"); if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { - nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr)); - g_message (" prefix %d (%s)", nm_ip4_address_get_prefix (addr), str); + prefix = nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr); + g_message (" prefix %d (%s)", prefix, str); + } else { + /* Get default netmask for the IP according to appropriate class. */ + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); + g_message (" prefix %d (default)", prefix); } + nm_ip4_address_set_prefix (addr, prefix); /* Routes: if the server returns classless static routes, we MUST ignore * the 'static_routes' option. diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c index 6211f1d9ce..dd1f914959 100644 --- a/src/tests/test-dhcp-options.c +++ b/src/tests/test-dhcp-options.c @@ -607,14 +607,76 @@ test_invalid_escaped_domain_searches (const char *client) g_hash_table_destroy (options); } -#define DHCLIENT "dhclient" -#define DHCPCD "dhcpcd" +static void +test_ip4_missing_prefix (const char *client, const char *ip, guint32 expected_prefix) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + + options = fill_table (generic_options, NULL); + g_hash_table_insert (options, "new_ip_address", string_to_byte_array_gvalue (ip)); + g_hash_table_remove (options, "new_subnet_mask"); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-ip4-missing-prefix", "failed to parse DHCP4 options"); + + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-ip4-missing-prefix", "unexpected number of IP4 addresses (not 1)"); + + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (addr != NULL, + "dhcp-ip4-missing-prefix", "missing IP4 address #1"); + + ASSERT (nm_ip4_address_get_prefix (addr) == expected_prefix, + "dhcp-ip4-missing-prefix", "unexpected IP4 address prefix %d (expected %d)", + nm_ip4_address_get_prefix (addr), expected_prefix); + + g_hash_table_destroy (options); +} + +static void +test_ip4_prefix_classless (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + + /* Ensure that the missing-subnet-mask handler doesn't mangle classless + * subnet masks at all. The handler should trigger only if the server + * doesn't send the subnet mask. + */ + + options = fill_table (generic_options, NULL); + g_hash_table_insert (options, "new_ip_address", string_to_byte_array_gvalue ("172.16.54.22")); + g_hash_table_insert (options, "new_subnet_mask", string_to_byte_array_gvalue ("255.255.252.0")); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-ip4-prefix-classless", "failed to parse DHCP4 options"); + + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-ip4-prefix-classless", "unexpected number of IP4 addresses (not 1)"); + + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (addr != NULL, + "dhcp-ip4-prefix-classless", "missing IP4 address #1"); + + ASSERT (nm_ip4_address_get_prefix (addr) == 22, + "dhcp-ip4-prefix-classless", "unexpected IP4 address prefix %d (expected 22)", + nm_ip4_address_get_prefix (addr)); + + g_hash_table_destroy (options); +} int main (int argc, char **argv) { GError *error = NULL; DBusGConnection *bus; char *base; + const char *clients[2][2] = { {DHCLIENT_PATH, "dhclient"}, {DHCPCD_PATH, "dhcpcd"} }; + guint32 i; g_type_init (); bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); @@ -623,28 +685,26 @@ int main (int argc, char **argv) FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); /* The tests */ - if (strlen (DHCLIENT_PATH)) { - test_generic_options (DHCLIENT); - test_wins_options (DHCLIENT); - test_classless_static_routes (DHCLIENT); - test_invalid_classless_routes1 (DHCLIENT); - test_invalid_classless_routes2 (DHCLIENT); - test_invalid_classless_routes3 (DHCLIENT); - test_gateway_in_classless_routes (DHCLIENT); - test_escaped_domain_searches (DHCLIENT); - test_invalid_escaped_domain_searches (DHCLIENT); - } + for (i = 0; i < 2; i++) { + const char *client_path = clients[i][0]; + const char *client = clients[i][1]; - if (strlen (DHCPCD_PATH)) { - test_generic_options (DHCPCD); - test_wins_options (DHCPCD); - test_classless_static_routes (DHCPCD); - test_invalid_classless_routes1 (DHCPCD); - test_invalid_classless_routes2 (DHCPCD); - test_invalid_classless_routes3 (DHCPCD); - test_gateway_in_classless_routes (DHCPCD); - test_escaped_domain_searches (DHCPCD); - test_invalid_escaped_domain_searches (DHCPCD); + if (!client_path || !strlen (client_path)) + continue; + + test_generic_options (client); + test_wins_options (client); + test_classless_static_routes (client); + test_invalid_classless_routes1 (client); + test_invalid_classless_routes2 (client); + test_invalid_classless_routes3 (client); + test_gateway_in_classless_routes (client); + test_escaped_domain_searches (client); + test_invalid_escaped_domain_searches (client); + test_ip4_missing_prefix (client, "192.168.1.10", 24); + test_ip4_missing_prefix (client, "172.16.54.50", 16); + test_ip4_missing_prefix (client, "10.1.2.3", 8); + test_ip4_prefix_classless (client); } base = g_path_get_basename (argv[0]); From a542bba20a88055aebf599963931429d96b916f0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Mar 2010 18:12:03 -0800 Subject: [PATCH 088/392] man: cleanups --- man/NetworkManager.8.in | 6 +----- man/NetworkManager.conf.5.in | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in index 48683902ef..2de7c262ab 100644 --- a/man/NetworkManager.8.in +++ b/man/NetworkManager.8.in @@ -87,14 +87,10 @@ in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helpe output to stdout) these can quickly help pinpoint the source of connection issues. .TP -.I "NM_SERIAL_DEBUG" -(0.7.x only) When set to anything, causes NetworkManager to log all serial -communication to and from serial devices like mobile broadband 3G modems. -.TP .I "NM_PPP_DEBUG" When set to anything, causes NetworkManager to turn on PPP debugging in pppd, which logs all PPP and PPTP frames and client/server exchanges. .SH SEE ALSO .BR nm\-tool (1), -.BR NetworkManager.conf (5), +.BR NetworkManager.conf (5). diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index 7eb48b6947..3de273846e 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -21,9 +21,8 @@ how NetworkManager handles system-wide connection settings. The location of the file may be changed through use of the "\-\-config=" argument for \fBNetworkManager\fP (8). -It is not necessary to restart NetworkManager (for version 0.8) or nm\-system\-settings -(for version 0.7) when making changes, as the configuration file is watched for changes -and reloaded automatically when necessary. +It is not necessary to restart NetworkManager when making changes, as the +configuration file is watched for changes and reloaded automatically when necessary. .SH "FILE FORMAT" .P The configuration file format is so-called key file (sort of ini-style format). From e8b5bcca560bc055a1643c97290de5a5e172582b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 2 Mar 2010 14:44:02 -0800 Subject: [PATCH 089/392] hosts: always check and update /etc/hosts if needed (rh #569914) If the hostname was changed while NM wasn't running, and thus /etc/hosts was out of sync with the new hostname, NM wouldn't make sure that the new hostname was mapped in /etc/hosts. Make sure that happens and add a bunch of testcases for /etc/hosts rewriting. --- .gitignore | 1 + src/Makefile.am | 24 ++- src/NetworkManagerPolicy.c | 251 ++++++---------------- src/nm-policy-hosts.c | 173 +++++++++++++++ src/nm-policy-hosts.h | 36 ++++ src/tests/Makefile.am | 17 +- src/tests/test-policy-hosts.c | 394 ++++++++++++++++++++++++++++++++++ 7 files changed, 708 insertions(+), 188 deletions(-) create mode 100644 src/nm-policy-hosts.c create mode 100644 src/nm-policy-hosts.h create mode 100644 src/tests/test-policy-hosts.c diff --git a/.gitignore b/.gitignore index ac036ec646..2df9a0d4b0 100644 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,7 @@ libnm-util/tests/test-general libnm-util/tests/test-need-secrets libnm-util/tests/test-setting-8021x src/tests/test-dhcp-options +src/tests/test-policy-hosts system-settings/plugins/keyfile/tests/test-keyfile system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh diff --git a/src/Makefile.am b/src/Makefile.am index a1505002bf..f0bb60b77b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,10 +30,14 @@ INCLUDES = -I${top_srcdir} \ -I${top_srcdir}/callouts ########################################### -# DHCP test library +# Test libraries ########################################### -noinst_LTLIBRARIES = libtest-dhcp.la +noinst_LTLIBRARIES = libtest-dhcp.la libtest-policy-hosts.la + +########################################### +# DHCP test library +########################################### libtest_dhcp_la_SOURCES = \ nm-ip4-config.c \ @@ -53,6 +57,20 @@ libtest_dhcp_la_LIBADD = \ $(DBUS_LIBS) \ $(LIBNL_LIBS) +########################################### +# Hosts policy test library +########################################### + +libtest_policy_hosts_la_SOURCES = \ + nm-policy-hosts.c \ + nm-policy-hosts.h + +libtest_policy_hosts_la_CPPFLAGS = \ + $(GLIB_CFLAGS) + +libtest_policy_hosts_la_LIBADD = \ + $(GLIB_LIBS) + ########################################### # NetworkManager @@ -99,6 +117,8 @@ NetworkManager_SOURCES = \ NetworkManager.c \ NetworkManagerPolicy.c \ NetworkManagerPolicy.h \ + nm-policy-hosts.c \ + nm-policy-hosts.h \ NetworkManagerUtils.c \ NetworkManagerUtils.h \ NetworkManagerSystem.c \ diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 1b7801c510..82cf26ce4d 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.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) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -41,6 +41,7 @@ #include "nm-named-manager.h" #include "nm-vpn-manager.h" #include "nm-modem.h" +#include "nm-policy-hosts.h" typedef struct LookupThread LookupThread; @@ -252,195 +253,64 @@ get_best_device (NMManager *manager, NMActRequest **out_req) return best; } -static gboolean -is_localhost_mapping (const char *str) -{ - return (!strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) && strstr (str, "localhost")); -} - -static gboolean -find_token (const char *line, const char *token) -{ - const char *start = line, *p = line; - - g_return_val_if_fail (line != NULL, FALSE); - g_return_val_if_fail (token != NULL, FALSE); - g_return_val_if_fail (strlen (token) > 0, FALSE); - - /* Walk through the line to find the next whitespace character */ - while (p <= line + strlen (line)) { - if (isblank (*p) || (*p == '\0')) { - /* Token starts with 'start' and ends with 'end' */ - if ((p > start) && *start && !strncmp (start, token, (p - start))) - return TRUE; /* found */ - - /* not found; advance start and continue looking */ - start = p + 1; - } - p++; - } - - return FALSE; -} - -#if 0 -/* Testcase for find_token; break it out and add it to the testsuite */ - -typedef struct { - const char *line; - const char *token; - gboolean expected; -} Foo; - -static Foo foo[] = { - { "127.0.0.1\tfoobar\tblah", "blah", TRUE }, - { "", "blah", FALSE }, - { "1.1.1.1\tbork\tfoo", "blah", FALSE }, - { "127.0.0.1 foobar\tblah", "blah", TRUE }, - { "127.0.0.1 foobar blah", "blah", TRUE }, - { "192.168.1.1 blah borkbork", "blah", TRUE }, - { "192.168.1.1 foobar\tblah borkbork", "blah", TRUE }, - { "192.168.1.1\tfoobar\tblah\tborkbork", "blah", TRUE }, - { "192.168.1.1 \tfoobar \tblah \tborkbork\t ", "blah", TRUE }, - { "\t\t\t\t \t\t\tasdfadf a\t\t\t\t\t \t\t\t\t\t ", "blah", FALSE }, - { NULL, NULL, FALSE } -}; - -int main(int argc, char **argv) -{ - Foo *iter = &foo[0]; - - while (iter->line) { - if (find_token (iter->line, iter->token) != iter->expected) { - g_message ("Failed: '%s' <= '%s' (%d)", iter->line, iter->token, iter->expected); - return 1; - } - iter++; - } - - g_message ("Success"); - return 0; -} -#endif - #define FALLBACK_HOSTNAME "localhost.localdomain" static gboolean -update_etc_hosts (const char *hostname) +update_etc_hosts (const char *hostname, gboolean *out_changed) { char *contents = NULL; - char **lines = NULL, **line, **host_mapping = NULL; + char **lines = NULL; GError *error = NULL; - gboolean initial_comments = TRUE; - gboolean added = FALSE; + GString *new_contents = NULL; gsize contents_len = 0; - GString *new_contents; gboolean success = FALSE; g_return_val_if_fail (hostname != NULL, FALSE); + g_return_val_if_fail (out_changed != NULL, FALSE); if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s", __func__, error ? error->code : 0, (error && error->message) ? error->message : "(unknown)"); - if (error) - g_error_free (error); - } else { - lines = g_strsplit_set (contents, "\n\r", 0); - g_free (contents); - } - - new_contents = g_string_sized_new (contents_len ? contents_len + 100 : 200); - if (!new_contents) { - nm_warning ("%s: not enough memory to update " SYSCONFDIR "/hosts", __func__); + g_clear_error (&error); return FALSE; } - /* Two-pass modification of /etc/hosts: - * - * 1) Look for a non-comment, non-localhost line that contains the current - * hostname. Mark that line. - * - * 2) For each line in the existing /etc/hosts, add it to the new /etc/hosts - * unless it starts with 127.0.0.1 and is right after the initial comments - * (if any) and contains "localhost". - */ + /* Get the new /etc/hosts contents */ + lines = g_strsplit_set (contents, "\n\r", 0); + new_contents = nm_policy_get_etc_hosts ((const char **) lines, + contents_len, + hostname, + FALLBACK_HOSTNAME, + &error); + g_strfreev (lines); + g_free (contents); - /* Find any existing hostname mapping */ - for (line = lines; lines && *line; line++) { - /* Look for any line that (a) contains the current hostname, and - * (b) does not start with '127.0.0.1' and contain 'localhost'. - */ - if ( strlen (*line) - && (*line[0] != '#') - && find_token (*line, hostname) - && !is_localhost_mapping (*line)) { - host_mapping = line; - break; - } - } + if (new_contents) { + nm_info ("Updating /etc/hosts with new system hostname"); - /* Construct the new hosts file; replace any 127.0.0.1 entry that is at the - * beginning of the file or right after initial comments and contains - * the string 'localhost'. If there is no 127.0.0.1 entry at the beginning - * or after initial comments that contains 'localhost', add one there - * and ignore any other 127.0.0.1 entries that contain 'localhost'. - */ - for (line = lines, initial_comments = TRUE; lines && *line; line++) { - gboolean add_line = TRUE; - - /* This is the first line after the initial comments */ - if (strlen (*line) && initial_comments && (*line[0] != '#')) { - initial_comments = FALSE; - - /* If some other line contained the hostname, make a simple - * localhost mapping and assume the user knows what they are doing - * with their manual hostname entry. Otherwise if the hostname - * wasn't found somewhere else, add it to the localhost mapping line - * to make sure it's mapped to something. - */ - if (host_mapping) - g_string_append (new_contents, "127.0.0.1"); - else - g_string_append_printf (new_contents, "127.0.0.1\t%s", hostname); - - if (strcmp (hostname, FALLBACK_HOSTNAME)) - g_string_append_printf (new_contents, "\t" FALLBACK_HOSTNAME); - - g_string_append (new_contents, "\tlocalhost\n"); - added = TRUE; - - /* Don't add the entry if it's supposed to be the actual localhost reverse mapping */ - if (is_localhost_mapping (*line)) - add_line = FALSE; + g_clear_error (&error); + /* And actually update /etc/hosts */ + if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { + nm_warning ("%s: couldn't update " SYSCONFDIR "/hosts: (%d) %s", + __func__, error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + success = TRUE; + *out_changed = TRUE; } - if (add_line) { - g_string_append (new_contents, *line); - /* Only append the new line if this isn't the last line in the file */ - if (*(line+1)) - g_string_append_c (new_contents, '\n'); - } - } - - /* Hmm, /etc/hosts was empty for some reason */ - if (!added) { - g_string_append (new_contents, "# Do not remove the following line, or various programs\n"); - g_string_append (new_contents, "# that require network functionality will fail.\n"); - g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost\n"); - } - - error = NULL; - if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { - nm_warning ("%s: couldn't update " SYSCONFDIR "/hosts: (%d) %s", - __func__, error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); - if (error) - g_error_free (error); - } else + g_string_free (new_contents, TRUE); + } else if (!error) { + /* No change required */ success = TRUE; + } else { + nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s", + __func__, error->code, error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } - g_string_free (new_contents, TRUE); return success; } @@ -450,6 +320,7 @@ set_system_hostname (const char *new_hostname, const char *msg) char old_hostname[HOST_NAME_MAX + 1]; int ret = 0; const char *name = new_hostname ? new_hostname : FALLBACK_HOSTNAME; + gboolean set_hostname = TRUE, changed = FALSE; old_hostname[HOST_NAME_MAX] = '\0'; errno = 0; @@ -458,30 +329,40 @@ set_system_hostname (const char *new_hostname, const char *msg) nm_warning ("%s: couldn't get the system hostname: (%d) %s", __func__, errno, strerror (errno)); } else { - /* Do nothing if the hostname isn't actually changing */ + /* Don't set the hostname if it isn't actually changing */ if ( (new_hostname && !strcmp (old_hostname, new_hostname)) || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME))) + set_hostname = FALSE; + } + + if (set_hostname) { + nm_info ("Setting system hostname to '%s' (%s)", name, msg); + ret = sethostname (name, strlen (name)); + if (ret != 0) { + nm_warning ("%s: couldn't set the system hostname to '%s': (%d) %s", + __func__, name, errno, strerror (errno)); return; - } - - nm_info ("Setting system hostname to '%s' (%s)", name, msg); - - ret = sethostname (name, strlen (name)); - if (ret == 0) { - if (!update_etc_hosts (name)) { - /* error updating /etc/hosts; fallback to localhost.localdomain */ - nm_info ("Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); - ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); - if (ret != 0) { - nm_warning ("%s: couldn't set the fallback system hostname (%s): (%d) %s", - __func__, FALLBACK_HOSTNAME, errno, strerror (errno)); - } } - nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); - } else { - nm_warning ("%s: couldn't set the system hostname to '%s': (%d) %s", - __func__, name, errno, strerror (errno)); } + + /* But still always try updating /etc/hosts just in case the hostname + * changed while NM wasn't running; we need to make sure that /etc/hosts + * has valid mappings for '127.0.0.1' and the current system hostname. If + * those exist, update_etc_hosts() will just return and won't touch + * /etc/hosts at all. + */ + if (!update_etc_hosts (name, &changed)) { + /* error updating /etc/hosts; fallback to localhost.localdomain */ + nm_info ("Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); + ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); + if (ret != 0) { + nm_warning ("%s: couldn't set the fallback system hostname (%s): (%d) %s", + __func__, FALLBACK_HOSTNAME, errno, strerror (errno)); + } + } + + if (changed) + nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); } static void diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c new file mode 100644 index 0000000000..35a0b9d60c --- /dev/null +++ b/src/nm-policy-hosts.c @@ -0,0 +1,173 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "nm-policy-hosts.h" + +gboolean +nm_policy_hosts_find_token (const char *line, const char *token) +{ + const char *start = line, *p = line; + + g_return_val_if_fail (line != NULL, FALSE); + g_return_val_if_fail (token != NULL, FALSE); + g_return_val_if_fail (strlen (token) > 0, FALSE); + + /* Walk through the line to find the next whitespace character */ + while (p <= line + strlen (line)) { + if (isblank (*p) || (*p == '\0')) { + /* Token starts with 'start' and ends with 'end' */ + if ((p > start) && *start && (p - start == strlen (token)) && !strncmp (start, token, (p - start))) + return TRUE; /* found */ + + /* not found; advance start and continue looking */ + start = p + 1; + } + p++; + } + + return FALSE; +} + +static gboolean +is_local_mapping (const char *str, const char *hostname) +{ + return ( !strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) + && nm_policy_hosts_find_token (str, hostname ? hostname : "localhost")); +} + +GString * +nm_policy_get_etc_hosts (const char **lines, + gsize existing_len, + const char *hostname, + const char *fallback_hostname, + GError **error) +{ + GString *contents = NULL; + const char **line; + gboolean found_host_nonlocal = FALSE; + gboolean found_host = FALSE; + gboolean found_localhost = FALSE; + gboolean initial_comments = TRUE; + gboolean added = FALSE; + + g_return_val_if_fail (lines != NULL, FALSE); + g_return_val_if_fail (hostname != NULL, FALSE); + + /* /etc/hosts needs at least two things: + * + * 1) current hostname mapped to any address + * 2) 'localhost' mapped to 127.0.0.1 + * + * If both these conditions exist in /etc/hosts, we don't need to bother + * updating the file. + */ + + /* Look for the two cases from above */ + for (line = lines; lines && *line; line++) { + if (strlen (*line) && (*line[0] != '#')) { + if (nm_policy_hosts_find_token (*line, hostname)) { + if (!is_local_mapping (*line, "localhost")) { + /* hostname is not on a 127.0.0.1 line or the line does not + * contain 'localhost'. + */ + found_host_nonlocal = TRUE; + } + found_host = TRUE; + } + + if (is_local_mapping (*line, "localhost")) { + /* a 127.0.0.1 line containing 'localhost' */ + found_localhost = TRUE; + } + } + + if (found_localhost && found_host) + return NULL; /* No update required */ + } + + contents = g_string_sized_new (existing_len ? existing_len + 100 : 200); + if (!contents) { + g_set_error_literal (error, 0, 0, "not enough memory"); + return NULL; + } + + /* Construct the new hosts file; replace any 127.0.0.1 entry that is at the + * beginning of the file or right after initial comments and contains + * the string 'localhost'. If there is no 127.0.0.1 entry at the beginning + * or after initial comments that contains 'localhost', add one there + * and ignore any other 127.0.0.1 entries that contain 'localhost'. + */ + for (line = lines, initial_comments = TRUE; lines && *line; line++) { + gboolean add_line = TRUE; + + /* This is the first line after the initial comments */ + if (strlen (*line) && initial_comments && (*line[0] != '#')) { + initial_comments = FALSE; + + /* If some other line contained the hostname but not 'localhost', + * make a simple localhost mapping and assume the user knows what + * they are doing with their manual hostname entry. Otherwise if + * the hostname wasn't found somewhere else, add it to the localhost + * mapping line to make sure it's mapped to something. + */ + if (found_host_nonlocal) + g_string_append (contents, "127.0.0.1"); + else + g_string_append_printf (contents, "127.0.0.1\t%s", hostname); + + if (strcmp (hostname, fallback_hostname)) { + g_string_append_printf (contents, "\t%s", fallback_hostname); + /* Don't add a standalone 'localhost.localdomain' 127 mapping */ + if (is_local_mapping (*line, fallback_hostname)) + add_line = FALSE; + } + + g_string_append (contents, "\tlocalhost\n"); + added = TRUE; + + /* Don't add the original line if it is a 'localhost' mapping */ + if (is_local_mapping (*line, "localhost")) + add_line = FALSE; + } + + if (add_line) { + g_string_append (contents, *line); + /* Only append the new line if this isn't the last line in the file */ + if (*(line+1)) + g_string_append_c (contents, '\n'); + } + } + + /* Hmm, /etc/hosts was empty for some reason */ + if (!added) { + g_string_append (contents, "# Do not remove the following line, or various programs\n"); + g_string_append (contents, "# that require network functionality will fail.\n"); + g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname); + } + + return contents; +} + diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h new file mode 100644 index 0000000000..4130ad0037 --- /dev/null +++ b/src/nm-policy-hosts.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2010 Red Hat, Inc. + */ + +#ifndef NM_POLICY_HOSTS_H +#define NM_POLICT_HOSTS_H + +#include + +GString *nm_policy_get_etc_hosts (const char **lines, + gsize existing_len, + const char *hostname, + const char *fallback_hostname, + GError **error); + +/* Only for testcases; don't use outside of nm-policy-hosts.c */ +gboolean nm_policy_hosts_find_token (const char *line, const char *token); + +#endif /* NM_POLICY_HOSTS_H */ + diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 75f9cffd59..39a994c39b 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -6,7 +6,9 @@ INCLUDES = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src -noinst_PROGRAMS = test-dhcp-options +noinst_PROGRAMS = test-dhcp-options test-policy-hosts + +####### DHCP options test ####### test_dhcp_options_SOURCES = \ test-dhcp-options.c @@ -24,10 +26,23 @@ test_dhcp_options_LDADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) +####### policy /etc/hosts test ####### + +test_policy_hosts_SOURCES = \ + test-policy-hosts.c + +test_policy_hosts_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_policy_hosts_LDADD = \ + $(top_builddir)/src/libtest-policy-hosts.la \ + $(GLIB_LIBS) + if WITH_TESTS check-local: test-dhcp-options $(abs_builddir)/test-dhcp-options + $(abs_builddir)/test-policy-hosts endif diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c new file mode 100644 index 0000000000..e14f15e5f2 --- /dev/null +++ b/src/tests/test-policy-hosts.c @@ -0,0 +1,394 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#include +#include + +#include "nm-policy-hosts.h" + +#define FALLBACK_HOSTNAME "localhost.localdomain" + +static void +test_generic (const char *before, + const char *after, + const char *hostname, + gboolean expect_error) +{ + char **lines; + GString *newc; + GError *error = NULL; + + /* Get the new /etc/hosts contents */ + lines = g_strsplit_set (before, "\n\r", 0); + newc = nm_policy_get_etc_hosts ((const char **) lines, + strlen (before), + hostname, + FALLBACK_HOSTNAME, + &error); + g_strfreev (lines); + + if (expect_error) { + g_assert (newc == NULL); + g_assert (error != NULL); + g_clear_error (&error); + } else if (after == NULL) { + /* No change to /etc/hosts required */ + g_assert (newc == NULL); + g_assert (error == NULL); + } else { + g_assert (newc != NULL); + g_assert (error == NULL); + +#if 0 + g_message ("\n--------------------------------------\n" + "%s" + "--------------------------------------", + newc->str); +#endif + g_assert (strlen (newc->str) == strlen (after)); + g_assert (strcmp (newc->str, after) == 0); + g_string_free (newc, TRUE); + } +} + +/*******************************************/ + +static const char *generic_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic (void) +{ + test_generic (generic_before, NULL, "localhost.localdomain", FALSE); +} + +/*******************************************/ + +static const char *generic_no_boilerplate_before = \ + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate (void) +{ + test_generic (generic_no_boilerplate_before, NULL, "localhost.localdomain", FALSE); +} + +/*******************************************/ + +static const char *generic_no_boilerplate_no_lh_before = \ + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *generic_no_boilerplate_no_lh_after = \ + "127.0.0.1 localhost\n" + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate_no_lh (void) +{ + test_generic (generic_no_boilerplate_no_lh_before, + generic_no_boilerplate_no_lh_after, + "localhost.localdomain", + FALSE); +} + +/*******************************************/ + + +static const char *generic_no_boilerplate_no_lh_no_host_before = \ + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *generic_no_boilerplate_no_lh_no_host_after = \ + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate_no_lh_no_host (void) +{ + test_generic (generic_no_boilerplate_no_lh_no_host_before, + generic_no_boilerplate_no_lh_no_host_after, + "comet", + FALSE); +} + +/*******************************************/ +static const char *named_generic_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 playboy localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named_generic (void) +{ + test_generic (named_generic_before, NULL, "playboy", FALSE); +} + +/*******************************************/ + +static const char *named_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static void +test_hosts_named_non127 (void) +{ + test_generic (named_non127_before, NULL, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named2_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n"; + +static void +test_hosts_named2_non127 (void) +{ + test_generic (named2_non127_before, NULL, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named_no_lh_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static const char *named_no_lh_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static void +test_hosts_named_no_localhost (void) +{ + test_generic (named_no_lh_before, named_no_lh_after, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *no_lh_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 tomcat\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *no_lh_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "127.0.0.1 tomcat\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_no_localhost (void) +{ + test_generic (no_lh_before, no_lh_after, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named_last_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 sparcbook.ausil.us\n" + "::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 sparcbook.ausil.us\n"; + +static void +test_hosts_named_last (void) +{ + test_generic (named_last_before, NULL, "sparcbook.ausil.us", FALSE); +} + +/*******************************************/ + +static const char *no_host_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + +static const char *no_host_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + +static void +test_hosts_no_host (void) +{ + test_generic (no_host_before, no_host_after, "comet", FALSE); +} + +/*******************************************/ + +static const char *long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost comet\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 adserver.adtech.de\n" + "127.0.0.1 a.as-us.falkag.net\n" + "127.0.0.1 a.as-eu.falkag.net\n" + "127.0.0.1 ads.doubleclick.com\n" + "\n" + "# random comment\n" + "127.0.0.1 m1.2mdn.net\n" + "127.0.0.1 ds.serving-sys.com\n" + "127.0.0.1 pagead2.googlesyndication.com\n" + "127.0.0.1 ad.doubleclick.com\n" + "127.0.0.1 ad.doubleclick.net\n" + "127.0.0.1 oascentral.movietickets.com\n" + "127.0.0.1 view.atdmt.com\n" + "127.0.0.1 ads.chumcity.com\n" + "127.0.0.1 ads.as4x.tmcs.net\n" + "127.0.0.1 n4403ad.doubleclick.net\n" + "127.0.0.1 www.assoc-amazon.com\n" + "127.0.0.1 s25.sitemeter.com\n" + "127.0.0.1 adlog.com.com\n" + "127.0.0.1 ahs.laptopmag.com\n" + "127.0.0.1 altfarm.mediaplex.com\n" + "127.0.0.1 ads.addynamix.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + + +static void +test_hosts_long (void) +{ + test_generic (long_before, NULL, "comet", FALSE); +} + +/*******************************************/ + +typedef struct { + const char *line; + const char *token; + gboolean expected; +} Foo; + +static Foo foo[] = { + /* Using \t here to easily differentiate tabs vs. spaces for testing */ + { "127.0.0.1\tfoobar\tblah", "blah", TRUE }, + { "", "blah", FALSE }, + { "1.1.1.1\tbork\tfoo", "blah", FALSE }, + { "127.0.0.1 foobar\tblah", "blah", TRUE }, + { "127.0.0.1 foobar blah", "blah", TRUE }, + { "127.0.0.1 localhost", "localhost.localdomain", FALSE }, + { "192.168.1.1 blah borkbork", "blah", TRUE }, + { "192.168.1.1 foobar\tblah borkbork", "blah", TRUE }, + { "192.168.1.1\tfoobar\tblah\tborkbork", "blah", TRUE }, + { "192.168.1.1 \tfoobar \tblah \tborkbork\t ", "blah", TRUE }, + { "\t\t\t\t \t\t\tasdfadf a\t\t\t\t\t \t\t\t\t\t ", "blah", FALSE }, + { NULL, NULL, FALSE } +}; + +static void +test_find_token (void) +{ + Foo *iter = &foo[0]; + + while (iter->line) { + gboolean found; + + found = nm_policy_hosts_find_token (iter->line, iter->token); + if (found != iter->expected) { + g_warning ("find-token: unexpected token result %d for '%s' <= '%s' (expected %d)", + found, iter->line, iter->token, iter->expected); + } + g_assert (found == iter->expected); + iter++; + } +} + +typedef void (*TCFunc)(void); + +#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) + +int main (int argc, char **argv) +{ + GTestSuite *suite; + + g_test_init (&argc, &argv, NULL); + + suite = g_test_get_root (); + + g_test_suite_add (suite, TESTCASE (test_find_token, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh_no_host, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_generic, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named2_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_no_localhost, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_localhost, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_last, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_host, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_long, NULL)); + + return g_test_run (); +} + From 9e627d1bced16929f3f969d5202f331ea7405f5c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 2 Mar 2010 15:06:14 -0800 Subject: [PATCH 090/392] trivial: rename some CamelCase source files to not-camel-case --- po/POTFILES.in | 2 +- src/Makefile.am | 14 +++++++------- src/backends/NetworkManagerArch.c | 2 +- src/backends/NetworkManagerDebian.c | 2 +- src/backends/NetworkManagerFrugalware.c | 2 +- src/backends/NetworkManagerGeneric.c | 2 +- src/backends/NetworkManagerGentoo.c | 2 +- src/backends/NetworkManagerMandriva.c | 2 +- src/backends/NetworkManagerPaldo.c | 2 +- src/backends/NetworkManagerPardus.c | 2 +- src/backends/NetworkManagerRedHat.c | 2 +- src/backends/NetworkManagerSlackware.c | 2 +- src/backends/NetworkManagerSuSE.c | 2 +- src/ip6-manager/nm-netlink-listener.c | 2 +- src/{NetworkManager.c => main.c} | 4 ++-- src/modem-manager/nm-modem.c | 2 +- src/named-manager/nm-named-manager.c | 2 +- src/nm-device-ethernet.c | 2 +- src/nm-device-olpc-mesh.c | 9 +++++++-- src/nm-device-wifi.c | 3 +-- src/nm-device-wifi.h | 2 +- src/nm-device.c | 3 +-- src/nm-manager.c | 2 +- src/nm-netlink-monitor.c | 2 +- src/{NetworkManagerPolicy.c => nm-policy.c} | 6 +++--- src/{NetworkManagerPolicy.h => nm-policy.h} | 0 src/{NetworkManagerSystem.c => nm-system.c} | 2 +- src/{NetworkManagerSystem.h => nm-system.h} | 0 src/{NetworkManagerAP.c => nm-wifi-ap.c} | 2 +- src/{NetworkManagerAP.h => nm-wifi-ap.h} | 0 src/vpn-manager/nm-vpn-connection.c | 2 +- 31 files changed, 43 insertions(+), 40 deletions(-) rename src/{NetworkManager.c => main.c} (99%) rename src/{NetworkManagerPolicy.c => nm-policy.c} (99%) rename src/{NetworkManagerPolicy.h => nm-policy.h} (100%) rename src/{NetworkManagerSystem.c => nm-system.c} (99%) rename src/{NetworkManagerSystem.h => nm-system.h} (100%) rename src/{NetworkManagerAP.c => nm-wifi-ap.c} (99%) rename src/{NetworkManagerAP.h => nm-wifi-ap.h} (100%) diff --git a/po/POTFILES.in b/po/POTFILES.in index 701dc795e1..99960438f9 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,7 +11,7 @@ libnm-util/crypto_gnutls.c libnm-util/crypto_nss.c libnm-util/nm-utils.c src/nm-netlink-monitor.c -src/NetworkManager.c +src/main.c src/dhcp-manager/nm-dhcp-dhclient.c src/ip6-manager/nm-netlink-listener.c src/named-manager/nm-named-manager.c diff --git a/src/Makefile.am b/src/Makefile.am index f0bb60b77b..5f81e491ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,8 +98,8 @@ NetworkManager_SOURCES = \ nm-device-cdma.h \ nm-device-gsm.c \ nm-device-gsm.h \ - NetworkManagerAP.c \ - NetworkManagerAP.h \ + nm-wifi-ap.c \ + nm-wifi-ap.h \ nm-dbus-manager.h \ nm-dbus-manager.c \ nm-udev-manager.c \ @@ -114,15 +114,15 @@ NetworkManager_SOURCES = \ nm-secrets-provider-interface.h \ nm-active-connection.h \ nm-active-connection.c \ - NetworkManager.c \ - NetworkManagerPolicy.c \ - NetworkManagerPolicy.h \ + main.c \ + nm-policy.c \ + nm-policy.h \ nm-policy-hosts.c \ nm-policy-hosts.h \ NetworkManagerUtils.c \ NetworkManagerUtils.h \ - NetworkManagerSystem.c \ - NetworkManagerSystem.h \ + nm-system.c \ + nm-system.h \ nm-logging.c \ nm-logging.h \ nm-manager.c \ diff --git a/src/backends/NetworkManagerArch.c b/src/backends/NetworkManagerArch.c index 3ed5677e87..c70e24593c 100644 --- a/src/backends/NetworkManagerArch.c +++ b/src/backends/NetworkManagerArch.c @@ -40,7 +40,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" /* diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c index 2f6abd1285..cba1363f3a 100644 --- a/src/backends/NetworkManagerDebian.c +++ b/src/backends/NetworkManagerDebian.c @@ -32,7 +32,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" diff --git a/src/backends/NetworkManagerFrugalware.c b/src/backends/NetworkManagerFrugalware.c index 492bf19399..dfe62921c0 100644 --- a/src/backends/NetworkManagerFrugalware.c +++ b/src/backends/NetworkManagerFrugalware.c @@ -27,7 +27,7 @@ #include #include -#include "NetworkManagerSystem.h" +#include "nm-system.h" /* Provided by the frugalwareutils package on Frugalware */ #include diff --git a/src/backends/NetworkManagerGeneric.c b/src/backends/NetworkManagerGeneric.c index 7984f2c02d..26076fa678 100644 --- a/src/backends/NetworkManagerGeneric.c +++ b/src/backends/NetworkManagerGeneric.c @@ -33,7 +33,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-netlink.h" #include "nm-utils.h" diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index aa4b40c373..8616941f1a 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -32,7 +32,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" diff --git a/src/backends/NetworkManagerMandriva.c b/src/backends/NetworkManagerMandriva.c index 527a25d896..8209ff4fe6 100644 --- a/src/backends/NetworkManagerMandriva.c +++ b/src/backends/NetworkManagerMandriva.c @@ -30,7 +30,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" /* diff --git a/src/backends/NetworkManagerPaldo.c b/src/backends/NetworkManagerPaldo.c index 0147a3b0e4..777d4e23e1 100644 --- a/src/backends/NetworkManagerPaldo.c +++ b/src/backends/NetworkManagerPaldo.c @@ -31,7 +31,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" diff --git a/src/backends/NetworkManagerPardus.c b/src/backends/NetworkManagerPardus.c index 52703e23d2..d952cf3657 100644 --- a/src/backends/NetworkManagerPardus.c +++ b/src/backends/NetworkManagerPardus.c @@ -29,7 +29,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" /* * nm_system_enable_loopback diff --git a/src/backends/NetworkManagerRedHat.c b/src/backends/NetworkManagerRedHat.c index 1e3f7e9652..954e58a865 100644 --- a/src/backends/NetworkManagerRedHat.c +++ b/src/backends/NetworkManagerRedHat.c @@ -28,7 +28,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" /* diff --git a/src/backends/NetworkManagerSlackware.c b/src/backends/NetworkManagerSlackware.c index 8d7c5bf294..a35e1bb628 100644 --- a/src/backends/NetworkManagerSlackware.c +++ b/src/backends/NetworkManagerSlackware.c @@ -29,7 +29,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" /* * nm_system_enable_loopback diff --git a/src/backends/NetworkManagerSuSE.c b/src/backends/NetworkManagerSuSE.c index a0cd1cb105..ef4ff15b37 100644 --- a/src/backends/NetworkManagerSuSE.c +++ b/src/backends/NetworkManagerSuSE.c @@ -32,7 +32,7 @@ #include #include "NetworkManagerGeneric.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" diff --git a/src/ip6-manager/nm-netlink-listener.c b/src/ip6-manager/nm-netlink-listener.c index bfcc22f630..ea7462c308 100644 --- a/src/ip6-manager/nm-netlink-listener.c +++ b/src/ip6-manager/nm-netlink-listener.c @@ -43,7 +43,7 @@ #include #include "NetworkManager.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-netlink-listener.h" #include "nm-utils.h" #include "nm-marshal.h" diff --git a/src/NetworkManager.c b/src/main.c similarity index 99% rename from src/NetworkManager.c rename to src/main.c index 17a96a9d16..5f500c1ac0 100644 --- a/src/NetworkManager.c +++ b/src/main.c @@ -43,8 +43,8 @@ #include "nm-utils.h" #include "NetworkManagerUtils.h" #include "nm-manager.h" -#include "NetworkManagerPolicy.h" -#include "NetworkManagerSystem.h" +#include "nm-policy.h" +#include "nm-system.h" #include "nm-named-manager.h" #include "nm-dbus-manager.h" #include "nm-supplicant-manager.h" diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 40a76b1db5..33acc0ccde 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -21,7 +21,7 @@ #include #include "nm-modem.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-dbus-manager.h" #include "nm-setting-connection.h" #include "nm-marshal.h" diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index c96a2e691b..2d4a132b78 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -39,7 +39,7 @@ #include "nm-named-manager.h" #include "nm-ip4-config.h" #include "nm-utils.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "NetworkManagerUtils.h" #ifdef HAVE_SELINUX diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index f20afcc45c..abc282c6f0 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -45,7 +45,7 @@ #include "nm-supplicant-config.h" #include "nm-netlink.h" #include "nm-netlink-monitor.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-setting-connection.h" #include "nm-setting-wired.h" #include "nm-setting-8021x.h" diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 8be4632c11..2a1a235330 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -43,14 +43,17 @@ #include "nm-device-private.h" #include "nm-utils.h" #include "NetworkManagerUtils.h" -#include "NetworkManagerPolicy.h" #include "nm-activation-request.h" #include "nm-properties-changed-signal.h" #include "nm-setting-connection.h" #include "nm-setting-olpc-mesh.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-manager.h" +/* This is a bug; but we can't really change API now... */ +#include "NetworkManagerVPN.h" + + #include "nm-device-olpc-mesh-glue.h" static void nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid); @@ -585,6 +588,7 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) /* disconnect companion device, if it is connected */ if (nm_device_get_act_request (NM_DEVICE (priv->companion))) { nm_warning ("disconnecting companion device"); + /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ nm_device_state_changed (NM_DEVICE (priv->companion), NM_DEVICE_STATE_DISCONNECTED, NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); @@ -822,6 +826,7 @@ companion_state_changed_cb (NMDeviceWifi *companion, return; nm_debug ("disconnecting mesh due to companion connectivity"); + /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index e44ac96cd6..aa03063760 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -39,7 +39,6 @@ #include "nm-utils.h" #include "nm-marshal.h" #include "NetworkManagerUtils.h" -#include "NetworkManagerPolicy.h" #include "nm-activation-request.h" #include "nm-supplicant-manager.h" #include "nm-supplicant-interface.h" @@ -51,7 +50,7 @@ #include "nm-setting-8021x.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" static gboolean impl_device_get_access_points (NMDeviceWifi *device, GPtrArray **aps, diff --git a/src/nm-device-wifi.h b/src/nm-device-wifi.h index c793844c5c..45b573a03c 100644 --- a/src/nm-device-wifi.h +++ b/src/nm-device-wifi.h @@ -28,7 +28,7 @@ #include "nm-rfkill.h" #include "nm-device.h" -#include "NetworkManagerAP.h" +#include "nm-wifi-ap.h" struct NMAccessPointList; diff --git a/src/nm-device.c b/src/nm-device.c index 7a2f83d96f..6ffa8ac63d 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -38,9 +38,8 @@ #include "nm-device-interface.h" #include "nm-device.h" #include "nm-device-private.h" -#include "NetworkManagerPolicy.h" #include "NetworkManagerUtils.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-dhcp-manager.h" #include "nm-dbus-manager.h" #include "nm-named-manager.h" diff --git a/src/nm-manager.c b/src/nm-manager.c index f49c670b2c..acf0f30ed6 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -39,7 +39,7 @@ #include "nm-device-olpc-mesh.h" #include "nm-device-cdma.h" #include "nm-device-gsm.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-properties-changed-signal.h" #include "nm-setting-bluetooth.h" #include "nm-setting-connection.h" diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 2c3987c3d5..04f87b4b1d 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -41,7 +41,7 @@ #include #include "NetworkManager.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-netlink-monitor.h" #include "nm-utils.h" #include "nm-marshal.h" diff --git a/src/NetworkManagerPolicy.c b/src/nm-policy.c similarity index 99% rename from src/NetworkManagerPolicy.c rename to src/nm-policy.c index 82cf26ce4d..702d3dc709 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/nm-policy.c @@ -25,9 +25,9 @@ #include #include -#include "NetworkManagerPolicy.h" +#include "nm-policy.h" #include "NetworkManagerUtils.h" -#include "NetworkManagerAP.h" +#include "nm-wifi-ap.h" #include "nm-activation-request.h" #include "nm-utils.h" #include "nm-device-interface.h" @@ -37,7 +37,7 @@ #include "nm-dbus-manager.h" #include "nm-setting-ip4-config.h" #include "nm-setting-connection.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-named-manager.h" #include "nm-vpn-manager.h" #include "nm-modem.h" diff --git a/src/NetworkManagerPolicy.h b/src/nm-policy.h similarity index 100% rename from src/NetworkManagerPolicy.h rename to src/nm-policy.h diff --git a/src/NetworkManagerSystem.c b/src/nm-system.c similarity index 99% rename from src/NetworkManagerSystem.c rename to src/nm-system.c index c514a221e7..78a3381eb0 100644 --- a/src/NetworkManagerSystem.c +++ b/src/nm-system.c @@ -42,7 +42,7 @@ #include #include -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-device.h" #include "nm-named-manager.h" #include "NetworkManagerUtils.h" diff --git a/src/NetworkManagerSystem.h b/src/nm-system.h similarity index 100% rename from src/NetworkManagerSystem.h rename to src/nm-system.h diff --git a/src/NetworkManagerAP.c b/src/nm-wifi-ap.c similarity index 99% rename from src/NetworkManagerAP.c rename to src/nm-wifi-ap.c index 9b95924144..f3365176ad 100644 --- a/src/NetworkManagerAP.c +++ b/src/nm-wifi-ap.c @@ -23,7 +23,7 @@ #include -#include "NetworkManagerAP.h" +#include "nm-wifi-ap.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" #include "nm-dbus-manager.h" diff --git a/src/NetworkManagerAP.h b/src/nm-wifi-ap.h similarity index 100% rename from src/NetworkManagerAP.h rename to src/nm-wifi-ap.h diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index f8360dc669..01bd23c578 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -35,7 +35,7 @@ #include "nm-setting-ip4-config.h" #include "nm-dbus-manager.h" #include "nm-manager.h" -#include "NetworkManagerSystem.h" +#include "nm-system.h" #include "nm-utils.h" #include "nm-vpn-plugin-bindings.h" #include "nm-marshal.h" From bfe58b26fbf80ad50bfe426f3b2e7f29c2f20f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 3 Mar 2010 09:57:28 +0100 Subject: [PATCH 091/392] trivial: replace NetworkManager.c occurence after renaming to main.c --- autogen.sh | 2 +- src/dhcp-manager/nm-dhcp-manager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 74543732da..213fb08329 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,7 +7,7 @@ REQUIRED_AUTOMAKE_VERSION=1.9 PKG_NAME=NetworkManager (test -f $srcdir/configure.ac \ - && test -f $srcdir/src/NetworkManager.c) || { + && test -f $srcdir/src/main.c) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level $PKG_NAME directory" exit 1 diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 648f4cd0dd..df78f1885a 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -80,7 +80,7 @@ NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client GHashTable *options, const char *reason); -/* Only for NetworkManager.c */ +/* Only for main.c */ NMDHCPManager *nm_dhcp_manager_new (const char *client, GError **error); #endif /* NM_DHCP_MANAGER_H */ From dbacb05d2a8bd0f8123c4a528e135573dbe5a5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 3 Mar 2010 10:11:11 +0100 Subject: [PATCH 092/392] core: fix GErrors pileup --- src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 5f500c1ac0..7b881b1471 100644 --- a/src/main.c +++ b/src/main.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) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -525,6 +525,7 @@ main (int argc, char *argv[]) (error && error->message) ? error->message : "unknown"); g_free (config); config = NULL; + g_clear_error (&error); /* Not a hard failure */ } } @@ -539,6 +540,7 @@ main (int argc, char *argv[]) (error && error->message) ? error->message : "unknown"); g_free (config); config = NULL; + g_clear_error (&error); /* Not a hard failure */ } } @@ -548,14 +550,13 @@ main (int argc, char *argv[]) plugins = plugins ? plugins : g_strdup (conf_plugins); g_free (conf_plugins); - g_clear_error (&error); - /* Parse the state file */ if (!parse_state_file (state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &error)) { g_warning ("State file %s parsing failed: (%d) %s.", state_file, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); + g_clear_error (&error); /* Not a hard failure */ } From 798d68caa4ad331029f529bf00ac5e2f089bda23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Sat, 6 Mar 2010 00:07:06 -0800 Subject: [PATCH 093/392] dhcp: more intelligent default DHCP client detection --- src/dhcp-manager/nm-dhcp-manager.c | 14 ++++++++++++++ src/main.c | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 241199f401..374c663681 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -251,6 +251,20 @@ nm_dhcp_manager_new (const char *client, GError **error) NMDHCPManagerPrivate *priv; DBusGConnection *g_connection; + /* Set some defaults based on build-time options */ + if (!client) { + if (strlen (DHCLIENT_PATH) && g_file_test (DHCLIENT_PATH, G_FILE_TEST_EXISTS)) + client = "dhclient"; + else if (strlen (DHCPCD_PATH) && g_file_test (DHCPCD_PATH, G_FILE_TEST_EXISTS)) + client = "dhcpcd"; + else { + g_set_error_literal (error, 0, 0, + "no suitable DHCP client; see 'man NetworkManager'" + " to specify one."); + return NULL; + } + } + g_warn_if_fail (singleton == NULL); g_return_val_if_fail (client != NULL, NULL); diff --git a/src/main.c b/src/main.c index 7b881b1471..c705cb8d50 100644 --- a/src/main.c +++ b/src/main.c @@ -652,7 +652,8 @@ main (int argc, char *argv[]) goto done; } - dhcp_mgr = nm_dhcp_manager_new (dhcp ? dhcp : "dhclient", &error); + /* Initialize DHCP manager */ + dhcp_mgr = nm_dhcp_manager_new (dhcp, &error); if (!dhcp_mgr) { nm_warning ("Failed to start the DHCP manager: %s.", error->message); goto done; From 3abf5f30bfdd09deb0c31b062c1a98f8875fe09d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 6 Mar 2010 00:18:28 -0800 Subject: [PATCH 094/392] system-settings: fix plugins for /etc/NetworkManager/NetworkManager.conf --- system-settings/plugins/ifupdown/plugin.c | 15 ++++++++++--- system-settings/plugins/keyfile/plugin.c | 27 +++++++++++++++-------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index d725bd90e2..e2358b9f51 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -59,7 +59,9 @@ #define IFUPDOWN_PLUGIN_INFO "(C) 2008 Canonical Ltd. To report bugs please use the NetworkManager mailing list." #define IFUPDOWN_SYSTEM_HOSTNAME_FILE "/etc/hostname" -#define IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" +#define IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" +#define IFUPDOWN_OLD_SYSTEM_SETTINGS_KEY_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" + #define IFUPDOWN_KEY_FILE_GROUP "ifupdown" #define IFUPDOWN_KEY_FILE_KEY_MANAGED "managed" #define IFUPDOWN_UNMANAGE_WELL_KNOWN_DEFAULT TRUE @@ -78,6 +80,7 @@ typedef struct { GHashTable *well_known_interfaces; GHashTable *well_known_ifaces; gboolean unmanage_well_known; + const char *conf_file; gulong inotify_event_id; int inotify_system_hostname_wd; @@ -403,13 +406,19 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) g_list_free (keys); g_hash_table_destroy (auto_ifaces); + /* Find the config file */ + if (g_file_test (IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE, G_FILE_TEST_EXISTS)) + priv->conf_file = IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE; + else + priv->conf_file = IFUPDOWN_OLD_SYSTEM_SETTINGS_KEY_FILE; + keyfile = g_key_file_new (); if (!g_key_file_load_from_file (keyfile, - IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE, + priv->conf_file, G_KEY_FILE_NONE, &error)) { nm_info ("loading system config file (%s) caused error: (%d) %s", - IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE, + priv->conf_file, error ? error->code : -1, error && error->message ? error->message : "(unknown)"); } else { diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 40f0960ff8..36f47ccdc5 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -42,7 +42,8 @@ #define KEYFILE_PLUGIN_NAME "keyfile" #define KEYFILE_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." -#define CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" +#define CONF_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" +#define OLD_CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" static char *plugin_get_hostname (SCPluginKeyfile *plugin); static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); @@ -59,6 +60,7 @@ typedef struct { GFileMonitor *monitor; guint monitor_id; + const char *conf_file; GFileMonitor *conf_file_monitor; guint conf_file_monitor_id; @@ -297,7 +299,7 @@ setup_monitoring (NMSystemConfigInterface *config) priv->monitor = monitor; } - file = g_file_new_for_path (CONF_FILE); + file = g_file_new_for_path (priv->conf_file); monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); g_object_unref (file); @@ -344,12 +346,13 @@ add_connection (NMSystemConfigInterface *config, static GSList * get_unmanaged_specs (NMSystemConfigInterface *config) { + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); GKeyFile *key_file; GSList *specs = NULL; GError *error = NULL; key_file = g_key_file_new (); - if (g_key_file_load_from_file (key_file, CONF_FILE, G_KEY_FILE_NONE, &error)) { + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) { char *str; str = g_key_file_get_value (key_file, "keyfile", "unmanaged-devices", NULL); @@ -366,7 +369,7 @@ get_unmanaged_specs (NMSystemConfigInterface *config) g_free (udis); /* Yes, g_free, not g_strfreev because we need the strings in the list */ } } else { - g_warning ("Error parsing file '%s': %s", CONF_FILE, error->message); + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); g_error_free (error); } @@ -378,15 +381,16 @@ get_unmanaged_specs (NMSystemConfigInterface *config) static char * plugin_get_hostname (SCPluginKeyfile *plugin) { + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (plugin); GKeyFile *key_file; char *hostname = NULL; GError *error = NULL; key_file = g_key_file_new (); - if (g_key_file_load_from_file (key_file, CONF_FILE, G_KEY_FILE_NONE, &error)) + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) hostname = g_key_file_get_value (key_file, "keyfile", "hostname", NULL); else { - g_warning ("Error parsing file '%s': %s", CONF_FILE, error->message); + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); g_error_free (error); } @@ -404,7 +408,7 @@ plugin_set_hostname (SCPluginKeyfile *plugin, const char *hostname) gboolean result = FALSE; key_file = g_key_file_new (); - if (g_key_file_load_from_file (key_file, CONF_FILE, G_KEY_FILE_NONE, &error)) { + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) { char *data; gsize len; @@ -412,7 +416,7 @@ plugin_set_hostname (SCPluginKeyfile *plugin, const char *hostname) data = g_key_file_to_data (key_file, &len, &error); if (data) { - g_file_set_contents (CONF_FILE, data, len, &error); + g_file_set_contents (priv->conf_file, data, len, &error); g_free (data); g_free (priv->hostname); @@ -425,7 +429,7 @@ plugin_set_hostname (SCPluginKeyfile *plugin, const char *hostname) g_error_free (error); } } else { - g_warning ("Error parsing file '%s': %s", CONF_FILE, error->message); + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); g_error_free (error); } @@ -441,6 +445,11 @@ sc_plugin_keyfile_init (SCPluginKeyfile *plugin) { SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (plugin); + if (g_file_test (CONF_FILE, G_FILE_TEST_EXISTS)) + priv->conf_file = CONF_FILE; + else + priv->conf_file = OLD_CONF_FILE; + priv->hostname = plugin_get_hostname (plugin); } From f97c0369c0b8e977876d51c91d36f03f926ce6b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 8 Mar 2010 10:59:16 +0100 Subject: [PATCH 095/392] doc: fix a typo --- libnm-util/nm-setting-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index 1dedad3b72..65f613eba9 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -434,7 +434,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) "(ie, contains only hexadecimal characters and '-'). " "The UUID should be assigned when the connection is " "created and never changed as long as the connection " - "stilla pplies to the same network. For example, " + "still applies to the same network. For example, " "it should not be changed when the user changes the " "connection's 'id', but should be recreated when the " "WiFi SSID, mobile broadband network provider, or the " From 639ae507e136b802113f431703700244fa0a0aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 9 Mar 2010 11:10:58 +0100 Subject: [PATCH 096/392] keyfile: don't free GError when it's NULL (after connection's successful update) --- system-settings/plugins/keyfile/nm-keyfile-connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index b64c2f906e..ed56d69d2e 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -88,7 +88,8 @@ update (NMSettingsConnectionInterface *connection, success = parent_settings_connection_iface->update (connection, callback, user_data); } else { callback (connection, error, user_data); - g_error_free (error); + if (error) + g_error_free (error); g_free (filename); } From 9c9898091a461f5facaf63b1b6d02586d8edc7ff Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Mar 2010 09:18:08 -0800 Subject: [PATCH 097/392] libnm-glib: deprecate original libnm_glib bits Been trying to move people off them for a long time, this makes it official. --- libnm-glib/Makefile.am | 29 ++++++++++++++++++++++++++--- libnm-glib/libnm_glib.h | 16 ++++++++-------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index c177fa3cb7..56192c4c70 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -23,6 +23,30 @@ BUILT_SOURCES = \ nm-ip6-config-bindings.h \ nm-dhcp6-config-bindings.h +##################################################### +# Deprecated original libnm_glib bits +##################################################### + +noinst_LTLIBRARIES = libdeprecated-nm-glib.la + +libdeprecated_nm_glib_la_SOURCES = \ + libnm_glib.h \ + libnm_glib.c + +libdeprecated_nm_glib_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -Wno-deprecated-declarations \ + -Wno-deprecated + +libdeprecated_nm_glib_la_LIBADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +##################################################### +# Real libnm-glib stuff +##################################################### + lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la libnm_glib_la_CFLAGS = \ @@ -64,7 +88,6 @@ libnminclude_HEADERS = \ nm-settings-service.h libnm_glib_la_SOURCES = \ - libnm_glib.c \ nm-object.c \ nm-object-private.h \ nm-client.c \ @@ -102,6 +125,7 @@ libnm_glib_la_SOURCES = \ libnm_glib_la_LIBADD = \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/marshallers/libmarshallers.la \ + $(builddir)/libdeprecated-nm-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(GCONF_LIBS) \ @@ -185,5 +209,4 @@ DISTCLEANFILES = libnm-glib.pc libnm-glib.pc EXTRA_DIST = libnm-glib.pc.in libnm-glib-vpn.pc.in libnm-glib.ver libnm-glib-vpn.ver -CLEANFILES = \ - $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) diff --git a/libnm-glib/libnm_glib.h b/libnm-glib/libnm_glib.h index fa3c812a57..01c055d01d 100644 --- a/libnm-glib/libnm_glib.h +++ b/libnm-glib/libnm_glib.h @@ -37,21 +37,21 @@ typedef enum libnm_glib_state LIBNM_NO_NETWORK_CONNECTION, LIBNM_ACTIVE_NETWORK_CONNECTION, LIBNM_INVALID_CONTEXT -} libnm_glib_state; +} libnm_glib_state G_GNUC_DEPRECATED; -typedef struct libnm_glib_ctx libnm_glib_ctx; +typedef struct libnm_glib_ctx libnm_glib_ctx G_GNUC_DEPRECATED; -typedef void (*libnm_glib_callback_func) (libnm_glib_ctx *libnm_ctx, gpointer user_data); +typedef void (*libnm_glib_callback_func) (libnm_glib_ctx *libnm_ctx, gpointer user_data) G_GNUC_DEPRECATED; -libnm_glib_ctx *libnm_glib_init (void); -void libnm_glib_shutdown (libnm_glib_ctx *ctx); +G_GNUC_DEPRECATED libnm_glib_ctx * libnm_glib_init (void); +G_GNUC_DEPRECATED void libnm_glib_shutdown (libnm_glib_ctx *ctx); -libnm_glib_state libnm_glib_get_network_state (const libnm_glib_ctx *ctx); +G_GNUC_DEPRECATED libnm_glib_state libnm_glib_get_network_state (const libnm_glib_ctx *ctx); -guint libnm_glib_register_callback (libnm_glib_ctx *ctx, libnm_glib_callback_func func, gpointer user_data, GMainContext *g_main_ctx); -void libnm_glib_unregister_callback (libnm_glib_ctx *ctx, guint id); +G_GNUC_DEPRECATED guint libnm_glib_register_callback (libnm_glib_ctx *ctx, libnm_glib_callback_func func, gpointer user_data, GMainContext *g_main_ctx); +G_GNUC_DEPRECATED void libnm_glib_unregister_callback (libnm_glib_ctx *ctx, guint id); G_END_DECLS From d0c792d59842abac896587191b15a3250dbc5ff3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Mar 2010 11:19:26 -0800 Subject: [PATCH 098/392] build: fix build of old libnm_glib stuff after 9c9898091a461f5facaf63b1b6d02586d8edc7ff --- test/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Makefile.am b/test/Makefile.am index 9a07f91564..8e235e4322 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -28,6 +28,9 @@ nm_online_LDADD = \ $(GLIB_LIBS) libnm_glib_test_SOURCES = libnm-glib-test.c +libnm_glib_test_CFLAGS = \ + -Wno-deprecated-declarations \ + -Wno-deprecated libnm_glib_test_LDADD = \ $(top_builddir)/libnm-glib/libnm-glib.la \ $(top_builddir)/libnm-util/libnm-util.la \ From 308e9110aeb32939d3f54cb9f97e3bef983d9ca0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Mar 2010 11:25:14 -0800 Subject: [PATCH 099/392] modem: log disconnect errors --- src/modem-manager/nm-modem.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 33acc0ccde..4ce4c9ee48 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -673,6 +673,19 @@ nm_modem_deactivate_quickly (NMModem *self, NMDevice *device) NM_MODEM_GET_CLASS (self)->deactivate_quickly (self, device); } +static void +disconnect_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + GError *error = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { + g_warning ("%s: disconnect failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } +} + void nm_modem_device_state_changed (NMModem *self, NMDeviceState new_state, @@ -698,9 +711,12 @@ nm_modem_device_state_changed (NMModem *self, case NM_DEVICE_STATE_FAILED: case NM_DEVICE_STATE_DISCONNECTED: if (was_connected) { - dbus_g_proxy_call_no_reply (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), - "Disconnect", - G_TYPE_INVALID); + dbus_g_proxy_begin_call (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), + "Disconnect", + disconnect_done, + self, + NULL, + G_TYPE_INVALID); } break; default: From f46a601022291b9ea66a7c0ad5bfa9f35d82c095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 12 Mar 2010 10:49:59 +0100 Subject: [PATCH 100/392] libnm-glib-test: fix crash when a VPN connection is active and print its base connection --- libnm-glib/libnm-glib-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c index ed296015cf..3ac0a24cd7 100644 --- a/libnm-glib/libnm-glib-test.c +++ b/libnm-glib/libnm-glib-test.c @@ -36,6 +36,7 @@ #include "nm-device-wifi.h" #include "nm-utils.h" #include "nm-active-connection.h" +#include "nm-vpn-connection.h" #include "nm-setting-ip4-config.h" static gboolean @@ -291,8 +292,10 @@ active_connections_changed (NMClient *client, GParamSpec *pspec, gpointer user_d connection = g_ptr_array_index (connections, i); g_print (" %s\n", nm_object_get_path (NM_OBJECT (connection))); devices = nm_active_connection_get_devices (connection); - for (j = 0; j < devices->len; j++) + for (j = 0; devices && j < devices->len; j++) g_print (" %s\n", nm_device_get_udi (g_ptr_array_index (devices, j))); + if (NM_IS_VPN_CONNECTION (connection)) + g_print (" VPN base connection: %s\n", nm_active_connection_get_specific_object (connection)); } } From 15351042bad7330d683417916a71194a5f5eb964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 12 Mar 2010 11:03:14 +0100 Subject: [PATCH 101/392] libnm-glib: add 'vpn-state' and 'banner' properties to NMVPNConnection class Without these properties, the errors like these occured: WARNING **: handle_property_changed: property 'vpn-state' changed but wasn't defined by object type NMVPNConnection. --- libnm-glib/Makefile.am | 2 +- libnm-glib/nm-vpn-connection.c | 71 +++++++++++++++++++++++++++++++--- libnm-glib/nm-vpn-connection.h | 5 ++- 3 files changed, 71 insertions(+), 7 deletions(-) diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 56192c4c70..58b5bc559e 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "4:0:2" + -version-info "4:1:2" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c index f66ed1960a..6910b6f63c 100644 --- a/libnm-glib/nm-vpn-connection.c +++ b/libnm-glib/nm-vpn-connection.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -40,6 +40,17 @@ typedef struct { NMVPNConnectionState vpn_state; } NMVPNConnectionPrivate; +enum { + PROP_0, + PROP_VPN_STATE, + PROP_BANNER, + + LAST_PROP +}; + +#define DBUS_PROP_VPN_STATE "VpnState" +#define DBUS_PROP_BANNER "Banner" + enum { VPN_STATE_CHANGED, @@ -74,8 +85,8 @@ nm_vpn_connection_get_banner (NMVPNConnection *vpn) if (!priv->banner) { priv->banner = _nm_object_get_string_property (NM_OBJECT (vpn), - NM_DBUS_INTERFACE_VPN_CONNECTION, - "Banner"); + NM_DBUS_INTERFACE_VPN_CONNECTION, + DBUS_PROP_BANNER); if (priv->banner && !strlen (priv->banner)) { g_free (priv->banner); priv->banner = NULL; @@ -94,8 +105,8 @@ nm_vpn_connection_get_vpn_state (NMVPNConnection *vpn) priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn); if (priv->vpn_state == NM_VPN_CONNECTION_STATE_UNKNOWN) { priv->vpn_state = _nm_object_get_uint_property (NM_OBJECT (vpn), - NM_DBUS_INTERFACE_VPN_CONNECTION, - "VpnState"); + NM_DBUS_INTERFACE_VPN_CONNECTION, + DBUS_PROP_VPN_STATE); } return priv->vpn_state; } @@ -172,6 +183,27 @@ finalize (GObject *object) G_OBJECT_CLASS (nm_vpn_connection_parent_class)->finalize (object); } +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMVPNConnection *self = NM_VPN_CONNECTION (object); + + switch (prop_id) { + case PROP_VPN_STATE: + g_value_set_uint (value, nm_vpn_connection_get_vpn_state (self)); + break; + case PROP_BANNER: + g_value_set_string (value, nm_vpn_connection_get_banner (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static void nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) { @@ -181,8 +213,37 @@ nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) /* virtual methods */ object_class->constructor = constructor; + object_class->get_property = get_property; object_class->finalize = finalize; + /* properties */ + + /** + * NMVPNConnection:vpn-state: + * + * The VPN state of the active VPN connection. + **/ + g_object_class_install_property (object_class, PROP_VPN_STATE, + g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, + "VpnState", + "Current VPN state", + NM_VPN_CONNECTION_STATE_UNKNOWN, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + + /** + * NMVPNConnection:banner: + * + * The VPN login banner of the active VPN connection. + **/ + g_object_class_install_property (object_class, PROP_BANNER, + g_param_spec_string (NM_VPN_CONNECTION_BANNER, + "Banner", + "Login Banner", + NULL, + G_PARAM_READABLE)); + /* signals */ signals[VPN_STATE_CHANGED] = g_signal_new ("vpn-state-changed", diff --git a/libnm-glib/nm-vpn-connection.h b/libnm-glib/nm-vpn-connection.h index 122a85b5cc..e03a80c77a 100644 --- a/libnm-glib/nm-vpn-connection.h +++ b/libnm-glib/nm-vpn-connection.h @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_VPN_CONNECTION_H @@ -39,6 +39,9 @@ G_BEGIN_DECLS #define NM_IS_VPN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_CONNECTION)) #define NM_VPN_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnectionClass)) +#define NM_VPN_CONNECTION_VPN_STATE "vpn-state" +#define NM_VPN_CONNECTION_BANNER "banner" + typedef struct { NMActiveConnection parent; } NMVPNConnection; From 4af1cc2661020675c0fb04fa647fb61361fd4af6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 16 Mar 2010 23:51:55 -0700 Subject: [PATCH 102/392] utils: add boolean value hash helper --- src/NetworkManagerUtils.c | 14 ++++++++++++++ src/NetworkManagerUtils.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 4934d465c6..100ccd363d 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -553,6 +553,20 @@ value_hash_add_uint (GHashTable *hash, value_hash_add (hash, key, value); } +void +value_hash_add_bool (GHashTable *hash, + const char *key, + gboolean val) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_BOOLEAN); + g_value_set_boolean (value, val); + + value_hash_add (hash, key, value); +} + gboolean nm_utils_do_sysctl (const char *path, const char *value) { diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 05f3b837a3..fa8b598db2 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -67,6 +67,10 @@ void value_hash_add_uint (GHashTable *hash, const char *key, guint32 val); +void value_hash_add_bool (GHashTable *hash, + const char *key, + gboolean val); + gboolean nm_utils_do_sysctl (const char *path, const char *value); #endif /* NETWORK_MANAGER_UTILS_H */ From d92400332025166ee7fc25111cd0d4e0e45062ba Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 16 Mar 2010 23:52:37 -0700 Subject: [PATCH 103/392] libnm-util: add nm_setting_gsm_get_home_only() For roaming control. --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 1 + libnm-util/nm-setting-gsm.c | 38 +++++++++++++++++++++++++++++++++++-- libnm-util/nm-setting-gsm.h | 5 ++++- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 55db3313c0..707b63cb37 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "3:0:2" + -version-info "4:0:3" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 3307b92ac1..bc64e1b64a 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -135,6 +135,7 @@ global: nm_setting_gsm_get_band; nm_setting_gsm_get_pin; nm_setting_gsm_get_puk; + nm_setting_gsm_get_home_only; nm_setting_ip4_config_error_get_type; nm_setting_ip4_config_error_quark; nm_setting_ip4_config_get_type; diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 626d2196cf..4b4560cd6d 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -80,6 +80,8 @@ typedef struct { guint32 allowed_bands; /* A bitfield of NM_SETTING_GSM_BAND_* */ char *pin; + + gboolean home_only; } NMSettingGsmPrivate; enum { @@ -94,6 +96,7 @@ enum { PROP_PIN, PROP_PUK, PROP_ALLOWED_BANDS, + PROP_HOME_ONLY, LAST_PROP }; @@ -191,6 +194,14 @@ nm_setting_gsm_get_puk (NMSettingGsm *setting) return NULL; } +gboolean +nm_setting_gsm_get_home_only (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->home_only; +} + static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -356,6 +367,9 @@ set_property (GObject *object, guint prop_id, if (str && strlen (str)) g_warning ("Tried to set deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_PUK); break; + case PROP_HOME_ONLY: + priv->home_only = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -401,6 +415,9 @@ get_property (GObject *object, guint prop_id, /* deprecated */ g_value_set_int (value, -1); break; + case PROP_HOME_ONLY: + g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -572,7 +589,8 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) || NM_SETTING_GSM_BAND_U800 || NM_SETTING_GSM_BAND_U850 || NM_SETTING_GSM_BAND_U900 - || NM_SETTING_GSM_BAND_U17IX, + || NM_SETTING_GSM_BAND_U17IX + || NM_SETTING_GSM_BAND_U1900, NM_SETTING_GSM_BAND_ANY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); @@ -593,6 +611,22 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + /** + * NMSettingGsm:home-only: + * + * When TRUE, only connections to the home network will be allowed. + * Connections to roaming networks will not be made. + **/ + g_object_class_install_property + (object_class, PROP_HOME_ONLY, + g_param_spec_boolean (NM_SETTING_GSM_HOME_ONLY, + "PIN", + "When TRUE, only connections to the home network will " + "be allowed. Connections to roaming networks will " + "not be made.", + FALSE, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + /* Deprecated properties */ /** * NMSettingGsm:puk: diff --git a/libnm-util/nm-setting-gsm.h b/libnm-util/nm-setting-gsm.h index 5b6a056455..0ac7122462 100644 --- a/libnm-util/nm-setting-gsm.h +++ b/libnm-util/nm-setting-gsm.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -61,6 +61,7 @@ GQuark nm_setting_gsm_error_quark (void); #define NM_SETTING_GSM_NETWORK_TYPE "network-type" #define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands" #define NM_SETTING_GSM_PIN "pin" +#define NM_SETTING_GSM_HOME_ONLY "home-only" /* DEPRECATED & UNUSED */ #define NM_SETTING_GSM_PUK "puk" @@ -95,6 +96,7 @@ typedef enum { NM_SETTING_GSM_BAND_U850 = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz (Class V) */ NM_SETTING_GSM_BAND_U900 = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz (Class VIII) */ NM_SETTING_GSM_BAND_U17IX = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz (Class IX) */ + NM_SETTING_GSM_BAND_U1900 = 0x00001000, /* WCDMA 3GPP UMTS 1900 MHz (Class II) */ } NMSettingGsmNetworkBand; typedef struct { @@ -122,6 +124,7 @@ const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting); int nm_setting_gsm_get_network_type (NMSettingGsm *setting); guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting); const char *nm_setting_gsm_get_pin (NMSettingGsm *setting); +gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting); /* DEPRECATED & UNUSED */ const char *nm_setting_gsm_get_puk (NMSettingGsm *setting); From a2bcb7991862c4a3f3586c47994ea2e5cc436235 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 16 Mar 2010 23:53:31 -0700 Subject: [PATCH 104/392] gsm: send new allowed mode and roaming control properties on connect --- src/modem-manager/nm-modem-gsm.c | 58 +++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index a7bd361c0d..152b2a6a9c 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -30,21 +30,30 @@ #include "NetworkManagerUtils.h" typedef enum { - MM_MODEM_GSM_MODE_UNKNOWN = 0x00000000, - MM_MODEM_GSM_MODE_ANY = 0x00000001, - MM_MODEM_GSM_MODE_GPRS = 0x00000002, - MM_MODEM_GSM_MODE_EDGE = 0x00000004, - MM_MODEM_GSM_MODE_UMTS = 0x00000008, - MM_MODEM_GSM_MODE_HSDPA = 0x00000010, - MM_MODEM_GSM_MODE_2G_PREFERRED = 0x00000020, - MM_MODEM_GSM_MODE_3G_PREFERRED = 0x00000040, - MM_MODEM_GSM_MODE_2G_ONLY = 0x00000080, - MM_MODEM_GSM_MODE_3G_ONLY = 0x00000100, - MM_MODEM_GSM_MODE_HSUPA = 0x00000200, - MM_MODEM_GSM_MODE_HSPA = 0x00000400, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY = 0, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_GPRS, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_EDGE, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_UMTS, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSDPA, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_PREFERRED, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_ONLY, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_ONLY, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSUPA, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA, - MM_MODEM_GSM_MODE_LAST = MM_MODEM_GSM_MODE_HSPA -} MMModemGsmMode; + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_LAST = MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA +} MMModemDeprecatedMode; + +typedef enum { + MM_MODEM_GSM_ALLOWED_MODE_ANY = 0, + MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED = 1, + MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED = 2, + MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY = 3, + MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY = 4, + + MM_MODEM_GSM_ALLOWED_MODE_LAST = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY +} MMModemGsmAllowedMode; G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) @@ -342,25 +351,34 @@ create_connect_properties (NMConnection *connection) if (str) value_hash_add_str (properties, "password", str); + /* Add both old and new preferred modes */ switch (nm_setting_gsm_get_network_type (setting)) { case NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA: - value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_MODE_3G_ONLY); + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_ONLY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY); break; case NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE: - value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_MODE_2G_ONLY); + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_ONLY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY); break; case NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA: - value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_MODE_3G_PREFERRED); + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_PREFERRED); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED); break; case NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE: - value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_MODE_2G_PREFERRED); + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED); break; default: - value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_MODE_ANY); + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_ANY); break; } - /* FIXME: band */ + /* Roaming */ + if (nm_setting_gsm_get_home_only (setting)) + value_hash_add_bool (properties, "home_only", TRUE); + return properties; } From 55949277bd4c69bd07b0085e94a4219ec22a0f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 18 Mar 2010 15:39:15 +0100 Subject: [PATCH 105/392] cli: changing nmcli output to better fit both computer and human needs The output is basically tabular with fields (columns) presenting specific pieces of info. Each line represents a single object. It's possible to switch to multiline output using '--multiline' option. In that mode single object is presented on more lines - each field on its line. Terse mode now uses ':' as field separator. It also escapes all occurences of ':' and '\' inside field values to ease parsing. The escaping behaviour can be controlled through '--escape' option. By default, escaping is switched on in tabular mode. When using terse mode ('--terse'), '--fields' option is mandatory for specifying required fields. That helps for flexibility and backwards compatibility. Not all output is converted yet. --- cli/src/connections.c | 212 ++++++++++++++----- cli/src/devices.c | 479 +++++++++++++++++++++++------------------- cli/src/nmcli.c | 88 +++++++- cli/src/nmcli.h | 58 +++-- cli/src/utils.c | 166 +++++++++++++++ cli/src/utils.h | 7 + 6 files changed, 727 insertions(+), 283 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index ae09fe0b5f..8f671cd72c 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -53,6 +53,37 @@ #include "connections.h" +/* Available field for 'con status' */ +static NmcOutputField nmc_fields_con_status[] = { + {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ + {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ + {"DEVICES", N_("DEVICES"), 10, NULL, 0}, /* 2 */ + {"SCOPE", N_("SCOPE"), 8, NULL, 0}, /* 3 */ + {"DEFAULT", N_("DEFAULT"), 8, NULL, 0}, /* 4 */ + {"DBUS-SERVICE", N_("DBUS-SERVICE"), 45, NULL, 0}, /* 5 */ + {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 6 */ + {"VPN", N_("VPN"), 5, NULL, 0}, /* 7 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,SPEC-OBJECT" +#define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN" + +/* Available field for 'con list' */ +static NmcOutputField nmc_fields_con_list[] = { + {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ + {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */ + {"SCOPE", N_("SCOPE"), 8, NULL, 0}, /* 3 */ + {"TIMESTAMP", N_("TIMESTAMP"), 12, NULL, 0}, /* 4 */ + {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL"), 34, NULL, 0}, /* 5 */ + {"AUTOCONNECT", N_("AUTOCONNECT"), 13, NULL, 0}, /* 6 */ + {"READONLY", N_("READONLY"), 10, NULL, 0}, /* 7 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY" +#define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,SCOPE,TIMESTAMP-REAL" + + typedef struct { NmCli *nmc; int argc; @@ -102,17 +133,31 @@ static void show_connection (NMConnection *data, gpointer user_data) { NMConnection *connection = (NMConnection *) data; + NmCli *nmc = (NmCli *) user_data; NMSettingConnection *s_con; - const char *id; - const char *uuid; - const char *con_type; + guint64 timestamp; + char *timestamp_str; + char timestamp_real_str[64]; s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); if (s_con) { - id = nm_setting_connection_get_id (s_con); - uuid = nm_setting_connection_get_uuid (s_con); - con_type = nm_setting_connection_get_connection_type (s_con); - print_table_line (0, con_type, 17, uuid, 38, id, 0, NULL); + /* Obtain field values */ + timestamp = nm_setting_connection_get_timestamp (s_con); + timestamp_str = g_strdup_printf ("%ld", timestamp); + strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); + nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); + nmc->allowed_fields[2].value = nm_setting_connection_get_connection_type (s_con); + nmc->allowed_fields[3].value = nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM ? _("system") : _("user"); + nmc->allowed_fields[4].value = timestamp_str; + nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); + nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); + + nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (nmc->print_fields, nmc->allowed_fields); + + g_free (timestamp_str); } } @@ -148,24 +193,46 @@ find_connection (GSList *list, const char *filter_type, const char *filter_val) static NMCResultCode do_connections_list (NmCli *nmc, int argc, char **argv) { + GError *error = NULL; + char *fields_str; + char *fields_all = NMC_FIELDS_CON_LIST_ALL; + char *fields_common = NMC_FIELDS_CON_LIST_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; gboolean valid_param_specified = FALSE; nmc->should_wait = FALSE; + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_con_list; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + g_string_printf (nmc->return_text, error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + if (argc == 0) { valid_param_specified = TRUE; - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("Connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); - if (nmc->print_output > NMC_PRINT_TERSE) - printf (_("System connections:\n")); - g_slist_foreach (nmc->system_connections, (GFunc) show_connection, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("System connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); - if (nmc->print_output > NMC_PRINT_TERSE) - printf (_("User connections:\n")); - g_slist_foreach (nmc->user_connections, (GFunc) show_connection, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("User connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); } else { while (argc > 0) { @@ -189,24 +256,25 @@ do_connections_list (NmCli *nmc, int argc, char **argv) g_string_printf (nmc->return_text, _("Error: %s - no such connection."), *argv); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; } + break; } else if (strcmp (*argv, "system") == 0) { valid_param_specified = TRUE; - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("System-wide connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); - g_slist_foreach (nmc->system_connections, (GFunc) show_connection, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("System connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); + break; } else if (strcmp (*argv, "user") == 0) { valid_param_specified = TRUE; - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("User connections"), _("Type"), 17, _("UUID"), 38, _("Name"), 20, NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("Type"), 17, _("UUID"), 38, _("Name"), 0, NULL); - g_slist_foreach (nmc->user_connections, (GFunc) show_connection, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("User connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); + break; } else { fprintf (stderr, _("Unknown parameter: %s\n"), *argv); @@ -226,12 +294,17 @@ error: return nmc->return_value; } +typedef struct { + NmCli *nmc; + NMConnectionScope scope; +} StatusInfo; + static void show_active_connection (gpointer data, gpointer user_data) { NMActiveConnection *active = NM_ACTIVE_CONNECTION (data); - GSList *con_list = (GSList *) user_data; - GSList *iter; + StatusInfo *info = (StatusInfo *) user_data; + GSList *con_list, *iter; const char *active_path; NMConnectionScope active_service_scope; NMSettingConnection *s_con; @@ -239,12 +312,14 @@ show_active_connection (gpointer data, gpointer user_data) GString *dev_str; int i; - dev_str = g_string_new (NULL); - active_path = nm_active_connection_get_connection (active); active_service_scope = nm_active_connection_get_scope (active); + if (active_service_scope != info->scope) + return; + /* Get devices of the active connection */ + dev_str = g_string_new (NULL); devices = nm_active_connection_get_devices (active); for (i = 0; devices && (i < devices->len); i++) { NMDevice *device = g_ptr_array_index (devices, i); @@ -255,24 +330,29 @@ show_active_connection (gpointer data, gpointer user_data) if (dev_str->len > 0) g_string_truncate (dev_str, dev_str->len - 1); /* Cut off last ',' */ + con_list = (info->scope == NM_CONNECTION_SCOPE_SYSTEM) ? info->nmc->system_connections : info->nmc->user_connections; for (iter = con_list; iter; iter = g_slist_next (iter)) { NMConnection *connection = (NMConnection *) iter->data; const char *con_path = nm_connection_get_path (connection); - NMConnectionScope con_scope = nm_connection_get_scope (connection); - if (!strcmp (active_path, con_path) && active_service_scope == con_scope) { - /* this connection is active */ + if (!strcmp (active_path, con_path)) { + /* This connection is active */ s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); g_assert (s_con != NULL); - // FIXME: Fix the output - print_table_line (0, nm_active_connection_get_default (active) ? _("yes") : _("no"), 8, - nm_active_connection_get_service_name (active), 45, -// nm_active_connection_get_specific_object (active), 0, -// nm_active_connection_get_connection (active), 0, - dev_str->str, 10, - nm_setting_connection_get_uuid (s_con), 38, - nm_setting_connection_get_id (s_con), 0, NULL); + /* Obtain field values */ + info->nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); + info->nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); + info->nmc->allowed_fields[2].value = dev_str->str; + info->nmc->allowed_fields[3].value = active_service_scope == NM_CONNECTION_SCOPE_SYSTEM ? _("system") : _("user"); + info->nmc->allowed_fields[4].value = nm_active_connection_get_default (active) ? _("yes") : _("no"); + info->nmc->allowed_fields[5].value = nm_active_connection_get_service_name (active); + info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); + info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); + + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (info->nmc->print_fields, info->nmc->allowed_fields); + break; } } @@ -283,6 +363,14 @@ static NMCResultCode do_connections_status (NmCli *nmc, int argc, char **argv) { const GPtrArray *active_cons; + GError *error = NULL; + StatusInfo *info; + char *fields_str; + char *fields_all = NMC_FIELDS_CON_STATUS_ALL; + char *fields_common = NMC_FIELDS_CON_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; nmc->should_wait = FALSE; @@ -292,18 +380,40 @@ do_connections_status (NmCli *nmc, int argc, char **argv) active_cons = nm_client_get_active_connections (nmc->client); - // FIXME: Fix the output - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("Active connections"), _("Default"), 8, _("Service"), 45, _("Devices"), 10, _("UUID"), 38, _("Name"), 20, NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("Default"), 8, _("Service"), 45, _("Devices"), 10, _("UUID"), 38, _("Name"), 0, NULL); + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; - if (active_cons && active_cons->len) { - g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc->system_connections); - g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc->user_connections); + nmc->allowed_fields = nmc_fields_con_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + g_string_printf (nmc->return_text, error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; } - return NMC_RESULT_SUCCESS; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("Active connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + + if (active_cons && active_cons->len) { + info = g_malloc0 (sizeof (StatusInfo)); + info->nmc = nmc; + info->scope = NM_CONNECTION_SCOPE_SYSTEM; + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) info); + info->scope = NM_CONNECTION_SCOPE_USER; + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) info); + g_free (info); + } + +error: + + return nmc->return_value; } /* -------------------- diff --git a/cli/src/devices.c b/cli/src/devices.c index d6c0b43dc5..1be00d9c45 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -55,6 +55,35 @@ #include "devices.h" +/* Available field for 'dev status' */ +static NmcOutputField nmc_fields_dev_status[] = { + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ + {"STATE", N_("STATE"), 12, NULL, 0}, /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" +#define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" + +/* Available field for 'dev wifi list' */ +static NmcOutputField nmc_fields_dev_wifi_list[] = { + {"SSID", N_("SSID"), 33, NULL, 0}, /* 0 */ + {"BSSID", N_("BSSID"), 19, NULL, 0}, /* 1 */ + {"MODE", N_("MODE"), 16, NULL, 0}, /* 2 */ + {"FREQ", N_("FREQ"), 10, NULL, 0}, /* 3 */ + {"RATE", N_("RATE"), 10, NULL, 0}, /* 4 */ + {"SIGNAL", N_("SIGNAL"), 8, NULL, 0}, /* 5 */ + {"SECURITY", N_("SECURITY"), 10, NULL, 0}, /* 6 */ + {"WPA-FLAGS", N_("WPA-FLAGS"), 25, NULL, 0}, /* 7 */ + {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 8 */ + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 9 */ + {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 10 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" + + /* static function prototypes */ static void usage (void); static const char *device_state_to_string (NMDeviceState state); @@ -75,7 +104,7 @@ usage (void) " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" - " wifi [list [iface ] | apinfo iface hwaddr ]\n\n")); + " wifi [list [iface ] [hwaddr ]]\n\n")); } /* quit main loop */ @@ -212,63 +241,94 @@ ip4_address_as_string (guint32 ip) } } +typedef struct { + NmCli *nmc; + const char* active_bssid; + const char* device; +} APInfo; + static void detail_access_point (gpointer data, gpointer user_data) { NMAccessPoint *ap = NM_ACCESS_POINT (data); - const char *active_bssid = (const char *) user_data; - GString *str; + APInfo *info = (APInfo *) user_data; gboolean active = FALSE; - guint32 flags, wpa_flags, rsn_flags; - const GByteArray * ssid; - char *tmp; + guint32 flags, wpa_flags, rsn_flags, freq, bitrate; + guint8 strength; + const GByteArray *ssid; + const char *hwaddr; + NM80211Mode mode; + char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; + GString *security_str; - flags = nm_access_point_get_flags (ap); - wpa_flags = nm_access_point_get_wpa_flags (ap); - rsn_flags = nm_access_point_get_rsn_flags (ap); - - if (active_bssid) { + if (info->active_bssid) { const char *current_bssid = nm_access_point_get_hw_address (ap); - if (current_bssid && !strcmp (current_bssid, active_bssid)) + if (current_bssid && !strcmp (current_bssid, info->active_bssid)) active = TRUE; } - str = g_string_new (NULL); - g_string_append_printf (str, - _("%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d"), - (nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA) ? ("Infra") : _("Ad-Hoc"), - nm_access_point_get_hw_address (ap), - nm_access_point_get_frequency (ap), - nm_access_point_get_max_bitrate (ap) / 1000, - nm_access_point_get_strength (ap)); + /* Get AP properties */ + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + ssid = nm_access_point_get_ssid (ap); + hwaddr = nm_access_point_get_hw_address (ap); + freq = nm_access_point_get_frequency (ap); + mode = nm_access_point_get_mode (ap); + bitrate = nm_access_point_get_max_bitrate (ap); + strength = nm_access_point_get_strength (ap); + /* Convert to strings */ + ssid_str = g_strdup_printf ("%s", ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); + freq_str = g_strdup_printf (_("%u MHz"), freq); + bitrate_str = g_strdup_printf (_("%u MB/s"), bitrate/1000); + strength_str = g_strdup_printf ("%u", strength); + wpa_flags_str = ap_wpa_rsn_flags_to_string (wpa_flags); + rsn_flags_str = ap_wpa_rsn_flags_to_string (rsn_flags); + + security_str = g_string_new (NULL); if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) && (wpa_flags != NM_802_11_AP_SEC_NONE) && (rsn_flags != NM_802_11_AP_SEC_NONE)) - g_string_append (str, _(", Encrypted: ")); + g_string_append (security_str, _("Encrypted: ")); if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) && (wpa_flags == NM_802_11_AP_SEC_NONE) && (rsn_flags == NM_802_11_AP_SEC_NONE)) - g_string_append (str, _(" WEP")); + g_string_append (security_str, _("WEP ")); if (wpa_flags != NM_802_11_AP_SEC_NONE) - g_string_append (str, _(" WPA")); + g_string_append (security_str, _("WPA ")); if (rsn_flags != NM_802_11_AP_SEC_NONE) - g_string_append (str, _(" WPA2")); + g_string_append (security_str, _("WPA2 ")); if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) - g_string_append (str, _(" Enterprise")); + g_string_append (security_str, _("Enterprise ")); - /* FIXME: broadcast/hidden */ + if (security_str->len > 0) + g_string_truncate (security_str, security_str->len-1); /* Chop off last space */ - ssid = nm_access_point_get_ssid (ap); - tmp = g_strdup_printf (" %s%s", active ? "*" : "", - ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); + info->nmc->allowed_fields[0].value = ssid_str; + info->nmc->allowed_fields[1].value = hwaddr; + info->nmc->allowed_fields[2].value = mode == NM_802_11_MODE_ADHOC ? _("Ad-Hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"); + info->nmc->allowed_fields[3].value = freq_str; + info->nmc->allowed_fields[4].value = bitrate_str; + info->nmc->allowed_fields[5].value = strength_str; + info->nmc->allowed_fields[6].value = security_str->str; + info->nmc->allowed_fields[7].value = wpa_flags_str; + info->nmc->allowed_fields[8].value = rsn_flags_str; + info->nmc->allowed_fields[9].value = info->device; + info->nmc->allowed_fields[10].value = active ? _("yes") : _("no"); - print_table_line (0, tmp, 25, str->str, 0, NULL); + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (info->nmc->print_fields, info->nmc->allowed_fields); - g_string_free (str, TRUE); - g_free (tmp); + g_free (ssid_str); + g_free (freq_str); + g_free (bitrate_str); + g_free (strength_str); + g_free (wpa_flags_str); + g_free (rsn_flags_str); + g_string_free (security_str, TRUE); } struct cb_info { @@ -280,7 +340,8 @@ static void show_device_info (gpointer data, gpointer user_data) { NMDevice *device = NM_DEVICE (data); -// struct cb_info *info = user_data; + NmCli *nmc = (NmCli *) user_data; + APInfo *info; char *tmp; NMDeviceState state; const char *dev_type; @@ -365,11 +426,21 @@ show_device_info (gpointer data, gpointer user_data) active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; } - printf (_("\n Wireless Access Points %s\n"), active_ap ? _("(* = current AP)") : ""); + printf (_("\n Wireless Access Points\n")); + nmc->print_fields.flags = NMC_PF_FLAG_HEADER; + nmc->print_fields.indent = 2; /* Indent by 2 spaces */ + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_COMMON, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->active_bssid = active_bssid; + info->device = nm_device_get_iface (device); aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); if (aps && aps->len) - g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid); + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); + g_free (info); } else if (NM_IS_DEVICE_ETHERNET (device)) { printf (_("\n Wired Properties\n")); @@ -425,22 +496,26 @@ show_device_info (gpointer data, gpointer user_data) static void show_device_status (NMDevice *device, NmCli *nmc) { - const char *iface; - const char *type; - const char *state; + nmc->allowed_fields[0].value = nm_device_get_iface (device); + nmc->allowed_fields[1].value = get_device_type (device); + nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); - iface = nm_device_get_iface (device); - type = get_device_type (device); - state = device_state_to_string (nm_device_get_state (device)); - - print_table_line (0, iface, 10, type, 17, state, 0, NULL); + nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (nmc->print_fields, nmc->allowed_fields); } static NMCResultCode do_devices_status (NmCli *nmc, int argc, char **argv) { + GError *error = NULL; const GPtrArray *devices; int i; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_STATUS_ALL; + char *fields_common = NMC_FIELDS_DEV_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; while (argc > 0) { fprintf (stderr, _("Unknown parameter: %s\n"), *argv); @@ -454,10 +529,26 @@ do_devices_status (NmCli *nmc, int argc, char **argv) devices = nm_client_get_devices (nmc->client); - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("Status of devices"), _("Device"), 10, _("Type"), 17, _("State"), 12, NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("Device"), 10, _("Type"), 17, _("State"), 0, NULL); + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_dev_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + g_string_printf (nmc->return_text, error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("Status of devices"); + print_fields (nmc->print_fields, nmc->allowed_fields); for (i = 0; devices && (i < devices->len); i++) { NMDevice *device = g_ptr_array_index (devices, i); @@ -504,6 +595,9 @@ do_devices_list (NmCli *nmc, int argc, char **argv) devices = nm_client_get_devices (nmc->client); + /* Set allowed fields for use while printing in detail_access_point() */ + nmc->allowed_fields = nmc_fields_dev_wifi_list; + if (iface_specified) { for (i = 0; devices && (i < devices->len); i++) { NMDevice *candidate = g_ptr_array_index (devices, i); @@ -517,10 +611,10 @@ do_devices_list (NmCli *nmc, int argc, char **argv) nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; } - show_device_info (device, nmc->client); + show_device_info (device, nmc); } else { if (devices) - g_ptr_array_foreach ((GPtrArray *) devices, show_device_info, nmc->client); + g_ptr_array_foreach ((GPtrArray *) devices, show_device_info, nmc); } error: @@ -665,119 +759,46 @@ error: } static void -show_acces_point_info (NMDevice *device) +show_acces_point_info (NMDevice *device, NmCli *nmc) { NMAccessPoint *active_ap = NULL; const char *active_bssid = NULL; const GPtrArray *aps; + APInfo *info; if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; } + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->active_bssid = active_bssid; + info->device = nm_device_get_iface (device); aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); if (aps && aps->len) - g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid); + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); + g_free (info); } static NMCResultCode do_device_wifi_list (NmCli *nmc, int argc, char **argv) { - //TODO: cleanup - const GPtrArray *devices; + GError *error = NULL; NMDevice *device = NULL; - const char *iface = NULL; - gboolean iface_specified = FALSE; - int i; - - while (argc > 0) { - if (strcmp (*argv, "iface") == 0) { - iface_specified = TRUE; - - if (next_arg (&argc, &argv) != 0) { - g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - goto error; - } - - iface = *argv; - } else { - fprintf (stderr, _("Unknown parameter: %s\n"), *argv); - } - - argc--; - argv++; - } - - /* create NMClient */ - if (!nmc->get_client (nmc)) - goto error; - - devices = nm_client_get_devices (nmc->client); - - if (iface_specified) { - for (i = 0; devices && (i < devices->len); i++) { - NMDevice *candidate = g_ptr_array_index (devices, i); - const char *dev_iface = nm_device_get_iface (candidate); - - if (!strcmp (dev_iface, iface)) - device = candidate; - } - - if (!device) { - g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - goto error; - } - - if ((NM_IS_DEVICE_WIFI (device))) { - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("WiFi scan list"), NULL); - - show_acces_point_info (device); - } else { - g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - goto error; - } - } else { - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("WiFi scan list"), NULL); - - for (i = 0; devices && (i < devices->len); i++) { - NMDevice *dev = g_ptr_array_index (devices, i); - const char *dev_iface = nm_device_get_iface (dev); - - if ((NM_IS_DEVICE_WIFI (dev))) { - if (nmc->print_output > NMC_PRINT_TERSE) - print_table_line (0, _("Device:"), 0, dev_iface, 0, NULL); - - show_acces_point_info (dev); - } - } - } - -error: - return nmc->return_value; -} - -static NMCResultCode -do_device_wifi_apinfo (NmCli *nmc, int argc, char **argv) -{ - const GPtrArray *devices; - const GPtrArray *aps; NMAccessPoint *ap = NULL; const char *iface = NULL; const char *hwaddr_user = NULL; - const char *hwaddr; - gboolean stop = FALSE; - guint32 flags, wpa_flags, rsn_flags, freq, bitrate; - guint8 strength; - const GByteArray *ssid; - NM80211Mode mode; - char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; + const GPtrArray *devices; + const GPtrArray *aps; + APInfo *info; int i, j; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_WIFI_LIST_ALL; + char *fields_common = NMC_FIELDS_DEV_WIFI_LIST_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; while (argc > 0) { if (strcmp (*argv, "iface") == 0) { @@ -802,90 +823,129 @@ do_device_wifi_apinfo (NmCli *nmc, int argc, char **argv) argv++; } - if (!hwaddr_user) { - g_string_printf (nmc->return_text, _("Error: hwaddr has to be specified.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - goto error; - } - /* create NMClient */ if (!nmc->get_client (nmc)) goto error; devices = nm_client_get_devices (nmc->client); - for (i = 0; !stop && devices && (i < devices->len); i++) { - NMDevice *device = g_ptr_array_index (devices, i); - const char *dev_iface = nm_device_get_iface (device); + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; - if (iface) { - if (!strcmp (iface, dev_iface)) - stop = TRUE; - else - continue; - } + nmc->allowed_fields = nmc_fields_dev_wifi_list; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); - aps = NULL; - if ((NM_IS_DEVICE_WIFI (device))) - aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); - for (j = 0; aps && (j < aps->len); j++) { - char *hwaddr_up; - NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); - const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); - - hwaddr_up = g_ascii_strup (hwaddr_user, -1); - if (!strcmp (hwaddr_up, candidate_hwaddr)) - ap = candidate_ap; - g_free (hwaddr_up); - } - } - - if (!ap) { - g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + if (error) { + g_string_printf (nmc->return_text, error->message); + g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; } - /* get AP properties */ - flags = nm_access_point_get_flags (ap); - wpa_flags = nm_access_point_get_wpa_flags (ap); - rsn_flags = nm_access_point_get_rsn_flags (ap); - ssid = nm_access_point_get_ssid (ap); - hwaddr = nm_access_point_get_hw_address (ap); - freq = nm_access_point_get_frequency (ap); - mode = nm_access_point_get_mode (ap); - bitrate = nm_access_point_get_max_bitrate (ap); - strength = nm_access_point_get_strength (ap); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("WiFi scan list"); - /* print them */ - ssid_str = g_strdup_printf ("%s", ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); - freq_str = g_strdup_printf (_("%u MHz"), freq); - bitrate_str = g_strdup_printf (_("%u MB/s"), bitrate/1000); - strength_str = g_strdup_printf ("%u", strength); - wpa_flags_str = ap_wpa_rsn_flags_to_string (wpa_flags); - rsn_flags_str = ap_wpa_rsn_flags_to_string (rsn_flags); + if (iface) { + /* Device specified - list only APs of this interface */ + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("AP parameters"), NULL); - else if (nmc->print_output == NMC_PRINT_NORMAL) - print_table_line (0, _("AP parameters"), 0, NULL); + if (!strcmp (dev_iface, iface)) { + device = candidate; + break; + } + } - print_table_line (0, _("SSID:"), 25, ssid_str, 0, NULL); - print_table_line (0, _("BSSID:"), 25, hwaddr, 0, NULL); - print_table_line (0, _("Frequency:"), 25, freq_str, 0, NULL); - print_table_line (0, _("Mode:"), 25, mode == NM_802_11_MODE_ADHOC ? _("Ad-hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"), 0, NULL); - print_table_line (0, _("Maximal bitrate:"), 25, bitrate_str, 0, NULL); - print_table_line (0, _("Strength:"), 25, strength_str, 0, NULL); - print_table_line (0, _("Flags:"), 25, flags == NM_802_11_AP_FLAGS_PRIVACY ? _("privacy") : _("(none)"), 0, NULL); - print_table_line (0, _("WPA flags:"), 25, wpa_flags_str, 0, NULL); - print_table_line (0, _("RSN flags:"), 25, rsn_flags_str, 0, NULL); + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } - g_free (ssid_str); - g_free (freq_str); - g_free (bitrate_str); - g_free (strength_str); - g_free (wpa_flags_str); - g_free (rsn_flags_str); + if (NM_IS_DEVICE_WIFI (device)) { + if (hwaddr_user) { + /* Specific AP requested - list only that */ + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + for (j = 0; aps && (j < aps->len); j++) { + char *hwaddr_up; + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + hwaddr_up = g_ascii_strup (hwaddr_user, -1); + if (!strcmp (hwaddr_up, candidate_hwaddr)) + ap = candidate_ap; + g_free (hwaddr_up); + } + if (!ap) { + g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->active_bssid = NULL; + info->device = nm_device_get_iface (device); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + detail_access_point (ap, info); + g_free (info); + } else { + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + show_acces_point_info (device, nmc); + } + } else { + g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + /* List APs for all devices */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + if (hwaddr_user) { + /* Specific AP requested - list only that */ + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + + if (!NM_IS_DEVICE_WIFI (dev)) + continue; + + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (dev)); + for (j = 0; aps && (j < aps->len); j++) { + char *hwaddr_up; + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + hwaddr_up = g_ascii_strup (hwaddr_user, -1); + if (!strcmp (hwaddr_up, candidate_hwaddr)) { + ap = candidate_ap; + + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->active_bssid = NULL; + info->device = nm_device_get_iface (dev); + detail_access_point (ap, info); + g_free (info); + } + g_free (hwaddr_up); + } + } + if (!ap) { + g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + if (NM_IS_DEVICE_WIFI (dev)) + show_acces_point_info (dev, nmc); + } + } + } error: return nmc->return_value; @@ -900,9 +960,6 @@ do_device_wifi (NmCli *nmc, int argc, char **argv) if (matches (*argv, "list") == 0) { nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); } - else if (matches (*argv, "apinfo") == 0) { - nmc->return_value = do_device_wifi_apinfo (nmc, argc-1, argv+1); - } else { g_string_printf (nmc->return_text, _("Error: 'dev wifi' command '%s' is not valid."), *argv); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index f2ed7156b0..ad793406fb 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -45,7 +45,7 @@ #include "devices.h" #include "network-manager.h" -#define NMCLI_VERSION "0.1" +#define NMCLI_VERSION "0.2" typedef struct { @@ -64,10 +64,13 @@ usage (const char *prog_name) fprintf (stderr, _("Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n\n" "OPTIONS\n" - " -t[erse] terse output\n" - " -p[retty] pretty output\n" - " -v[ersion] show program version\n" - " -h[elp] print this help\n\n" + " -t[erse] terse output\n" + " -p[retty] pretty output\n" + " -m[ultiline] multiline output\n" + " -f[ields] |all|common specify fields to output\n" + " -e[scape] yes|no escape columns separators in values\n" + " -v[ersion] show program version\n" + " -h[elp] print this help\n\n" "OBJECT\n" " nm NetworkManager status\n" " con NetworkManager connections\n" @@ -132,9 +135,57 @@ parse_command_line (NmCli *nmc, int argc, char **argv) if (opt[1] == '-') opt++; if (matches (opt, "-terse") == 0) { - nmc->print_output = NMC_PRINT_TERSE; + if (nmc->print_output == NMC_PRINT_TERSE) { + g_string_printf (nmc->return_text, _("Option '--terse' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + else if (nmc->print_output == NMC_PRINT_PRETTY) { + g_string_printf (nmc->return_text, _("Option '--terse' is mutually exclusive with '--pretty'.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + else + nmc->print_output = NMC_PRINT_TERSE; } else if (matches (opt, "-pretty") == 0) { - nmc->print_output = NMC_PRINT_PRETTY; + if (nmc->print_output == NMC_PRINT_PRETTY) { + g_string_printf (nmc->return_text, _("Option '--pretty' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + else if (nmc->print_output == NMC_PRINT_TERSE) { + g_string_printf (nmc->return_text, _("Option '--pretty' is mutually exclusive with '--terse'.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + else + nmc->print_output = NMC_PRINT_PRETTY; + } else if (matches (opt, "-multiline") == 0) { + nmc->multiline_output = TRUE; + } else if (matches (opt, "-escape") == 0) { + next_arg (&argc, &argv); + if (argc <= 1) { + g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + if (!strcmp (argv[1], "yes")) + nmc->escape_values = TRUE; + else if (!strcmp (argv[1], "no")) + nmc->escape_values = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[1], opt); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + } else if (matches (opt, "-fields") == 0) { + next_arg (&argc, &argv); + if (argc <= 1) { + g_string_printf (nmc->return_text, _("Error: fields for '%s' options are missing."), opt); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + nmc->required_fields = g_strdup (argv[1]); } else if (matches (opt, "-version") == 0) { printf (_("nmcli tool, version %s\n"), NMCLI_VERSION); return NMC_RESULT_SUCCESS; @@ -150,6 +201,20 @@ parse_command_line (NmCli *nmc, int argc, char **argv) argv++; } + /* Some validity options checks */ + if (nmc->print_output == NMC_PRINT_TERSE) { + if (!nmc->required_fields) { + g_string_printf (nmc->return_text, _("Option '--terse' requires specifying '--fields'.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } else if ( !strcasecmp (nmc->required_fields, "all") + || !strcasecmp (nmc->required_fields, "common")) { + g_string_printf (nmc->return_text, _("Option '--terse' requires specific '--fields' option, not 'all' or 'common'.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + } + if (argc > 1) return do_cmd (nmc, argv[1], argc-1, argv+1); @@ -217,6 +282,11 @@ nmc_init (NmCli *nmc) nmc->should_wait = FALSE; nmc->print_output = NMC_PRINT_NORMAL; + nmc->multiline_output = FALSE; + nmc->escape_values = TRUE; + nmc->required_fields = NULL; + nmc->allowed_fields = NULL; + memset (&nmc->print_fields, '\0', sizeof (NmcPrintFields)); } static void @@ -231,6 +301,10 @@ nmc_cleanup (NmCli *nmc) g_slist_free (nmc->system_connections); g_slist_free (nmc->user_connections); + + g_free (nmc->required_fields); + if (nmc->print_fields.indices) + g_array_free (nmc->print_fields.indices, TRUE); } static gboolean diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index 2daa4154e6..8b4c34207e 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -20,10 +20,12 @@ #ifndef NMC_NMCLI_H #define NMC_NMCLI_H +#include + +#include #include #include - /* nmcli exit codes */ typedef enum { /* Indicates successful execution */ @@ -51,27 +53,55 @@ typedef enum { NMC_PRINT_PRETTY } NMCPrintOutput; +/* === Output fields === */ +typedef struct { + const char *name; /* Field's name */ + const char *name_l10n; /* Field's name for translation */ + int width; /* Width in screen columns */ + const char *value; /* Value of current field */ + guint32 flags; /* Flags */ +} NmcOutputField; + +/* Flags for NmcPrintFields */ +#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular*/ +#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse outpud mode */ +#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ +#define NMC_PF_FLAG_HEADER 0x00000008 /* Print headers instead of values */ +#define NMC_PF_FLAG_ESCAPE 0x00000010 /* Escape column separator and '\' */ + +typedef struct { + GArray *indices; /* Array of field indices to the array of allowed fields */ + char *header_name; /* Name of the output */ + int indent; /* Indent by this number of spaces */ + guint32 flags; /* Various flags for controlling output: see NMC_PF_FLAG_* values */ +} NmcPrintFields; + /* NmCli - main structure */ typedef struct _NmCli { - NMClient *client; - NMClient *(*get_client) (struct _NmCli *nmc); + NMClient *client; /* Pointer to NMClient of libnm-glib */ + NMClient *(*get_client) (struct _NmCli *nmc); /* Pointer to function for creating NMClient */ - NMCResultCode return_value; - GString *return_text; + NMCResultCode return_value; /* Return code of nmcli */ + GString *return_text; /* Reason text */ - int timeout; + int timeout; /* Operation timeout */ - NMRemoteSettingsSystem *system_settings; - NMRemoteSettings *user_settings; + NMRemoteSettingsSystem *system_settings; /* System settings */ + NMRemoteSettings *user_settings; /* User settings */ - gboolean system_settings_running; - gboolean user_settings_running; + gboolean system_settings_running; /* Is system settings service running? */ + gboolean user_settings_running; /* Is user settings service running? */ - GSList *system_connections; - GSList *user_connections; + GSList *system_connections; /* List of system connections */ + GSList *user_connections; /* List of user connections */ - gboolean should_wait; - NMCPrintOutput print_output; + gboolean should_wait; /* Indication that nmcli should not end yet */ + NMCPrintOutput print_output; /* Output mode */ + gboolean multiline_output; /* Multiline output instead of default tabular */ + gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ + char *required_fields; /* Required fields in output: '--fields' option */ + NmcOutputField *allowed_fields; /* Array of allowed fields for particular commands */ + NmcPrintFields print_fields; /* Structure with field indices to print */ } NmCli; #endif /* NMC_NMCLI_H */ diff --git a/cli/src/utils.c b/cli/src/utils.c index cd99b10fde..ce22947acb 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -21,6 +21,7 @@ #include #include +#include #include "utils.h" @@ -46,6 +47,171 @@ next_arg (int *argc, char ***argv) return 0; } +/* + * Parse comma separated fields in 'fields_str' according to 'fields_array'. + * IN: 'field_str': comma-separated fields names + * 'fields_array': array of allowed fields + * RETURN: GArray with indices representing fields in 'fields_array'. + */ +GArray * +parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error) +{ + char **fields, **iter; + GArray *array; + int i; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + array = g_array_new (FALSE, FALSE, sizeof (int)); + + /* Split supplied fields string */ + fields = g_strsplit_set (fields_str, ",", -1); + for (iter = fields; iter && *iter; iter++) { + for (i = 0; fields_array[i].name; i++) { + if (strcasecmp (*iter, fields_array[i].name) == 0) { + g_array_append_val (array, i); + break; + } + } + if (fields_array[i].name == NULL) { + if (!strcasecmp (*iter, "all") || !strcasecmp (*iter, "common")) + g_set_error (error, 0, 0, _("Error: 'con status': field '%s' has to be alone."), *iter); + + else + g_set_error (error, 0, 0, _("Error: 'con status': invalid field '%s'."), *iter); + g_array_free (array, TRUE); + array = NULL; + goto done; + } + } +done: + return array; +} + +void +print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) +{ + GString *str; + int width1, width2; + int table_width = 0; + char *line = NULL; + char *indent_str; + const char *value; + int i, idx; + gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE; + gboolean terse = fields.flags & NMC_PF_FLAG_TERSE; + gboolean pretty = fields.flags & NMC_PF_FLAG_PRETTY; + gboolean header = fields.flags & NMC_PF_FLAG_HEADER; + gboolean escape = fields.flags & NMC_PF_FLAG_ESCAPE; + + /* Headers are not printed in terse mode */ + if (header && terse) + return; + + if (multiline) { + /* --- Multiline mode --- */ + if (header && pretty) { + /* Print the table header */ + table_width = g_utf8_strlen (fields.header_name, -1) + 4; + line = g_strnfill (79, '='); + width1 = strlen (fields.header_name); + width2 = g_utf8_strlen (fields.header_name, -1); + printf ("%s\n", line); + printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); + printf ("%s\n", line); + g_free (line); + } + + /* Print values */ + if (!header) { + for (i = 0; i < fields.indices->len; i++) { + char *tmp; + idx = g_array_index (fields.indices, int, i); + tmp = g_strdup_printf ("%s:", _(field_values[idx].name_l10n)); + printf ("%-*s%s\n", terse ? 0 : 20, tmp, field_values[idx].value); + g_free (tmp); + } + if (pretty) { + line = g_strnfill (79, '-'); + printf ("%s\n", line); + g_free (line); + } + } + return; + } + + /* --- Tabular mode: each line = one object --- */ + str = g_string_new (NULL); + + for (i = 0; i < fields.indices->len; i++) { + idx = g_array_index (fields.indices, int, i); + if (header) + value = _(field_values[idx].name_l10n); + else + value = field_values[idx].value; + if (terse) { + if (escape) { + const char *p = value; + while (*p) { + if (*p == ':' || *p == '\\') + g_string_append_c (str, '\\'); /* Escaping by '\' */ + g_string_append_c (str, *p); + p++; + } + } + else + g_string_append_printf (str, "%s", value); + g_string_append_c (str, ':'); /* Column separator */ + } else { + width1 = strlen (value); + width2 = g_utf8_strlen (value, -1); /* Width of the string (in screen colums) */ + if (strlen (value) == 0) + value = "--"; + g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, value); + g_string_append_c (str, ' '); /* Column separator */ + table_width += field_values[idx].width + width1 - width2 + 1; + } + } + + if (table_width <= 0) + table_width = g_utf8_strlen (fields.header_name, -1) + 4; + + if (header && pretty) { + /* Print the table header */ + line = g_strnfill (table_width, '='); + width1 = strlen (fields.header_name); + width2 = g_utf8_strlen (fields.header_name, -1); + printf ("%s\n", line); + printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); + printf ("%s\n", line); + g_free (line); + } + + + /* Print the line */ + if (str->len > 0) { + g_string_truncate (str, str->len-1); /* Chop off last column separator */ + if (fields.indent > 0) { + indent_str = g_strnfill (fields.indent, ' '); + g_string_prepend (str, indent_str); + g_free (indent_str); + } + printf ("%s\n", str->str); + } + + if (header && pretty) { + if (str->len > 0) { + line = g_strnfill (table_width, '-'); + printf ("%s\n", line); + g_free (line); + } + } + + g_string_free (str, TRUE); +} + + +/*--- obsolete printing functions ---*/ void print_table_header (const char *name, ...) { diff --git a/cli/src/utils.h b/cli/src/utils.h index 468550e212..513d214b83 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -20,8 +20,15 @@ #ifndef NMC_UTILS_H #define NMC_UTILS_H +#include + +#include "nmcli.h" + +/* === Functions === */ int matches (const char *cmd, const char *pattern); int next_arg (int *argc, char ***argv); +GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); +void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); void print_table_header (const char *name, ...); void print_table_line (int indent, ...); From 8f5192ab49d51138b12a13b1484b3d630b662616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 19 Mar 2010 14:53:08 +0100 Subject: [PATCH 106/392] cli: converting 'nmcli nm ...' outputs to new format --- cli/src/network-manager.c | 97 ++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 12 deletions(-) diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index b5c3bd5418..519f02f955 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -30,6 +30,22 @@ #include "network-manager.h" +/* Available fields for 'nm status' */ +static NmcOutputField nmc_fields_nm_status[] = { + {"RUNNING", N_("RUNNING"), 15, NULL, 0}, /* 0 */ + {"STATE", N_("STATE"), 15, NULL, 0}, /* 1 */ + {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 2 */ + {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 3 */ + {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 4 */ + {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_STATUS_COMMON "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_WIFI "WIFI" +#define NMC_FIELDS_NM_WWAN "WWAN" + + extern GMainLoop *loop; /* static function prototypes */ @@ -84,9 +100,37 @@ show_nm_status (NmCli *nmc) NMState state; const char *wireless_hw_enabled_str, *wireless_enabled_str; const char *wwan_hw_enabled_str, *wwan_enabled_str; + GError *error = NULL; + const char *fields_str; + const char *fields_all = NMC_FIELDS_NM_STATUS_ALL; + const char *fields_common = NMC_FIELDS_NM_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; g_return_val_if_fail (nmc->client != NULL, NMC_RESULT_ERROR_UNKNOWN); + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + g_string_printf (nmc->return_text, error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("NetworkManager status"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nm_running = nm_client_get_manager_running (nmc->client); state = nm_client_get_state (nmc->client); if (nm_running) { @@ -98,15 +142,15 @@ show_nm_status (NmCli *nmc) wireless_hw_enabled_str = wireless_enabled_str = wwan_hw_enabled_str = wwan_enabled_str = _("unknown"); } - if (nmc->print_output == NMC_PRINT_PRETTY) - print_table_header (_("NetworkManager status"), NULL); + nmc->allowed_fields[0].value = nm_running ? _("running") : _("not running"); + nmc->allowed_fields[1].value = nm_state_to_string (state); + nmc->allowed_fields[2].value = wireless_hw_enabled_str; + nmc->allowed_fields[3].value = wireless_enabled_str; + nmc->allowed_fields[4].value = wwan_hw_enabled_str; + nmc->allowed_fields[5].value = wwan_enabled_str; - print_table_line (0, _("NM running:"), 25, nm_running ? _("running") : _("not running"), 0, NULL); - print_table_line (0, _("NM state:"), 25, nm_state_to_string (state), 0, NULL); - print_table_line (0, _("NM wireless hardware:"), 25, wireless_hw_enabled_str, 0, NULL); - print_table_line (0, _("NM wireless:"), 25, wireless_enabled_str, 0, NULL); - print_table_line (0, _("NM WWAN hardware:"), 25, wwan_hw_enabled_str, 0, NULL); - print_table_line (0, _("NM WWAN:"), 25, wwan_enabled_str, 0, NULL); + nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ return NMC_RESULT_SUCCESS; } @@ -118,6 +162,9 @@ do_network_manager (NmCli *nmc, int argc, char **argv) { gboolean enable_wifi; gboolean enable_wwan; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; /* create NMClient */ if (!nmc->get_client (nmc)) @@ -139,8 +186,21 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } else if (matches (*argv, "wifi") == 0) { if (next_arg (&argc, &argv) != 0) { - /* no argument, show current state */ - print_table_line (0, _("NM wireless:"), 25, nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"), 0, NULL); + /* no argument, show current WiFi state */ + if (nmc->required_fields && strcasecmp (nmc->required_fields, "WIFI")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: '%s'"), + nmc->required_fields, NMC_FIELDS_NM_WIFI); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WIFI, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("WiFi enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) enable_wifi = TRUE; @@ -156,8 +216,21 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } else if (matches (*argv, "wwan") == 0) { if (next_arg (&argc, &argv) != 0) { - /* no argument, show current state */ - print_table_line (0, _("NM WWAN:"), 25, nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"), 0, NULL); + /* no argument, show current WWAN state */ + if (nmc->required_fields && strcasecmp (nmc->required_fields, "WWAN")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: '%s'"), + nmc->required_fields, NMC_FIELDS_NM_WWAN); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WWAN, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.header_name = _("WWAN enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) enable_wwan = TRUE; From 3f92bb3c2ede52e91cdbeb8f0c5fd2e1b025d83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 19 Mar 2010 15:46:25 +0100 Subject: [PATCH 107/392] cli: fix a memory leak --- cli/src/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/src/utils.c b/cli/src/utils.c index ce22947acb..e944b4b2b7 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -85,6 +85,8 @@ parse_output_fields (const char *fields_str, const NmcOutputField fields_array[] } } done: + if (fields) + g_strfreev (fields); return array; } From 4fe2acbef366f87235461849f7208aae94f74df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Larra=C3=B1aga=20Murgoitio?= Date: Fri, 19 Mar 2010 12:10:25 -0700 Subject: [PATCH 108/392] po: update Basque translation (bgo #613055) --- po/eu.po | 1487 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 1281 insertions(+), 206 deletions(-) diff --git a/po/eu.po b/po/eu.po index 58353d1b00..f2e96a504a 100644 --- a/po/eu.po +++ b/po/eu.po @@ -1,69 +1,1279 @@ -# translation of eu.po to Basque +# translation of NetworkManager.master.po to Basque # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # -# Iñaki Larrañaga Murgoitio , 2008. +# Iñaki Larrañaga Murgoitio , 2008, 2010. msgid "" msgstr "" -"Project-Id-Version: eu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-09 16:04+0200\n" -"PO-Revision-Date: 2008-09-09 16:25+0200\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-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-16 17:05+0100\n" "Last-Translator: Iñaki Larrañaga Murgoitio \n" "Language-Team: Basque \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Erabilera: nmcli con { KOMANDOA| help }\n" +" KOMANDOA := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Konexioak" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Mota" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUIDa" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Izena" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Sistemako konexioak:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Erabiltzailearen konexioak:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Errorea: %s argumentua falta da." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Errorea: %s - ez dago halako konexiorik" + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Sistema osoko konexioak" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Erabiltzailearen konexioak" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parametro ezezagunak: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Errorea: ez da baliozko parametrorik zehaztu." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "bai" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "ez" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Konexio aktiboak" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Lehenetsia" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Zerbitzua" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Gailuak" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ez dago konexio aktiborik '%s' gailuan" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ez dago konexio edo gailu aktiborik" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktibatzen" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktibatuta" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "ezezaguna" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN konektatzen (prestatzen)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN konektatzen (autentifikazioa behar da)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN konektatzen" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN konektatzen (IP konfigurazioa lortzen)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN konektatuta" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN konexioak huts egin du" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN deskonektatuta" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "arrazoi ezezaguna" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "bat ere ez" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "erabiltzailea deskonektatu egin da" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "oinarriko sarearen konexioa eten egin da" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN zerbitzua ustekabean gelditu da" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN zerbitzuak konfigurazio baliogabea itzuli du" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "konexioaren saiakeraren denbora-muga" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN zerbitzua ez da orduan abiatu" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "huts egin du VPN zerbitzuak abiaraztean" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "VPNren ezkutukoak ez dira baliozkoak" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "VPNren ezkutukoak baliogabeak" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "konexioa kendu egin da" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "egoera: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Konexioa aktibatuta\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Errorea: konexioaren aktibazioak huts egin du" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "egoera: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Errorea: konexioaren aktibazioak huts egin du: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Errorea: denbora-muga %d segundotan iraungituta." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Errorea: konexioaren aktibazioak huts egin du: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Errorea: hust egin du '%s'(r)en konexio aktiboa lortzean." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Konexio aktiboaren egoera: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Konexio aktiboaren bide-izena: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Errorea: konexio ezezaguna: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Errorea: denbora-mugaren '%s' balioa ez da baliozkoa." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Errorea: IDa edo UUIDa zehaztu behar da." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Errorea: ez da gailu egokirik aurkitu: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Errorea: ez da gailu egokirik aurkitu." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Abisua: konexioa ez dago aktibo\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Errorea: 'con' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Errorea: ezin izan da 'D-Bus'-arekin konektatu." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Errorea: ezin izan da sistemako ezarpenik lortu." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Errorea: ezin izan da erabiltzailearen ezarpenik lortu." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Errorea: ezin da konexiorik lortu. Ezarpenen zerbitzuak ez dira exekutatzen ari." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Erabilera: nmcli dev { KOMANDOA | help }\n" +"\n" +" KOMANDOA := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "kudeatu gabea" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "ez dago erabilgarri" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "deskonektatuta" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "konektatzen (prestatzen)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "konektatzen (konfiguratzen)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "konektatzen (autentifikazioa behar da)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "konektatzen (IParen konfigurazioa lortzen)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "konektatuta" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "konexioak huts egin du" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Ezezaguna" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(bat ere ez)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: errorea 0x%X IP4 helbidea bihurtzean" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Maizt. %d MHz, Emaria: %d Mb/s, Indarra %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", enkriptatuta: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " enpresa" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Gailua" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Kontrolatzailea" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(ezezaguna)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Egoera" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW helbidea" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Ahalmenak:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Garraiolaria detektatuta" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Abiadura" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Haririk gabekoaren propietateak\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP enkriptatzea" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA enkriptatzea" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 enkriptatzea" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP zifratua" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP zifratua" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" %s haririk gabeko sarbide-puntua\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = uneko SarPunt)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Haridunaren propietateak\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Garraiolaria" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "piztu" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "itzali" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 ezarpenak:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Helbidea" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Aurrizkia" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Atebidea" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Gailuen egoera" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Errorea: '%s' argumentua falta da." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Errorea: '%s' gailua ez da aurkitu." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Ongi burututa: '%s' gailua ongi deskonektatu da." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Errorea: huts egin du '%s' (%s) gailua deskonektatzean: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Gailuaren egoera: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Errorea: interfazea zehaztu behar da." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Wifi-en eskaneatze-zerrenda" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Errorea: '%s' gailua ez da haririk gabeko gailu bat." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Gailua:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Errorea: hardwarearen helbidea zehaztu behar da." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Errorea: ez da '%s' hw helbideko sarbide-punturik aurkitu." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "SPuntuaren parametroak" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSIDa:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSIDa:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Maiztasuna:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modua:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Azpiegitura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Gehienezko bit-emaria:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Indarra:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Banderak:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "pribatutasuna" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA banderak:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN banderak:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Errorea: 'dev wifi' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Errorea: 'dev' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Erabilera: nmcli nm { KOMANDOA | help }\n" +"\n" +" KOMANDOA := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "lotan" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "konektatzen" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "gaituta" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "desgaituta" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "NetworkManager-en egoera" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM-ren exekuzioa:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "exekutatzen" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "ez da exekutatzen ari" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM-ren egoera:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM haririk gabeko hardwarea:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM haririk gabekoa:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN hardwarea:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Errorea: baliogabeko 'wifi' parametroa: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Errorea: baliogabeko 'wwan' parametroa: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Errorea: 'nm' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Erabilera: %s [AUKERAK] OBJEKTUA { KOMANDOA | help }\n" +"\n" +"AUKERAK\n" +" -t[erse] xehetasunezko irteera\n" +" -p[retty] irteera politta\n" +" -v[ersion] erakutsi programaren bertsioa\n" +" -h[elp] erakutsi laguntza hau\n" +"\n" +"OBJEKTUA\n" +" nm NetworkManager-en egoera\n" +" con NetworkManager-en konexioak\n" +" dev NetworkManager-ek kudeatutako gailuak\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "'%s' objektua ezezaguna da. Saiatu honako komandoarekin: nmcli help" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli tresna, %s bertsioa\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "'%s' aukera ezezaguna da. Saiatu honako komandoarekin: nmcli -help" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d seinalea jaso da, itzaltzen..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Errorea: ezin izan da NetworkManager-ekin konektatu." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Behar bezala egin da" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM gako-fitxategiak ez du amaierako '%s' etiketa." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ez dirudi PEM gako pribatuaren fitxategia denik." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Ez dago nahikoa memoria PEM fitxategiko datuak gordetzeko." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Gaizki osatutako PEM fitxategia: Proc-Type ez da aurreneko etiketa." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Gaizki osatutako PEM fitxategia: Proc-Type '%s' etiketa ezezaguna." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Gaizki osatutako PEM fitxategia: DEK-Info ez da bigarren etiketa." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Gaizki osatutako PEM fitxategia: ez da IV aurkitu DEK-Info etiketan." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Gaizki osatutako PEM fitxategia: IV-ek okerreko formatua du DEK-Info " +"etiketan." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Gaizki osatutako PEM fitxategia: gako pribatuaren '%s' zifratua ezezaguna." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Ezin izan da gako pribatua deskodetu." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "'%s' PEM ziurtagiriak ez du amaierako '%s' etiketa." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Huts egin du ziurtagiria deskodetzean." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Ez dago nahikoa memoria ziurtagiriaren datuak gordetzeko." + +#: ../libnm-util/crypto.c:294 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Not enough memory to store file data." +msgstr "Ez dago nahikoa memoria fitxategiko datuak gordetzeko." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV-ek byte-kopuru bikoitia izan behar du luzeran." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Ez dago nahikoa memoria IV gordetzeko." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-ek hamaseitarrak ez diren digituak ditu." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Gako pribatuaren '%s' zifratua ezezaguna da." + +#: ../libnm-util/crypto.c:391 +#, c-format +#| msgid "Not enough memory to store decrypted private key." +msgid "Not enough memory to decrypt private key." +msgstr "Ez dago nahikoa memoria gako pribatua deszifratzeko." + +#: ../libnm-util/crypto.c:511 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Unable to determine private key type." +msgstr "Huts egin du gako pribatuaren mota zehaztean." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Ez dago nahikoa memoria deszifratutako gako pribatua gordetzeko." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Huts egin du zifratzearen motorra hasieratzean." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Huts egin du MD5 motorra hasieratzean: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Baliogabeko IV luzera (gutxienez %zd izan behar du)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Ez dago nahikoa memoria deszifratutako gako buferrarentzako." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Huts egin du zifratze-testuingurua hasieratzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Huts egin du IV ezartzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Huts egin du gako pribatua deszifratzean: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Huts egin du gako pribatua deszifratzean: ustekabeko betegarriaren luzera." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key." +msgstr "Huts egin du gako pribatua deszifratzean." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Ezin izan da memoria esleitu enkriptatzeko." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Huts egin du zifratze-testuingurua enkriptazioa hasieratzean: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Huts egin du gako simetrikoa ezartzean enkriptatzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Huts egin du IV ezartzean enkriptatzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Huts egin du datuak enkriptatzean: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Errorea ziurtagiriaren datuak hasieratzean: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Ezin izan da ziurtagiria deskodetu: %s." + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Ezin izan da PKCS#12 deskodetzailea hasieratu: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Ezin izan da PKCS#12 fitxategia deskodetu: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Ezin izan da PKCS#12 fitxategia egiaztatu: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Huts egin du zifratzearen motorra hasieratzean: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Huts egin du MD5-en testuingurua hasieratzean: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Baliogabeko IV luzera (gutxienez %d izan behar du)" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Huts egin du zifratuaren erretena hasieratzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Huts egin du IV ezartzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Huts egin du deszifratzearen testuingurua hasieratzean." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Huts egin du gako pribatua deszifratzean: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Huts egin du gako pribatua deszifratzean: deszifratutako datuak luzeegiak dira." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Huts egin du gako pribatuaren deszifratzea amaitzean: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Huts egin du zifratuaren erretenaren enkriptazioa hasieratzean." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Huts egin du gako simetrikoa ezartzean enkriptatzeko." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Huts egin du IV ezartzean enkriptatzeko." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Huts egin du enkriptazioaren testuingurua hasieratzean." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Huts egin du enkriptatzean: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Ustekabeko datu kopurua enkriptatu ostean." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Ezin izan da ziurtagiria dekodetu: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Ezin izan da pasahitza UCS2-ra bihurtu: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Ezin izan da PKCS#12 deskodetzailea hasieratu: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Ezin izan da PKCS#12 fitxategia deskodetu: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Ezin izan da PKCS#12 fitxategia egiaztatu: %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Ezin izan da ausazko daturik sortu." + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Ez dago nahikoa memoria gakoa enkriptatzeko." + +#: ../libnm-util/nm-utils.c:1655 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Ezin izan da memoria esleitu PEM fitxategia sortzeko." + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ezin izan da memoria esleitu IV idazteko PEM fitxategian." + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Ezin izan da memoria esleitu enkriptatutako gakoa idazteko PEM fitxategian." + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Ezin izan da memoria esleitu PEM fitxategiko datuentzako." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "errorea netlink-en mezua prozesatzean: %s" -#: ../src/nm-netlink-monitor.c:250 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "ezin da netlink-ekin konektatu konexioaren egoera monitorizatzeko: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "ezin da netlink-ekin konektatu konexioaren egoera monitorizatzeko: %s" -#: ../src/nm-netlink-monitor.c:268 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "ezin da netlink taldearekin elkartu konexioaren egoera monitorizatzeko: %s" -#: ../src/nm-netlink-monitor.c:276 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "ezin da netlink-en konexio-cachea esleitu konexioaren egoera " "monitorizatzeko: %s" -#: ../src/nm-netlink-monitor.c:439 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "errorea gertatu da socket-eko datuen zai egotean" + +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 #, c-format msgid "error updating link cache: %s" msgstr "errorea netlink-en konexio-cachea eguneratzean: %s" -#: ../src/nm-netlink-monitor.c:497 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "errorea gertatu da socket-eko datuen zai egotean" - -#: ../src/NetworkManager.c:250 +#: ../src/NetworkManager.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Aukera baliogabea. Erabili '--help' baliozko aukeren zerrenda ikusteko.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:89 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager-ek sortuta\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:95 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 #, c-format msgid "" "# Merged from %s\n" @@ -72,205 +1282,70 @@ msgstr "" "# %s(e)ndik batuta\n" "\n" -#: ../src/named-manager/nm-named-manager.c:240 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "" -"OHARRA: libc-en ebaztaileak ez du 3 izen-zerbitzari baino gehiago " -"onartzen." +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "ezin da netlink-en kudeaketa esleitu: %s" -#: ../src/named-manager/nm-named-manager.c:242 +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "ezin da netlink-ekin konektatu: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "ezin da netlink taldearekin elkartu: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "OHARRA: libc-en ebaztaileak ez du 3 izen-zerbitzari baino gehiago onartzen." + +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Azpian zerrendatutako izen-zenbitzariak ez dira ezagutuko." -#: ../system-settings/src/main.c:366 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Auto %s" -#: ../libnm-util/crypto.c:125 -#, c-format -msgid "PEM key file had no end tag '%s'." -msgstr "PEM gako-fitxategiak ez du amaierako '%s' etiketa." +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Sistema" -#: ../libnm-util/crypto.c:135 -#, c-format -msgid "Doesn't look like a PEM private key file." -msgstr "Ez dirudi PEM gako pribatuaren fitxategia denik." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Konexio partekatua babestutako haririk gabeko sarearen bidez" -#: ../libnm-util/crypto.c:143 -#, c-format -msgid "Not enough memory to store PEM file data." -msgstr "Ez dago nahikoa memoria PEM fitxategiko datuak gordetzeko." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Konexio partekatua irekitako haririk gabeko sarearen bidez" -#: ../libnm-util/crypto.c:159 -#, c-format -msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "Gaizki osatutako PEM fitxategia: Proc-Type ez da aurreneko etiketa." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Aldatu sistemako ostalari-izen iraunkorra" -#: ../libnm-util/crypto.c:167 -#, c-format -msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Gaizki osatutako PEM fitxategia: Proc-Type '%s' etiketa ezezaguna." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Aldatu sistemako konexioak" -#: ../libnm-util/crypto.c:177 -#, c-format -msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "Gaizki osatutako PEM fitxategia: DEK-Info ez da bigarren etiketa." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemako arauek sistemako ezarpenak aldatzea saihesten dute" -#: ../libnm-util/crypto.c:188 -#, c-format -msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Gaizki osatutako PEM fitxategia: ez da IV aurkitu DEK-Info etiketan." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemako arauek sistemako ostalari-izen iraunkorra aldatzea saihesten dute" -#: ../libnm-util/crypto.c:195 -#, c-format -msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "" -"Gaizki osatutako PEM fitxategia: IV-ek okerreko formatua du DEK-Info " -"etiketan." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistemako arauek babestutako haririk gabeko sareen bidez konexioak partekatzea saihesten dute" -#: ../libnm-util/crypto.c:208 -#, c-format -msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "Gaizki osatutako PEM fitxategia: gako pribatuaren '%s' zifratua ezezaguna." - -#: ../libnm-util/crypto.c:227 -#, c-format -msgid "Could not decode private key." -msgstr "Ezin izan da gako pribatua deskodetu." - -#: ../libnm-util/crypto.c:271 -#, c-format -msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "'%s' PEM ziurtagiriak ez du amaierako '%s' etiketa." - -#: ../libnm-util/crypto.c:281 -#, c-format -msgid "Failed to decode certificate." -msgstr "Huts egin du ziurtagiria deskodetzean." - -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 -#, c-format -msgid "Not enough memory to store certificate data." -msgstr "Ez dago nahikoa memoria ziurtagiriaren datuak gordetzeko." - -#: ../libnm-util/crypto.c:328 -#, c-format -msgid "IV must be an even number of bytes in length." -msgstr "IV-ek byte-kopuru bikoitia izan behar du luzeran." - -#: ../libnm-util/crypto.c:337 -#, c-format -msgid "Not enough memory to store the IV." -msgstr "Ez dago nahikoa memoria IV gordetzeko." - -#: ../libnm-util/crypto.c:348 -#, c-format -msgid "IV contains non-hexadecimal digits." -msgstr "IV-ek hamaseitarrak ez diren digituak ditu." - -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:157 -#, c-format -msgid "Private key cipher '%s' was unknown." -msgstr "Gako pribatuaren '%s' zifratua ezezaguna da." - -#: ../libnm-util/crypto.c:395 -#, c-format -msgid "Not enough memory to create private key decryption key." -msgstr "Ez dago nahikoa memoria gako pribatuaren gako deszifratua sortzeko." - -#: ../libnm-util/crypto.c:513 -#, c-format -msgid "Not enough memory to store decrypted private key." -msgstr "Ez dago nahikoa memoria deszifratutako gako pribatua gordetzeko." - -#: ../libnm-util/crypto_gnutls.c:45 -msgid "Failed to initialize the crypto engine." -msgstr "Huts egin du zifratzearen motorra hasieratzean." - -#: ../libnm-util/crypto_gnutls.c:89 -#, c-format -msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Huts egin du MD5 motorra hasieratzean: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:166 -#, c-format -msgid "Not enough memory for decrypted key buffer." -msgstr "Ez dago nahikoa memoria deszifratutako gako buferrarentzako." - -#: ../libnm-util/crypto_gnutls.c:160 -#, c-format -msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Huts egin du zifratze-testuingurua hasieratzean deszifratzeko: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:169 -#, c-format -msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:178 -#, c-format -msgid "Failed to set IV for decryption: %s / %s." -msgstr "Huts egin du IV ezartzean deszifratzeko: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:187 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "Huts egin du gako pribatua deszifratzean: %s /%s." - -#: ../libnm-util/crypto_gnutls.c:225 -#, c-format -msgid "Error initializing certificate data: %s" -msgstr "Errorea ziurtagiriaren datuak hasieratzean: %s" - -#: ../libnm-util/crypto_gnutls.c:237 -#, c-format -msgid "Couldn't decode certificate: %s" -msgstr "Ezin izan da ziurtagiria deskodetu: %s." - -#: ../libnm-util/crypto_nss.c:52 -#, c-format -msgid "Failed to initialize the crypto engine: %d." -msgstr "Huts egin du zifratzearen motorra hasieratzean: %d." - -#: ../libnm-util/crypto_nss.c:98 -#, c-format -msgid "Failed to initialize the MD5 context: %d." -msgstr "Huts egin du MD5-en testuingurua hasieratzean: %d." - -#: ../libnm-util/crypto_nss.c:174 -#, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "Huts egin du zifratuaren erretena hasieratzean deszifratzeko." - -#: ../libnm-util/crypto_nss.c:184 -#, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko." - -#: ../libnm-util/crypto_nss.c:194 -#, c-format -msgid "Failed to set IV for decryption." -msgstr "Huts egin du IV ezartzean deszifratzeko." - -#: ../libnm-util/crypto_nss.c:202 -#, c-format -msgid "Failed to initialize the decryption context." -msgstr "Huts egin du deszifratzearen testuingurua hasieratzean." - -#: ../libnm-util/crypto_nss.c:215 -#, c-format -msgid "Failed to decrypt the private key: %d." -msgstr "Huts egin du gako pribatua deszifratzean: %d." - -#: ../libnm-util/crypto_nss.c:227 -#, c-format -msgid "Failed to finalize decryption of the private key: %d." -msgstr "Huts egin du gako pribatuaren deszifratzea amaitzean: %d." - -#: ../libnm-util/crypto_nss.c:271 -#, c-format -msgid "Couldn't decode certificate: %d" -msgstr "Ezin izan da ziurtagiria dekodetu: %d" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistemako arauek irakitako haririk gabeko sareen bidez konexioak partekatzea saihesten dute" From e7eaacf426737236c7cf842dd9301534bf6e0739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Fri, 19 Mar 2010 12:12:01 -0700 Subject: [PATCH 109/392] po: update Spanish translation (bgo #612079) --- po/es.po | 1170 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1068 insertions(+), 102 deletions(-) diff --git a/po/es.po b/po/es.po index 6120118b8a..fe3f8297d2 100644 --- a/po/es.po +++ b/po/es.po @@ -7,96 +7,815 @@ # Antonio Ognio , 2004. # Francisco Javier F. Serrador , 2004, 2005, 2006. # Lucas Vieites Fariña , 2005, 2006. -# Jorge González , 2007, 2008. +# Jorge González , 2007, 2008, 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2008-11-13 21:19+0000\n" -"PO-Revision-Date: 2008-11-14 20:28+0100\n" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-07 13:27+0100\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:476 -#, c-format -msgid "error processing netlink message: %s" -msgstr "error al procesar el mensaje de netlink: %s" - -#: ../src/nm-netlink-monitor.c:252 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "" -"no se puede asignar el manejador netlink para monitorizar el estado del " -"enlace: %s" - -#: ../src/nm-netlink-monitor.c:262 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"no se puede conectar con netlink para monitorizar el estado del enlace: %s" - -#: ../src/nm-netlink-monitor.c:270 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" - -#: ../src/nm-netlink-monitor.c:278 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "" -"no se puede asignar el enlace a la caché de netlink para monitorizar el " -"estado del enlace: %s" - -#: ../src/nm-netlink-monitor.c:441 -#, c-format -msgid "error updating link cache: %s" -msgstr "error al actualizar el enlace caché: %s" - -#: ../src/nm-netlink-monitor.c:499 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "ha ocurrido un error mientras esperaban datos en un socket" - -#: ../src/NetworkManager.c:252 -#, c-format -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "" -"Opción no válida. Use --help para ver una lista de las opciones válidas.\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 -msgid "# Created by NetworkManager\n" -msgstr "# Creado por NetworkManager\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#: ../cli/src/connections.c:86 #, c-format msgid "" -"# Merged from %s\n" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" "\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" msgstr "" -"# Mezclado de %s\n" -"\n" -#: ../src/named-manager/nm-named-manager.c:256 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "" -"NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " -"servidores de nombres." +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Conexiones" -#: ../src/named-manager/nm-named-manager.c:258 -msgid "The nameservers listed below may not be recognized." -msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Tipo" -#: ../system-settings/src/main.c:376 +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Nombre" + +#: ../cli/src/connections.c:163 #, c-format -msgid "Auto %s" -msgstr "Auto %ss" +msgid "System connections:\n" +msgstr "" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "" + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "" + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "" + +#: ../cli/src/connections.c:221 +#, 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 "sí" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "no" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Conexiones activas" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Predeterminada" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Servicio" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Dispositivos" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "activando" + +#: ../cli/src/connections.c:732 +msgid "activated" +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 +msgid "unknown" +msgstr "desconocido" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "razón desconocida" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "ninguna" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "estado: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "" + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "" + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "" + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "" + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "" + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "" + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "" + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "" + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "" + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "" + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "" + +#: ../cli/src/devices.c:238 +#, 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 "" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr "" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "" + +#: ../cli/src/devices.c:348 +#, 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 "" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" + +#: ../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:458 +msgid "Status of devices" +msgstr "" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "" + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "" + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "" + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "" + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "" + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "" + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "" + +#: ../cli/src/devices.c:863 +#, 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 "" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "" + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "" + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "" + +#: ../cli/src/network-manager.c:104 +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 "" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "" + +#. 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:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "" + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "" + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "" #: ../libnm-util/crypto.c:120 #, c-format @@ -184,8 +903,9 @@ msgstr "No hay memoria suficiente para almacenar la IV." msgid "IV contains non-hexadecimal digits." msgstr "IV contiene dígitos no hexadecimales." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Se desconocía el cifrador de clave privada «%s»." @@ -205,71 +925,111 @@ msgstr "No se pudo determinar el tipo de clave privada." msgid "Not enough memory to store decrypted private key." msgstr "No hay memoria suficiente para almacenar la clave privada descifrada." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Falló al inicializar el motor de descifrado." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Falló al inicializar el motor MD5: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "No hay memoria suficiente para el búfer de la clave descifrada." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Falló al inicializar el contexto de descifrado: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Falló al establecer la clave simétrica para el descifrado: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Falló al establecer IV para el descifrado: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Falló al descifrar la clave privada: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../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 "Falló al descifrar la clave privada: longitud inesperada del relleno." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Falló al descifrar la clave privada." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "No se pudo reservar memoria para el cifrado." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Falló al inicializar el contexto de cifrado: %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 "Falló al establecer la clave simétrica para el cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Falló al establecer IV para el cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Falló al cifrar los datos: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Error al inicializar los datos del certificado: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "No se pudo decodificar el certificado: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "No se pudo inicializar el decodificador PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "No se pudo decodificar el archivo PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "No se pudo verificar el archivo PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Falló al inicializar el motor de cifrado: %d." @@ -279,62 +1039,268 @@ msgstr "Falló al inicializar el motor de cifrado: %d." msgid "Failed to initialize the MD5 context: %d." msgstr "Falló al inicializar el contexto MD5: %d" -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "" + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Falló al inicializar la ranura de descifrado." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Falló al establecer la clave simétrica para el descifrado." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Falló al establecer IV para el descifrado." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Falló al inicializar el contexto de descifrado." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Falló al descifrar la clave privada: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../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 "" +"Falló al descifrar la clave privada: los datos descifrados son demasiado " +"grandes." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Falló la finalización del descifrado de la clave privada: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../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 "Falló al inicializar la ranura de cifrado." + +#: ../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 "Falló al establecer la clave simétrica para el cifrado." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Falló al establecer IV para el cifrado." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Falló al inicializar el contexto de cifrado." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Falló al cifrar: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "" + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "No se pudo decodificar el certificado: %d" -#: ../libnm-util/crypto_nss.c:317 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "No se pudo convertir la contraseña a UCS2: %d" -#: ../libnm-util/crypto_nss.c:345 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "No se pudo inicializar el decodificador PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:354 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "No se pudo decodificar el archivo PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:363 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "No se pudo verificar el archivo PKCS#12: %d" -#~ msgid "Not enough memory to create private key decryption key." -#~ msgstr "" -#~ "No hay memoria suficiente para crear la clave privada de la clave de " -#~ "descifrado." +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "No se pudo generar datos aleatorios." + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "No hay memoria suficiente para crear la clave privada de cifrado." + +#: ../libnm-util/nm-utils.c:1655 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "No se pudo reservar memoria para crear el archivo PEM." + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "" + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "No se pudo reservar memoria para el archivo de datos PEM." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "error al procesar el mensaje de netlink: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"no se puede asignar el manejador netlink para monitorizar el estado del " +"enlace: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"no se puede conectar con netlink para monitorizar el estado del enlace: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"no se puede asignar el enlace a la caché de netlink para monitorizar el " +"estado del enlace: %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 "ha ocurrido un error mientras esperaban datos en un socket" + +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "error al actualizar el enlace caché: %s" + +#: ../src/NetworkManager.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opción no válida. Use --help para ver una lista de las opciones válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +msgid "# Created by NetworkManager\n" +msgstr "# Creado por NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Mezclado de %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "no se puede asignar el manejador netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "no se puede conectar con netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "no pudo unirse al grupo netlink: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " +"servidores de nombres." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %ss" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" From edbc28daa3111d2e7cc0644834e8edf851af159e Mon Sep 17 00:00:00 2001 From: Christian Kirbach Date: Fri, 19 Mar 2010 12:14:11 -0700 Subject: [PATCH 110/392] po: updated German translation (bgo #612670) --- po/de.po | 885 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 866 insertions(+), 19 deletions(-) diff --git a/po/de.po b/po/de.po index 05709384d2..ea2fe025cb 100644 --- a/po/de.po +++ b/po/de.po @@ -7,20 +7,867 @@ # Thomas Gier , 2007. # Andre Klapper , 2007. # Hauke Mehrtens , 2008. -# Christian Kirbach , 2009. -# +# Christian Kirbach , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-15 23:02+0200\n" -"PO-Revision-Date: 2009-10-14 11:27+0200\n" +"POT-Creation-Date: 2010-03-12 08:15+0100\n" +"PO-Revision-Date: 2010-03-12 08:17+0100\n" "Last-Translator: Christian Kirbach \n" -"Language-Team: German \n" +"Language-Team: Deutsch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Aufruf: nmcli con { BEFEHL | help }\n" +" BEFEHL := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Verbindungen" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Name" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "System-Verbindungen:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Benutzer-Verbindungen:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Fehler: %s Argument fehlt." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Fehler: %s - keine solche Verbindung." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Systemweite Verbindungen" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Benutzer-Verbindungen" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Unbekannter Parameter: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Fehler: Kein gültiger Parameter angegeben." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "nein" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktive Verbindungen " + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Vorgabe" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Dienst" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Gerät" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "keine aktive Verbindung auf Gerät »%s«" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "keine aktive Verbindung auf Gerät" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "wird aktiviert" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktiviert" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "unbekannt" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN wird verbunden (vorbereiten)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN wird verbunden (Legitimierung erforderlich)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN wird verbunden" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN wird verbunden (IP-Konfiguration wird ermittelt)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN verbunden" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN-Verbindung fehlgeschlagen" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN getrennt" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "unbekannter Grund" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "kein" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "der Benutzer wurde getrennt" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "die Basisverbindung wurde unterbrochen" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "der VPN-Dienst brach unerwartet ab" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "der VPN-Dienst gab eine ungültige Konfiguration zurück" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "Der Verbindungsversuch ist zeitlich abgelaufen" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "der VPN-Dienst ist nicht rechtzeitig gestartet" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "der VPN-Dienst konnte nicht starten" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "keine gültigen VPN-Geheimnisse" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "ungültige VPN-Geheimnisse" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "Die Verbindung wurde entfernt" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "Zustand: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Verbindung aktiviert\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "Zustand: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Fehler: Zeitbeschränkung von %d Sekunden abgelaufen." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Fehler: Erlangen der Verbindung für »%s« ist fehlgeschlagen." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Zustand der aktiven Verbindung: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Pfad der aktiven Verbindung: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Fehler: Unbekannte Verbindung: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Fehler: Der Wert »%s« für den Zeitablauf ist nicht gültig." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Fehler: id oder uuid muss angegeben werden." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Fehler: Kein passendes Gerät gefunden: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Fehler: Kein passendes Gerät gefunden." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Warnung: Verbindung ist derzeit nicht aktiv\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »con« ist nicht gültig." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Fehler: Es konnte nicht mit D-Bus verbunden werden." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Fehler: Verbindungen können nicht erlangt werden: Die Einstellungsdienste " +"werden nicht ausgeführt." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Aufruf: nmcli dev { BEFEHL | help }\n" +"\n" +" BEFEHL := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "nicht verwaltet" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "nicht verfügbar" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "getrennt" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "wird verbunden (vorbereiten)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "wird verbunden (konfigurieren)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "wird verbunden (Legitimierung erforderlich)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "wird verbunden (IP-Konfiguration wird ermittelt)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "verbunden" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "Verbindung fehlgeschlagen" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Unbekannt" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(keine)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Verschlüsselt:" + +#: ../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" + +# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr "Enterprise" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Gerät" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Treiber" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(unbekannt)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Zustand" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Hardware-Adresse" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +"Fähigkeiten:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Trägersignal erkannt" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Geschwindigkeit" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Eigenschaften der drahtlosen Verbindung\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP-Verschlüsselung" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA-Verschlüsselung" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2-Verschlüsselung" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP-Chiffre" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP-Chiffre" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Zugangspunkte für Drahtlosnetzwerk %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = aktueller Zugangspunkt)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Eigenschaften der kabelgebundenen Verbindung\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Trägersignal" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "an" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "aus" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4-Einstellungen:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adresse" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Präfix" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Status von Geräten" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Fehler: Argument »%s« fehlt." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Fehler: Gerät »%s« wurde nicht gefunden" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Erfolg: Gerät »%s« wurde erfolgreich getrennt." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Fehler: Trennung des Gerätes »%s« (%s) ist fehlgeschlagen: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Gerätezustand: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Fehler: Schnittstelle muss angegeben werden." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Suchliste für WiFi" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fehler: Gerät »%s« ist kein WiFi-Gerät." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Gerät:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Fehler: Hardware-Adresse muss angegeben werden." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "" +"Fehler: Der Zugangspunkt mit Hardware-Adresse »%s« wurde nicht gefunden." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parameter des Zugangspunktes" + +#: ../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 "Frequenz:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modus:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastuktur" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maximale Bitrate:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Stärke:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flags:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "Datenschutzmodus" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA-Flags:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN-Flags:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist nicht gültig." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev« ist nicht gültig." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Aufruf: nmcli nm { BEFEHL | help }\n" +"\n" +" BEFEHL := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "schlafend" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "wird verbunden" + +#: ../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 "aktiviert" + +#: ../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 "deaktiviert" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Status von NetworkManager" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM läuft:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "wird ausgeführt" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "wird nicht ausgeführt" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Status von NM:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM Drahtlos-Hardware:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM drahtlos:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN-Hardware:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Fehler: Ungültiger »wifi«-Parameter: »%s«." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Fehler: Ungültiger »wwan«-Parameter: »%s«." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »nm« ist nicht gültig." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Aufruf: %s [OPTIONEN] OBJEKT { BEFEHL | help }\n" +"\n" +"OPTIONEN\n" +" -t[erse] knappe Ausgabe\n" +" -p[retty] hübsche Ausgabe\n" +" -v[ersion] Programm-Version anzeigen\n" +" -h[elp] dies Hilfe ausgeben\n" +"\n" +"OBJEKT\n" +" nm Status von NetworkManager\n" +" con Verbindungen von NetworkManager\n" +" dev von NetworkManager verwaltete Verbindungen\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli, Version %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Option »%s« ist unbekannt, versuchen Sie »nmcli -help«." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Signal %d wurde empfangen, wird beendet …" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Fehler: Verbindung konnte nicht mit NetworkManager hergestellt werden." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Erfolg" #: ../libnm-util/crypto.c:120 #, c-format @@ -237,7 +1084,7 @@ msgstr "PKCS#12 konnte nicht decodiert werden: %s" msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12-Datei konnte nicht überprüft werden: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Fehler beim Initialisieren der Verschlüsselung: %d." @@ -351,38 +1198,38 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" msgid "Could not generate random data." msgstr "Zufällige Daten konnten nicht erstellt werden." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1545 #, c-format msgid "Not enough memory to make encryption key." msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels." -#: ../libnm-util/nm-utils.c:1633 +#: ../libnm-util/nm-utils.c:1655 msgid "Could not allocate memory for PEM file creation." msgstr "" "Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:1667 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "" "Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " "werden." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:1679 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " "werden." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:1698 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "" "Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." #: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 +#: ../src/nm-netlink-monitor.c:582 #: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" @@ -421,23 +1268,23 @@ msgstr "" msgid "error occurred while waiting for data on socket" msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 #, c-format msgid "error updating link cache: %s" msgstr "Fehler beim Aktualisieren des Verbindungs-Cache: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" -"Ungültige Option. Verwenden Sie Bitte »--help«, um eine Liste der gültigen " +"Ungültige Option. Verwenden Sie bitte »--help«, um eine Liste der gültigen " "Optionen zu erhalten.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 msgid "# Created by NetworkManager\n" msgstr "# Erstellt von NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 #, c-format msgid "" "# Merged from %s\n" @@ -478,7 +1325,7 @@ msgstr "" msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 msgid "System" msgstr "System" From 48ea547d7ae6586f9b6b6f9ae80b6d725db41d34 Mon Sep 17 00:00:00 2001 From: Daniel Nylander Date: Fri, 19 Mar 2010 12:15:23 -0700 Subject: [PATCH 111/392] po: updated Swedish translation (bgo #611638) --- po/sv.po | 1193 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1121 insertions(+), 72 deletions(-) diff --git a/po/sv.po b/po/sv.po index f8f2d2b6fa..d9d9147a5c 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1,7 +1,7 @@ # Swedish messages for NetworkManager. -# Copyright (C) 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. # Christian Rose , 2004, 2005, 2006. -# Daniel Nylander , 2006, 2008, 2009. +# Daniel Nylander , 2006, 2008, 2009, 2010. # # $Id: sv.po,v 1.14 2006/12/10 18:34:55 dnylande Exp $ # @@ -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: 2009-08-27 03:24+0000\n" -"PO-Revision-Date: 2009-09-05 09:45+0100\n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-02 22:05+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" @@ -18,6 +18,940 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" +msgstr "" +"Användning: nmcli con { KOMMANDO | help }\n" +" KOMMANDO := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | användare]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +#| msgid "_VPN Connections" +msgid "Connections" +msgstr "Anslutningar" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Name" +msgstr "Namn" + +#: ../cli/src/connections.c:163 +#, c-format +#| msgid "Modify system connections" +msgid "System connections:\n" +msgstr "Systemanslutningar:\n" + +#: ../cli/src/connections.c:167 +#, c-format +#| msgid "No network connection" +msgid "User connections:\n" +msgstr "Användaranslutningar:\n" + +#: ../cli/src/connections.c:178 +#: ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 +#: ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 +#: ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 +#: ../cli/src/devices.c:614 +#: ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Fel: %s-argument saknas." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Fel: %s - ingen sådan anslutning." + +#: ../cli/src/connections.c:196 +#| msgid "Modify system connections" +msgid "System-wide connections" +msgstr "Systemanslutningar" + +#: ../cli/src/connections.c:205 +#| msgid "No network connection" +msgid "User connections" +msgstr "Användaranslutningar" + +#: ../cli/src/connections.c:212 +#: ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 +#: ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 +#: ../cli/src/devices.c:628 +#: ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Okänd parameter: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Fel: ingen giltig parameter angiven." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 +#: ../cli/src/devices.c:353 +#: ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 +#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:361 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:304 +msgid "no" +msgstr "nej" + +#: ../cli/src/connections.c:297 +#| msgid "Modify system connections" +msgid "Active connections" +msgstr "Aktiva anslutningar" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:304 +msgid "Default" +msgstr "Standard" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Service" +msgstr "Tjänst" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Enheter" + +#: ../cli/src/connections.c:659 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "no active connection on device '%s'" +msgstr "ingen aktiv anslutning på enheten \"%s\"" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ingen aktiv anslutning eller enhet" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktiverar" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktiverad" + +#: ../cli/src/connections.c:735 +#: ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 +#: ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 +#: ../cli/src/network-manager.c:98 +#| msgid "(unknown)" +msgid "unknown" +msgstr "okänt" + +#: ../cli/src/connections.c:744 +#| msgid "VPN connecting to '%s'" +msgid "VPN connecting (prepare)" +msgstr "VPN ansluter (förbereder)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN ansluter (behöver autentisering)" + +#: ../cli/src/connections.c:748 +#| msgid "_VPN Connections" +msgid "VPN connecting" +msgstr "VPN ansluter" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ansluter (hämtar IP-konfiguration)" + +#: ../cli/src/connections.c:752 +#| msgid "_VPN Connections" +msgid "VPN connected" +msgstr "VPN ansluten" + +#: ../cli/src/connections.c:754 +#| msgid "VPN Connect Failure" +msgid "VPN connection failed" +msgstr "VPN-anslutning misslyckades" + +#: ../cli/src/connections.c:756 +#| msgid "VPN Connect Failure" +msgid "VPN disconnected" +msgstr "VPN frånkopplad" + +#: ../cli/src/connections.c:767 +#| msgid "(unknown)" +msgid "unknown reason" +msgstr "okänd anledning" + +#: ../cli/src/connections.c:769 +#| msgid "None" +msgid "none" +msgstr "ingen" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "användaren kopplades från" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "basnätverksanslutningen avbröts" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN-tjänsten stoppades oväntat" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN-tjänsten returnerade en ogiltig konfiguration" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "anslutningsförsöket översteg tidsgränsen" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN-tjänsten startade inte i tid" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN-tjänsten misslyckades med att starta" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "inga giltiga VPN-hemligheter" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "ogiltiga VPN-hemligheter" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "anslutningen togs bort" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "tillstånd: %s\n" + +#: ../cli/src/connections.c:806 +#: ../cli/src/connections.c:832 +#, c-format +#| msgid "Connection _Information" +msgid "Connection activated\n" +msgstr "Anslutning aktiverad\n" + +#: ../cli/src/connections.c:809 +#, c-format +#| msgid "Connection to the wired network failed." +msgid "Error: Connection activation failed." +msgstr "Fel: Aktivering av anslutning misslyckades." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "tillstånd: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Fel: Aktivering av anslutning misslyckades: %s." + +#: ../cli/src/connections.c:855 +#: ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Fel: Tidsgränsen %d sekunder gick ut." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Fel: Aktivering av anslutning misslyckades: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Fel: Hämtning av aktiv anslutning för \"%s\" misslyckades." + +#: ../cli/src/connections.c:921 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "Active connection state: %s\n" +msgstr "Tillstånd för aktiv anslutning: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "Active connection path: %s\n" +msgstr "Sökväg för aktiv anslutning: %s\n" + +#: ../cli/src/connections.c:976 +#: ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Fel: Okänd anslutning: %s." + +#: ../cli/src/connections.c:1011 +#: ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Fel: värdet \"%s\" för tidsgränsen är inte giltigt." + +#: ../cli/src/connections.c:1024 +#: ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Fel: id eller uuid måste anges." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Fel: Ingen lämplig enhet hittades: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Fel: Ingen lämplig enhet hittades." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Varning: Anslutningen är inte aktiv\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Fel: \"con\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Fel: kunde inte ansluta till D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Fel: Kunde inte få systeminställningar." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Fel: Kunde inte få användarinställningar." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Fel: Kan inte få anslutningar: inställningstjänster är inte igång." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Användning: nmcli dev { KOMMANDO | help }\n" +"\n" +" KOMMANDO := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "ohanterad" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "otillgänglig" + +#: ../cli/src/devices.c:97 +#: ../cli/src/network-manager.c:73 +#| msgid "_Disconnect VPN..." +msgid "disconnected" +msgstr "frånkopplad" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "ansluter (förbereder)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "ansluter (konfigurerar)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "ansluter (behöver autentisering)" + +#: ../cli/src/devices.c:105 +#| msgid "Connection _Information" +msgid "connecting (getting IP configuration)" +msgstr "ansluter (hämtar IP-konfiguration)" + +#: ../cli/src/devices.c:107 +#: ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "ansluten" + +#: ../cli/src/devices.c:109 +#| msgid "Connection _Information" +msgid "connection failed" +msgstr "anslutningen misslyckades" + +#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Okänt" + +#. print them +#: ../cli/src/devices.c:164 +#: ../cli/src/devices.c:266 +#: ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +#| msgid "(unknown)" +msgid "(none)" +msgstr "(ingen)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: fel vid konvertering av IP4-adress 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frekv %d MHz, Hast %d Mb/s, Styrka %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Krypterad: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + +#: ../cli/src/devices.c:294 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Device" +msgstr "Enhet" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Drivrutin" + +#: ../cli/src/devices.c:299 +#: ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(okänt)" + +#: ../cli/src/devices.c:300 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "State" +msgstr "Tillstånd" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Hårdvaruadress" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Förmågor:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Bärardetektering" + +#: ../cli/src/devices.c:336 +#, c-format +#| msgid "%d Mb/s" +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Hastighet" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Trådlösa egenskaper\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP-kryptering" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA-kryptering" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2-kryptering" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP-chiffer" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP-chiffer" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Trådlösa accesspunkter %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = aktuell AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Trådbundna egenskaper\n" + +#: ../cli/src/devices.c:377 +#: ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Bärare" + +#: ../cli/src/devices.c:377 +#| msgid "None" +msgid "on" +msgstr "på" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "av" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4-inställningar:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adress" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Prefix" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Status för enheter" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Fel: \"%s\"-argument saknas." + +#: ../cli/src/devices.c:516 +#: ../cli/src/devices.c:655 +#: ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Fel: Enheten \"%s\" hittades inte." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Lyckades: Enheten \"%s\" kopplades från." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Fel: Frånkoppling av enheten \"%s\" (%s) misslyckades: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Enhetstillstånd: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Fel: gränssnitt (iface) måste anges." + +#: ../cli/src/devices.c:736 +#: ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi-avsökningslista" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fel: Enheten \"%s\" är inte en WiFi-enhet." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Enhet:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Fel: hwaddr måste anges." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Fel: Accesspunkt med hwaddr \"%s\" hittades inte." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +#| msgid "%d Mb/s" +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 +#: ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP-parametrar" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Frekvens:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Läge:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktur" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maximal bitfrekvens:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Styrka:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flaggor:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "integritet" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA-flaggor:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN-flaggor:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fel: \"dev wifi\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fel: \"dev\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Användning: nmcli nm { KOMMANDO | help }\n" +"\n" +" KOMMANDO := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "sover" + +#: ../cli/src/network-manager.c:69 +#| msgid "VPN connecting to '%s'" +msgid "connecting" +msgstr "ansluter" + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "aktiverad" + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "inaktiverad" + +#: ../cli/src/network-manager.c:102 +#| msgid "NetworkManager Applet" +msgid "NetworkManager status" +msgstr "Status för Nätverkshanterare" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM kör:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "kör" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "kör inte" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM tillstånd:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM trådlös hårdvara:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 +#: ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM trådlös:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN hårdvara:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 +#: ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Fel: ogiltig \"wifi\"-parameter: \"%s\"." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Fel: ogiltig \"wwan\"-parameter: \"%s\"." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Fel: \"nm\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Användning: %s [FLAGGOR] OBJEKT { KOMMANDO | help }\n" +"\n" +"FLAGGOR\n" +" -t[erse] kort utdata\n" +" -p[retty] vackert utdata\n" +" -v[ersion] visa programversion\n" +" -h[elp] skriv ut denna hjälp\n" +"\n" +"OBJEKT\n" +" nm status för Nätverkshanterare\n" +" con anslutningar i Nätverkshanterare\n" +" dev enheter hanterade av Nätverkshanterare\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objektet \"%s\" är okänt, prova \"nmcli help\"." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli-verktyg, version %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Flagan \"%s\" är okänd, prova \"nmcli -help\"." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Fångade signal %d, stänger av..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Fel: Kunde inte ansluta till Nätverkshanterare." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Lyckades" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -104,8 +1038,10 @@ msgid "IV contains non-hexadecimal digits." msgstr "IV innehåller icke-hexadecimala siffror." #: ../libnm-util/crypto.c:382 -#: ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Privata nyckelchiffret \"%s\" var okänt." @@ -125,73 +1061,115 @@ msgstr "Kunde inte bestämma typ av privat nyckel." msgid "Not enough memory to store decrypted private key." msgstr "Inte tillräckligt mycket minne för att lagra dekrypterad privat nyckel." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Misslyckades med att initiera krypteringsmotorn." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Misslyckades med att initiera MD5-motorn: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 -#: ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Ogiltig IV-längd (måste vara minst %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Inte tillräckligt mycket minne för buffert för dekrypterade nycklar." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Misslyckades med att initiera chifferkontexten för dekryptering: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Misslyckades med att ställa in symmetrisk nyckel för dekryptering: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Misslyckades med att ställa in IV för dekryptering: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Misslyckades med att dekryptera den privata nyckeln: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Misslyckades med att dekryptera privata nyckeln: oväntad utfyllningslängd." + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Misslyckades med att dekryptera privata nyckeln." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Kunde inte allokera minne för kryptering." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Misslyckades med att initiera chifferkontexten för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Misslyckades med att ställa in IV för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Misslyckades med att kryptera datat: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Fel vid initiering av certifikatdata: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Kunde inte avkoda certifikat: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Kunde inte initiera PKCS#12-avkodare: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Kunde inte avkoda PKCS#12-fil: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Kunde inte verifiera PKCS#12-fil: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Misslyckades med att initiera krypteringsmotorn: %d." @@ -201,63 +1179,143 @@ msgstr "Misslyckades med att initiera krypteringsmotorn: %d." msgid "Failed to initialize the MD5 context: %d." msgstr "Misslyckades med att initiera MD5-kontexten: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Ogiltig IV-längd (måste vara minst %d)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Misslyckades med att initiera dekrypteringschifferplatsen." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Misslyckades med att ställa in symmetrisk nyckel för dekryptering." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Misslyckades med att ställa in IV för dekryptering." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Misslyckades med att initiera dekrypteringskontexten." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Misslyckades med att dekryptera privata nyckeln: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Misslyckades med att dekryptera privata nyckeln: dekrypterat data är för stort." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Misslyckades med att färdigställa dekryptering av den privata nyckeln: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Misslyckades med att initiera krypteringschifferplatsen." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Misslyckades med att ställa in IV för kryptering." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Misslyckades med att initiera krypteringskontexten." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Misslyckades med att kryptera: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Oväntad mängd data efter kryptering." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Kunde inte avkoda certifikat: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Kunde inte konvertera lösenord till UCS2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Kunde inte initiera PKCS#12-avkodare: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Kunde inte avkoda PKCS#12-fil: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Kunde inte verifiera PKCS#12-fil: %d" +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Kunde inte generera slumpmässigt data." + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Inte tillräckligt mycket minne för att skapa krypteringsnyckel." + +#: ../libnm-util/nm-utils.c:1655 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Kunde inte allokera minne för att skapa PEM-fil." + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Kunde inte allokera minne för skrivning av IV till PEM-fil." + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Kunde inte allokera minne för skrivning av krypterad nyckel till PEM-fil." + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Kunde inte allokera minne för PEM-fildata." + #: ../src/nm-netlink-monitor.c:194 #: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "fel vid behandling av netlink-meddelande: %s" @@ -283,19 +1341,26 @@ 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/NetworkManager.c:330 +#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "fel vid uppdatering av länkcache: %s" + +#: ../src/NetworkManager.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Ogiltig flagga. Använd --help för att se en lista över giltiga flaggor.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 msgid "# Created by NetworkManager\n" msgstr "# Skapad av Nätverkshanterare\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 #, c-format msgid "" "# Merged from %s\n" @@ -304,6 +1369,24 @@ msgstr "" "# Sammanfogad från %s\n" "\n" +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "kan inte allokera netlink-handtag: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "kan inte ansluta till netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "kan inte gå med i netlink-grupp: %s" + #: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namnservrar." @@ -312,13 +1395,12 @@ msgstr "OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namns msgid "The nameservers listed below may not be recognized." msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Automatisk %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 -#| msgid "Open System" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 msgid "System" msgstr "System" @@ -335,7 +1417,6 @@ 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 "No active connections!" msgid "Modify system connections" msgstr "Ändra systemanslutningar" @@ -355,12 +1436,6 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett skyddat tr 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 "error updating link cache: %s" -#~ msgstr "fel vid uppdatering av länkcache: %s" -#~ msgid "Not enough memory to create private key decryption key." -#~ msgstr "" -#~ "Inte tillräckligt mycket minne för att skapa dekrypteringsnyckel för " -#~ "privat nyckel." #~ msgid "operation took too long" #~ msgstr "åtgärden tog för lång tid" #~ msgid "received data from wrong type of sender" @@ -373,22 +1448,14 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ 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 "Connection to the wired network failed." -#~ msgstr "Anslutning till det trådburna nätverket 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 "%d Mb/s" -#~ msgstr "%d Mb/s" #~ msgid "Wired Ethernet (%s)" #~ msgstr "Trådbundet Ethernet (%s)" #~ msgid "Wireless Ethernet (%s)" #~ msgstr "Trådlöst Ethernet (%s)" -#~ msgid "Unknown" -#~ msgstr "Okänt" -#~ msgid "NetworkManager Applet" -#~ msgstr "Panelprogram för nätverkshantering" #~ msgid "" #~ "Copyright © 2004-2006 Red Hat, Inc.\n" #~ "Copyright © 2005-2006 Novell, Inc." @@ -427,8 +1494,6 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ msgstr "" #~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett fel vid start " #~ "av VPN-programmet." -#~ msgid "VPN Connect Failure" -#~ msgstr "VPN-anslutningsfel" #~ 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." @@ -454,8 +1519,6 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ 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 "(unknown)" -#~ msgstr "(okänt)" #~ 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'..." @@ -478,28 +1541,18 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ msgstr "Nätverkshanteraren är inte igång" #~ msgid "Networking disabled" #~ msgstr "Nätverk inaktiverat" -#~ msgid "No network connection" -#~ msgstr "Ingen nätverksanslutning" #~ 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 "VPN connection to '%s'" -#~ msgstr "VPN-anslutning till \"%s\"" -#~ msgid "VPN connecting to '%s'" -#~ msgstr "VPN-ansluter till \"%s\"" #~ 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 "_VPN Connections" -#~ msgstr "_VPN-anslutningar" #~ msgid "_Configure VPN..." #~ msgstr "_Konfigurera VPN..." -#~ msgid "_Disconnect VPN..." -#~ msgstr "Koppla _från VPN..." #~ msgid "_Dial Up Connections" #~ msgstr "_Uppringda anslutningar" #~ msgid "Connect to %s..." @@ -514,8 +1567,6 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ msgstr "Aktivera _nätverk" #~ msgid "Enable _Wireless" #~ msgstr "Aktivera _trådlöst" -#~ msgid "Connection _Information" -#~ msgstr "Anslutnings_information" #~ msgid "_Help" #~ msgstr "_Hjälp" #~ msgid "_About" @@ -536,8 +1587,6 @@ msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trå #~ msgstr "TKIP" #~ msgid "Dynamic WEP" #~ msgstr "Dynamisk WEP" -#~ msgid "None" -#~ msgstr "Ingen" #~ msgid "WEP 64/128-bit ASCII" #~ msgstr "WEP 64/128-bitars ASCII" #~ msgid "WEP 64/128-bit Hex" From 869a1dc6c9d77bc1ca0d24685429c9a65a231b6f Mon Sep 17 00:00:00 2001 From: Tomasz Dominikowski Date: Fri, 19 Mar 2010 12:16:19 -0700 Subject: [PATCH 112/392] po: updated Polish translation (bgo #612167) --- po/pl.po | 1419 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1340 insertions(+), 79 deletions(-) diff --git a/po/pl.po b/po/pl.po index bcee37a9b5..7ffa179913 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-08-27 03:24+0000\n" -"PO-Revision-Date: 2009-09-09 01:47+0200\n" -"Last-Translator: Piotr Drąg \n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-08 11:52+0100\n" +"Last-Translator: Tomasz Dominikowski \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,6 +19,1076 @@ msgstr "" "X-Poedit-Language: Polish\n" "X-Poedit-Country: Poland\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" +msgstr "" +"Użycie: nmcli con { POLECENIE | help }\n" +" POLECENIE := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" + + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Połączenia" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Name" +msgstr "Nazwa" + + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Połączenia systemowe:\n" + + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Połączenia użytkownika:\n" + + +#: ../cli/src/connections.c:178 +#: ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 +#: ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 +#: ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 +#: ../cli/src/devices.c:614 +#: ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Błąd: brak parametru %s." + + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Błąd: %s - nie ma takiego połączenia." + + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Połączenia systemowe" + + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Połączenia użytkownika" + + +#: ../cli/src/connections.c:212 +#: ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 +#: ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 +#: ../cli/src/devices.c:628 +#: ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Nieznany parametr: %s\n" + + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Błąd: nie podano prawidłowego parametru." + + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 +#: ../cli/src/devices.c:353 +#: ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 +#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:361 +msgid "yes" +msgstr "tak" + + +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:304 +msgid "no" +msgstr "nie" + + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktywne połączenia" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:304 +msgid "Default" +msgstr "Domyślne" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Service" +msgstr "Usługa" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Urządzenia" + + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "brak aktywnych połączeń na urządzeniu \"%s\"" + + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "brak aktywnych połączeń na urządzeń" + + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktywowanie" + + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktywowano" + + +#: ../cli/src/connections.c:735 +#: ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 +#: ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 +#: ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "nieznane" + + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "Łączenie z VPN (przygotowanie)" + + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "Łączenie z VPN (wymaga uwierzytelnienia)" + + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "Łączenie z VPN" + + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "Łączenie z VPN (pobieranie konfiguracji adresu IP)" + + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "Połączono z VPN" + + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "Połączenie z VPN się nie powiodło" + + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "Rozłączono z VPN" + + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "nieznany powód" + + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "brak" + + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "użytkownik został rozłączony" + + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "podstawowe połączenie sieciowe zostało przerwane" + + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "usługa VPN została nieoczekiwanie zatrzymana" + + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "usługa VPN zwróciła nieprawidłową konfigurację" + + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "próba połączenia przekroczyła czas oczekiwania" + + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "usługa VPN nie została uruchomiona w czasie" + + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "uruchomienie usługi VPN się nie powiodło" + + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "brak prawidłowych haseł VPN" + + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "nieprawidłowe hasła VPN" + + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "połączenie zostało usunięte" + + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "stan: %s\n" + + +#: ../cli/src/connections.c:806 +#: ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Aktywowano połączenie\n" + + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Błąd: aktywacja połączenia się nie powiodła." + + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stan: %s (%d)\n" + + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Błąd: aktywacja połączenia się nie powiodła: %s." + + +#: ../cli/src/connections.c:855 +#: ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Błąd: przekroczono czas oczekiwania o %d sekund." + + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Błąd: aktywacja połączenia się nie powiodła: %s" + + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Błąd: uzyskanie aktywnego połączenia dla \"%s\" się nie powiodło." + + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stan aktywnego połączenia: %s\n" + + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Ścieżka aktywnego połączenia: %s\n" + + +#: ../cli/src/connections.c:976 +#: ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Błąd: nieznane połączenie: %s." + + +#: ../cli/src/connections.c:1011 +#: ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Błąd: wartość czasu oczekiwania \"%s\" jest nieprawidłowa." + + +#: ../cli/src/connections.c:1024 +#: ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Błąd: należy podać identyfikator lub UUID." + + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia: %s" + + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia." + + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Ostrzeżenie: połączenie nie jest aktywne\n" + + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Błąd: polecenie \"con\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Błąd: nie można połączyć się z D-Bus." + + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Błąd: nie można uzyskać ustawień systemu." + + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Błąd: nie można uzyskać ustawień użytkownika." + + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Błąd: nie można uzyskać połączeń: usługi ustawień nie są uruchomione." + + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Użycie: nmcli dev { POLECENIE | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "niezarządzane" + + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "niedostępne" + + +#: ../cli/src/devices.c:97 +#: ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "rozłączono" + + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "łączenie (przygotowanie)" + + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "łączenie (konfigurowanie)" + + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "łączenie (wymaga uwierzytelnienia)" + + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "łączenie (pobieranie konfiguracji adresu IP)" + + +#: ../cli/src/devices.c:107 +#: ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "połączono" + + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "połączenie się nie powiodło" + + +#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Nieznane" + + +#. print them +#: ../cli/src/devices.c:164 +#: ../cli/src/devices.c:266 +#: ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(brak)" + + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: błąd podczas konwertowania adresu IPv4 0x%X" + + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, częstotliwość %d MHz, prędkość %d Mb/s, siła sygnału %d" + + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-hoc" + + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", zaszyfrowane: " + + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + + +#: ../cli/src/devices.c:294 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Device" +msgstr "Urządzenie" + + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Sterownik" + + +#: ../cli/src/devices.c:299 +#: ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(nieznane)" + + +#: ../cli/src/devices.c:300 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "State" +msgstr "Stan" + + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Adres sprzętowy" + + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Możliwości:\n" + + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Wykrywanie operatora" + + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Prędkość" + + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Właściwości sieci bezprzewodowej\n" + + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Szyfrowanie WEP" + + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Szyfrowanie WPA" + + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Szyfrowanie WPA2" + + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Szyfr TKIP" + + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Szyfr CCMP" + + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Bezprzewodowe punkty dostępowe %s\n" + + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = bieżący punkt dostępowy)" + + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Właściwości sieci przewodowej\n" + + +#: ../cli/src/devices.c:377 +#: ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Operator" + + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "włączone" + + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "wyłączone" + + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Ustawienia IPv4:\n" + + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adres" + + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Przedrostek" + + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Brama" + + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Stan urządzenia" + + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Błąd: brak parametru \"%s\"." + + +#: ../cli/src/devices.c:516 +#: ../cli/src/devices.c:655 +#: ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Błąd: nie odnaleziono urządzenia \"%s\"." + + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Powodzenie: urządzenie \"%s\" zostało rozłączone." + + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Błąd: rozłączenie urządzenia \"%s\" (%s) się nie powiodło: %s" + + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stan urządzenia: %d (%s)\n" + + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Błąd: należy podać interfejs." + + +#: ../cli/src/devices.c:736 +#: ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Lista skanowania sieci WiFi" + + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Błąd: urządzenie \"%s\" nie jest urządzeniem WiFi." + + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Urządzenie:" + + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Błąd: należy podać adres sprzętowy." + + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Błąd: nie odnaleziono punktu dostępowego z adresem sprzętowym \"%s\"." + + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + + +#: ../cli/src/devices.c:869 +#: ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parametry punkty dostępowego" + + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Częstotliwość:" + + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Tryb:" + + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktura" + + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maksymalna prędkość:" + + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Siła sygnału:" + + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flagi:" + + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "prywatne" + + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Flagi WPA:" + + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Flagi RSN:" + + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Błąd: polecenie \"dev wifi\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Błąd: polecenie \"dev\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Użycie: nmcli nm { POLECENIE | help }\n" +"\n" +" POLECENIE := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "wstrzymane" + + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "łączenie" + + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "włączone" + + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "wyłączone" + + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Stan programu NetworkManager" + + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "Program NetworkManager jest uruchomiony:" + + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "uruchamiany" + + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "nieuruchomiony" + + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Stan programu NetworkManager:" + + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Adres sprzętowy programu NetworkManager:" + + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 +#: ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "Sieć bezprzewodowa programu NetworkManager:" + + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "WWAM sprzętu programu NetworkManager:" + + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 +#: ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "WWAN programu NetworkManager:" + + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Błąd: nieprawidłowy parametr \"wifi\": \"%s\"." + + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Błąd: nieprawidłowy parametr \"wwan\": \"%s\"." + + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Błąd: parametr \"nm\" \"%s\" jest nieprawidłowy." + + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Użycie: %s [OPCJE] OBIEKT { POLECENIE | help }\n" +"\n" +"OPCJE\n" +" -t[erse] zwięzłe wyjście\n" +" -p[retty] sformatowane wyjście\n" +" -v[ersion] wyświetla wersję programu\n" +" -h[elp] wyświetla tę opcję\n" +"\n" +"OBIEKT\n" +" nm stan programu NetworkManager\n" +" con połączenia programu NetworkManager\n" +" dev urządzenia zarządzane przez program NetworkManager\n" +"\n" + + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Obiekt \"%s\" jest nieznany. Można spróbować polecenie \"nmcli help\"." + + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "narzędzie nmcli, wersja %s\n" + + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Opcja \"%s\" jest nieznana. Można spróbować polecenie \"nmcli help\"." + + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Przechwycono sygnał %d, wyłączanie..." + + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Błąd: nie można połączyć się z programem NetworkManager." + + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Powodzenie" + + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -29,10 +1099,11 @@ msgstr "Plik klucza PEM nie zawiera znacznika końcowego \"%s\"." msgid "Doesn't look like a PEM private key file." msgstr "Nie wygląda na plik klucza prywatnego PEM." + #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." -msgstr "Brak wystarczającej ilości pamięci do przechowania danych PEM." +msgstr "Brak wystarczającej ilości pamięci do przechowania danych pliku PEM." #: ../libnm-util/crypto.c:154 #, c-format @@ -57,7 +1128,7 @@ msgstr "Uszkodzony plik PEM: brak IV w znaczniku DEK-Info." #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Uszkodzony plik PEM: niepoprawny format IV w znaczniku DEK-Info." +msgstr "Uszkodzony plik PEM: nieprawidłowy format IV w znaczniku DEK-Info." #: ../libnm-util/crypto.c:203 #, c-format @@ -67,17 +1138,18 @@ msgstr "Uszkodzony plik PEM: nieznany szyfr klucza prywatnego: \"%s\"." #: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "Nie można było zdekodować klucza prywatnego." +msgstr "Nie można zdekodować klucza prywatnego." #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." msgstr "Certyfikat PEM \"%s\" nie zawiera kończącego znacznika \"%s\"." + #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "Nieudane zdekodowanie certyfikatu." +msgstr "Zdekodowanie certyfikatu się nie powiodło." #: ../libnm-util/crypto.c:286 #, c-format @@ -89,24 +1161,28 @@ msgstr "Brak wystarczającej ilości pamięci do przechowania danych certyfikatu msgid "Not enough memory to store file data." msgstr "Brak wystarczającej ilości pamięci do przechowania danych pliku." + #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "Ilość bajtów w IV musi być parzystą liczbą." +msgstr "Liczba bajtów w IV musi być liczbą parzystą." #: ../libnm-util/crypto.c:333 #, c-format msgid "Not enough memory to store the IV." msgstr "Brak wystarczającej ilości pamięci do przechowania IV." + #: ../libnm-util/crypto.c:344 #, c-format msgid "IV contains non-hexadecimal digits." -msgstr "IV zawiera nie-szesnastkowe cyfry." +msgstr "IV zawiera nieszesnastkowe cyfry." #: ../libnm-util/crypto.c:382 -#: ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Nieznany szyfr klucza prywatnego \"%s\"." @@ -116,187 +1192,353 @@ msgstr "Nieznany szyfr klucza prywatnego \"%s\"." msgid "Not enough memory to decrypt private key." msgstr "Brak wystarczającej ilości pamięci do odszyfrowania klucza prywatnego." + #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." -msgstr "Nieudane określenie typu klucza prywatnego." +msgstr "Nie można określić typu klucza prywatnego." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." msgstr "Brak wystarczającej ilości pamięci do przechowania odszyfrowanego klucza prywatnego." -#: ../libnm-util/crypto_gnutls.c:46 -msgid "Failed to initialize the crypto engine." -msgstr "Nieudana inicjacja modułu szyfrowania." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Zainicjowanie modułu szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Nieudana inicjacja modułu MD5: %s / %s." +msgstr "Zainicjowanie modułu MD5 się nie powiodło: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 -#: ../libnm-util/crypto_nss.c:178 + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Brak wystarczającej ilości pamięci dla bufora odszyfrowanego klucza." -#: ../libnm-util/crypto_gnutls.c:160 + +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Nieudana inicjacja kontekstu szyfru do odszyfrowania: %s / %s." +msgstr "Zainicjowanie kontekstu szyfru do odszyfrowania się nie powiodło: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 + +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Nieudane ustawienie klucza symetrycznego do odszyfrowania: %s / %s." +msgstr "Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 + +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "Nieudane ustawienie IV do odszyfrowania: %s / %s." +msgstr "Ustawienie IV do odszyfrowania się nie powiodło: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "Nieudane odszyfrowanie klucza prywatnego: %s / %s." #: ../libnm-util/crypto_gnutls.c:200 #, c-format -msgid "Failed to decrypt the private key." -msgstr "Nieudane odszyfrowanie klucza prywatnego." +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %s / %s." -#: ../libnm-util/crypto_gnutls.c:235 + +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: nieoczekiwana długość wypełnienia." + + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło." + + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nie można przydzielić pamięci do szyfrowania." + + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Zainicjowanie kontekstu szyfru do szyfrowania się nie powiodło: %s / %s." + + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Ustawienie klucza symetrycznego do szyfrowania się nie powiodło: %s / %s." + + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Ustawienie IV do szyfrowania się nie powiodło: %s / %s." + + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Zaszyfrowanie danych się nie powiodło: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Błąd podczas inicjowania danych certyfikatu: %s" -#: ../libnm-util/crypto_gnutls.c:257 + +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "Nie można było zdekodować certyfikatu: %s" +msgstr "Nie można zdekodować certyfikatu: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Nie można zainicjować dekodera PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 + +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" -msgstr "Nie można było odszyfrować pliku PKCS#12: %s" +msgstr "Nie można odszyfrować pliku PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 + +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" -msgstr "Nie można było zweryfikować pliku PKCS#12: %s" +msgstr "Nie można zweryfikować pliku PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 + +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Nieudana inicjacja modułu szyfrowania: %d." +msgstr "Zainicjowanie modułu szyfrowania się nie powiodło: %d." + #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "Nieudana inicjacja kontekstu MD5: %d." +msgstr "Zainicjowanie kontekstu MD5 się nie powiodło: %d." -#: ../libnm-util/crypto_nss.c:186 + +#: ../libnm-util/crypto_nss.c:179 #, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "Nieudana inicjacja slotu szyfru do odszyfrowania." +msgid "Invalid IV length (must be at least %d)." +msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %d)." + #: ../libnm-util/crypto_nss.c:196 #, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "Nieudane ustawienie klucza symetrycznego do odszyfrowania." +msgid "Failed to initialize the decryption cipher slot." +msgstr "Zainicjowanie gniazda szyfru do odszyfrowania się nie powiodło." + #: ../libnm-util/crypto_nss.c:206 #, c-format -msgid "Failed to set IV for decryption." -msgstr "Nieudane ustawienie IV do odszyfrowania." +msgid "Failed to set symmetric key for decryption." +msgstr "Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło." -#: ../libnm-util/crypto_nss.c:214 + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Ustawienie IV do odszyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "Nieudana inicjacja kontekstu odszyfrowania." +msgstr "Zainicjowanie kontekstu odszyfrowania się nie powiodło." -#: ../libnm-util/crypto_nss.c:227 + +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "Nieudane odszyfrowanie klucza prywatnego: %d." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %d." -#: ../libnm-util/crypto_nss.c:239 + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: odszyfrowane dane są za duże." + + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "Nieudane ukończenie odszyfrowania klucza prywatnego: %d." +msgstr "Zakończenie odszyfrowania klucza prywatnego się nie powiodło: %d." -#: ../libnm-util/crypto_nss.c:284 + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Zainicjowanie gniazda szyfru do szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Ustawienie klucza symetrycznego do szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Ustawienie IV do szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Zainicjowanie kontekstu szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Zaszyfrowanie się nie powiodło: %d." + + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Nieoczekiwana ilość danych po zaszyfrowaniu." + + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Nie można było zdekodować certyfikatu: %d" +msgstr "Nie można zdekodować certyfikatu: %d" -#: ../libnm-util/crypto_nss.c:319 + +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" -msgstr "Nie można skonwertować hasła do UCS2: %d" +msgstr "Nie można przekonwertować hasła do UCS2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Nie można zainicjować dekodera PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:356 + +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Nie można było odszyfrować pliku PKCS#12: %d" +msgstr "Nie można odszyfrować pliku PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:365 + +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" -msgstr "Nie można było zweryfikować pliku PKCS#12: %d" +msgstr "Nie można zweryfikować pliku PKCS#12: %d" + + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Nie można utworzyć losowych danych." + + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Brak wystarczającej ilości pamięci, aby utworzyć klucz szyfrowania." + + +#: ../libnm-util/nm-utils.c:1655 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nie można przydzielić pamięci do utworzenia pliku PEM." + + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nie można przydzielić pamięci do zapisywania IV do pliku PEM." + + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nie można przydzielić pamięci do zapisywania zaszyfrowanego klucza do pliku PEM." + + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nie można przydzielić pamięci dla danych pliku PEM." #: ../src/nm-netlink-monitor.c:194 #: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "błąd podczas przetwarzania komunikatu netlink: %s" + #: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "nie można utworzyć uchwytu netlink dla monitorowania statusu połączenia: %s" +msgstr "nie można przydzielić uchwytu netlink dla monitorowania stanu połączenia: %s" + #: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "nie można połączyć się z netlink dla monitorowania statusu połączenia: %s" +msgstr "nie można połączyć się z netlink dla monitorowania stanu połączenia: %s" + #: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" -msgstr "nie można dołączyć do grupy netlink dla monitorowania statusu połączenia: %s" +msgstr "nie można dołączyć do grupy netlink dla monitorowania stanu połączenia: %s" + #: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "nie można utworzyć buforów połączenia netlink dla monitorowania statusu połączenia: %s" +msgstr "nie można przydzielić pamięci podręcznej połączenia netlink dla monitorowania stanu połączenia: %s" + #: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 msgid "error occurred while waiting for data on socket" -msgstr "napotkano błąd podczas oczekiwania na dane" +msgstr "wystąpił błąd podczas oczekiwania na dane na gnieździe" -#: ../src/NetworkManager.c:330 + +#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "błąd podczas aktualizowania pamięci podręcznej połączenia: %s" + + +#: ../src/NetworkManager.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Błędna opcja. Parametr --help wyświetla listę poprawnych opcji.\n" +msgstr "Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 msgid "# Created by NetworkManager\n" -msgstr "# Utworzony przez NetworkManager\n" +msgstr "# Utworzony przez program NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 #, c-format msgid "" "# Merged from %s\n" @@ -305,6 +1547,22 @@ msgstr "" "# Scalony od %s\n" "\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "nie można przydzielić uchwytu netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "nie można połączyć się z netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nie można dołączyć do grupy netlink: %s" + #: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw." @@ -313,14 +1571,16 @@ msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw." msgid "The nameservers listed below may not be recognized." msgstr "Poniższe serwery nazw nie mogą nie zostać rozpoznane." -#: ../src/system-settings/nm-default-wired-connection.c:194 + +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" -msgstr "Auto %s" +msgstr "Automatyczne %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 msgid "System" -msgstr "System" +msgstr "Systemowe" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" @@ -353,3 +1613,4 @@ msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez chronio #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez otwartą sieć WiFi" + From 6ab52b33eeb302b3ad4ca545bbbc2eb387ea8255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Sat, 20 Mar 2010 14:08:06 +0100 Subject: [PATCH 113/392] cli: print_fields() adjustments; error messages fixes --- cli/src/connections.c | 14 ++++++++++---- cli/src/devices.c | 10 ++++++++-- cli/src/network-manager.c | 9 ++++++--- cli/src/utils.c | 38 +++++++++++++++++++++++++------------- 4 files changed, 49 insertions(+), 22 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 8f671cd72c..129235d3eb 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -215,7 +215,10 @@ do_connections_list (NmCli *nmc, int argc, char **argv) nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); if (error) { - g_string_printf (nmc->return_text, error->message); + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_LIST_ALL); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; @@ -391,7 +394,10 @@ do_connections_status (NmCli *nmc, int argc, char **argv) nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); if (error) { - g_string_printf (nmc->return_text, error->message); + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_STATUS_ALL); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; @@ -824,9 +830,9 @@ find_device_for_connection (NmCli *nmc, NMConnection *connection, const char *if return TRUE; } else { if (iface) - g_set_error (error, 0, 0, "device '%s' not compatible with connection '%s'", iface, nm_setting_connection_get_id (s_con)); + g_set_error (error, 0, 0, _("device '%s' not compatible with connection '%s'"), iface, nm_setting_connection_get_id (s_con)); else - g_set_error (error, 0, 0, "no device found for connection '%s'", nm_setting_connection_get_id (s_con)); + g_set_error (error, 0, 0, _("no device found for connection '%s'"), nm_setting_connection_get_id (s_con)); return FALSE; } } diff --git a/cli/src/devices.c b/cli/src/devices.c index 1be00d9c45..ce7741facc 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -540,7 +540,10 @@ do_devices_status (NmCli *nmc, int argc, char **argv) nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); if (error) { - g_string_printf (nmc->return_text, error->message); + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev status': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_STATUS_ALL); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; @@ -840,7 +843,10 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); if (error) { - g_string_printf (nmc->return_text, error->message); + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev wifi': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev wifi': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_WIFI_LIST_ALL); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index 519f02f955..b3fda87d4b 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -121,7 +121,10 @@ show_nm_status (NmCli *nmc) nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); if (error) { - g_string_printf (nmc->return_text, error->message); + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'nm status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'nm status': %s; allowed fields: %s"), error->message, NMC_FIELDS_NM_STATUS_ALL); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; return nmc->return_value; @@ -188,7 +191,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { /* no argument, show current WiFi state */ if (nmc->required_fields && strcasecmp (nmc->required_fields, "WIFI")) { - g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: '%s'"), + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), nmc->required_fields, NMC_FIELDS_NM_WIFI); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto end; @@ -218,7 +221,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { /* no argument, show current WWAN state */ if (nmc->required_fields && strcasecmp (nmc->required_fields, "WWAN")) { - g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: '%s'"), + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), nmc->required_fields, NMC_FIELDS_NM_WWAN); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto end; diff --git a/cli/src/utils.c b/cli/src/utils.c index e944b4b2b7..416af4ea32 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -52,6 +52,7 @@ next_arg (int *argc, char ***argv) * IN: 'field_str': comma-separated fields names * 'fields_array': array of allowed fields * RETURN: GArray with indices representing fields in 'fields_array'. + * Caller is responsible to free it. */ GArray * parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error) @@ -75,10 +76,10 @@ parse_output_fields (const char *fields_str, const NmcOutputField fields_array[] } if (fields_array[i].name == NULL) { if (!strcasecmp (*iter, "all") || !strcasecmp (*iter, "common")) - g_set_error (error, 0, 0, _("Error: 'con status': field '%s' has to be alone."), *iter); + g_set_error (error, 0, 0, _("field '%s' has to be alone"), *iter); else - g_set_error (error, 0, 0, _("Error: 'con status': invalid field '%s'."), *iter); + g_set_error (error, 0, 1, _("invalid field '%s'"), *iter); g_array_free (array, TRUE); array = NULL; goto done; @@ -90,6 +91,12 @@ done: return array; } +/* + * Print both headers or values of 'field_values' array. + * Entries to print and their order are specified via indices + * in 'fields.indices' array. + * 'fields.flags' specify various aspects influencing the output. + */ void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) { @@ -106,16 +113,21 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) gboolean header = fields.flags & NMC_PF_FLAG_HEADER; gboolean escape = fields.flags & NMC_PF_FLAG_ESCAPE; - /* Headers are not printed in terse mode */ + /* No headers are printed in terse mode: + * - neither whole name header nor field (column) names + */ if (header && terse) return; if (multiline) { /* --- Multiline mode --- */ + enum { ML_HEADER_WIDTH = 79 }; if (header && pretty) { /* Print the table header */ - table_width = g_utf8_strlen (fields.header_name, -1) + 4; - line = g_strnfill (79, '='); + int header_width = g_utf8_strlen (fields.header_name, -1) + 4; + table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width; + + line = g_strnfill (ML_HEADER_WIDTH, '='); width1 = strlen (fields.header_name); width2 = g_utf8_strlen (fields.header_name, -1); printf ("%s\n", line); @@ -134,7 +146,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) g_free (tmp); } if (pretty) { - line = g_strnfill (79, '-'); + line = g_strnfill (ML_HEADER_WIDTH, '-'); printf ("%s\n", line); g_free (line); } @@ -175,11 +187,11 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } } - if (table_width <= 0) - table_width = g_utf8_strlen (fields.header_name, -1) + 4; - + /* Print the table header */ if (header && pretty) { - /* Print the table header */ + int header_width = g_utf8_strlen (fields.header_name, -1) + 4; + table_width = table_width < header_width ? header_width : table_width; + line = g_strnfill (table_width, '='); width1 = strlen (fields.header_name); width2 = g_utf8_strlen (fields.header_name, -1); @@ -189,18 +201,18 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) g_free (line); } - - /* Print the line */ + /* Print actual values */ if (str->len > 0) { g_string_truncate (str, str->len-1); /* Chop off last column separator */ if (fields.indent > 0) { indent_str = g_strnfill (fields.indent, ' '); - g_string_prepend (str, indent_str); + g_string_prepend (str, indent_str); g_free (indent_str); } printf ("%s\n", str->str); } + /* Print horizontal separator */ if (header && pretty) { if (str->len > 0) { line = g_strnfill (table_width, '-'); From 21638ff470833cc4aeb050949dffad6382f2fffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 22 Mar 2010 18:43:28 +0100 Subject: [PATCH 114/392] cli: convert 'dev list' to new format; checking options validity for terse --- cli/src/connections.c | 30 ++++- cli/src/devices.c | 273 +++++++++++++++++++++++++++----------- cli/src/network-manager.c | 28 +++- cli/src/nmcli.c | 14 -- cli/src/nmcli.h | 11 +- cli/src/utils.c | 39 ++++-- cli/src/utils.h | 1 + 7 files changed, 278 insertions(+), 118 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 129235d3eb..b5e31feebe 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -154,7 +154,7 @@ show_connection (NMConnection *data, gpointer user_data) nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); g_free (timestamp_str); @@ -227,12 +227,12 @@ do_connections_list (NmCli *nmc, int argc, char **argv) if (argc == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("System connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("User connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); @@ -264,7 +264,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "system") == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("System connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); @@ -273,7 +273,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "user") == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("User connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); @@ -353,7 +353,7 @@ show_active_connection (gpointer data, gpointer user_data) info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); - info->nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); break; } @@ -403,7 +403,7 @@ do_connections_status (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("Active connections"); print_fields (nmc->print_fields, nmc->allowed_fields); @@ -1266,6 +1266,7 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) ArgsInfo *args = (ArgsInfo *) user_data; static gboolean system_cb_called = FALSE; static gboolean user_cb_called = FALSE; + GError *error = NULL; if (NM_IS_REMOTE_SETTINGS_SYSTEM (settings)) { system_cb_called = TRUE; @@ -1282,13 +1283,19 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) return; if (args->argc == 0) { + if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) + goto error; args->nmc->return_value = do_connections_list (args->nmc, args->argc, args->argv); } else { if (matches (*args->argv, "list") == 0) { + if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) + goto error; args->nmc->return_value = do_connections_list (args->nmc, args->argc-1, args->argv+1); } else if (matches(*args->argv, "status") == 0) { + if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) + goto error; args->nmc->return_value = do_connections_status (args->nmc, args->argc-1, args->argv+1); } else if (matches(*args->argv, "up") == 0) { @@ -1310,6 +1317,15 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) if (!args->nmc->should_wait) quit (); + return; + +error: + g_string_printf (args->nmc->return_text, _("Error: %s."), error->message); + args->nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + args->nmc->should_wait = FALSE; + g_error_free (error); + quit (); + return; } diff --git a/cli/src/devices.c b/cli/src/devices.c index ce7741facc..e82dda628e 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -65,6 +65,73 @@ static NmcOutputField nmc_fields_dev_status[] = { #define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" #define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" +/* Available field for 'dev list' - general part */ +static NmcOutputField nmc_fields_dev_list_general[] = { + {"NAME", N_("NAME"), 10, NULL, 0}, /* 0 */ + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 1 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */ + {"DRIVER", N_("DRIVER"), 10, NULL, 0}, /* 3 */ + {"HWADDR", N_("HWADDR"), 19, NULL, 0}, /* 4 */ + {"STATE", N_("STATE"), 14, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_GENERAL_ALL "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" +#define NMC_FIELDS_DEV_LIST_GENERAL_COMMON "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" + +/* Available field for 'dev list' - capabilities part */ +static NmcOutputField nmc_fields_dev_list_cap[] = { + {"NAME", N_("NAME"), 13, NULL, 0}, /* 0 */ + {"CARRIER-DETECT", N_("CARRIER-DETECT"), 16, NULL, 0}, /* 1 */ + {"SPEED", N_("SPEED"), 10, NULL, 0}, /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_CAP_ALL "NAME,CARRIER-DETECT,SPEED" +#define NMC_FIELDS_DEV_LIST_CAP_COMMON "NAME,CARRIER-DETECT,SPEED" + +/* Available field for 'dev list' - wired properties part */ +static NmcOutputField nmc_fields_dev_list_wired_prop[] = { + {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ + {"CARRIER", N_("CARRIER"), 10, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL "NAME,CARRIER" +#define NMC_FIELDS_DEV_LIST_WIRED_PROP_COMMON "NAME,CARRIER" + + +/* Available field for 'dev list' - wireless properties part */ +static NmcOutputField nmc_fields_dev_list_wifi_prop[] = { + {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ + {"WEP", N_("WEP"), 5, NULL, 0}, /* 1 */ + {"WPA", N_("WPA"), 5, NULL, 0}, /* 2 */ + {"WPA2", N_("WPA2"), 6, NULL, 0}, /* 3 */ + {"TKIP", N_("TKIP"), 6, NULL, 0}, /* 4 */ + {"CCMP", N_("CCMP"), 6, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP" +#define NMC_FIELDS_DEV_LIST_WIFI_PROP_COMMON "NAME,WEP,WPA,WPA2,TKIP,CCMP" + +/* Available field for 'dev list' - IPv4 settings part */ +static NmcOutputField nmc_fields_dev_list_ip4_settings[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */ + {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */ + {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" +#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" + +/* Available field for 'dev list' - IPv4 settings DNS part */ +static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP4_DNS_ALL "NAME,DNS" +#define NMC_FIELDS_DEV_LIST_IP4_DNS_COMMON "NAME,DNS" + + /* Available field for 'dev wifi list' */ static NmcOutputField nmc_fields_dev_wifi_list[] = { {"SSID", N_("SSID"), 33, NULL, 0}, /* 0 */ @@ -78,10 +145,12 @@ static NmcOutputField nmc_fields_dev_wifi_list[] = { {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 8 */ {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 9 */ {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 10 */ + {"NAME", N_("NAME"), 8, NULL, 0}, /* 11 */ /* For WiFi scan in nm dev list */ {NULL, NULL, 0, NULL, 0} }; #define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" #define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST "NAME,"NMC_FIELDS_DEV_WIFI_LIST_COMMON /* static function prototypes */ @@ -203,6 +272,7 @@ ap_wpa_rsn_flags_to_string (guint32 flags) return ret_str; } +#if 0 static void print_header (const char *label, const char *iface, const char *connection) { @@ -222,6 +292,7 @@ print_header (const char *label, const char *iface, const char *connection) g_string_free (string, TRUE); } +#endif static gchar * ip4_address_as_string (guint32 ip) @@ -318,8 +389,9 @@ detail_access_point (gpointer data, gpointer user_data) info->nmc->allowed_fields[8].value = rsn_flags_str; info->nmc->allowed_fields[9].value = info->device; info->nmc->allowed_fields[10].value = active ? _("yes") : _("no"); + info->nmc->allowed_fields[11].value = "AP"; - info->nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); g_free (ssid_str); @@ -343,44 +415,48 @@ show_device_info (gpointer data, gpointer user_data) NmCli *nmc = (NmCli *) user_data; APInfo *info; char *tmp; + const char *hwaddr = NULL; NMDeviceState state; - const char *dev_type; guint32 caps; guint32 speed; + char *speed_str = NULL; const GArray *array; - gboolean is_default = FALSE; - const char *id = NULL; - - state = nm_device_get_state (device); - print_header (_("Device"), nm_device_get_iface (device), id); + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; /* General information */ - dev_type = get_device_type (device); - print_table_line (0, _("Type"), 25, dev_type, 0, NULL); - print_table_line (0, _("Driver"), 25, nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"), 0, NULL); - print_table_line (0, _("State"), 25, device_state_to_string (state), 0, NULL); - if (is_default) - print_table_line (0, _("Default"), 25, _("yes"), 0, NULL); - else - print_table_line (0, _("Default"), 25, _("no"), 0, NULL); + nmc->allowed_fields = nmc_fields_dev_list_general; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("Device details"); + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - tmp = NULL; + state = nm_device_get_state (device); if (NM_IS_DEVICE_ETHERNET (device)) - tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device))); + hwaddr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); else if (NM_IS_DEVICE_WIFI (device)) - tmp = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device))); + hwaddr = nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)); - if (tmp) { - print_table_line (0, _("HW Address"), 25, tmp, 0, NULL); - g_free (tmp); - } + nmc->allowed_fields[0].value = "GENERAL"; + nmc->allowed_fields[1].value = nm_device_get_iface (device); + nmc->allowed_fields[2].value = get_device_type (device); + nmc->allowed_fields[3].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"); + nmc->allowed_fields[4].value = hwaddr ? hwaddr : _("unknown)"); + nmc->allowed_fields[5].value = device_state_to_string (state); + + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + printf ("\n"); /* empty line */ /* Capabilities */ - caps = nm_device_get_capabilities (device); - printf (_("\n Capabilities:\n")); - if (caps & NM_DEVICE_CAP_CARRIER_DETECT) - print_table_line (2, _("Carrier Detect"), 23, _("yes"), 0, NULL); + nmc->allowed_fields = nmc_fields_dev_list_cap; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_CAP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + caps = nm_device_get_capabilities (device); speed = 0; if (NM_IS_DEVICE_ETHERNET (device)) { /* Speed in Mb/s */ @@ -390,14 +466,16 @@ show_device_info (gpointer data, gpointer user_data) speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); speed /= 1000; } + if (speed) + speed_str = g_strdup_printf (_("%u Mb/s"), speed); - if (speed) { - char *speed_string; + nmc->allowed_fields[0].value = "CAPABILITIES"; + nmc->allowed_fields[1].value = (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = speed_str ? speed_str : _("unknown"); - speed_string = g_strdup_printf (_("%u Mb/s"), speed); - print_table_line (2, _("Speed"), 23, speed_string, 0, NULL); - g_free (speed_string); - } + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (speed_str); /* Wireless specific information */ if ((NM_IS_DEVICE_WIFI (device))) { @@ -406,31 +484,36 @@ show_device_info (gpointer data, gpointer user_data) const char *active_bssid = NULL; const GPtrArray *aps; - printf (_("\n Wireless Properties\n")); + printf ("\n"); /* empty line */ wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); - if (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) - print_table_line (2, _("WEP Encryption"), 23, _("yes"), 0, NULL); - if (wcaps & NM_WIFI_DEVICE_CAP_WPA) - print_table_line (2, _("WPA Encryption"), 23, _("yes"), 0, NULL); - if (wcaps & NM_WIFI_DEVICE_CAP_RSN) - print_table_line (2, _("WPA2 Encryption"), 23, _("yes"), 0, NULL); - if (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) - print_table_line (2, _("TKIP cipher"), 23, _("yes"), 0, NULL); - if (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) - print_table_line (2, _("CCMP cipher"), 23, _("yes"), 0, NULL); + nmc->allowed_fields = nmc_fields_dev_list_wifi_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[0].value = "WIFI-PROPERTIES"; + nmc->allowed_fields[1].value = (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = (wcaps & NM_WIFI_DEVICE_CAP_WPA) ? _("yes") : _("no"); + nmc->allowed_fields[3].value = (wcaps & NM_WIFI_DEVICE_CAP_RSN) ? _("yes") : _("no"); + nmc->allowed_fields[4].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + printf ("\n"); /* empty line */ + + /* Wireless access points */ if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; } - printf (_("\n Wireless Access Points\n")); - - nmc->print_fields.flags = NMC_PF_FLAG_HEADER; - nmc->print_fields.indent = 2; /* Indent by 2 spaces */ - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_COMMON, nmc->allowed_fields, NULL); + nmc->allowed_fields = nmc_fields_dev_wifi_list; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST, nmc->allowed_fields, NULL); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ info = g_malloc0 (sizeof (APInfo)); @@ -442,12 +525,18 @@ show_device_info (gpointer data, gpointer user_data) g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); g_free (info); } else if (NM_IS_DEVICE_ETHERNET (device)) { - printf (_("\n Wired Properties\n")); + printf ("\n"); /* empty line */ + /* Wired properties */ + nmc->allowed_fields = nmc_fields_dev_list_wired_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - if (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) - print_table_line (2, _("Carrier"), 23, _("on"), 0, NULL); - else - print_table_line (2, _("Carrier"), 23, _("off"), 0, NULL); + nmc->allowed_fields[0].value = "WIRED-PROPERTIES"; + nmc->allowed_fields[1].value = (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) ? _("on") : _("off"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ } /* IP Setup info */ @@ -455,42 +544,62 @@ show_device_info (gpointer data, gpointer user_data) NMIP4Config *cfg = nm_device_get_ip4_config (device); GSList *iter; - printf (_("\n IPv4 Settings:\n")); + printf ("\n"); /* empty line */ + + nmc->allowed_fields = nmc_fields_dev_list_ip4_settings; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { NMIP4Address *addr = (NMIP4Address *) iter->data; guint32 prefix = nm_ip4_address_get_prefix (addr); char *tmp2; + char *addr_str, *prefix_str, *gateway_str; - tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); - print_table_line (2, _("Address"), 23, tmp, 0, NULL); - g_free (tmp); + addr_str = ip4_address_as_string (nm_ip4_address_get_address (addr)); tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); - tmp = g_strdup_printf ("%d (%s)", prefix, tmp2); + prefix_str = g_strdup_printf ("%d (%s)", prefix, tmp2); g_free (tmp2); - print_table_line (2, _("Prefix"), 23, tmp, 0, NULL); - g_free (tmp); - tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); - print_table_line (2, _("Gateway"), 23, tmp, 0, NULL); - g_free (tmp); - printf ("\n"); + gateway_str = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + + nmc->allowed_fields[0].value = "IPv4-SETTINGS"; + nmc->allowed_fields[1].value = addr_str; + nmc->allowed_fields[2].value = prefix_str; + nmc->allowed_fields[3].value = gateway_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (addr_str); + g_free (prefix_str); + g_free (gateway_str); } - array = nm_ip4_config_get_nameservers (cfg); if (array) { int i; + printf ("\n"); /* empty line */ + + nmc->allowed_fields = nmc_fields_dev_list_ip4_dns; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_DNS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + for (i = 0; i < array->len; i++) { tmp = ip4_address_as_string (g_array_index (array, guint32, i)); - print_table_line (2, _("DNS"), 23, tmp, 0, NULL); + nmc->allowed_fields[0].value = "IPv4-DNS"; + nmc->allowed_fields[1].value = tmp; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ g_free (tmp); } } } - printf ("\n\n"); + printf ("\n"); } static void @@ -500,7 +609,7 @@ show_device_status (NMDevice *device, NmCli *nmc) nmc->allowed_fields[1].value = get_device_type (device); nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); - nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); } @@ -549,7 +658,7 @@ do_devices_status (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("Status of devices"); print_fields (nmc->print_fields, nmc->allowed_fields); @@ -598,9 +707,6 @@ do_devices_list (NmCli *nmc, int argc, char **argv) devices = nm_client_get_devices (nmc->client); - /* Set allowed fields for use while printing in detail_access_point() */ - nmc->allowed_fields = nmc_fields_dev_wifi_list; - if (iface_specified) { for (i = 0; devices && (i < devices->len); i++) { NMDevice *candidate = g_ptr_array_index (devices, i); @@ -852,7 +958,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi scan list"); if (iface) { @@ -979,15 +1085,22 @@ do_device_wifi (NmCli *nmc, int argc, char **argv) NMCResultCode do_devices (NmCli *nmc, int argc, char **argv) { + GError *error = NULL; + /* create NMClient */ if (!nmc->get_client (nmc)) - goto error; + goto end; - if (argc == 0) - nmc->return_value = do_devices_status (nmc, argc-1, argv+1); + if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; + nmc->return_value = do_devices_status (nmc, 0, NULL); + } if (argc > 0) { if (matches (*argv, "status") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; nmc->return_value = do_devices_status (nmc, argc-1, argv+1); } else if (matches (*argv, "list") == 0) { @@ -997,6 +1110,8 @@ do_devices (NmCli *nmc, int argc, char **argv) nmc->return_value = do_device_disconnect (nmc, argc-1, argv+1); } else if (matches (*argv, "wifi") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; nmc->return_value = do_device_wifi (nmc, argc-1, argv+1); } else if (strcmp (*argv, "help") == 0) { @@ -1008,6 +1123,12 @@ do_devices (NmCli *nmc, int argc, char **argv) } } +end: + return nmc->return_value; + error: + g_string_printf (nmc->return_text, _("Error: %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (error); return nmc->return_value; } diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index b3fda87d4b..e4fbe2ea85 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -130,7 +130,7 @@ show_nm_status (NmCli *nmc) return nmc->return_value; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("NetworkManager status"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ @@ -152,7 +152,7 @@ show_nm_status (NmCli *nmc) nmc->allowed_fields[4].value = wwan_hw_enabled_str; nmc->allowed_fields[5].value = wwan_enabled_str; - nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ return NMC_RESULT_SUCCESS; @@ -163,6 +163,7 @@ show_nm_status (NmCli *nmc) NMCResultCode do_network_manager (NmCli *nmc, int argc, char **argv) { + GError *error = NULL; gboolean enable_wifi; gboolean enable_wwan; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; @@ -174,11 +175,15 @@ do_network_manager (NmCli *nmc, int argc, char **argv) goto end; if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; nmc->return_value = show_nm_status (nmc); } if (argc > 0) { if (matches (*argv, "status") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; nmc->return_value = show_nm_status (nmc); } else if (matches (*argv, "sleep") == 0) { @@ -190,6 +195,8 @@ do_network_manager (NmCli *nmc, int argc, char **argv) else if (matches (*argv, "wifi") == 0) { if (next_arg (&argc, &argv) != 0) { /* no argument, show current WiFi state */ + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; if (nmc->required_fields && strcasecmp (nmc->required_fields, "WIFI")) { g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), nmc->required_fields, NMC_FIELDS_NM_WIFI); @@ -198,11 +205,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } nmc->allowed_fields = nmc_fields_nm_status; nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WIFI, nmc->allowed_fields, NULL); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) @@ -219,6 +226,8 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } else if (matches (*argv, "wwan") == 0) { if (next_arg (&argc, &argv) != 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto error; /* no argument, show current WWAN state */ if (nmc->required_fields && strcasecmp (nmc->required_fields, "WWAN")) { g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), @@ -228,11 +237,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } nmc->allowed_fields = nmc_fields_nm_status; nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WWAN, nmc->allowed_fields, NULL); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_HEADER; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WWAN enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_HEADER; /* Clear HEADER flag */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) @@ -259,4 +268,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) end: quit (); return nmc->return_value; + +error: + quit (); + g_string_printf (nmc->return_text, _("Error: %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (error); + return nmc->return_value; } diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index ad793406fb..10017f6254 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -201,20 +201,6 @@ parse_command_line (NmCli *nmc, int argc, char **argv) argv++; } - /* Some validity options checks */ - if (nmc->print_output == NMC_PRINT_TERSE) { - if (!nmc->required_fields) { - g_string_printf (nmc->return_text, _("Option '--terse' requires specifying '--fields'.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - return nmc->return_value; - } else if ( !strcasecmp (nmc->required_fields, "all") - || !strcasecmp (nmc->required_fields, "common")) { - g_string_printf (nmc->return_text, _("Option '--terse' requires specific '--fields' option, not 'all' or 'common'.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - return nmc->return_value; - } - } - if (argc > 1) return do_cmd (nmc, argv[1], argc-1, argv+1); diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index 8b4c34207e..5ff1ea943c 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -63,11 +63,12 @@ typedef struct { } NmcOutputField; /* Flags for NmcPrintFields */ -#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular*/ -#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse outpud mode */ -#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ -#define NMC_PF_FLAG_HEADER 0x00000008 /* Print headers instead of values */ -#define NMC_PF_FLAG_ESCAPE 0x00000010 /* Escape column separator and '\' */ +#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular*/ +#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse outpud mode */ +#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ +#define NMC_PF_FLAG_MAIN_HEADER 0x00000008 /* Print main header */ +#define NMC_PF_FLAG_FIELD_NAMES 0x00000010 /* Print field names instead of values */ +#define NMC_PF_FLAG_ESCAPE 0x00000020 /* Escape column separator and '\' */ typedef struct { GArray *indices; /* Array of field indices to the array of allowed fields */ diff --git a/cli/src/utils.c b/cli/src/utils.c index 416af4ea32..7dea6a1b94 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -91,6 +91,24 @@ done: return array; } +gboolean +nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error) +{ + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (print_output == NMC_PRINT_TERSE) { + if (!fields) { + g_set_error (error, 0, 0, _("Option '--terse' requires specifying '--fields'")); + return FALSE; + } else if ( !strcasecmp (fields, "all") + || !strcasecmp (fields, "common")) { + g_set_error (error, 0, 0, _("Option '--terse' requires specific '--fields' option values , not '%s'"), fields); + return FALSE; + } + } + return TRUE; +} + /* * Print both headers or values of 'field_values' array. * Entries to print and their order are specified via indices @@ -110,20 +128,21 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE; gboolean terse = fields.flags & NMC_PF_FLAG_TERSE; gboolean pretty = fields.flags & NMC_PF_FLAG_PRETTY; - gboolean header = fields.flags & NMC_PF_FLAG_HEADER; + gboolean main_header = fields.flags & NMC_PF_FLAG_MAIN_HEADER; + gboolean field_names = fields.flags & NMC_PF_FLAG_FIELD_NAMES; gboolean escape = fields.flags & NMC_PF_FLAG_ESCAPE; /* No headers are printed in terse mode: - * - neither whole name header nor field (column) names + * - neither main header nor field (column) names */ - if (header && terse) + if ((main_header || field_names) && terse) return; if (multiline) { /* --- Multiline mode --- */ enum { ML_HEADER_WIDTH = 79 }; - if (header && pretty) { - /* Print the table header */ + if (main_header && pretty) { + /* Print the main header */ int header_width = g_utf8_strlen (fields.header_name, -1) + 4; table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width; @@ -137,7 +156,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } /* Print values */ - if (!header) { + if (!field_names) { for (i = 0; i < fields.indices->len; i++) { char *tmp; idx = g_array_index (fields.indices, int, i); @@ -159,7 +178,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) for (i = 0; i < fields.indices->len; i++) { idx = g_array_index (fields.indices, int, i); - if (header) + if (field_names) value = _(field_values[idx].name_l10n); else value = field_values[idx].value; @@ -187,8 +206,8 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } } - /* Print the table header */ - if (header && pretty) { + /* Print the main table header */ + if (main_header && pretty) { int header_width = g_utf8_strlen (fields.header_name, -1) + 4; table_width = table_width < header_width ? header_width : table_width; @@ -213,7 +232,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } /* Print horizontal separator */ - if (header && pretty) { + if (field_names && pretty) { if (str->len > 0) { line = g_strnfill (table_width, '-'); printf ("%s\n", line); diff --git a/cli/src/utils.h b/cli/src/utils.h index 513d214b83..75e9c921e9 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -28,6 +28,7 @@ int matches (const char *cmd, const char *pattern); int next_arg (int *argc, char ***argv); GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); +gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error); void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); void print_table_header (const char *name, ...); void print_table_line (int indent, ...); From eedde7283fce2afceb8722cfb82544038fa3bbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 22 Mar 2010 18:59:40 +0100 Subject: [PATCH 115/392] libnm-util: add functions to output ip6 settings of connections --- libnm-util/Makefile.am | 2 +- libnm-util/nm-utils.c | 257 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 258 insertions(+), 1 deletion(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 707b63cb37..8841978778 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "4:0:3" + -version-info "4:1:3" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 31aae7c02b..9cf1be5749 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -764,6 +764,203 @@ nm_utils_convert_byte_array_to_string (const GValue *src_value, GValue *dest_val g_string_free (printable, FALSE); } +static gboolean +nm_utils_inet6_ntop (struct in6_addr *addr, char *buf) +{ + if (!inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN)) { + int i; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", addr->s6_addr[0]); + for (i = 1; i < 16; i++) + g_string_append_printf (ip6_str, " %02X", addr->s6_addr[i]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return FALSE; + } + return TRUE; +} + +static void +nm_utils_convert_ip6_dns_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GByteArray *bytearray; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + + if (i > 0) + g_string_append (printable, ", "); + + bytearray = (GByteArray *) g_ptr_array_index (ptr_array, i++); + if (bytearray->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) bytearray->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "%s", buf); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GValueArray *elements; + GValue *tmp; + GByteArray *ba_addr; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + guint32 prefix; + + if (i > 0) + g_string_append (printable, ", "); + + g_string_append (printable, "{ "); + elements = (GValueArray *) g_ptr_array_index (ptr_array, i++); + if ( (elements->n_values != 2) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT)) { + g_string_append (printable, "invalid"); + continue; + } + + /* IPv6 address */ + tmp = g_value_array_get_nth (elements, 0); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "ip = %s", buf); + g_string_append (printable, ", "); + + /* Prefix */ + tmp = g_value_array_get_nth (elements, 1); + prefix = g_value_get_uint (tmp); + if (prefix > 128) { + g_string_append (printable, "invalid"); + continue; + } + g_string_append_printf (printable, "px = %u", prefix); + g_string_append (printable, " }"); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_ip6_route_struct_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GValueArray *elements; + GValue *tmp; + GByteArray *ba_addr; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + guint32 prefix, metric; + + if (i > 0) + g_string_append (printable, ", "); + + g_string_append (printable, "{ "); + elements = (GValueArray *) g_ptr_array_index (ptr_array, i++); + if ( (elements->n_values != 4) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 3)) != G_TYPE_UINT)) { + g_string_append (printable, "invalid"); + continue; + } + + /* Destination address */ + tmp = g_value_array_get_nth (elements, 0); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "dst = %s", buf); + g_string_append (printable, ", "); + + /* Prefix */ + tmp = g_value_array_get_nth (elements, 1); + prefix = g_value_get_uint (tmp); + if (prefix > 128) { + g_string_append (printable, "invalid"); + continue; + } + g_string_append_printf (printable, "px = %u", prefix); + g_string_append (printable, ", "); + + /* Next hop addresses */ + tmp = g_value_array_get_nth (elements, 2); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "nh = %s", buf); + g_string_append (printable, ", "); + + /* Metric */ + tmp = g_value_array_get_nth (elements, 3); + metric = g_value_get_uint (tmp); + g_string_append_printf (printable, "mt = %u", metric); + + g_string_append (printable, " }"); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + void _nm_utils_register_value_transformations (void) { @@ -791,6 +988,15 @@ _nm_utils_register_value_transformations (void) g_value_register_transform_func (DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_STRING, nm_utils_convert_byte_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, + G_TYPE_STRING, + nm_utils_convert_ip6_dns_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + G_TYPE_STRING, + nm_utils_convert_ip6_addr_struct_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, + G_TYPE_STRING, + nm_utils_convert_ip6_route_struct_array_to_string); registered = TRUE; } } @@ -1232,6 +1438,18 @@ nm_utils_ip4_get_default_prefix (guint32 ip) return 24; /* Class C - 255.255.255.0 */ } +/** + * nm_utils_ip6_addresses_from_gvalue: + * @value: gvalue containing a GPtrArray of GValueArrays of (GArray of guchars) and guint32 + * + * Utility function to convert a #GPtrArray of #GValueArrays of (#GArray of guchars) and guint32 + * representing a list of NetworkManager IPv6 addresses (which is a pair of address + * and prefix), into a GSList of #NMIP6Address objects. The specific format of + * this serialization is not guaranteed to be stable and the #GValueArray may be + * extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP6Address objects + **/ GSList * nm_utils_ip6_addresses_from_gvalue (const GValue *value) { @@ -1280,6 +1498,19 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value) return g_slist_reverse (list); } +/** + * nm_utils_ip6_addresses_to_gvalue: + * @list: a list of #NMIP6Address objects + * @value: a pointer to a #GValue into which to place the converted addresses, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP6Address objects into a + * GPtrArray of GValueArrays of (GArray or guchars) and guint32 representing a list + * of NetworkManager IPv6 addresses (which is a pair of address and prefix). + * The specific format of this serialization is not guaranteed to be stable and may be + * extended in the future. + **/ void nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) { @@ -1314,6 +1545,19 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) g_value_take_boxed (value, addresses); } +/** + * nm_utils_ip6_routes_from_gvalue: + * @value: gvalue containing a GPtrArray of GValueArrays of (GArray or guchars), guint32, + * (GArray of guchars), and guint32 + * + * Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, + * (GArray of guchars), and guint32 representing a list of NetworkManager IPv6 + * routes (which is a tuple of destination, prefix, next hop, and metric) + * into a GSList of #NMIP6Route objects. The specific format of this serialization + * is not guaranteed to be stable and may be extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP6Route objects + **/ GSList * nm_utils_ip6_routes_from_gvalue (const GValue *value) { @@ -1366,6 +1610,19 @@ nm_utils_ip6_routes_from_gvalue (const GValue *value) return g_slist_reverse (list); } +/** + * nm_utils_ip6_routes_to_gvalue: + * @list: a list of #NMIP6Route objects + * @value: a pointer to a #GValue into which to place the converted routes, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP6Route objects into a GPtrArray of + * GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 + * representing a list of NetworkManager IPv6 routes (which is a tuple of destination, + * prefix, next hop, and metric). The specific format of this serialization is not + * guaranteed to be stable and may be extended in the future. + **/ void nm_utils_ip6_routes_to_gvalue (GSList *list, GValue *value) { From 111ff834938463aad78326c1c30175e80b5b0600 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 13:25:15 -0700 Subject: [PATCH 116/392] dhcp: tell dhcpcd to send hostname to server too if requested --- src/dhcp-manager/nm-dhcp-dhcpcd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 27fb31bcc4..1e014e70b5 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -70,7 +70,7 @@ real_ip4_start (NMDHCPClient *client, GPid pid = 0; GError *error = NULL; char *pid_contents = NULL, *binary_name; - const char *iface, *uuid; + const char *iface, *uuid, *hostname; g_return_val_if_fail (priv->pid_file == NULL, -1); @@ -105,6 +105,12 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); + hostname = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + if (hostname && strlen (hostname)) { + g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */ + g_ptr_array_add (argv, (gpointer) hostname ); + } + g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); From 55728349a1ec838fffe1d42b3f48d08d03117f09 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 14:12:32 -0700 Subject: [PATCH 117/392] core: properly clear non-fatal errors from state file parsing --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index c705cb8d50..f8312fa54e 100644 --- a/src/main.c +++ b/src/main.c @@ -556,9 +556,9 @@ main (int argc, char *argv[]) state_file, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); - g_clear_error (&error); /* Not a hard failure */ } + g_clear_error (&error); /* Tricky: become_daemon is FALSE by default, so unless it's TRUE because * of a CLI option, it'll become TRUE after this From 78dd4fc9f249f1a288462318a087d3c41a63465c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 14:22:10 -0700 Subject: [PATCH 118/392] dhcp: make client selection more forgiving If your distributor forgot to set up the client path for you, this makes NM look in the right places and allows you to use either client if it's installed, no matter what NM was configured with. --- src/dhcp-manager/nm-dhcp-dhclient.c | 35 ++++++++- src/dhcp-manager/nm-dhcp-dhclient.h | 2 + src/dhcp-manager/nm-dhcp-dhcpcd.c | 37 +++++++-- src/dhcp-manager/nm-dhcp-dhcpcd.h | 2 + src/dhcp-manager/nm-dhcp-manager.c | 114 ++++++++++++++++++---------- src/dhcp-manager/nm-dhcp-manager.h | 12 +++ 6 files changed, 155 insertions(+), 47 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index ac8f29a109..9ea31ef7aa 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -54,11 +54,35 @@ G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) #define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" typedef struct { + const char *path; char *conf_file; char *lease_file; char *pid_file; } NMDHCPDhclientPrivate; +const char * +nm_dhcp_dhclient_get_path (const char *try_first) +{ + static const char *dhclient_paths[] = { + "/sbin/dhclient", + "/usr/sbin/dhclient", + "/usr/pkg/sbin/dhclient", + "/usr/local/sbin/dhclient", + NULL + }; + const char **path = dhclient_paths; + + if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS)) + return try_first; + + while (*path != NULL) { + if (g_file_test (*path, G_FILE_TEST_EXISTS)) + break; + path++; + } + + return *path; +} static char * get_leasefile_for_iface (const char * iface, const char *uuid, gboolean ipv6) @@ -478,13 +502,13 @@ dhclient_start (NMDHCPClient *client, return -1; } - if (!g_file_test (DHCLIENT_PATH, G_FILE_TEST_EXISTS)) { - nm_warning (DHCLIENT_PATH " does not exist."); + if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { + nm_warning ("%s does not exist.", priv->path); return -1; } /* Kill any existing dhclient from the pidfile */ - binary_name = g_path_get_basename (DHCLIENT_PATH); + binary_name = g_path_get_basename (priv->path); nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); @@ -495,7 +519,7 @@ dhclient_start (NMDHCPClient *client, } argv = g_ptr_array_new (); - g_ptr_array_add (argv, (gpointer) DHCLIENT_PATH); + g_ptr_array_add (argv, (gpointer) priv->path); g_ptr_array_add (argv, (gpointer) "-d"); @@ -710,6 +734,9 @@ out: static void nm_dhcp_dhclient_init (NMDHCPDhclient *self) { + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (self); + + priv->path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); } static void diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h index db9f73d254..be242de057 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.h +++ b/src/dhcp-manager/nm-dhcp-dhclient.h @@ -43,5 +43,7 @@ GType nm_dhcp_dhclient_get_type (void); GSList *nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid); +const char *nm_dhcp_dhclient_get_path (const char *try_first); + #endif /* NM_DHCP_DHCLIENT_H */ diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 1e014e70b5..6895498a23 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -42,9 +42,33 @@ G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_DHCPCD) #define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" typedef struct { + const char *path; char *pid_file; } NMDHCPDhcpcdPrivate; +const char * +nm_dhcp_dhcpcd_get_path (const char *try_first) +{ + static const char *dhcpcd_paths[] = { + "/sbin/dhcpcd", + "/usr/sbin/dhcpcd", + "/usr/pkg/sbin/dhcpcd", + "/usr/local/sbin/dhcpcd", + NULL + }; + const char **path = dhcpcd_paths; + + if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS)) + return try_first; + + while (*path != NULL) { + if (g_file_test (*path, G_FILE_TEST_EXISTS)) + break; + path++; + } + + return *path; +} GSList * nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid) @@ -83,18 +107,18 @@ real_ip4_start (NMDHCPClient *client, return -1; } - if (!g_file_test (DHCPCD_PATH, G_FILE_TEST_EXISTS)) { - nm_warning (DHCPCD_PATH " does not exist."); + if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { + nm_warning ("%s does not exist.", priv->path); return -1; } - /* Kill any existing dhclient from the pidfile */ - binary_name = g_path_get_basename (DHCPCD_PATH); + /* Kill any existing dhcpcd from the pidfile */ + binary_name = g_path_get_basename (priv->path); nm_dhcp_client_stop_existing (priv->pid_file, binary_name); g_free (binary_name); argv = g_ptr_array_new (); - g_ptr_array_add (argv, (gpointer) DHCPCD_PATH); + g_ptr_array_add (argv, (gpointer) priv->path); g_ptr_array_add (argv, (gpointer) "-B"); /* Don't background on lease (disable fork()) */ @@ -230,6 +254,9 @@ out: static void nm_dhcp_dhcpcd_init (NMDHCPDhcpcd *self) { + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (self); + + priv->path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); } static void diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.h b/src/dhcp-manager/nm-dhcp-dhcpcd.h index 9a98129419..586c569786 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.h +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.h @@ -43,5 +43,7 @@ GType nm_dhcp_dhcpcd_get_type (void); GSList *nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid); +const char *nm_dhcp_dhcpcd_get_path (const char *try_first); + #endif /* NM_DHCP_DHCPCD_H */ diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 374c663681..765606788f 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -44,6 +44,35 @@ #include "nm-dbus-glib-types.h" #include "nm-glib-compat.h" +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GQuark +nm_dhcp_manager_error_quark (void) +{ + static GQuark ret = 0; + + if (ret == 0) + ret = g_quark_from_static_string ("nm_dhcp_manager_error"); + + return ret; +} + +GType +nm_dhcp_manager_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_BAD_CLIENT, "BadClient"), + ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_INTERNAL, "InternalError"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMDhcpManagerError", values); + } + return etype; +} + #define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" #define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" @@ -233,15 +262,48 @@ out: static GType get_client_type (const char *client, GError **error) { - g_return_val_if_fail (client != NULL, 0); + const char *dhclient_path = NULL; + const char *dhcpcd_path = NULL; - if (!strcmp (client, "dhclient") && strlen (DHCLIENT_PATH)) + dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); + dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); + + if (!client) { + if (dhclient_path) + return NM_TYPE_DHCP_DHCLIENT; + else if (dhcpcd_path) + return NM_TYPE_DHCP_DHCPCD; + else { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("no usable DHCP client could be found.")); + return 0; + } + } + + if (!strcmp (client, "dhclient")) { + if (!dhclient_path) { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("'dhclient' could be found.")); + return 0; + } return NM_TYPE_DHCP_DHCLIENT; - else if (!strcmp (client, "dhcpcd") && strlen (DHCPCD_PATH)) - return NM_TYPE_DHCP_DHCPCD; - else - g_set_error (error, 0, 0, "unknown or missing DHCP client '%s'", client); + } + if (!strcmp (client, "dhcpcd")) { + if (!dhcpcd_path) { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("'dhcpcd' could be found.")); + return 0; + } + return NM_TYPE_DHCP_DHCPCD; + } + + g_set_error (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("unsupported DHCP client '%s'"), client); return 0; } @@ -250,32 +312,19 @@ nm_dhcp_manager_new (const char *client, GError **error) { NMDHCPManagerPrivate *priv; DBusGConnection *g_connection; + GType client_type; - /* Set some defaults based on build-time options */ - if (!client) { - if (strlen (DHCLIENT_PATH) && g_file_test (DHCLIENT_PATH, G_FILE_TEST_EXISTS)) - client = "dhclient"; - else if (strlen (DHCPCD_PATH) && g_file_test (DHCPCD_PATH, G_FILE_TEST_EXISTS)) - client = "dhcpcd"; - else { - g_set_error_literal (error, 0, 0, - "no suitable DHCP client; see 'man NetworkManager'" - " to specify one."); - return NULL; - } - } + client_type = get_client_type (client, error); + if (!client_type) + return NULL; g_warn_if_fail (singleton == NULL); - g_return_val_if_fail (client != NULL, NULL); singleton = g_object_new (NM_TYPE_DHCP_MANAGER, NULL); priv = NM_DHCP_MANAGER_GET_PRIVATE (singleton); - /* Figure out which DHCP client to use */ - priv->client_type = get_client_type (client, error); - if (!priv->client_type) - goto error; - + /* Client-specific setup */ + priv->client_type = client_type; if (priv->client_type == NM_TYPE_DHCP_DHCLIENT) priv->get_lease_config_func = nm_dhcp_dhclient_get_lease_config; else if (priv->client_type == NM_TYPE_DHCP_DHCPCD) @@ -286,10 +335,7 @@ nm_dhcp_manager_new (const char *client, GError **error) priv->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_object_unref); - if (!priv->clients) { - g_set_error_literal (error, 0, 0, "not enough memory to initialize DHCP manager"); - goto error; - } + g_assert (priv->clients); priv->dbus_mgr = nm_dbus_manager_get (); g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); @@ -297,10 +343,7 @@ nm_dhcp_manager_new (const char *client, GError **error) NM_DHCP_CLIENT_DBUS_SERVICE, "/", NM_DHCP_CLIENT_DBUS_IFACE); - if (!priv->proxy) { - g_set_error_literal (error, 0, 0, "not enough memory to initialize DHCP manager proxy"); - goto error; - } + g_assert (priv->proxy); dbus_g_proxy_add_signal (priv->proxy, "Event", @@ -313,11 +356,6 @@ nm_dhcp_manager_new (const char *client, GError **error) NULL); return singleton; - -error: - g_object_unref (singleton); - singleton = NULL; - return singleton; } #define STATE_ID_TAG "state-id" diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index df78f1885a..9d83d09605 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -33,6 +33,18 @@ #include "nm-dhcp4-config.h" #include "nm-hostname-provider.h" +enum { + NM_DHCP_MANAGER_ERROR_BAD_CLIENT = 0, + NM_DHCP_MANAGER_ERROR_INTERNAL = 1, +}; + +#define NM_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_quark ()) +#define NN_TYPE_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_get_type ()) + +GQuark nm_dhcp_manager_error_quark (void); +GType nm_dhcp_manager_error_get_type (void); + + #define NM_TYPE_DHCP_MANAGER (nm_dhcp_manager_get_type ()) #define NM_DHCP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManager)) #define NM_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) From 301284875943f609f48f06c84f1ab1e2523970ab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 17:54:16 -0700 Subject: [PATCH 119/392] rfkill: remove unused ignore_udev switch --- src/nm-manager.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index acf0f30ed6..1b3fe5b317 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -158,10 +158,6 @@ typedef struct { const char *key; const char *prop; const char *hw_prop; - /* Hack for WWAN for 0.8 release; we'll start using udev - * after 0.8 gets out. - */ - gboolean ignore_udev; RfKillState (*other_enabled_func) (NMManager *); gboolean (*object_filter_func) (GObject *); } RadioState; @@ -1383,8 +1379,7 @@ manager_rfkill_update_one_type (NMManager *self, RfKillState composite; gboolean new_e = TRUE, new_he = TRUE; - if (!rstate->ignore_udev) - udev_state = nm_udev_manager_get_rfkill_state (priv->udev_mgr, rtype); + udev_state = nm_udev_manager_get_rfkill_state (priv->udev_mgr, rtype); if (rstate->other_enabled_func) other_state = rstate->other_enabled_func (self); @@ -2858,23 +2853,21 @@ nm_manager_start (NMManager *self) if (!rstate->desc) continue; - if (!rstate->ignore_udev) { - switch (nm_udev_manager_get_rfkill_state (priv->udev_mgr, i)) { - case RFKILL_UNBLOCKED: - enabled = TRUE; - hw_enabled = TRUE; - break; - case RFKILL_SOFT_BLOCKED: - enabled = FALSE; - hw_enabled = TRUE; - break; - case RFKILL_HARD_BLOCKED: - enabled = FALSE; - hw_enabled = FALSE; - break; - default: - break; - } + switch (nm_udev_manager_get_rfkill_state (priv->udev_mgr, i)) { + case RFKILL_UNBLOCKED: + enabled = TRUE; + hw_enabled = TRUE; + break; + case RFKILL_SOFT_BLOCKED: + enabled = FALSE; + hw_enabled = TRUE; + break; + case RFKILL_HARD_BLOCKED: + enabled = FALSE; + hw_enabled = FALSE; + break; + default: + break; } rstate->hw_enabled = hw_enabled; From c471bb4a03c6416b2d635c6884c58501d059c395 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 18:32:32 -0700 Subject: [PATCH 120/392] po: add new translatable --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 99960438f9..4369c5b994 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -13,6 +13,7 @@ libnm-util/nm-utils.c src/nm-netlink-monitor.c src/main.c src/dhcp-manager/nm-dhcp-dhclient.c +src/dhcp-manager/nm-dhcp-manager.c src/ip6-manager/nm-netlink-listener.c src/named-manager/nm-named-manager.c src/system-settings/nm-default-wired-connection.c From b7d21eba690186e310034a36355d350afd4af8d4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 18:50:32 -0700 Subject: [PATCH 121/392] dhcp: print out DHCP client command strings --- src/dhcp-manager/nm-dhcp-dhclient.c | 6 +++++- src/dhcp-manager/nm-dhcp-dhcpcd.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 9ea31ef7aa..bf892bcfd7 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -484,7 +484,7 @@ dhclient_start (NMDHCPClient *client, GPid pid = 0; GError *error = NULL; const char *iface, *uuid; - char *binary_name; + char *binary_name, *cmd_str; gboolean ipv6; g_return_val_if_fail (priv->pid_file == NULL, -1); @@ -545,6 +545,10 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); + cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); + nm_info ("running: %s", cmd_str); + g_free (cmd_str); + if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhclient_child_setup, NULL, &pid, &error)) { nm_warning ("dhclient failed to start. error: '%s'", error->message); diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 6895498a23..123ac06ab7 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -93,7 +93,7 @@ real_ip4_start (NMDHCPClient *client, GPtrArray *argv = NULL; GPid pid = 0; GError *error = NULL; - char *pid_contents = NULL, *binary_name; + char *pid_contents = NULL, *binary_name, *cmd_str; const char *iface, *uuid, *hostname; g_return_val_if_fail (priv->pid_file == NULL, -1); @@ -138,6 +138,10 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) iface); g_ptr_array_add (argv, NULL); + cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); + nm_info ("running: %s", cmd_str); + g_free (cmd_str); + if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhcpcd_child_setup, NULL, &pid, &error)) { nm_warning ("dhcpcd failed to start. error: '%s'", error->message); From 35e5656e655007c9e9b80e6caa46b7a67134ad80 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 22:51:19 -0700 Subject: [PATCH 122/392] bluetooth: fix race condition causing NAP connections to fail (rh #572340) The race would start DHCP before we had the BNEP interface from bluez, causing the wrong interface name to be used. --- src/nm-device-bt.c | 97 ++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 7e0f459dd6..0eec484ad4 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -51,6 +51,9 @@ typedef struct { char *name; guint32 capabilities; + gboolean connected; + gboolean have_iface; + DBusGProxy *type_proxy; DBusGProxy *dev_proxy; @@ -535,6 +538,53 @@ nm_device_bt_modem_removed (NMDeviceBt *self, NMModem *modem) return TRUE; } +static gboolean +modem_find_timeout (gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + + priv->timeout_id = 0; + + nm_device_state_changed (NM_DEVICE (user_data), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND); + return FALSE; +} + +static void +check_connect_continue (NMDeviceBt *self) +{ + NMDevice *device = NM_DEVICE (self); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + gboolean pan = (priv->bt_type == NM_BT_CAPABILITY_NAP); + gboolean dun = (priv->bt_type == NM_BT_CAPABILITY_DUN); + + if (!priv->connected || !priv->have_iface) + return; + + nm_info ("Activation (%s %s/bluetooth) Stage 2 of 5 (Device Configure) " + "successful. Will connect via %s.", + nm_device_get_iface (device), + nm_device_get_ip_iface (device), + dun ? "DUN" : (pan ? "PAN" : "unknown")); + + if (pan) { + /* Bluez says we're connected now. Start IP config. */ + nm_device_activate_schedule_stage3_ip_config_start (device); + } else if (dun) { + /* Wait for ModemManager to find the modem */ + if (priv->timeout_id) + g_source_remove (priv->timeout_id); + priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); + + nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " + "waiting for modem to appear.", + nm_device_get_iface (device)); + } else + g_assert_not_reached (); +} + static void bluez_connect_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, @@ -573,20 +623,8 @@ bluez_connect_cb (DBusGProxy *proxy, } /* Stage 3 gets scheduled when Bluez says we're connected */ -} - -static gboolean -modem_find_timeout (gpointer user_data) -{ - NMDeviceBt *self = NM_DEVICE_BT (user_data); - NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); - - priv->timeout_id = 0; - - nm_device_state_changed (NM_DEVICE (user_data), - NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND); - return FALSE; + priv->have_iface = TRUE; + check_connect_continue (self); } static void @@ -608,28 +646,8 @@ bluez_property_changed (DBusGProxy *proxy, connected = g_value_get_boolean (value); if (connected) { if (state == NM_DEVICE_STATE_CONFIG) { - gboolean pan = (priv->bt_type == NM_BT_CAPABILITY_NAP); - gboolean dun = (priv->bt_type == NM_BT_CAPABILITY_DUN); - - nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " - "successful. Will connect via %s.", - nm_device_get_iface (device), - dun ? "DUN" : (pan ? "PAN" : "unknown")); - - if (pan) { - /* Bluez says we're connected now. Start IP config. */ - nm_device_activate_schedule_stage3_ip_config_start (device); - } else if (dun) { - /* Wait for ModemManager to find the modem */ - if (priv->timeout_id) - g_source_remove (priv->timeout_id); - priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); - - nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " - "waiting for modem to appear.", - nm_device_get_iface (device)); - } else - g_assert_not_reached (); + priv->connected = TRUE; + check_connect_continue (self); } } else { gboolean fail = FALSE; @@ -645,8 +663,10 @@ bluez_property_changed (DBusGProxy *proxy, fail = TRUE; } - if (fail) + if (fail) { nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_CARRIER); + priv->connected = FALSE; + } } } @@ -761,6 +781,9 @@ real_deactivate_quickly (NMDevice *device) { NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + priv->have_iface = FALSE; + priv->connected = FALSE; + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { if (priv->modem) { From b95c390015338650fcf44c825f2927f05667b6eb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 23:07:17 -0700 Subject: [PATCH 123/392] bluetooth: add timeout for bluetooth connection request --- include/NetworkManager.h | 3 +++ introspection/nm-device.xml | 5 +++++ src/nm-device-bt.c | 32 ++++++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index ce2a81b228..7847826fd0 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -369,6 +369,9 @@ typedef enum { /* The modem could not be found */ NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND, + /* The Bluetooth connection failed or timed out */ + NM_DEVICE_STATE_REASON_BT_FAILED, + /* Unused */ NM_DEVICE_STATE_REASON_LAST = 0xFFFF } NMDeviceStateReason; diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 49b77a5ba0..0d0a9508ae 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -397,6 +397,11 @@ The modem could not be found. + + + The Bluetooth connection timed out or failed. + + diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 0eec484ad4..c60afe7d14 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -542,11 +542,9 @@ static gboolean modem_find_timeout (gpointer user_data) { NMDeviceBt *self = NM_DEVICE_BT (user_data); - NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); - priv->timeout_id = 0; - - nm_device_state_changed (NM_DEVICE (user_data), + NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0; + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND); return FALSE; @@ -602,16 +600,18 @@ bluez_connect_cb (DBusGProxy *proxy, error && error->message ? error->message : "(unknown)"); g_clear_error (&error); - // FIXME: get a better reason code - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); return; } if (!device || !strlen (device)) { nm_warning ("Invalid network device returned by bluez"); - // FIXME: get a better reason code - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); } if (priv->bt_type == NM_BT_CAPABILITY_DUN) { @@ -670,6 +670,18 @@ bluez_property_changed (DBusGProxy *proxy, } } +static gboolean +bt_connect_timeout (gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + + NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0; + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); + return FALSE; +} + static NMActStageReturn real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) { @@ -736,6 +748,10 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) G_TYPE_STRING, dun ? BLUETOOTH_DUN_UUID : BLUETOOTH_NAP_UUID, G_TYPE_INVALID); + if (priv->timeout_id) + g_source_remove (priv->timeout_id); + priv->timeout_id = g_timeout_add_seconds (30, bt_connect_timeout, device); + return NM_ACT_STAGE_RETURN_POSTPONE; } From c8e23d36e3b1ced223c5eea2234bc696fa3b77c9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Mar 2010 23:13:49 -0700 Subject: [PATCH 124/392] core: add numeric reason codes for easier maintenance Also makes it easier to keep the introspection and the C in sync. --- include/NetworkManager.h | 88 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 7847826fd0..9df444f27c 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -241,136 +241,136 @@ typedef enum { NM_DEVICE_STATE_REASON_NONE = 0, /* Unknown error */ - NM_DEVICE_STATE_REASON_UNKNOWN, + NM_DEVICE_STATE_REASON_UNKNOWN = 1, /* Device is now managed */ - NM_DEVICE_STATE_REASON_NOW_MANAGED, + NM_DEVICE_STATE_REASON_NOW_MANAGED = 2, /* Device is now managed unmanaged */ - NM_DEVICE_STATE_REASON_NOW_UNMANAGED, + NM_DEVICE_STATE_REASON_NOW_UNMANAGED = 3, /* The device could not be readied for configuration */ - NM_DEVICE_STATE_REASON_CONFIG_FAILED, + NM_DEVICE_STATE_REASON_CONFIG_FAILED = 4, /* IP configuration could not be reserved (no available address, timeout, etc) */ - NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE = 5, /* The IP config is no longer valid */ - NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED, + NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED = 6, /* Secrets were required, but not provided */ - NM_DEVICE_STATE_REASON_NO_SECRETS, + NM_DEVICE_STATE_REASON_NO_SECRETS = 7, /* 802.1x supplicant disconnected */ - NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT, + NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8, /* 802.1x supplicant configuration failed */ - NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED = 9, /* 802.1x supplicant failed */ - NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED = 10, /* 802.1x supplicant took too long to authenticate */ - NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT, + NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT = 11, /* PPP service failed to start */ - NM_DEVICE_STATE_REASON_PPP_START_FAILED, + NM_DEVICE_STATE_REASON_PPP_START_FAILED = 12, /* PPP service disconnected */ - NM_DEVICE_STATE_REASON_PPP_DISCONNECT, + NM_DEVICE_STATE_REASON_PPP_DISCONNECT = 13, /* PPP failed */ - NM_DEVICE_STATE_REASON_PPP_FAILED, + NM_DEVICE_STATE_REASON_PPP_FAILED = 14, /* DHCP client failed to start */ - NM_DEVICE_STATE_REASON_DHCP_START_FAILED, + NM_DEVICE_STATE_REASON_DHCP_START_FAILED = 15, /* DHCP client error */ - NM_DEVICE_STATE_REASON_DHCP_ERROR, + NM_DEVICE_STATE_REASON_DHCP_ERROR = 16, /* DHCP client failed */ - NM_DEVICE_STATE_REASON_DHCP_FAILED, + NM_DEVICE_STATE_REASON_DHCP_FAILED = 17, /* Shared connection service failed to start */ - NM_DEVICE_STATE_REASON_SHARED_START_FAILED, + NM_DEVICE_STATE_REASON_SHARED_START_FAILED = 18, /* Shared connection service failed */ - NM_DEVICE_STATE_REASON_SHARED_FAILED, + NM_DEVICE_STATE_REASON_SHARED_FAILED = 19, /* AutoIP service failed to start */ - NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED, + NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED = 20, /* AutoIP service error */ - NM_DEVICE_STATE_REASON_AUTOIP_ERROR, + NM_DEVICE_STATE_REASON_AUTOIP_ERROR = 21, /* AutoIP service failed */ - NM_DEVICE_STATE_REASON_AUTOIP_FAILED, + NM_DEVICE_STATE_REASON_AUTOIP_FAILED = 22, /* The line is busy */ - NM_DEVICE_STATE_REASON_MODEM_BUSY, + NM_DEVICE_STATE_REASON_MODEM_BUSY = 23, /* No dial tone */ - NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE, + NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE = 24, /* No carrier could be established */ - NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER, + NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER = 25, /* The dialing request timed out */ - NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT, + NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT = 26, /* The dialing attempt failed */ - NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED, + NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED = 27, /* Modem initialization failed */ - NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED, + NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED = 28, /* Failed to select the specified APN */ - NM_DEVICE_STATE_REASON_GSM_APN_FAILED, + NM_DEVICE_STATE_REASON_GSM_APN_FAILED = 29, /* Not searching for networks */ - NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING = 30, /* Network registration denied */ - NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED = 31, /* Network registration timed out */ - NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT = 32, /* Failed to register with the requested network */ - NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED = 33, /* PIN check failed */ - NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED, + NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED = 34, /* Necessary firmware for the device may be missing */ - NM_DEVICE_STATE_REASON_FIRMWARE_MISSING, + NM_DEVICE_STATE_REASON_FIRMWARE_MISSING = 35, /* The device was removed */ - NM_DEVICE_STATE_REASON_REMOVED, + NM_DEVICE_STATE_REASON_REMOVED = 36, /* NetworkManager went to sleep */ - NM_DEVICE_STATE_REASON_SLEEPING, + NM_DEVICE_STATE_REASON_SLEEPING = 37, /* The device's active connection disappeared */ - NM_DEVICE_STATE_REASON_CONNECTION_REMOVED, + NM_DEVICE_STATE_REASON_CONNECTION_REMOVED = 38, /* Device disconnected by user or client */ - NM_DEVICE_STATE_REASON_USER_REQUESTED, + NM_DEVICE_STATE_REASON_USER_REQUESTED = 39, /* Carrier/link changed */ - NM_DEVICE_STATE_REASON_CARRIER, + NM_DEVICE_STATE_REASON_CARRIER = 40, /* The device's existing connection was assumed */ - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED = 41, /* The supplicant is now available */ - NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE, + NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE = 42, /* The modem could not be found */ - NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND, + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND = 43, /* The Bluetooth connection failed or timed out */ - NM_DEVICE_STATE_REASON_BT_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED = 44, /* Unused */ NM_DEVICE_STATE_REASON_LAST = 0xFFFF From e5a66e2882806d618ac9d89d15030f067023d7ca Mon Sep 17 00:00:00 2001 From: Shankar Prasad Date: Wed, 24 Mar 2010 01:21:56 -0700 Subject: [PATCH 125/392] po: updated Kannada translation (bgo #609510) --- po/kn.po | 287 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 231 insertions(+), 56 deletions(-) diff --git a/po/kn.po b/po/kn.po index 999ee84b06..3a433c8dfd 100644 --- a/po/kn.po +++ b/po/kn.po @@ -3,19 +3,20 @@ # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. # -# Shankar Prasad , 2009. +# Shankar Prasad , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.po.master.kn\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-06-15 03:24+0000\n" -"PO-Revision-Date: 2009-06-15 14:24+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-02-10 14:31+0530\n" "Last-Translator: Shankar Prasad \n" -"Language-Team: Kannada \n" +"Language-Team: kn-IN <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" +"X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../libnm-util/crypto.c:120 @@ -103,8 +104,9 @@ msgstr "IV ಅನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು msgid "IV contains non-hexadecimal digits." msgstr "IV ಯು ಹೆಕ್ಸಾ-ದಶಮಾಂಶ ಅಲ್ಲದ ಅಂಕೆಗಳನ್ನು ಹೊಂದಿದೆ." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ಖಾಸಗಿ ಕೀಲಿ ಸಿಫರ್ '%s' ತಿಳಿದಿಲ್ಲ." @@ -124,72 +126,111 @@ msgstr "ಖಾಸಗಿ ಕೀಲಿಯ ಬಗೆಯನ್ನು ನಿರ್ಧ msgid "Not enough memory to store decrypted private key." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "ಕ್ರಿಪ್ಟೋ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ಅಮಾನ್ಯವಾದ IV ಗಾತ್ರ (ಕನಿಷ್ಟ %zd ಇರಬೇಕು)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ಬಫರಿಗಾಗಿ ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "ಡೀಕ್ರಿಪ್ಸ್ ಮಾಡುವ ಸಿಫರ್ ಸಂದರ್ಭವನ್ನು ಆರಂಭಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು IV ಅನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಅನಿರೀಕ್ಷಿತವಾದ ಪ್ಯಾಡಿಂಗ್ ಗಾತ್ರ" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 #, c-format msgid "Failed to decrypt the private key." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಸಿಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../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 "ಗೂಢಲಿಪೀಕರಣ ಸಿಫರ್ ಸಂದರ್ಭವನ್ನು ಆರಂಭಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %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 "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %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 "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %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 "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "ಪ್ರಮಾಣಪತ್ರ ದತ್ತಾಂಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 ಡೀಕೋಡರ್ ಅನ್ನು ಆರಂಭಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ಕಡತವನ್ನು ಪರಿಶೀಲಿಸಲಾಗಿಲ್ಲ: %s" #: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "ಕ್ರಿಪ್ಟೊ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." @@ -199,105 +240,194 @@ msgstr "ಕ್ರಿಪ್ಟೊ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭ msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 ಸಂದರ್ಭವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ಅಮಾನ್ಯವಾದ IV ಗಾತ್ರ (ಕನಿಷ್ಟ %d ಇರಬೇಕು)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "ಡೀಕ್ರಪ್ಟ್ ಮಾಡಲಾಗುವ ಸಿಫರ್ ಜಾಗವನ್ನು ಆರಂಭಿಸಲು ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು IV ಅನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವ ಸನ್ನಿವೇಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../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 "" +"ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ದತ್ತಾಂಶದ ಗಾತ್ರವು " +"ಬಹಳ ದೊಡ್ಡದಾಗಿದೆ." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಿಕೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:363 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾಗುವ ಸಿಫರ್ ಜಾಗವನ್ನು ಆರಂಭಿಸಲು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "ಗೂಢಲಿಪೀಕರಿಸುವ ಸನ್ನಿವೇಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಅನಿರೀಕ್ಷಿತವಾದ ದತ್ತಾಂಶದ ಮೊತ್ತ." + +#: ../libnm-util/crypto_nss.c:446 #, c-format msgid "Couldn't decode certificate: %d" msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:481 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "ಗುಪ್ತಪದವನ್ನು UCS2 ಗೆ ಬದಲಾಯಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:509 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ಡೀಕೋಡರ್ ಅನ್ನು ಆರಂಭಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:518 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:527 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ಕಡತವನ್ನು ಖಚಿತಪಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:556 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "ಮನಸ್ಸಿಗೆ ಬಂದ ದತ್ತಾಂಶವನ್ನು ಉತ್ಪಾದಿಸಲಾಗಲಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1633 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ಕಡತ ರಚನೆಗೆ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV ಅನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ಕಡತ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್ ಸಂದೇಶವನ್ನು ಸಂಸ್ಕರಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು " +"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %" +"s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ನಿಯೋಜಿಸಲು " +"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" + +#: ../src/nm-netlink-monitor.c:558 #, c-format msgid "error updating link cache: %s" msgstr "ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ಅಪ್‌ಡೇಟ್ ಮಾಡುವಾಗ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" - -#: ../src/NetworkManager.c:329 +#: ../src/NetworkManager.c:330 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ಅಮಾನ್ಯವಾದ ಆಯ್ಕೆ. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager ನಿಂದ ನಿರ್ಮಿಸಲಾಗಿದೆ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -306,28 +436,73 @@ msgstr "" "# %s ಇಂದ ಒಗ್ಗೂಡಿಸಲಾಗಿದೆ\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " +"ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." + +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." -#: ../src/system-settings/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "ಸ್ವಯಂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2168 +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 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:2 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ 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 ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + From cd52f2ea5a5c1cb781588a2ed6f18d0e13b14892 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Giri Date: Wed, 24 Mar 2010 01:22:58 -0700 Subject: [PATCH 126/392] po: updated Oriya translation (bgo #610332) --- po/or.po | 373 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 275 insertions(+), 98 deletions(-) diff --git a/po/or.po b/po/or.po index dc124759ad..5ab219e632 100644 --- a/po/or.po +++ b/po/or.po @@ -1,86 +1,22 @@ -# translation of or.po to Oriya +# translation of NetworkManager.master.or.po to Oriya # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # -# Manoj Kumar Giri , 2008. +# Manoj Kumar Giri , 2008, 2010. msgid "" msgstr "" -"Project-Id-Version: or\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2008-11-25 21:02+0000\n" -"PO-Revision-Date: 2008-11-26 19:09+0530\n" +"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: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-02-10 16:09+0530\n" "Last-Translator: Manoj Kumar Giri \n" -"Language-Team: Oriya\n" +"Language-Team: Oriya \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2;plural=(n!=1)\n" - -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 -#, c-format -msgid "error processing netlink message: %s" -msgstr "netlink ସନ୍ଦେଶ ପଠାଇବାରେ ତ୍ରୁଟି: %s" - -#: ../src/nm-netlink-monitor.c:251 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" - -#: ../src/nm-netlink-monitor.c:261 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" - -#: ../src/nm-netlink-monitor.c:269 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" - -#: ../src/nm-netlink-monitor.c:277 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink କ୍ୟାଶେ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" - -#: ../src/nm-netlink-monitor.c:418 -#, c-format -msgid "error updating link cache: %s" -msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାରେ ତ୍ରୁଟି: %s" - -#: ../src/nm-netlink-monitor.c:484 -msgid "error occurred while waiting for data on socket" -msgstr "ସକେଟରେ ତଥ୍ୟ ପାଇଁ ଅପେକ୍ଷା କରିବା ସମୟରେ ତ୍ରୁଟି" - -#: ../src/NetworkManager.c:293 -#, c-format -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 -msgid "# Created by NetworkManager\n" -msgstr "# NetworkManager ଦ୍ୱାରା ନିର୍ମିତ\n" - -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 -#, c-format -msgid "" -"# Merged from %s\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" "\n" -msgstr "" -"# %s ରୁ ମିଶ୍ରିତ\n" -"\n" - -#: ../src/named-manager/nm-named-manager.c:256 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." - -#: ../src/named-manager/nm-named-manager.c:258 -msgid "The nameservers listed below may not be recognized." -msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." - -#: ../system-settings/src/main.c:376 -#, c-format -msgid "Auto %s" -msgstr "ସ୍ୱୟଂ %s" #: ../libnm-util/crypto.c:120 #, c-format @@ -167,8 +103,9 @@ msgstr "IV କୁ ସଂରକ୍ଷଣ କରିବା ପାଇଁ ଯଥେ msgid "IV contains non-hexadecimal digits." msgstr "IV ଷୋହଳମିକ ସଂଖ୍ୟା ଧାରଣ କରିନଥାଏ." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁଞ୍ଜି '%s' ଅଜଣା ଥିଲା." @@ -188,66 +125,106 @@ msgstr "ବ୍ୟକ୍ତିଗତ କି ପ୍ରକାର ନିର୍ଧା msgid "Not enough memory to store decrypted private key." msgstr "ବିକୋଡ଼ନ ବ୍ୟକ୍ତିଗତ ତଥ୍ୟ ସଂରକ୍ଷଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "କ୍ରିପ୍ଟ ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ଅବୈଧ IV ଲମ୍ବ (ଅତିକମରେ %zd ହେବା ଉଚିତ)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "କି ବଫରକୁ ବିକୋଡ଼ନ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "ବିକୋଡ଼ନ କୁଞ୍ଜି ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "ବିକୋଡ଼ନ ପାଇଁ ସମମିତ କି ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅପ୍ରତ୍ୟାଶିତ ପ୍ୟାଡିଙ୍ଗ ଲମ୍ବ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 #, c-format msgid "Failed to decrypt the private key." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ସଂଗୁପ୍ତ କରିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../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 "ବିକୋଡ଼ନ କୁଞ୍ଜି ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %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 "ବିକୋଡ଼ନ ପାଇଁ ସମମିତ କି ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %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 "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %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 "ତଥ୍ୟକୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "ପ୍ରମାଣପତ୍ର ତଥ୍ୟକୁ ଆରମ୍ଭ କରିବାରେ ତ୍ରୁଟି: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "ପ୍ରମାଣପତ୍ରକୁ ଅବସଂକେତ କରିପାରିଲେ ନାହିଁ: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 ଅବସଂକେତକକୁ ଆରମ୍ଭ କରିପାରିଲେ ନାହିଁ: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତ କରିହେବ ନାହିଁ: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲା ନାହିଁ: %s" @@ -262,58 +239,258 @@ msgstr "କ୍ରିପ୍ଟ ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରି msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ଅବୈଧ IV ଲମ୍ବ (ନିଶ୍ଚିତ ଭାବରେ ଅତିକମରେ %d ହେବା ଉଚିତ)।" + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "ଅବସଂକେତନ କୁଞ୍ଜି ସ୍ଥାନକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "ଅବସଂକେତନ ପାଇଁ ସମମିତ କିକୁ ବିନ୍ୟାସ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "ଅବସଂକେତନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "ଅବସଂକେତନ ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../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 "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅବସଂକେତ ତଥ୍ୟଟି ଅତ୍ୟଧିକ ବଡ଼।" + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "ବ୍ୟକ୍ତିଗତ କିର ଅବସଂକେତନକୁ ନିଶ୍ଚୟ କରିବାରେ ବିଫଳ: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:363 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "ଅବସଂକେତନ କୁଞ୍ଜି ସ୍ଥାନକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "ଅବସଂକେତନ ପାଇଁ ସମମିତ କିକୁ ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "ଅବସଂକେତନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "ଅବସଂକେତନ ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "ଅବସଂକେତ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ସଂଗୁପ୍ତ କରିବା ପରେ ଅପ୍ରତ୍ୟଶିତ ପରିମାଣର ତଥ୍ୟ।" + +#: ../libnm-util/crypto_nss.c:446 #, c-format msgid "Couldn't decode certificate: %d" msgstr "ପ୍ରମାଣପତ୍ରକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:481 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "ପ୍ରବେଶସଙ୍କେତକୁ UCS2ରେ ପରିବର୍ତ୍ତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:509 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ଅବସଂକେତକକୁ ଆରମ୍ଭ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:518 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:527 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲାନାହିଁ: %d" +#: ../libnm-util/crypto_nss.c:556 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "ମନଇଚ୍ଛା ତଥ୍ୟକୁ ଅବସଂକେତ କରିହେଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "ବିକୋଡ଼ନ କି କୁ ନିର୍ମାଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ମୃତି ସ୍ଥାନ ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1633 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ଫାଇଲ ନିର୍ମାଣ ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ଫାଇଲରେ IV ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ଫାଇଲରେ ସଂଗୁପ୍ତ କି ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink ସନ୍ଦେଶ ପଠାଇବାରେ ତ୍ରୁଟି: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink କ୍ୟାଶେ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "ସକେଟରେ ତଥ୍ୟ ପାଇଁ ଅପେକ୍ଷା କରିବା ସମୟରେ ତ୍ରୁଟି" + +#: ../src/nm-netlink-monitor.c:558 +#, c-format +msgid "error updating link cache: %s" +msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାରେ ତ୍ରୁଟି: %s" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager ଦ୍ୱାରା ନିର୍ମିତ\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s ରୁ ମିଶ୍ରିତ\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "ସ୍ୱୟଂ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +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 ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" + From 88f68c10ff107d1846beb8dae9ef6bb30667b8f4 Mon Sep 17 00:00:00 2001 From: Ani Peter Date: Wed, 24 Mar 2010 01:24:45 -0700 Subject: [PATCH 127/392] po: add Malayalam translation (bgo #613680) --- po/LINGUAS | 1 + po/ml.po | 1320 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1321 insertions(+) create mode 100644 po/ml.po diff --git a/po/LINGUAS b/po/LINGUAS index 51d84b2a92..9494643213 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -35,6 +35,7 @@ ku lt lv mk +ml mr nb ne diff --git a/po/ml.po b/po/ml.po new file mode 100644 index 0000000000..d5728eafe3 --- /dev/null +++ b/po/ml.po @@ -0,0 +1,1320 @@ +# translation of NetworkManager.master_upstream.ml.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Ani Peter , 2010 +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.master_upstream.ml\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-03-23 03:25+0000\n" +"PO-Revision-Date: 2010-03-23 17:04+0530\n" +"Last-Translator: Ani Peter | അനി പീറ്റര്‍\n" +"Language-Team: Swathantra Malayalam Computing | സ്വതന്ത്ര മലയാളം കമ്പ്യൂട്ടിങ് \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c: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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "പേരു്" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "സിസ്റ്റം കണക്ഷനുകള്‍:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "പിശക്: %s ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "പിശക്: %s - ഇത്തരം കണക്ഷന്‍ ലഭ്യമല്ല." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "സിസ്റ്റത്തിലുള്ള കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "അപരിചിതമായ പരാമീറ്റര്‍: %s\n" + +#: ../cli/src/connections.c:221 +#, 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 "ഇല്ല" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "സജീവമായ കണക്ഷനുകള്‍" + +#: ../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:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "സര്‍വീസ്" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "ഡിവൈസുകള്‍" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ഡിവൈസ് '%s'-ല്‍ സജീവമായ കണക്ഷന്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "സജീവമായ കണക്ഷന്‍ അല്ലെങ്കില്‍ ഡിവൈസ് ലഭ്യമല്ല" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "സജീവമാക്കുന്നു" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "സജീവമാക്കിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "അപരിചിതം" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (തയ്യാറാകുക)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "വിപിഎന്‍ കണക്ഷന്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "വിപിഎന്‍ വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "അപരിചിതമായ കാരണം" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "ഒന്നുമില്ല" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "ഉപയോക്താവു് വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "അടിസ്ഥാന നെറ്റ്‌വര്‍ക്ക് കണക്ഷന്‍ തടസ്സപ്പെടുത്തിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "വിപിഎന്‍ സര്‍വീസ് അപ്രതീക്ഷിതമായി നിര്‍ത്തിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "വിപിഎന്‍ സര്‍വീസ് തെറ്റായ ക്രമീകരണം തിരികെ നല്‍കിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "കണക്ഷനുള്ള ശ്രമം കഴിഞ്ഞിരിക്കുന്നു" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "വിപിഎന്‍ സര്‍വീസ് സമയത്തിനു് ആരംഭിച്ചില്ല" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "വിപിഎന്‍ സര്‍വീസ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "ശരിയായ വിപിഎന്‍ രഹസ്യങ്ങള്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "തെറ്റായ വിപിഎന്‍ രഹസ്യങ്ങള്‍" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "കണക്ഷന്‍ നീക്കം ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "അവസ്ഥ: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "കണക്ഷന്‍ സജീവമാക്കിയിരിക്കുന്നു\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "അവസ്ഥ: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "പിശക്: സമയപരിധി %d നിമിഷത്തിന്റെ കാലാവധി കഴിഞ്ഞിരിക്കുന്നു." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "പിശക്: '%s'-നുള്ള സജീവമായ കണക്ഷന്‍ ലഭ്യമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "സജീവമായ കണക്ഷന്റെ അവസ്ഥ: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "സജീവമായ കണക്ഷന്‍ പാഥ്: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "പിശക്: അപരിചിതമായ കണക്ഷന്‍: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "പിശഖ്: സമയപരിധിയുടെ മൂല്ല്യം '%s' തെറ്റാണു്." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "പിശക്: id അല്ലെങ്കില്‍ uuid വ്യക്തമാക്കേണ്ടതുണ്ടു്." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "മുന്നറിയിപ്പു്: കണക്ഷന്‍ സജീവമല്ല\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "പിശക്: 'con' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "പിശക്: D-Bus-ലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "പിശക്: സിസ്റ്റം സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "പിശക്: ഉപയോക്താവിനുള്ള സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "പിശക്: കണക്ഷനുകള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമല്ല: സജ്ജീകരണങ്ങള്‍ക്കുള്ള സര്‍വീസുകള്‍ പ്രവര്‍ത്തിക്കുന്നില്ല." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "കൈകാര്യം ചെയ്തിട്ടില്ലാത്തതു്" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "ലഭ്യമല്ലാത്തതു്" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "കണക്ട് ചെയ്യുന്നു (തയ്യാറാക്കുക)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "കണക്ട് ചെയ്യുന്നു (ക്രമീകരിക്കുന്നു)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "കണക്ട് ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "കണക്ഷന്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "അപരിചിതം" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(ഒന്നുമില്ല)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:IP4 വിലാസം 0x%X വേര്‍തിരിക്കുന്നതില്‍ പിശക്" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Freq %d MHz, Rate %d Mb/s, അളവു് %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr "എന്റര്‍പ്രൈസ്" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "ഡിവൈസ്" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ഡ്രൈവര്‍" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(അപരിചിതം)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "അവസ്ഥ" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW വിലാസം" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" വിശേഷതകള്‍:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "കാരിയര്‍ ഡിറ്റെക്ട്" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "വേഗത" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" വയര്‍ലെസ്സ് വിശേഷതകള്‍\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP എന്‍ക്രിപ്ഷന്‍" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA എന്‍ക്രിപ്ഷന്‍" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 എന്‍ക്രിപ്ഷന്‍" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP സിഫര്‍" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP സിഫര്‍" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" വയര്‍ലെസ്സ് ആക്സെസ്സ് പോയിന്റുകള്‍ %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = current AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" വയര്‍ഡ് വിശേഷതകള്‍\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "കാരിയര്‍" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "ഓണ്‍" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "ഓഫ്" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 സജ്ജീകരണങ്ങള്‍:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "ഡിവൈസുകളുടെ അവസ്ഥ" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "പിശക്: '%s' ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "പിശക്: ഡിവൈസ് '%s' ലഭ്യമായില്ല." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "വിജയിച്ചു: ഡിവൈസ് '%s' വിജയകരമായി വിഛേദിച്ചിരിക്കുന്നു." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "പിശക്: ഡിവൈസ് '%s' (%s) വിഛേദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ഡിവൈസിന്റെ അവസ്ഥ: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "പിശക്: iface നല്‍കേണ്ടതുണ്ടു്." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi പരിശോധന പട്ടിക" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "പിശക്: '%s' ഡിവൈസ് ഒരു വൈഫൈ ഡിവൈസല്ല." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "ഡിവൈസ്:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "പിശക്: hwaddr വ്യക്തമാക്കേണ്ടതുണ്ടു്." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "പിശക്: hwaddr '%s'-നുള്ള ആക്സെസ്സ് പോയിന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "എപി പരാമീറ്ററുകള്‍" + +#: ../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 "ഫ്രീക്വന്‍സി:" + +#: ../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 "അളവു്:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "ഫ്ലാഗുകള്‍:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "സ്വകാര്യത" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA ഫ്ലാഗുകള്‍:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN ഫ്ലാഗുകള്‍:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "പിശക്: 'dev wifi' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "പിശക്: 'dev' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "കണക്ട് ചെയ്യുന്നു" + +#: ../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 "enabled" + +#: ../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 "disabled" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "നെറ്റ്‌വര്‍ക്ക്മാനേജറിന്റെ അവസ്ഥ" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM പ്രവര്‍ത്തനത്തില്‍:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "പ്രവര്‍ത്തനത്തില്‍" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "പ്രവര്‍ത്തനത്തിലില്ല" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM അവസ്ഥ:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM വയര്‍ലെസ്സ് ഹാര്‍ഡ്‌വെയര്‍:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM വയര്‍ലെസ്സ്:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN ഹാര്‍ഡ്‌വെയര്‍:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "പിശക്: തെറ്റായ 'wifi' പരാമീറ്റര്‍: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "പിശക്: തെറ്റായ 'wwan' പരാമീറ്റര്‍: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "പിശക്: 'nm' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "'%s' ഐഛികം അപരിചിതം, 'nmcli help' ശ്രമിക്കുക." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli പ്രയോഗം, പതിപ്പു് %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "'%s' ഐഛികം അപരിചിതം, 'nmcli -help' ശ്രമിക്കുക." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d സിഗ്നല്‍ ലഭ്യമായി, അടച്ചു പൂട്ടുന്നു..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "പിശക്: നെറ്റ്‌വര്‍ക്ക്മാനേജറിലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "വിജയിച്ചു" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM കീ ഫയലിനു് അവസാനമുള്ള റ്റാഗ് '%s' ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "ഒരു PEM സ്വകാര്യ കീ ഫയല്‍ പോലെയല്ലിതു്." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr " ‌PEM ഫയല്‍ ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "തെറ്റായ PEM ഫയല്‍: Proc-രീതിയിലുള്ളതു് ആദ്യത്തെ റ്റാഗ് അല്ല." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "തെറ്റായ PEM ഫയല്‍: അപരിചിതമായ Proc-രീതിയിലുള്ള റ്റാഗ് '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info രണ്ടാത്തെ റ്റാഗ് അല്ല." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info റ്റാഗില്‍ IV ലഭ്യമായില്ല." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info റ്റാഗില്‍ IV-ന്റെ ശൈലി തെറ്റാണു്." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "തെറ്റായ PEM ഫയല്‍: അപരിചിതമായ സ്വകാര്യ കീ സിഫര്‍ '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "സ്വകാര്യ കീ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമല്ല." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM സര്‍ട്ടിഫിക്കേറ്റ് '%s'-നു് ഒടുവിലുള്ള റ്റാഗ് '%s' ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "‌സര്‍ട്ടിഫിക്കേറ്റ് ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ഫയല്‍ ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV-ന്റെ വ്യാപ്തി ഈവന്‍ അക്കത്തിലുള്ള ബൈറ്റുകളായിരിക്കണം." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-ല്‍ നോണ്‍-ഹെക്സാഡെസിമല്‍ അക്കങ്ങളുണ്ടു്." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "സ്വകാര്യ കീ സിഫര്‍ '%s' അപരിചിതം." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "സ്വകാര്യ കീ രീതി കണ്ടുപിടിക്കുവാന്‍ സാധ്യമല്ല." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ഡീക്രിപ്റ്റ് ചെയ്ത സ്വകാര്യ കീ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ക്രിപ്റ്റോ എഞ്ചില്‍ ആരംഭിക്കുന്നതില്‍ പരാജയം." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 എഞ്ചില്‍ ആരംഭിക്കുവാന്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "തെറ്റായ IV വ്യാപ്തി (കുറഞ്ഞതു് %zd ആയിരിക്കണം)" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ഡീക്രിപ്റ്റ് ചെയ്ത കീ ബഫറിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ഡീക്രിപ്ഷന്‍ സിഫര്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയം: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ഡീക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ഡീക്രിപ്ഷനുള്ള IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: അപ്രതീക്ഷിതമായ പാഢിങ് നീളം." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "എന്‍ക്രിപ്റ്റിങിനുള്ള മെമ്മറി അനുവദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു," + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "എന്‍ക്രിപ്ഷന്‍ സിഫര്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "എന്‍ക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "എന്‍ക്രിപ്ഷനുള്ള IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ഡേറ്റാ എന്‍ക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡേറ്റാ ആരംഭിക്കുന്നതില്‍ പിശക്: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ഡീകോഡര്‍ ആരംഭിക്കുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ഫയല്‍ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ഫയല്‍ ഉറപ്പാക്കുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ക്രിപ്റ്റോ എഞ്ചിന്‍ ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "തെറ്റായ IV നീളം (കുറഞ്ഞതു് %d ആയിരിക്കണം)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ഡീക്രിപ്ഷന്‍ സിഫര്‍ സ്ലോട്ട് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ഡീക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ഡീക്രിപ്ഷനായി IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ഡീക്രിപ്ഷന്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: ഡീക്രിപ്റ്റ് ചെയ്ത ഡേറ്റ വളരെ വലുതാണു്." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "സ്വകാര്യ കീയുടെ ‍ഡീക്രിപ്ഷന്‍ ഉറപ്പാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "എന്‍ക്രിപ്ഷന്‍ സിഫര്‍ സ്ലോട്ട് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "എന്‍ക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "എന്‍ക്രിപ്ഷനുള്ള IV കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "എന്‍ക്രിപ്ഷന്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്തതിനു് ശേഷം അപ്രതീക്ഷിതമായ ഡേറ്റാ" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "രഹസ്യവാക്ക് UCS2-ലേക്ക് വേര്‍തിരിക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ഡീകോഡര്‍ ആരംഭിക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ഫയല്‍ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ഫയല്‍ ഉറപ്പാക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "വേഗത്തില്‍ ഡേറ്റാ തയ്യാറാക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:1802 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "എന്‍ക്രിപ്ഷന്‍ കീ തയ്യാറാക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/nm-utils.c:1912 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ഫയല്‍ ഉണ്ടാക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:1924 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ഫയലിലേക്ക് IV സൂക്ഷിക്കുന്നതിനാവശ്യമുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:1936 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ഫയലിലേക്ക് എന്‍ക്രിപ്റ്റ് ചെയ്ത കീ സൂക്ഷിക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:1955 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ഫയല്‍ ഡേറ്റായ്ക്കുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "നെറ്റ്ലിങ്ക് സന്ദേശം പ്രവര്‍ത്തിപ്പിക്കുമ്പോള്‍ പിശക്: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ലിിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്കുമായി കണക്ട് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഗ്രൂപ്പിലേക്ക് പങ്കു് ചേരുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ലിങ്ക് കാഷേ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %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 "സോക്കറ്റില്‍ ഡേറ്റായ്ക്കായി കാത്തിരിക്കുമ്പോള്‍ പിശകുണ്ടായിരിക്കുന്നു" + +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "ലിങ്ക് കാഷേ പരിഷ്കരിക്കുന്നതില്‍ പിശക്: %s" + +#: ../src/main.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "തെറ്റായ ഉപാധി. ശരിയായ കൂടുതല്‍ ഉപാധികള്‍ക്കായി ദയവായി --help ഉപയോഗിക്കുക.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +msgid "# Created by NetworkManager\n" +msgstr "# തയ്യാറാക്കിയതു് NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s-ല്‍ നിന്നും കൂട്ടിചേര്‍ത്തിരിക്കുന്നു\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "നെറ്റ്ലിങ്കിലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "നെറ്റ്ലിങ്ക് ഗ്രൂപ്പില്‍ ചേരുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "കുറിപ്പു്: libc റിസോള്‍വര്‍ 3 നെയിംസര്‍വറുകളില്‍ കൂടതല്‍ പിന്തുണയ്ക്കുന്നതല്ല." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "താഴെ പറഞ്ഞിരിക്കുന്ന നെയിംസര്‍വറുകള്‍ തിരിച്ചറിയപ്പെടുന്നവയല്ല." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ഓട്ടോ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "സിസ്റ്റം" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "സിസ്റ്റം കണക്ഷനുകളില്‍ മാറ്റം വരുത്തുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr " സിസ്റ്റത്തിന്റെ സജ്ജീകരണങ്ങളില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + From 8846bd83ad76dfb8bda0843a214057b05bcd9300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Mar 2010 12:47:53 +0100 Subject: [PATCH 128/392] cli: print_fields(): don't segfault when a value is not set --- cli/src/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/utils.c b/cli/src/utils.c index 7dea6a1b94..bd9bad519c 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -124,6 +124,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) char *line = NULL; char *indent_str; const char *value; + const char *not_set_str = _("not set"); int i, idx; gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE; gboolean terse = fields.flags & NMC_PF_FLAG_TERSE; @@ -161,7 +162,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) char *tmp; idx = g_array_index (fields.indices, int, i); tmp = g_strdup_printf ("%s:", _(field_values[idx].name_l10n)); - printf ("%-*s%s\n", terse ? 0 : 20, tmp, field_values[idx].value); + printf ("%-*s%s\n", terse ? 0 : 20, tmp, field_values[idx].value ? field_values[idx].value : not_set_str); g_free (tmp); } if (pretty) { @@ -181,7 +182,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) if (field_names) value = _(field_values[idx].name_l10n); else - value = field_values[idx].value; + value = field_values[idx].value ? field_values[idx].value : not_set_str; if (terse) { if (escape) { const char *p = value; From 31970798bc5165635cd9c3362fbd3088dd6bac8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Mar 2010 13:42:47 +0100 Subject: [PATCH 129/392] cli: add NMC_RESULT_ERROR_USER_INPUT code for bad invocation of nmcli --- cli/src/connections.c | 36 ++++++++++++++++++------------------ cli/src/devices.c | 32 ++++++++++++++++---------------- cli/src/network-manager.c | 24 ++++++++++++------------ cli/src/nmcli.c | 30 +++++++++++++++--------------- cli/src/nmcli.h | 17 ++++++++++------- 5 files changed, 71 insertions(+), 68 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index b5e31feebe..8005b02f6b 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -220,7 +220,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) else g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_LIST_ALL); g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -246,7 +246,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } valid_param_specified = TRUE; @@ -290,7 +290,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) if (!valid_param_specified) { g_string_printf (nmc->return_text, _("Error: no valid parameter specified.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } error: @@ -399,7 +399,7 @@ do_connections_status (NmCli *nmc, int argc, char **argv) else g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_STATUS_ALL); g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1081,7 +1081,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1097,7 +1097,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "iface") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1106,7 +1106,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "ap") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1117,7 +1117,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) } else if (strcmp (*argv, "--timeout") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1125,7 +1125,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) nmc->timeout = strtol (*argv, NULL, 10); if (errno || nmc->timeout < 0) { g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } } else { @@ -1138,7 +1138,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) if (!id_specified) { g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1199,7 +1199,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1225,7 +1225,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) if (!id_specified) { g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1284,18 +1284,18 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) if (args->argc == 0) { if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) - goto error; + goto opt_error; args->nmc->return_value = do_connections_list (args->nmc, args->argc, args->argv); } else { if (matches (*args->argv, "list") == 0) { if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) - goto error; + goto opt_error; args->nmc->return_value = do_connections_list (args->nmc, args->argc-1, args->argv+1); } else if (matches(*args->argv, "status") == 0) { if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) - goto error; + goto opt_error; args->nmc->return_value = do_connections_status (args->nmc, args->argc-1, args->argv+1); } else if (matches(*args->argv, "up") == 0) { @@ -1310,7 +1310,7 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) } else { usage (); g_string_printf (args->nmc->return_text, _("Error: 'con' command '%s' is not valid."), *args->argv); - args->nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + args->nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; args->nmc->should_wait = FALSE; } } @@ -1319,9 +1319,9 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) quit (); return; -error: +opt_error: g_string_printf (args->nmc->return_text, _("Error: %s."), error->message); - args->nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + args->nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; args->nmc->should_wait = FALSE; g_error_free (error); quit (); diff --git a/cli/src/devices.c b/cli/src/devices.c index e82dda628e..b3fdf634bc 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -654,7 +654,7 @@ do_devices_status (NmCli *nmc, int argc, char **argv) else g_string_printf (nmc->return_text, _("Error: 'dev status': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_STATUS_ALL); g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -688,7 +688,7 @@ do_devices_list (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -805,7 +805,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -815,7 +815,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) } else if (strcmp (*argv, "--timeout") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -823,7 +823,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) nmc->timeout = strtol (*argv, NULL, 10); if (errno || nmc->timeout < 0) { g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -837,7 +837,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) if (!iface_specified) { g_string_printf (nmc->return_text, _("Error: iface has to be specified.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -913,14 +913,14 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) if (strcmp (*argv, "iface") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } iface = *argv; } else if (strcmp (*argv, "hwaddr") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } hwaddr_user = *argv; @@ -954,7 +954,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) else g_string_printf (nmc->return_text, _("Error: 'dev wifi': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_WIFI_LIST_ALL); g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } @@ -1074,7 +1074,7 @@ do_device_wifi (NmCli *nmc, int argc, char **argv) } else { g_string_printf (nmc->return_text, _("Error: 'dev wifi' command '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } } @@ -1093,14 +1093,14 @@ do_devices (NmCli *nmc, int argc, char **argv) if (argc == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; nmc->return_value = do_devices_status (nmc, 0, NULL); } if (argc > 0) { if (matches (*argv, "status") == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; nmc->return_value = do_devices_status (nmc, argc-1, argv+1); } else if (matches (*argv, "list") == 0) { @@ -1111,7 +1111,7 @@ do_devices (NmCli *nmc, int argc, char **argv) } else if (matches (*argv, "wifi") == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; nmc->return_value = do_device_wifi (nmc, argc-1, argv+1); } else if (strcmp (*argv, "help") == 0) { @@ -1119,16 +1119,16 @@ do_devices (NmCli *nmc, int argc, char **argv) } else { g_string_printf (nmc->return_text, _("Error: 'dev' command '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } } end: return nmc->return_value; -error: +opt_error: g_string_printf (nmc->return_text, _("Error: %s."), error->message); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; g_error_free (error); return nmc->return_value; } diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index e4fbe2ea85..98e1c08052 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -126,7 +126,7 @@ show_nm_status (NmCli *nmc) else g_string_printf (nmc->return_text, _("Error: 'nm status': %s; allowed fields: %s"), error->message, NMC_FIELDS_NM_STATUS_ALL); g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } @@ -176,14 +176,14 @@ do_network_manager (NmCli *nmc, int argc, char **argv) if (argc == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; nmc->return_value = show_nm_status (nmc); } if (argc > 0) { if (matches (*argv, "status") == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; nmc->return_value = show_nm_status (nmc); } else if (matches (*argv, "sleep") == 0) { @@ -196,11 +196,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { /* no argument, show current WiFi state */ if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; if (nmc->required_fields && strcasecmp (nmc->required_fields, "WIFI")) { g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), nmc->required_fields, NMC_FIELDS_NM_WIFI); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto end; } nmc->allowed_fields = nmc_fields_nm_status; @@ -218,7 +218,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) enable_wifi = FALSE; else { g_string_printf (nmc->return_text, _("Error: invalid 'wifi' parameter: '%s'."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto end; } nm_client_wireless_set_enabled (nmc->client, enable_wifi); @@ -227,12 +227,12 @@ do_network_manager (NmCli *nmc, int argc, char **argv) else if (matches (*argv, "wwan") == 0) { if (next_arg (&argc, &argv) != 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) - goto error; + goto opt_error; /* no argument, show current WWAN state */ if (nmc->required_fields && strcasecmp (nmc->required_fields, "WWAN")) { g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), nmc->required_fields, NMC_FIELDS_NM_WWAN); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto end; } nmc->allowed_fields = nmc_fields_nm_status; @@ -250,7 +250,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) enable_wwan = FALSE; else { g_string_printf (nmc->return_text, _("Error: invalid 'wwan' parameter: '%s'."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto end; } nm_client_wwan_set_enabled (nmc->client, enable_wwan); @@ -261,7 +261,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } else { g_string_printf (nmc->return_text, _("Error: 'nm' command '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } } @@ -269,10 +269,10 @@ end: quit (); return nmc->return_value; -error: +opt_error: quit (); g_string_printf (nmc->return_text, _("Error: %s."), error->message); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; g_error_free (error); return nmc->return_value; } diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index 10017f6254..21524185f8 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -106,8 +106,8 @@ do_cmd (NmCli *nmc, const char *argv0, int argc, char **argv) return c->func (nmc, argc-1, argv+1); } - g_string_printf (nmc->return_text, _("Object '%s' is unknown, try 'nmcli help'."), argv0); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Object '%s' is unknown, try 'nmcli help'."), argv0); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } @@ -136,26 +136,26 @@ parse_command_line (NmCli *nmc, int argc, char **argv) opt++; if (matches (opt, "-terse") == 0) { if (nmc->print_output == NMC_PRINT_TERSE) { - g_string_printf (nmc->return_text, _("Option '--terse' is specified the second time.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Option '--terse' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } else if (nmc->print_output == NMC_PRINT_PRETTY) { - g_string_printf (nmc->return_text, _("Option '--terse' is mutually exclusive with '--pretty'.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Option '--terse' is mutually exclusive with '--pretty'.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } else nmc->print_output = NMC_PRINT_TERSE; } else if (matches (opt, "-pretty") == 0) { if (nmc->print_output == NMC_PRINT_PRETTY) { - g_string_printf (nmc->return_text, _("Option '--pretty' is specified the second time.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Option '--pretty' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } else if (nmc->print_output == NMC_PRINT_TERSE) { - g_string_printf (nmc->return_text, _("Option '--pretty' is mutually exclusive with '--terse'.")); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Option '--pretty' is mutually exclusive with '--terse'.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } else @@ -166,7 +166,7 @@ parse_command_line (NmCli *nmc, int argc, char **argv) next_arg (&argc, &argv); if (argc <= 1) { g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } if (!strcmp (argv[1], "yes")) @@ -175,14 +175,14 @@ parse_command_line (NmCli *nmc, int argc, char **argv) nmc->escape_values = FALSE; else { g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[1], opt); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } } else if (matches (opt, "-fields") == 0) { next_arg (&argc, &argv); if (argc <= 1) { g_string_printf (nmc->return_text, _("Error: fields for '%s' options are missing."), opt); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } nmc->required_fields = g_strdup (argv[1]); @@ -193,8 +193,8 @@ parse_command_line (NmCli *nmc, int argc, char **argv) usage (base); return NMC_RESULT_SUCCESS; } else { - g_string_printf (nmc->return_text, _("Option '%s' is unknown, try 'nmcli -help'."), opt); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_string_printf (nmc->return_text, _("Error: Option '%s' is unknown, try 'nmcli -help'."), opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } argc--; diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index 5ff1ea943c..9d121a203b 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -32,25 +32,28 @@ typedef enum { NMC_RESULT_SUCCESS = 0, /* Unknown / unspecified error */ - NMC_RESULT_ERROR_UNKNOWN, + NMC_RESULT_ERROR_UNKNOWN = 1, + + /* Wrong invocation of nmcli */ + NMC_RESULT_ERROR_USER_INPUT = 2, /* A timeout expired */ - NMC_RESULT_ERROR_TIMEOUT_EXPIRED, + NMC_RESULT_ERROR_TIMEOUT_EXPIRED = 3, /* Error in connection activation */ - NMC_RESULT_ERROR_CON_ACTIVATION, + NMC_RESULT_ERROR_CON_ACTIVATION = 4, /* Error in connection deactivation */ - NMC_RESULT_ERROR_CON_DEACTIVATION, + NMC_RESULT_ERROR_CON_DEACTIVATION = 5, /* Error in device disconnect */ - NMC_RESULT_ERROR_DEV_DISCONNECT + NMC_RESULT_ERROR_DEV_DISCONNECT = 6 } NMCResultCode; typedef enum { NMC_PRINT_TERSE = 0, - NMC_PRINT_NORMAL, - NMC_PRINT_PRETTY + NMC_PRINT_NORMAL = 1, + NMC_PRINT_PRETTY = 2 } NMCPrintOutput; /* === Output fields === */ From a91da03b658845dc697ce873d28c4ca8524783fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Mar 2010 19:05:35 +0100 Subject: [PATCH 130/392] cli: 'dev list' adjustments Modifications are mainly for multiline mode to ease parsing - each field name is prefixed with a section name. 'dev list' now also supports printing particular sections specifed via '--fields' option. --- cli/src/connections.c | 14 +- cli/src/devices.c | 499 +++++++++++++++++++++----------------- cli/src/network-manager.c | 12 +- cli/src/nmcli.h | 14 +- cli/src/utils.c | 21 +- 5 files changed, 314 insertions(+), 246 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 8005b02f6b..86e51e3988 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -154,7 +154,7 @@ show_connection (NMConnection *data, gpointer user_data) nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); g_free (timestamp_str); @@ -227,12 +227,12 @@ do_connections_list (NmCli *nmc, int argc, char **argv) if (argc == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("System connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("User connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); @@ -264,7 +264,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "system") == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("System connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); @@ -273,7 +273,7 @@ do_connections_list (NmCli *nmc, int argc, char **argv) else if (strcmp (*argv, "user") == 0) { valid_param_specified = TRUE; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("User connections"); print_fields (nmc->print_fields, nmc->allowed_fields); g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); @@ -353,7 +353,7 @@ show_active_connection (gpointer data, gpointer user_data) info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); - info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); break; } @@ -403,7 +403,7 @@ do_connections_status (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("Active connections"); print_fields (nmc->print_fields, nmc->allowed_fields); diff --git a/cli/src/devices.c b/cli/src/devices.c index b3fdf634bc..05896c75fc 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -55,7 +55,7 @@ #include "devices.h" -/* Available field for 'dev status' */ +/* Available fields for 'dev status' */ static NmcOutputField nmc_fields_dev_status[] = { {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ @@ -65,7 +65,22 @@ static NmcOutputField nmc_fields_dev_status[] = { #define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" #define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" -/* Available field for 'dev list' - general part */ + +/* Available sections for 'dev list' */ +static NmcOutputField nmc_fields_dev_list_sections[] = { + {"GENERAL", N_("GENERAL"), 0, NULL, 0}, /* 0 */ + {"CAPABILITIES", N_("CAPABILITIES"), 0, NULL, 0}, /* 1 */ + {"WIFI-PROPERTIES", N_("WIFI-PROPERTIES"), 0, NULL, 0}, /* 2 */ + {"AP", N_("AP"), 0, NULL, 0}, /* 3 */ + {"WIRED-PROPERTIES", N_("WIRED-PROPERTIES"), 0, NULL, 0}, /* 4 */ + {"IP4-SETTINGS", N_("IP4-SETTINGS"), 0, NULL, 0}, /* 5 */ + {"IP4-DNS", N_("IP4-DNS"), 0, NULL, 0}, /* 6 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS" +#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS" + +/* Available fields for 'dev list' - GENERAL part */ static NmcOutputField nmc_fields_dev_list_general[] = { {"NAME", N_("NAME"), 10, NULL, 0}, /* 0 */ {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 1 */ @@ -78,7 +93,7 @@ static NmcOutputField nmc_fields_dev_list_general[] = { #define NMC_FIELDS_DEV_LIST_GENERAL_ALL "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" #define NMC_FIELDS_DEV_LIST_GENERAL_COMMON "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" -/* Available field for 'dev list' - capabilities part */ +/* Available fields for 'dev list' - CAPABILITIES part */ static NmcOutputField nmc_fields_dev_list_cap[] = { {"NAME", N_("NAME"), 13, NULL, 0}, /* 0 */ {"CARRIER-DETECT", N_("CARRIER-DETECT"), 16, NULL, 0}, /* 1 */ @@ -88,7 +103,7 @@ static NmcOutputField nmc_fields_dev_list_cap[] = { #define NMC_FIELDS_DEV_LIST_CAP_ALL "NAME,CARRIER-DETECT,SPEED" #define NMC_FIELDS_DEV_LIST_CAP_COMMON "NAME,CARRIER-DETECT,SPEED" -/* Available field for 'dev list' - wired properties part */ +/* Available fields for 'dev list' - wired properties part */ static NmcOutputField nmc_fields_dev_list_wired_prop[] = { {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ {"CARRIER", N_("CARRIER"), 10, NULL, 0}, /* 1 */ @@ -98,7 +113,7 @@ static NmcOutputField nmc_fields_dev_list_wired_prop[] = { #define NMC_FIELDS_DEV_LIST_WIRED_PROP_COMMON "NAME,CARRIER" -/* Available field for 'dev list' - wireless properties part */ +/* Available fields for 'dev list' - wireless properties part */ static NmcOutputField nmc_fields_dev_list_wifi_prop[] = { {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ {"WEP", N_("WEP"), 5, NULL, 0}, /* 1 */ @@ -111,7 +126,7 @@ static NmcOutputField nmc_fields_dev_list_wifi_prop[] = { #define NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP" #define NMC_FIELDS_DEV_LIST_WIFI_PROP_COMMON "NAME,WEP,WPA,WPA2,TKIP,CCMP" -/* Available field for 'dev list' - IPv4 settings part */ +/* Available fields for 'dev list' - IPv4 settings part */ static NmcOutputField nmc_fields_dev_list_ip4_settings[] = { {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */ @@ -122,7 +137,7 @@ static NmcOutputField nmc_fields_dev_list_ip4_settings[] = { #define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" #define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" -/* Available field for 'dev list' - IPv4 settings DNS part */ +/* Available fields for 'dev list' - IPv4 settings DNS part */ static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */ @@ -132,24 +147,24 @@ static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { #define NMC_FIELDS_DEV_LIST_IP4_DNS_COMMON "NAME,DNS" -/* Available field for 'dev wifi list' */ +/* Available fields for 'dev wifi list' */ static NmcOutputField nmc_fields_dev_wifi_list[] = { - {"SSID", N_("SSID"), 33, NULL, 0}, /* 0 */ - {"BSSID", N_("BSSID"), 19, NULL, 0}, /* 1 */ - {"MODE", N_("MODE"), 16, NULL, 0}, /* 2 */ - {"FREQ", N_("FREQ"), 10, NULL, 0}, /* 3 */ - {"RATE", N_("RATE"), 10, NULL, 0}, /* 4 */ - {"SIGNAL", N_("SIGNAL"), 8, NULL, 0}, /* 5 */ - {"SECURITY", N_("SECURITY"), 10, NULL, 0}, /* 6 */ - {"WPA-FLAGS", N_("WPA-FLAGS"), 25, NULL, 0}, /* 7 */ - {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 8 */ - {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 9 */ - {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 10 */ - {"NAME", N_("NAME"), 8, NULL, 0}, /* 11 */ /* For WiFi scan in nm dev list */ + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"SSID", N_("SSID"), 33, NULL, 0}, /* 1 */ + {"BSSID", N_("BSSID"), 19, NULL, 0}, /* 2 */ + {"MODE", N_("MODE"), 16, NULL, 0}, /* 3 */ + {"FREQ", N_("FREQ"), 10, NULL, 0}, /* 4 */ + {"RATE", N_("RATE"), 10, NULL, 0}, /* 5 */ + {"SIGNAL", N_("SIGNAL"), 8, NULL, 0}, /* 6 */ + {"SECURITY", N_("SECURITY"), 10, NULL, 0}, /* 7 */ + {"WPA-FLAGS", N_("WPA-FLAGS"), 25, NULL, 0}, /* 8 */ + {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 9 */ + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 10 */ + {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 11 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" -#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" #define NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST "NAME,"NMC_FIELDS_DEV_WIFI_LIST_COMMON @@ -272,28 +287,6 @@ ap_wpa_rsn_flags_to_string (guint32 flags) return ret_str; } -#if 0 -static void -print_header (const char *label, const char *iface, const char *connection) -{ - GString *string; - - string = g_string_sized_new (79); - g_string_append_printf (string, "- %s: ", label); - if (iface) - g_string_append_printf (string, "%s ", iface); - if (connection) - g_string_append_printf (string, " [%s] ", connection); - - while (string->len < 80) - g_string_append_c (string, '-'); - - printf ("%s\n", string->str); - - g_string_free (string, TRUE); -} -#endif - static gchar * ip4_address_as_string (guint32 ip) { @@ -314,6 +307,7 @@ ip4_address_as_string (guint32 ip) typedef struct { NmCli *nmc; + int index; const char* active_bssid; const char* device; } APInfo; @@ -331,6 +325,7 @@ detail_access_point (gpointer data, gpointer user_data) NM80211Mode mode; char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; GString *security_str; + char *ap_name; if (info->active_bssid) { const char *current_bssid = nm_access_point_get_hw_address (ap); @@ -378,22 +373,24 @@ detail_access_point (gpointer data, gpointer user_data) if (security_str->len > 0) g_string_truncate (security_str, security_str->len-1); /* Chop off last space */ - info->nmc->allowed_fields[0].value = ssid_str; - info->nmc->allowed_fields[1].value = hwaddr; - info->nmc->allowed_fields[2].value = mode == NM_802_11_MODE_ADHOC ? _("Ad-Hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"); - info->nmc->allowed_fields[3].value = freq_str; - info->nmc->allowed_fields[4].value = bitrate_str; - info->nmc->allowed_fields[5].value = strength_str; - info->nmc->allowed_fields[6].value = security_str->str; - info->nmc->allowed_fields[7].value = wpa_flags_str; - info->nmc->allowed_fields[8].value = rsn_flags_str; - info->nmc->allowed_fields[9].value = info->device; - info->nmc->allowed_fields[10].value = active ? _("yes") : _("no"); - info->nmc->allowed_fields[11].value = "AP"; + ap_name = g_strdup_printf ("AP%d", info->index++); /* AP */ + info->nmc->allowed_fields[0].value = ap_name; + info->nmc->allowed_fields[1].value = ssid_str; + info->nmc->allowed_fields[2].value = hwaddr; + info->nmc->allowed_fields[3].value = mode == NM_802_11_MODE_ADHOC ? _("Ad-Hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"); + info->nmc->allowed_fields[4].value = freq_str; + info->nmc->allowed_fields[5].value = bitrate_str; + info->nmc->allowed_fields[6].value = strength_str; + info->nmc->allowed_fields[7].value = security_str->str; + info->nmc->allowed_fields[8].value = wpa_flags_str; + info->nmc->allowed_fields[9].value = rsn_flags_str; + info->nmc->allowed_fields[10].value = info->device; + info->nmc->allowed_fields[11].value = active ? _("yes") : _("no"); - info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); + g_free (ap_name); g_free (ssid_str); g_free (freq_str); g_free (bitrate_str); @@ -413,6 +410,7 @@ show_device_info (gpointer data, gpointer user_data) { NMDevice *device = NM_DEVICE (data); NmCli *nmc = (NmCli *) user_data; + GError *error = NULL; APInfo *info; char *tmp; const char *hwaddr = NULL; @@ -421,185 +419,243 @@ show_device_info (gpointer data, gpointer user_data) guint32 speed; char *speed_str = NULL; const GArray *array; + GArray *sections_array; + int k; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_LIST_SECTIONS_ALL; + char *fields_common = NMC_FIELDS_DEV_LIST_SECTIONS_COMMON; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + gboolean was_output = FALSE; - /* General information */ + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + sections_array = parse_output_fields (fields_str, nmc_fields_dev_list_sections, &error); + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev list': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev list': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_LIST_SECTIONS_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return; + } + + /* Main header */ nmc->allowed_fields = nmc_fields_dev_list_general; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ONLY; nmc->print_fields.header_name = _("Device details"); nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - state = nm_device_get_state (device); - if (NM_IS_DEVICE_ETHERNET (device)) - hwaddr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); - else if (NM_IS_DEVICE_WIFI (device)) - hwaddr = nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)); + /* Loop through the required sections and print them. */ + for (k = 0; k < sections_array->len; k++) { + int section_idx = g_array_index (sections_array, int, k); - nmc->allowed_fields[0].value = "GENERAL"; - nmc->allowed_fields[1].value = nm_device_get_iface (device); - nmc->allowed_fields[2].value = get_device_type (device); - nmc->allowed_fields[3].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"); - nmc->allowed_fields[4].value = hwaddr ? hwaddr : _("unknown)"); - nmc->allowed_fields[5].value = device_state_to_string (state); + if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) + printf ("\n"); /* Empty line */ - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = FALSE; - printf ("\n"); /* empty line */ - - /* Capabilities */ - nmc->allowed_fields = nmc_fields_dev_list_cap; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_CAP_ALL, nmc->allowed_fields, NULL); - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - - caps = nm_device_get_capabilities (device); - speed = 0; - if (NM_IS_DEVICE_ETHERNET (device)) { - /* Speed in Mb/s */ - speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device)); - } else if (NM_IS_DEVICE_WIFI (device)) { - /* Speed in b/s */ - speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); - speed /= 1000; - } - if (speed) - speed_str = g_strdup_printf (_("%u Mb/s"), speed); - - nmc->allowed_fields[0].value = "CAPABILITIES"; - nmc->allowed_fields[1].value = (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"); - nmc->allowed_fields[2].value = speed_str ? speed_str : _("unknown"); - - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ - g_free (speed_str); - - /* Wireless specific information */ - if ((NM_IS_DEVICE_WIFI (device))) { - guint32 wcaps; - NMAccessPoint *active_ap = NULL; - const char *active_bssid = NULL; - const GPtrArray *aps; - - printf ("\n"); /* empty line */ - - wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); - - nmc->allowed_fields = nmc_fields_dev_list_wifi_prop; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL, nmc->allowed_fields, NULL); - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - - nmc->allowed_fields[0].value = "WIFI-PROPERTIES"; - nmc->allowed_fields[1].value = (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) ? _("yes") : _("no"); - nmc->allowed_fields[2].value = (wcaps & NM_WIFI_DEVICE_CAP_WPA) ? _("yes") : _("no"); - nmc->allowed_fields[3].value = (wcaps & NM_WIFI_DEVICE_CAP_RSN) ? _("yes") : _("no"); - nmc->allowed_fields[4].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) ? _("yes") : _("no"); - nmc->allowed_fields[5].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) ? _("yes") : _("no"); - - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ - - printf ("\n"); /* empty line */ - - /* Wireless access points */ - if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { - active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); - active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; - } - - nmc->allowed_fields = nmc_fields_dev_wifi_list; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST, nmc->allowed_fields, NULL); - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - - info = g_malloc0 (sizeof (APInfo)); - info->nmc = nmc; - info->active_bssid = active_bssid; - info->device = nm_device_get_iface (device); - aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); - if (aps && aps->len) - g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); - g_free (info); - } else if (NM_IS_DEVICE_ETHERNET (device)) { - printf ("\n"); /* empty line */ - /* Wired properties */ - nmc->allowed_fields = nmc_fields_dev_list_wired_prop; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL, nmc->allowed_fields, NULL); - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - - nmc->allowed_fields[0].value = "WIRED-PROPERTIES"; - nmc->allowed_fields[1].value = (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) ? _("on") : _("off"); - - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ - } - - /* IP Setup info */ - if (state == NM_DEVICE_STATE_ACTIVATED) { - NMIP4Config *cfg = nm_device_get_ip4_config (device); - GSList *iter; - - printf ("\n"); /* empty line */ - - nmc->allowed_fields = nmc_fields_dev_list_ip4_settings; - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL); - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - - for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { - NMIP4Address *addr = (NMIP4Address *) iter->data; - guint32 prefix = nm_ip4_address_get_prefix (addr); - char *tmp2; - char *addr_str, *prefix_str, *gateway_str; - - addr_str = ip4_address_as_string (nm_ip4_address_get_address (addr)); - - tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); - prefix_str = g_strdup_printf ("%d (%s)", prefix, tmp2); - g_free (tmp2); - - gateway_str = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); - - nmc->allowed_fields[0].value = "IPv4-SETTINGS"; - nmc->allowed_fields[1].value = addr_str; - nmc->allowed_fields[2].value = prefix_str; - nmc->allowed_fields[3].value = gateway_str; - - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; - print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ - g_free (addr_str); - g_free (prefix_str); - g_free (gateway_str); - } - array = nm_ip4_config_get_nameservers (cfg); - if (array) { - int i; - - printf ("\n"); /* empty line */ - - nmc->allowed_fields = nmc_fields_dev_list_ip4_dns; + /* section GENERAL */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[0].name)) { + nmc->allowed_fields = nmc_fields_dev_list_general; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; - nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_DNS_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - for (i = 0; i < array->len; i++) { - tmp = ip4_address_as_string (g_array_index (array, guint32, i)); - nmc->allowed_fields[0].value = "IPv4-DNS"; - nmc->allowed_fields[1].value = tmp; + state = nm_device_get_state (device); + if (NM_IS_DEVICE_ETHERNET (device)) + hwaddr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); + else if (NM_IS_DEVICE_WIFI (device)) + hwaddr = nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[0].name; /* "GENERAL"*/ + nmc->allowed_fields[1].value = nm_device_get_iface (device); + nmc->allowed_fields[2].value = get_device_type (device); + nmc->allowed_fields[3].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"); + nmc->allowed_fields[4].value = hwaddr ? hwaddr : _("unknown)"); + nmc->allowed_fields[5].value = device_state_to_string (state); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = TRUE; + } + + /* section CAPABILITIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[1].name)) { + nmc->allowed_fields = nmc_fields_dev_list_cap; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_CAP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + caps = nm_device_get_capabilities (device); + speed = 0; + if (NM_IS_DEVICE_ETHERNET (device)) { + /* Speed in Mb/s */ + speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device)); + } else if (NM_IS_DEVICE_WIFI (device)) { + /* Speed in b/s */ + speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); + speed /= 1000; + } + if (speed) + speed_str = g_strdup_printf (_("%u Mb/s"), speed); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[1].name; /* "CAPABILITIES" */ + nmc->allowed_fields[1].value = (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = speed_str ? speed_str : _("unknown"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (speed_str); + was_output = TRUE; + } + + /* Wireless specific information */ + if ((NM_IS_DEVICE_WIFI (device))) { + guint32 wcaps; + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + + /* section WIFI-PROPERTIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[2].name)) { + wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); + + nmc->allowed_fields = nmc_fields_dev_list_wifi_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[2].name; /* "WIFI-PROPERTIES" */ + nmc->allowed_fields[1].value = (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = (wcaps & NM_WIFI_DEVICE_CAP_WPA) ? _("yes") : _("no"); + nmc->allowed_fields[3].value = (wcaps & NM_WIFI_DEVICE_CAP_RSN) ? _("yes") : _("no"); + nmc->allowed_fields[4].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ - g_free (tmp); + was_output = TRUE; + } + + /* section AP */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[3].name)) { + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + nmc->allowed_fields = nmc_fields_dev_wifi_list; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->index = 1; + info->active_bssid = active_bssid; + info->device = nm_device_get_iface (device); + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); + g_free (info); + was_output = TRUE; + } + } else if (NM_IS_DEVICE_ETHERNET (device)) { + /* WIRED-PROPERTIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[4].name)) { + nmc->allowed_fields = nmc_fields_dev_list_wired_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[4].name; /* "WIRED-PROPERTIES" */ + nmc->allowed_fields[1].value = (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) ? _("on") : _("off"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = TRUE; + } + } + + /* IP Setup info */ + if (state == NM_DEVICE_STATE_ACTIVATED) { + NMIP4Config *cfg = nm_device_get_ip4_config (device); + GSList *iter; + + /* IP4-SETTINGS */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[5].name)) { + nmc->allowed_fields = nmc_fields_dev_list_ip4_settings; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + char *tmp2; + char *addr_str, *prefix_str, *gateway_str; + + addr_str = ip4_address_as_string (nm_ip4_address_get_address (addr)); + + tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); + prefix_str = g_strdup_printf ("%d (%s)", prefix, tmp2); + g_free (tmp2); + + gateway_str = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[5].name; /* "IP4-SETTINGS" */ + nmc->allowed_fields[1].value = addr_str; + nmc->allowed_fields[2].value = prefix_str; + nmc->allowed_fields[3].value = gateway_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (addr_str); + g_free (prefix_str); + g_free (gateway_str); + } + was_output = TRUE; + } + /* IP4-DNS */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[6].name)) { + array = nm_ip4_config_get_nameservers (cfg); + if (array) { + int i; + + nmc->allowed_fields = nmc_fields_dev_list_ip4_dns; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_DNS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (i = 0; i < array->len; i++) { + char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[6].name, i+1); + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + nmc->allowed_fields[0].value = dns_name; /* "IP4-DNS" */ + nmc->allowed_fields[1].value = tmp; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (tmp); + g_free (dns_name); + } + } + was_output = TRUE; } } } - printf ("\n"); + if (sections_array) + g_array_free (sections_array, TRUE); } static void @@ -609,7 +665,7 @@ show_device_status (NMDevice *device, NmCli *nmc) nmc->allowed_fields[1].value = get_device_type (device); nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); } @@ -642,7 +698,7 @@ do_devices_status (NmCli *nmc, int argc, char **argv) fields_str = fields_common; else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) fields_str = fields_all; - else + else fields_str = nmc->required_fields; nmc->allowed_fields = nmc_fields_dev_status; @@ -658,7 +714,7 @@ do_devices_status (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("Status of devices"); print_fields (nmc->print_fields, nmc->allowed_fields); @@ -882,6 +938,7 @@ show_acces_point_info (NMDevice *device, NmCli *nmc) info = g_malloc0 (sizeof (APInfo)); info->nmc = nmc; + info->index = 1; info->active_bssid = active_bssid; info->device = nm_device_get_iface (device); aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); @@ -942,7 +999,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) fields_str = fields_common; else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) fields_str = fields_all; - else + else fields_str = nmc->required_fields; nmc->allowed_fields = nmc_fields_dev_wifi_list; @@ -958,7 +1015,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) goto error; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi scan list"); if (iface) { @@ -1000,6 +1057,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) } info = g_malloc0 (sizeof (APInfo)); info->nmc = nmc; + info->index = 1; info->active_bssid = NULL; info->device = nm_device_get_iface (device); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ @@ -1037,6 +1095,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) info = g_malloc0 (sizeof (APInfo)); info->nmc = nmc; + info->index = 1; info->active_bssid = NULL; info->device = nm_device_get_iface (dev); detail_access_point (ap, info); diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index 98e1c08052..b65dfcd7bd 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -130,7 +130,7 @@ show_nm_status (NmCli *nmc) return nmc->return_value; } - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("NetworkManager status"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ @@ -152,7 +152,7 @@ show_nm_status (NmCli *nmc) nmc->allowed_fields[4].value = wwan_hw_enabled_str; nmc->allowed_fields[5].value = wwan_enabled_str; - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ return NMC_RESULT_SUCCESS; @@ -205,11 +205,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } nmc->allowed_fields = nmc_fields_nm_status; nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WIFI, nmc->allowed_fields, NULL); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) @@ -237,11 +237,11 @@ do_network_manager (NmCli *nmc, int argc, char **argv) } nmc->allowed_fields = nmc_fields_nm_status; nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WWAN, nmc->allowed_fields, NULL); - nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WWAN enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { if (!strcmp (*argv, "on")) diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index 9d121a203b..a9c04d4d59 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -66,12 +66,14 @@ typedef struct { } NmcOutputField; /* Flags for NmcPrintFields */ -#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular*/ -#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse outpud mode */ -#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ -#define NMC_PF_FLAG_MAIN_HEADER 0x00000008 /* Print main header */ -#define NMC_PF_FLAG_FIELD_NAMES 0x00000010 /* Print field names instead of values */ -#define NMC_PF_FLAG_ESCAPE 0x00000020 /* Escape column separator and '\' */ +#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular */ +#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse output mode */ +#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ +#define NMC_PF_FLAG_MAIN_HEADER_ADD 0x00000008 /* Print main header in addition to values/field names */ +#define NMC_PF_FLAG_MAIN_HEADER_ONLY 0x00000010 /* Print main header only */ +#define NMC_PF_FLAG_FIELD_NAMES 0x00000020 /* Print field names instead of values */ +#define NMC_PF_FLAG_ESCAPE 0x00000040 /* Escape column separator and '\' */ +#define NMC_PF_FLAG_SECTION_PREFIX 0x00000080 /* Use the first value as section prefix for the other field names - just in multiline */ typedef struct { GArray *indices; /* Array of field indices to the array of allowed fields */ diff --git a/cli/src/utils.c b/cli/src/utils.c index bd9bad519c..cd3f69abfc 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -129,14 +129,17 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE; gboolean terse = fields.flags & NMC_PF_FLAG_TERSE; gboolean pretty = fields.flags & NMC_PF_FLAG_PRETTY; - gboolean main_header = fields.flags & NMC_PF_FLAG_MAIN_HEADER; + gboolean main_header_add = fields.flags & NMC_PF_FLAG_MAIN_HEADER_ADD; + gboolean main_header_only = fields.flags & NMC_PF_FLAG_MAIN_HEADER_ONLY; gboolean field_names = fields.flags & NMC_PF_FLAG_FIELD_NAMES; gboolean escape = fields.flags & NMC_PF_FLAG_ESCAPE; + gboolean section_prefix = fields.flags & NMC_PF_FLAG_SECTION_PREFIX; + gboolean main_header = main_header_add || main_header_only; /* No headers are printed in terse mode: * - neither main header nor field (column) names */ - if ((main_header || field_names) && terse) + if ((main_header_only || field_names) && terse) return; if (multiline) { @@ -157,12 +160,16 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } /* Print values */ - if (!field_names) { + if (!main_header_only && !field_names) { for (i = 0; i < fields.indices->len; i++) { char *tmp; idx = g_array_index (fields.indices, int, i); - tmp = g_strdup_printf ("%s:", _(field_values[idx].name_l10n)); - printf ("%-*s%s\n", terse ? 0 : 20, tmp, field_values[idx].value ? field_values[idx].value : not_set_str); + if (section_prefix && idx == 0) /* The first field is section prefix */ + continue; + tmp = g_strdup_printf ("%s%s%s:", section_prefix ? field_values[0].value : "", + section_prefix ? "." : "", + _(field_values[idx].name_l10n)); + printf ("%-*s%s\n", terse ? 0 : 32, tmp, field_values[idx].value ? field_values[idx].value : not_set_str); g_free (tmp); } if (pretty) { @@ -222,7 +229,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } /* Print actual values */ - if (str->len > 0) { + if (!main_header_only && str->len > 0) { g_string_truncate (str, str->len-1); /* Chop off last column separator */ if (fields.indent > 0) { indent_str = g_strnfill (fields.indent, ' '); @@ -233,7 +240,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) } /* Print horizontal separator */ - if (field_names && pretty) { + if (!main_header_only && field_names && pretty) { if (str->len > 0) { line = g_strnfill (table_width, '-'); printf ("%s\n", line); From 6773cc6a639e6698d19b8b6bc91cc6bfa2a1d26e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Mar 2010 14:10:34 -0700 Subject: [PATCH 131/392] api: clarify Connection.Updated arguments --- introspection/nm-exported-connection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introspection/nm-exported-connection.xml b/introspection/nm-exported-connection.xml index 5cb157ebc6..46907c05e9 100644 --- a/introspection/nm-exported-connection.xml +++ b/introspection/nm-exported-connection.xml @@ -46,7 +46,7 @@ - Contains the changed settings. + Contains complete connection setting parameters, including changes. From 1e329c5c0cffeba0116a4835a7666a72a16d9197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Mar 2010 23:28:00 +0100 Subject: [PATCH 132/392] cli: Convert SSID to a printable form If SSID is a UTF-8 string, it is printed as it is, but enclosed in quotes. Otherwise the bytes are converted to hex string (in uppercase). The added quotes for UTF-8 string allow to disambiguate the two forms. --- cli/src/devices.c | 2 +- cli/src/utils.c | 27 +++++++++++++++++++++++++++ cli/src/utils.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 05896c75fc..8e27460b42 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -345,7 +345,7 @@ detail_access_point (gpointer data, gpointer user_data) strength = nm_access_point_get_strength (ap); /* Convert to strings */ - ssid_str = g_strdup_printf ("%s", ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : _("(none)")); + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); freq_str = g_strdup_printf (_("%u MHz"), freq); bitrate_str = g_strdup_printf (_("%u MB/s"), bitrate/1000); strength_str = g_strdup_printf ("%u", strength); diff --git a/cli/src/utils.c b/cli/src/utils.c index cd3f69abfc..81e7e66df9 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -47,6 +47,33 @@ next_arg (int *argc, char ***argv) return 0; } +/* + * Convert SSID to a printable form. + * If it is an UTF-8 string, enclose it in quotes and return it. + * Otherwise convert it to a hex string representation. + * Caller has to free the returned string using g_free() + */ +char * +ssid_to_printable (const char *str, gsize len) +{ + GString *printable; + char *printable_str; + int i; + + if (str == NULL || len == 0) + return NULL; + + if (g_utf8_validate (str, len, NULL)) + return g_strdup_printf ("'%.*s'", (int) len, str); + + printable = g_string_new (NULL); + for (i = 0; i < len; i++) { + g_string_append_printf (printable, "%02X", (unsigned char) str[i]); + } + printable_str = g_string_free (printable, FALSE); + return printable_str; +} + /* * Parse comma separated fields in 'fields_str' according to 'fields_array'. * IN: 'field_str': comma-separated fields names diff --git a/cli/src/utils.h b/cli/src/utils.h index 75e9c921e9..5264feb714 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -27,6 +27,7 @@ /* === Functions === */ int matches (const char *cmd, const char *pattern); int next_arg (int *argc, char ***argv); +char *ssid_to_printable (const char *str, gsize len); GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error); void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); From 8b0b9c29c1a96e166788be69788a327345710ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Mar 2010 23:36:50 +0100 Subject: [PATCH 133/392] cli: Remove obsolete print_table_* functions --- cli/src/utils.c | 80 ------------------------------------------------- cli/src/utils.h | 2 -- 2 files changed, 82 deletions(-) diff --git a/cli/src/utils.c b/cli/src/utils.c index 81e7e66df9..087a984850 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -278,83 +278,3 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) g_string_free (str, TRUE); } - -/*--- obsolete printing functions ---*/ -void -print_table_header (const char *name, ...) -{ - va_list ap; - GString *str; - char *col, *line = NULL; - int col_width, width1, width2, table_width = 0; - - str = g_string_new (NULL); - - va_start (ap, name); - while ((col = va_arg (ap, char *)) != NULL) { - col_width = va_arg (ap, int); - width1 = strlen (col); - width2 = g_utf8_strlen (col, -1); /* Width of the string (in screen colums) */ - g_string_append_printf (str, "%-*s", col_width + width1 - width2, col); - g_string_append_c (str, ' '); /* Column separator */ - table_width += col_width + width1 - width2 + 1; - } - va_end (ap); - - if (table_width <= 0) - table_width = g_utf8_strlen (name, -1) + 4; - - /* Print the table header */ - line = g_strnfill (table_width, '='); - printf ("%s\n", line); - width1 = strlen (name); - width2 = g_utf8_strlen (name, -1); - printf ("%*s\n", (table_width + width2)/2 + width1 - width2, name); - printf ("%s\n", line); - if (str->len > 0) { - g_string_truncate (str, str->len-1); /* Chop off last column separator */ - printf ("%s\n", str->str); - g_free (line); - line = g_strnfill (table_width, '-'); - printf ("%s\n", line); - } - - g_free (line); - g_string_free (str, TRUE); -} - -void -print_table_line (int indent, ...) -{ - va_list ap; - GString *str; - char *col, *indent_str; - int col_width, width1, width2; - - str = g_string_new (NULL); - - va_start (ap, indent); - while ((col = va_arg (ap, char *)) != NULL) { - col_width = va_arg (ap, int); - width1 = strlen (col); - width2 = g_utf8_strlen (col, -1); /* Width of the string (in screen colums) */ - g_string_append_printf (str, "%-*s", col_width + width1 - width2, col); - g_string_append_c (str, ' '); /* Column separator */ - } - va_end (ap); - - /* Print the line */ - if (str->len > 0) - { - g_string_truncate (str, str->len-1); /* Chop off last column separator */ - if (indent > 0) { - indent_str = g_strnfill (indent, ' '); - g_string_prepend (str, indent_str); - g_free (indent_str); - } - printf ("%s\n", str->str); - } - - g_string_free (str, TRUE); -} - diff --git a/cli/src/utils.h b/cli/src/utils.h index 5264feb714..e12dae85d9 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -31,7 +31,5 @@ char *ssid_to_printable (const char *str, gsize len); GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error); void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); -void print_table_header (const char *name, ...); -void print_table_line (int indent, ...); #endif /* NMC_UTILS_H */ From 89af61f73c9e1c4ddd2152cdc0ca5a66e709fd04 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Mar 2010 11:36:19 -0700 Subject: [PATCH 134/392] core: better matching of rfkill types This also fixes a bug where WWAN devices were not correctly recognized for enable/disable operations. --- src/nm-device-cdma.c | 2 ++ src/nm-device-gsm.c | 2 ++ src/nm-device-interface.c | 10 ++++++++++ src/nm-device-interface.h | 2 ++ src/nm-device-wifi.c | 1 + src/nm-device.c | 13 +++++++++++++ src/nm-manager.c | 30 ++++++++++-------------------- 7 files changed, 40 insertions(+), 20 deletions(-) diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index bc73e9dab0..6725b15181 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -30,6 +30,7 @@ #include "NetworkManagerUtils.h" #include "nm-marshal.h" #include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" #include "nm-device-cdma-glue.h" @@ -326,6 +327,7 @@ nm_device_cdma_new (NMModemCdma *modem, const char *driver) NM_DEVICE_INTERFACE_DRIVER, driver, NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, NULL); if (device) { g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c index 1bb7017533..bfcadc6c54 100644 --- a/src/nm-device-gsm.c +++ b/src/nm-device-gsm.c @@ -30,6 +30,7 @@ #include "NetworkManagerUtils.h" #include "nm-marshal.h" #include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" #include "nm-device-gsm-glue.h" @@ -326,6 +327,7 @@ nm_device_gsm_new (NMModemGsm *modem, const char *driver) NM_DEVICE_INTERFACE_DRIVER, driver, NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, NULL); if (device) { g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index f0a4fd1c6b..5f7f5fbdc5 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -24,6 +24,7 @@ #include "nm-device-interface.h" #include "nm-utils.h" #include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" static gboolean impl_device_disconnect (NMDeviceInterface *device, GError **error); @@ -176,6 +177,15 @@ nm_device_interface_init (gpointer g_iface) NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + g_object_interface_install_property + (g_iface, g_param_spec_uint (NM_DEVICE_INTERFACE_RFKILL_TYPE, + "Rfkill Type", + "Type of rfkill switch (if any) supported by this device", + RFKILL_TYPE_WLAN, + RFKILL_TYPE_MAX, + RFKILL_TYPE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + /* Signals */ g_signal_new ("state-changed", iface_type, diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 306f2dbe6d..b86dac5950 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -58,6 +58,7 @@ typedef enum #define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ #define NM_DEVICE_INTERFACE_MANAGED "managed" #define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ +#define NM_DEVICE_INTERFACE_RFKILL_TYPE "rfkill-type" /* Internal only */ typedef enum { NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000, @@ -75,6 +76,7 @@ typedef enum { NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE, NM_DEVICE_INTERFACE_PROP_MANAGED, NM_DEVICE_INTERFACE_PROP_TYPE_DESC, + NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, } NMDeviceInterfaceProp; diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index aa03063760..6f473e1b1c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -3485,6 +3485,7 @@ nm_device_wifi_new (const char *udi, NM_DEVICE_WIFI_IFINDEX, ifindex, NM_DEVICE_INTERFACE_TYPE_DESC, "802.11 WiFi", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_WIFI, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WLAN, NULL); } diff --git a/src/nm-device.c b/src/nm-device.c index 6ffa8ac63d..556cc187ed 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -52,6 +52,7 @@ #include "nm-dhcp4-config.h" #include "nm-ip6-manager.h" #include "nm-marshal.h" +#include "nm-rfkill.h" #define NM_ACT_REQUEST_IP4_CONFIG "nm-act-request-ip4-config" #define NM_ACT_REQUEST_IP6_CONFIG "nm-act-request-ip6-config" @@ -87,6 +88,7 @@ typedef struct { guint32 capabilities; char * driver; gboolean managed; /* whether managed by NM or not */ + RfKillType rfkill_type; guint32 ip4_address; @@ -194,6 +196,7 @@ nm_device_init (NMDevice *self) priv->capabilities = NM_DEVICE_CAP_NONE; priv->state = NM_DEVICE_STATE_UNMANAGED; priv->dhcp_timeout = 0; + priv->rfkill_type = RFKILL_TYPE_UNKNOWN; } static GObject* @@ -3069,6 +3072,9 @@ set_property (GObject *object, guint prop_id, g_free (priv->type_desc); priv->type_desc = g_value_dup_string (value); break; + case NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE: + priv->rfkill_type = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -3145,6 +3151,9 @@ get_property (GObject *object, guint prop_id, case NM_DEVICE_INTERFACE_PROP_TYPE_DESC: g_value_set_string (value, priv->type_desc); break; + case NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE: + g_value_set_uint (value, priv->rfkill_type); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -3231,6 +3240,10 @@ nm_device_class_init (NMDeviceClass *klass) NM_DEVICE_INTERFACE_PROP_TYPE_DESC, NM_DEVICE_INTERFACE_TYPE_DESC); + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, + NM_DEVICE_INTERFACE_RFKILL_TYPE); + signals[AUTOCONNECT_ALLOWED] = g_signal_new ("autoconnect-allowed", G_OBJECT_CLASS_TYPE (object_class), diff --git a/src/nm-manager.c b/src/nm-manager.c index 1b3fe5b317..9b69632270 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -154,12 +154,12 @@ typedef struct { typedef struct { gboolean enabled; gboolean hw_enabled; + RfKillType rtype; const char *desc; const char *key; const char *prop; const char *hw_prop; RfKillState (*other_enabled_func) (NMManager *); - gboolean (*object_filter_func) (GObject *); } RadioState; typedef struct { @@ -1242,8 +1242,10 @@ manager_set_radio_enabled (NMManager *manager, /* enable/disable wireless devices as required */ for (iter = priv->devices; iter; iter = iter->next) { - if ( rstate->object_filter_func - && rstate->object_filter_func (G_OBJECT (iter->data))) + RfKillType devtype = RFKILL_TYPE_UNKNOWN; + + g_object_get (G_OBJECT (iter->data), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == rstate->rtype) nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (iter->data), enabled); } } @@ -1356,18 +1358,6 @@ nm_manager_get_modem_enabled_state (NMManager *self) return wwan_state; } -static gboolean -rfkill_wlan_filter (GObject *object) -{ - return NM_IS_DEVICE_WIFI (object); -} - -static gboolean -rfkill_wwan_filter (GObject *object) -{ - return NM_IS_MODEM (object); -} - static void manager_rfkill_update_one_type (NMManager *self, RadioState *rstate, @@ -2704,11 +2694,11 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) for (i = 0; i < RFKILL_TYPE_MAX; i++) { RadioState *rstate = &priv->radio_states[i]; gboolean enabled = (rstate->hw_enabled && rstate->enabled); + RfKillType devtype = RFKILL_TYPE_UNKNOWN; - if ( rstate->object_filter_func - && rstate->object_filter_func (G_OBJECT (device))) { + g_object_get (G_OBJECT (device), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == rstate->rtype) nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), enabled); - } } nm_device_clear_autoconnect_inhibit (device); @@ -3123,7 +3113,7 @@ nm_manager_init (NMManager *manager) priv->radio_states[RFKILL_TYPE_WLAN].hw_prop = NM_MANAGER_WIRELESS_HARDWARE_ENABLED; priv->radio_states[RFKILL_TYPE_WLAN].desc = "WiFi"; priv->radio_states[RFKILL_TYPE_WLAN].other_enabled_func = nm_manager_get_ipw_rfkill_state; - priv->radio_states[RFKILL_TYPE_WLAN].object_filter_func = rfkill_wlan_filter; + priv->radio_states[RFKILL_TYPE_WLAN].rtype = RFKILL_TYPE_WLAN; priv->radio_states[RFKILL_TYPE_WWAN].enabled = TRUE; priv->radio_states[RFKILL_TYPE_WWAN].key = "WWANEnabled"; @@ -3131,7 +3121,7 @@ nm_manager_init (NMManager *manager) priv->radio_states[RFKILL_TYPE_WWAN].hw_prop = NM_MANAGER_WWAN_HARDWARE_ENABLED; priv->radio_states[RFKILL_TYPE_WWAN].desc = "WWAN"; priv->radio_states[RFKILL_TYPE_WWAN].other_enabled_func = nm_manager_get_modem_enabled_state; - priv->radio_states[RFKILL_TYPE_WWAN].object_filter_func = rfkill_wwan_filter; + priv->radio_states[RFKILL_TYPE_WWAN].rtype = RFKILL_TYPE_WWAN; for (i = 0; i < RFKILL_TYPE_MAX; i++) priv->radio_states[i].hw_enabled = TRUE; From 9a1143b337231c6a938b81462455cdc68a9bfada Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Mar 2010 12:18:26 -0700 Subject: [PATCH 135/392] modem: fix modem type checking for various operations After the DUN branch merge (I think?) a number of NM_IS_MODEM calls were left around which now always return FALSE since NMDeviceCdma and NMDeviceGsm aren't subclasses of NMModem anymore. But we still need generic "is this a modem subclass" checks in a few places, so add a modem base class that both the GSM and CDMA device classes inherit from and use that. Plus, we want to consolidate a ton of the common code in nm-device-gsm.c and nm-device-cdma.c into the base class in the future anyway. --- src/Makefile.am | 2 ++ src/nm-device-cdma.c | 13 +++++++- src/nm-device-cdma.h | 6 ++-- src/nm-device-gsm.c | 13 +++++++- src/nm-device-gsm.h | 6 ++-- src/nm-device-interface.c | 12 +++++++- src/nm-device-interface.h | 4 +++ src/nm-device-modem.c | 64 +++++++++++++++++++++++++++++++++++++++ src/nm-device-modem.h | 49 ++++++++++++++++++++++++++++++ src/nm-manager.c | 11 ++++--- src/nm-policy.c | 4 +-- 11 files changed, 168 insertions(+), 16 deletions(-) create mode 100644 src/nm-device-modem.c create mode 100644 src/nm-device-modem.h diff --git a/src/Makefile.am b/src/Makefile.am index 5f81e491ed..f2a791c6ca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -94,6 +94,8 @@ NetworkManager_SOURCES = \ nm-device-olpc-mesh.h \ nm-device-bt.c \ nm-device-bt.h \ + nm-device-modem.h \ + nm-device-modem.c \ nm-device-cdma.c \ nm-device-cdma.h \ nm-device-gsm.c \ diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 6725b15181..7acf790148 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -36,7 +36,7 @@ static void device_interface_init (NMDeviceInterface *iface_class); -G_DEFINE_TYPE_EXTENDED (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE, 0, +G_DEFINE_TYPE_EXTENDED (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE_MODEM, 0, G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) #define NM_DEVICE_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaPrivate)) @@ -312,6 +312,14 @@ modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) /*****************************************************************************/ +static NMModem * +real_get_modem (NMDeviceModem *device) +{ + return NM_DEVICE_CDMA_GET_PRIVATE (NM_DEVICE_CDMA (device))->modem; +} + +/*****************************************************************************/ + NMDevice * nm_device_cdma_new (NMModemCdma *modem, const char *driver) { @@ -371,6 +379,7 @@ nm_device_cdma_class_init (NMDeviceCdmaClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + NMDeviceModemClass *modem_class = NM_DEVICE_MODEM_CLASS (klass); g_type_class_add_private (object_class, sizeof (NMDeviceCdmaPrivate)); @@ -389,6 +398,8 @@ nm_device_cdma_class_init (NMDeviceCdmaClass *klass) device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; device_class->deactivate_quickly = real_deactivate_quickly; + modem_class->get_modem = real_get_modem; + /* Signals */ signals[PPP_STATS] = g_signal_new ("ppp-stats", diff --git a/src/nm-device-cdma.h b/src/nm-device-cdma.h index ec4496d742..f840a66fc9 100644 --- a/src/nm-device-cdma.h +++ b/src/nm-device-cdma.h @@ -21,7 +21,7 @@ #ifndef NM_DEVICE_CDMA_H #define NM_DEVICE_CDMA_H -#include "nm-device.h" +#include "nm-device-modem.h" #include "nm-modem-cdma.h" G_BEGIN_DECLS @@ -34,11 +34,11 @@ G_BEGIN_DECLS #define NM_DEVICE_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaClass)) typedef struct { - NMDevice parent; + NMDeviceModem parent; } NMDeviceCdma; typedef struct { - NMDeviceClass parent; + NMDeviceModemClass parent; /* Signals */ void (*signal_quality) (NMDeviceCdma *self, guint32 quality); diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c index bfcadc6c54..5d795d43e7 100644 --- a/src/nm-device-gsm.c +++ b/src/nm-device-gsm.c @@ -36,7 +36,7 @@ static void device_interface_init (NMDeviceInterface *iface_class); -G_DEFINE_TYPE_EXTENDED (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE, 0, +G_DEFINE_TYPE_EXTENDED (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE_MODEM, 0, G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) #define NM_DEVICE_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GSM, NMDeviceGsmPrivate)) @@ -312,6 +312,14 @@ modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) /*****************************************************************************/ +static NMModem * +real_get_modem (NMDeviceModem *device) +{ + return NM_DEVICE_GSM_GET_PRIVATE (NM_DEVICE_GSM (device))->modem; +} + +/*****************************************************************************/ + NMDevice * nm_device_gsm_new (NMModemGsm *modem, const char *driver) { @@ -371,6 +379,7 @@ nm_device_gsm_class_init (NMDeviceGsmClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + NMDeviceModemClass *modem_class = NM_DEVICE_MODEM_CLASS (klass); g_type_class_add_private (object_class, sizeof (NMDeviceGsmPrivate)); @@ -389,6 +398,8 @@ nm_device_gsm_class_init (NMDeviceGsmClass *klass) device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; device_class->deactivate_quickly = real_deactivate_quickly; + modem_class->get_modem = real_get_modem; + /* Signals */ signals[PPP_STATS] = g_signal_new ("ppp-stats", diff --git a/src/nm-device-gsm.h b/src/nm-device-gsm.h index 1a74cfa1cd..1981c8287c 100644 --- a/src/nm-device-gsm.h +++ b/src/nm-device-gsm.h @@ -21,7 +21,7 @@ #ifndef NM_DEVICE_GSM_H #define NM_DEVICE_GSM_H -#include "nm-device.h" +#include "nm-device-modem.h" #include "nm-modem-gsm.h" G_BEGIN_DECLS @@ -34,11 +34,11 @@ G_BEGIN_DECLS #define NM_DEVICE_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_GSM, NMDeviceGsmClass)) typedef struct { - NMDevice parent; + NMDeviceModem parent; } NMDeviceGsm; typedef struct { - NMDeviceClass parent; + NMDeviceModemClass parent; /* Signals */ void (*signal_quality) (NMDeviceGsm *self, guint32 quality); diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index 5f7f5fbdc5..74ab9d2986 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -379,6 +379,16 @@ nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled) g_return_if_fail (NM_IS_DEVICE_INTERFACE (device)); if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->set_enabled) - return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->set_enabled (device, enabled); + NM_DEVICE_INTERFACE_GET_INTERFACE (device)->set_enabled (device, enabled); +} + +gboolean +nm_device_interface_get_enabled (NMDeviceInterface *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->get_enabled) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->get_enabled (device); + return TRUE; } diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index b86dac5950..adbafcaa25 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -103,6 +103,8 @@ struct _NMDeviceInterface { void (*set_enabled) (NMDeviceInterface *device, gboolean enabled); + gboolean (*get_enabled) (NMDeviceInterface *device); + /* Signals */ void (*state_changed) (NMDeviceInterface *device, NMDeviceState new_state, @@ -137,6 +139,8 @@ NMConnection * nm_device_interface_connection_match_config (NMDeviceInterface *d gboolean nm_device_interface_can_assume_connection (NMDeviceInterface *device); +gboolean nm_device_interface_get_enabled (NMDeviceInterface *device); + void nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled); #endif /* NM_DEVICE_INTERFACE_H */ diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c new file mode 100644 index 0000000000..6c769ddcee --- /dev/null +++ b/src/nm-device-modem.c @@ -0,0 +1,64 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include + +#include "nm-device-modem.h" +#include "nm-device-interface.h" +#include "nm-modem.h" + +static void device_interface_init (NMDeviceInterface *iface_class); + +G_DEFINE_TYPE_EXTENDED (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE, G_TYPE_FLAG_ABSTRACT, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) + +/*****************************************************************************/ + +static gboolean +real_get_enabled (NMDeviceInterface *device) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (device); + NMModem *modem; + + g_assert (NM_DEVICE_MODEM_GET_CLASS (self)->get_modem); + modem = NM_DEVICE_MODEM_GET_CLASS (self)->get_modem (self); + +g_message ("%s: modem %p", __func__, modem); + return modem ? nm_modem_get_mm_enabled (modem) : TRUE; +} + +/*****************************************************************************/ + +static void +device_interface_init (NMDeviceInterface *iface_class) +{ + iface_class->get_enabled = real_get_enabled; +} + +static void +nm_device_modem_init (NMDeviceModem *self) +{ +} + +static void +nm_device_modem_class_init (NMDeviceModemClass *config_class) +{ +} + diff --git a/src/nm-device-modem.h b/src/nm-device-modem.h new file mode 100644 index 0000000000..05c66ae776 --- /dev/null +++ b/src/nm-device-modem.h @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_MODEM_H +#define NM_DEVICE_MODEM_H + +#include +#include + +#include "nm-device.h" +#include "nm-modem.h" + +#define NM_TYPE_DEVICE_MODEM (nm_device_modem_get_type ()) +#define NM_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModem)) +#define NM_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass)) +#define NM_IS_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_MODEM)) +#define NM_IS_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_MODEM)) +#define NM_DEVICE_MODEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass)) + +typedef struct { + NMDevice parent; +} NMDeviceModem; + +typedef struct { + NMDeviceClass parent; + + NMModem * (*get_modem) (NMDeviceModem *modem); +} NMDeviceModemClass; + +GType nm_device_modem_get_type (void); + +#endif /* NM_DEVICE_MODEM_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index 9b69632270..6c18bc2b6b 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -30,7 +30,6 @@ #include "nm-dbus-manager.h" #include "nm-vpn-manager.h" #include "nm-modem-manager.h" -#include "nm-modem.h" #include "nm-device-bt.h" #include "nm-device-interface.h" #include "nm-device-private.h" @@ -1345,9 +1344,11 @@ nm_manager_get_modem_enabled_state (NMManager *self) for (iter = priv->devices; iter; iter = g_slist_next (iter)) { NMDevice *candidate = NM_DEVICE (iter->data); RfKillState candidate_state = RFKILL_UNBLOCKED; + RfKillType devtype = RFKILL_TYPE_UNKNOWN; - if (NM_IS_MODEM (candidate)) { - if (nm_modem_get_mm_enabled (NM_MODEM (candidate)) == FALSE) + g_object_get (G_OBJECT (candidate), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == RFKILL_TYPE_WWAN) { + if (!nm_device_interface_get_enabled (NM_DEVICE_INTERFACE (candidate))) candidate_state = RFKILL_SOFT_BLOCKED; if (candidate_state > wwan_state) @@ -1458,7 +1459,7 @@ add_device (NMManager *self, NMDevice *device) iface = nm_device_get_ip_iface (device); g_assert (iface); - if (!NM_IS_MODEM (device) && find_device_by_iface (self, iface)) { + if (!NM_IS_DEVICE_MODEM (device) && find_device_by_iface (self, iface)) { g_object_unref (device); return; } @@ -1490,7 +1491,7 @@ add_device (NMManager *self, NMDevice *device) nm_manager_rfkill_update (self, RFKILL_TYPE_WLAN); nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), priv->radio_states[RFKILL_TYPE_WLAN].enabled); - } else if (NM_IS_MODEM (device)) { + } else if (NM_IS_DEVICE_MODEM (device)) { g_signal_connect (device, "notify::" NM_MODEM_ENABLED, G_CALLBACK (manager_modem_enabled_changed), self); diff --git a/src/nm-policy.c b/src/nm-policy.c index 702d3dc709..6ee4e0eb6a 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -34,13 +34,13 @@ #include "nm-device.h" #include "nm-device-wifi.h" #include "nm-device-ethernet.h" +#include "nm-device-modem.h" #include "nm-dbus-manager.h" #include "nm-setting-ip4-config.h" #include "nm-setting-connection.h" #include "nm-system.h" #include "nm-named-manager.h" #include "nm-vpn-manager.h" -#include "nm-modem.h" #include "nm-policy-hosts.h" typedef struct LookupThread LookupThread; @@ -235,7 +235,7 @@ get_best_device (NMManager *manager, NMActRequest **out_req) } } - if (!can_default && !NM_IS_MODEM (dev)) + if (!can_default && !NM_IS_DEVICE_MODEM (dev)) continue; /* 'never-default' devices can't ever be the default */ From c45064ba36fdd3562f26f290324f8baee353236d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Mar 2010 12:21:01 -0700 Subject: [PATCH 136/392] modem: remove debugging printf --- src/nm-device-modem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index 6c769ddcee..1f74f39d5b 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.c @@ -40,7 +40,6 @@ real_get_enabled (NMDeviceInterface *device) g_assert (NM_DEVICE_MODEM_GET_CLASS (self)->get_modem); modem = NM_DEVICE_MODEM_GET_CLASS (self)->get_modem (self); -g_message ("%s: modem %p", __func__, modem); return modem ? nm_modem_get_mm_enabled (modem) : TRUE; } From f032e478d8fa73b0c259fb0b88d315eaecb0779a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Mar 2010 13:15:03 -0700 Subject: [PATCH 137/392] modem: consolidate common modem code into NMDeviceModem --- src/nm-device-cdma.c | 369 ++------------------------------------ src/nm-device-cdma.h | 1 - src/nm-device-gsm.c | 369 ++------------------------------------ src/nm-device-gsm.h | 1 - src/nm-device-modem.c | 402 +++++++++++++++++++++++++++++++++++++++++- src/nm-device-modem.h | 7 +- 6 files changed, 422 insertions(+), 727 deletions(-) diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c index 7acf790148..45771f4291 100644 --- a/src/nm-device-cdma.c +++ b/src/nm-device-cdma.c @@ -20,342 +20,38 @@ #include -#include "nm-dbus-glib-types.h" -#include "nm-modem.h" #include "nm-modem-cdma.h" #include "nm-device-interface.h" -#include "nm-device-private.h" #include "nm-device-cdma.h" -#include "nm-utils.h" -#include "NetworkManagerUtils.h" -#include "nm-marshal.h" #include "nm-properties-changed-signal.h" #include "nm-rfkill.h" #include "nm-device-cdma-glue.h" -static void device_interface_init (NMDeviceInterface *iface_class); - -G_DEFINE_TYPE_EXTENDED (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE_MODEM, 0, - G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) - -#define NM_DEVICE_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaPrivate)) - -typedef struct { - NMModem *modem; -} NMDeviceCdmaPrivate; +G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE_MODEM) enum { - PPP_STATS, PROPERTIES_CHANGED, - LAST_SIGNAL }; - static guint signals[LAST_SIGNAL] = { 0 }; -static void -ppp_stats (NMModem *modem, - guint32 in_bytes, - guint32 out_bytes, - gpointer user_data) -{ - g_signal_emit (NM_DEVICE_CDMA (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); -} - -static void -ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - - switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { - case NM_DEVICE_STATE_PREPARE: - case NM_DEVICE_STATE_CONFIG: - case NM_DEVICE_STATE_NEED_AUTH: - case NM_DEVICE_STATE_IP_CONFIG: - case NM_DEVICE_STATE_ACTIVATED: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); - break; - default: - break; - } -} - -static void -device_state_changed (NMDevice *device, - NMDeviceState new_state, - NMDeviceState old_state, - NMDeviceStateReason reason, - gpointer user_data) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); - - nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); -} - -static gboolean -real_hw_is_up (NMDevice *device) -{ - return nm_modem_hw_is_up (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, device); -} - -static gboolean -real_hw_bring_up (NMDevice *device, gboolean *no_firmware) -{ - return nm_modem_hw_bring_up (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, device, no_firmware); -} - -static NMConnection * -real_get_best_auto_connection (NMDevice *device, - GSList *connections, - char **specific_object) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); - - return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); -} - -static void -real_connection_secrets_updated (NMDevice *device, - NMConnection *connection, - GSList *updated_settings, - RequestSecretsCaller caller) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); - NMActRequest *req; - - g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); - - req = nm_device_get_act_request (device); - g_assert (req); - - if (!nm_modem_connection_secrets_updated (priv->modem, - req, - connection, - updated_settings, - caller)) { - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); - return; - } - - /* PPP handles stuff itself... */ - if (caller == SECRETS_CALLER_PPP) - return; - - /* Otherwise, on success for CDMA secrets we need to schedule stage1 again */ - g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); - nm_device_activate_schedule_stage1_device_prepare (device); -} - -static gboolean -real_check_connection_compatible (NMDevice *device, - NMConnection *connection, - GError **error) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); - - return nm_modem_check_connection_compatible (priv->modem, connection, error); -} - - -static void -modem_need_auth (NMModem *modem, - const char *setting_name, - gboolean retry, - RequestSecretsCaller caller, - const char *hint1, - const char *hint2, - gpointer user_data) -{ - NMDeviceCdma *self = NM_DEVICE_CDMA (user_data); - NMActRequest *req; - - req = nm_device_get_act_request (NM_DEVICE (self)); - g_assert (req); - - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); -} - -static void -modem_prepare_result (NMModem *modem, - gboolean success, - NMDeviceStateReason reason, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDeviceState state; - - state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); - g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); - - if (success) - nm_device_activate_schedule_stage2_device_config (device); - else - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); -} - -static NMActStageReturn -real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) -{ - NMActRequest *req; - - req = nm_device_get_act_request (device); - g_assert (req); - - return nm_modem_act_stage1_prepare (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, req, reason); -} - -static NMActStageReturn -real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) -{ - NMActRequest *req; - - req = nm_device_get_act_request (device); - g_assert (req); - - return nm_modem_act_stage2_config (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, req, reason); -} - -static void -modem_ip4_config_result (NMModem *self, - const char *iface, - NMIP4Config *config, - GError *error, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDeviceState state; - - state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); - g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); - - if (error) { - nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); - } else { - if (iface) - nm_device_set_ip_iface (device, iface); - - nm_device_activate_schedule_stage4_ip4_config_get (device); - } -} - -static NMActStageReturn -real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) -{ - return nm_modem_stage3_ip4_config_start (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, - device, - NM_DEVICE_CLASS (nm_device_cdma_parent_class), - reason); -} - -static NMActStageReturn -real_act_stage4_get_ip4_config (NMDevice *device, - NMIP4Config **config, - NMDeviceStateReason *reason) -{ - return nm_modem_stage4_get_ip4_config (NM_DEVICE_CDMA_GET_PRIVATE (device)->modem, - device, - NM_DEVICE_CLASS (nm_device_cdma_parent_class), - config, - reason); -} - -static void -real_deactivate_quickly (NMDevice *device) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (device); - - nm_modem_deactivate_quickly (priv->modem, device); -} - -static guint32 -real_get_generic_capabilities (NMDevice *device) -{ - return NM_DEVICE_CAP_NM_SUPPORTED; -} - -static void -real_set_enabled (NMDeviceInterface *device, gboolean enabled) -{ - NMDeviceCdma *self = NM_DEVICE_CDMA (device); - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (self); - NMDeviceState state; - - if (priv->modem) { - nm_modem_set_mm_enabled (priv->modem, enabled); - - if (enabled == FALSE) { - state = nm_device_interface_get_state (device); - if (state == NM_DEVICE_STATE_ACTIVATED) { - nm_device_state_changed (NM_DEVICE (device), - NM_DEVICE_STATE_DISCONNECTED, - NM_DEVICE_STATE_REASON_NONE); - } - } - } -} - -static void -modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) -{ - NMDeviceCdma *self = NM_DEVICE_CDMA (user_data); - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (self); - - real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); -} - -/*****************************************************************************/ - -static NMModem * -real_get_modem (NMDeviceModem *device) -{ - return NM_DEVICE_CDMA_GET_PRIVATE (NM_DEVICE_CDMA (device))->modem; -} - -/*****************************************************************************/ - NMDevice * nm_device_cdma_new (NMModemCdma *modem, const char *driver) { - NMDevice *device; - g_return_val_if_fail (modem != NULL, NULL); g_return_val_if_fail (NM_IS_MODEM_CDMA (modem), NULL); g_return_val_if_fail (driver != NULL, NULL); - device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_CDMA, - NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), - NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), - NM_DEVICE_INTERFACE_DRIVER, driver, - NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", - NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, - NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, - NULL); - if (device) { - g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); - - NM_DEVICE_CDMA_GET_PRIVATE (device)->modem = g_object_ref (modem); - g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); - g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); - g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); - g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); - g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); - g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), device); - } - - return device; -} - -static void -device_interface_init (NMDeviceInterface *iface_class) -{ - iface_class->set_enabled = real_set_enabled; + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_CDMA, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, + NM_DEVICE_MODEM_MODEM, modem, + NULL); } static void @@ -363,61 +59,16 @@ nm_device_cdma_init (NMDeviceCdma *self) { } -static void -finalize (GObject *object) -{ - NMDeviceCdmaPrivate *priv = NM_DEVICE_CDMA_GET_PRIVATE (object); - - g_object_unref (priv->modem); - priv->modem = NULL; - - G_OBJECT_CLASS (nm_device_cdma_parent_class)->finalize (object); -} - static void nm_device_cdma_class_init (NMDeviceCdmaClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); - NMDeviceModemClass *modem_class = NM_DEVICE_MODEM_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMDeviceCdmaPrivate)); - - /* Virtual methods */ - object_class->finalize = finalize; - - device_class->get_best_auto_connection = real_get_best_auto_connection; - device_class->connection_secrets_updated = real_connection_secrets_updated; - device_class->check_connection_compatible = real_check_connection_compatible; - device_class->hw_is_up = real_hw_is_up; - device_class->hw_bring_up = real_hw_bring_up; - device_class->get_generic_capabilities = real_get_generic_capabilities; - device_class->act_stage1_prepare = real_act_stage1_prepare; - device_class->act_stage2_config = real_act_stage2_config; - device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; - device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; - device_class->deactivate_quickly = real_deactivate_quickly; - - modem_class->get_modem = real_get_modem; /* Signals */ - signals[PPP_STATS] = - g_signal_new ("ppp-stats", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceCdmaClass, ppp_stats), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, - G_TYPE_UINT, G_TYPE_UINT); - signals[PROPERTIES_CHANGED] = nm_properties_changed_signal_new (object_class, G_STRUCT_OFFSET (NMDeviceCdmaClass, properties_changed)); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - nm_modem_get_serial_dbus_info ()); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_nm_device_cdma_object_info); } diff --git a/src/nm-device-cdma.h b/src/nm-device-cdma.h index f840a66fc9..f0bf34567c 100644 --- a/src/nm-device-cdma.h +++ b/src/nm-device-cdma.h @@ -43,7 +43,6 @@ typedef struct { /* Signals */ void (*signal_quality) (NMDeviceCdma *self, guint32 quality); - void (*ppp_stats) (NMDeviceCdma *self, guint32 in_bytes, guint32 out_bytes); void (*properties_changed) (NMDeviceCdma *self, GHashTable *properties); } NMDeviceCdmaClass; diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c index 5d795d43e7..2a98a41f4e 100644 --- a/src/nm-device-gsm.c +++ b/src/nm-device-gsm.c @@ -20,342 +20,38 @@ #include -#include "nm-dbus-glib-types.h" -#include "nm-modem.h" #include "nm-modem-gsm.h" #include "nm-device-interface.h" -#include "nm-device-private.h" #include "nm-device-gsm.h" -#include "nm-utils.h" -#include "NetworkManagerUtils.h" -#include "nm-marshal.h" #include "nm-properties-changed-signal.h" #include "nm-rfkill.h" #include "nm-device-gsm-glue.h" -static void device_interface_init (NMDeviceInterface *iface_class); - -G_DEFINE_TYPE_EXTENDED (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE_MODEM, 0, - G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) - -#define NM_DEVICE_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GSM, NMDeviceGsmPrivate)) - -typedef struct { - NMModem *modem; -} NMDeviceGsmPrivate; +G_DEFINE_TYPE (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE_MODEM) enum { - PPP_STATS, PROPERTIES_CHANGED, - LAST_SIGNAL }; - static guint signals[LAST_SIGNAL] = { 0 }; -static void -ppp_stats (NMModem *modem, - guint32 in_bytes, - guint32 out_bytes, - gpointer user_data) -{ - g_signal_emit (NM_DEVICE_GSM (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); -} - -static void -ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - - switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { - case NM_DEVICE_STATE_PREPARE: - case NM_DEVICE_STATE_CONFIG: - case NM_DEVICE_STATE_NEED_AUTH: - case NM_DEVICE_STATE_IP_CONFIG: - case NM_DEVICE_STATE_ACTIVATED: - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); - break; - default: - break; - } -} - -static void -device_state_changed (NMDevice *device, - NMDeviceState new_state, - NMDeviceState old_state, - NMDeviceStateReason reason, - gpointer user_data) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); - - nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); -} - -static gboolean -real_hw_is_up (NMDevice *device) -{ - return nm_modem_hw_is_up (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, device); -} - -static gboolean -real_hw_bring_up (NMDevice *device, gboolean *no_firmware) -{ - return nm_modem_hw_bring_up (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, device, no_firmware); -} - -static NMConnection * -real_get_best_auto_connection (NMDevice *device, - GSList *connections, - char **specific_object) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); - - return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); -} - -static void -real_connection_secrets_updated (NMDevice *device, - NMConnection *connection, - GSList *updated_settings, - RequestSecretsCaller caller) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); - NMActRequest *req; - - g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); - - req = nm_device_get_act_request (device); - g_assert (req); - - if (!nm_modem_connection_secrets_updated (priv->modem, - req, - connection, - updated_settings, - caller)) { - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); - return; - } - - /* PPP handles stuff itself... */ - if (caller == SECRETS_CALLER_PPP) - return; - - /* Otherwise, on success for GSM secrets we need to schedule stage1 again */ - g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); - nm_device_activate_schedule_stage1_device_prepare (device); -} - -static gboolean -real_check_connection_compatible (NMDevice *device, - NMConnection *connection, - GError **error) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); - - return nm_modem_check_connection_compatible (priv->modem, connection, error); -} - - -static void -modem_need_auth (NMModem *modem, - const char *setting_name, - gboolean retry, - RequestSecretsCaller caller, - const char *hint1, - const char *hint2, - gpointer user_data) -{ - NMDeviceGsm *self = NM_DEVICE_GSM (user_data); - NMActRequest *req; - - req = nm_device_get_act_request (NM_DEVICE (self)); - g_assert (req); - - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); -} - -static void -modem_prepare_result (NMModem *modem, - gboolean success, - NMDeviceStateReason reason, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDeviceState state; - - state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); - g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); - - if (success) - nm_device_activate_schedule_stage2_device_config (device); - else - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); -} - -static NMActStageReturn -real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) -{ - NMActRequest *req; - - req = nm_device_get_act_request (device); - g_assert (req); - - return nm_modem_act_stage1_prepare (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, req, reason); -} - -static NMActStageReturn -real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) -{ - NMActRequest *req; - - req = nm_device_get_act_request (device); - g_assert (req); - - return nm_modem_act_stage2_config (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, req, reason); -} - -static void -modem_ip4_config_result (NMModem *self, - const char *iface, - NMIP4Config *config, - GError *error, - gpointer user_data) -{ - NMDevice *device = NM_DEVICE (user_data); - NMDeviceState state; - - state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); - g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); - - if (error) { - nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); - } else { - if (iface) - nm_device_set_ip_iface (device, iface); - - nm_device_activate_schedule_stage4_ip4_config_get (device); - } -} - -static NMActStageReturn -real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) -{ - return nm_modem_stage3_ip4_config_start (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, - device, - NM_DEVICE_CLASS (nm_device_gsm_parent_class), - reason); -} - -static NMActStageReturn -real_act_stage4_get_ip4_config (NMDevice *device, - NMIP4Config **config, - NMDeviceStateReason *reason) -{ - return nm_modem_stage4_get_ip4_config (NM_DEVICE_GSM_GET_PRIVATE (device)->modem, - device, - NM_DEVICE_CLASS (nm_device_gsm_parent_class), - config, - reason); -} - -static void -real_deactivate_quickly (NMDevice *device) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (device); - - nm_modem_deactivate_quickly (priv->modem, device); -} - -static guint32 -real_get_generic_capabilities (NMDevice *device) -{ - return NM_DEVICE_CAP_NM_SUPPORTED; -} - -static void -real_set_enabled (NMDeviceInterface *device, gboolean enabled) -{ - NMDeviceGsm *self = NM_DEVICE_GSM (device); - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (self); - NMDeviceState state; - - if (priv->modem) { - nm_modem_set_mm_enabled (priv->modem, enabled); - - if (enabled == FALSE) { - state = nm_device_interface_get_state (device); - if (state == NM_DEVICE_STATE_ACTIVATED) { - nm_device_state_changed (NM_DEVICE (device), - NM_DEVICE_STATE_DISCONNECTED, - NM_DEVICE_STATE_REASON_NONE); - } - } - } -} - -static void -modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) -{ - NMDeviceGsm *self = NM_DEVICE_GSM (user_data); - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (self); - - real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); -} - -/*****************************************************************************/ - -static NMModem * -real_get_modem (NMDeviceModem *device) -{ - return NM_DEVICE_GSM_GET_PRIVATE (NM_DEVICE_GSM (device))->modem; -} - -/*****************************************************************************/ - NMDevice * nm_device_gsm_new (NMModemGsm *modem, const char *driver) { - NMDevice *device; - g_return_val_if_fail (modem != NULL, NULL); g_return_val_if_fail (NM_IS_MODEM_GSM (modem), NULL); g_return_val_if_fail (driver != NULL, NULL); - device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_GSM, - NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), - NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), - NM_DEVICE_INTERFACE_DRIVER, driver, - NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", - NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, - NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, - NULL); - if (device) { - g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); - - NM_DEVICE_GSM_GET_PRIVATE (device)->modem = g_object_ref (modem); - g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), device); - g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), device); - g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), device); - g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), device); - g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), device); - g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), device); - } - - return device; -} - -static void -device_interface_init (NMDeviceInterface *iface_class) -{ - iface_class->set_enabled = real_set_enabled; + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_GSM, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, + NM_DEVICE_MODEM_MODEM, modem, + NULL); } static void @@ -363,61 +59,16 @@ nm_device_gsm_init (NMDeviceGsm *self) { } -static void -finalize (GObject *object) -{ - NMDeviceGsmPrivate *priv = NM_DEVICE_GSM_GET_PRIVATE (object); - - g_object_unref (priv->modem); - priv->modem = NULL; - - G_OBJECT_CLASS (nm_device_gsm_parent_class)->finalize (object); -} - static void nm_device_gsm_class_init (NMDeviceGsmClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); - NMDeviceModemClass *modem_class = NM_DEVICE_MODEM_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMDeviceGsmPrivate)); - - /* Virtual methods */ - object_class->finalize = finalize; - - device_class->get_best_auto_connection = real_get_best_auto_connection; - device_class->connection_secrets_updated = real_connection_secrets_updated; - device_class->check_connection_compatible = real_check_connection_compatible; - device_class->hw_is_up = real_hw_is_up; - device_class->hw_bring_up = real_hw_bring_up; - device_class->get_generic_capabilities = real_get_generic_capabilities; - device_class->act_stage1_prepare = real_act_stage1_prepare; - device_class->act_stage2_config = real_act_stage2_config; - device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; - device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; - device_class->deactivate_quickly = real_deactivate_quickly; - - modem_class->get_modem = real_get_modem; /* Signals */ - signals[PPP_STATS] = - g_signal_new ("ppp-stats", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceGsmClass, ppp_stats), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, - G_TYPE_UINT, G_TYPE_UINT); - signals[PROPERTIES_CHANGED] = nm_properties_changed_signal_new (object_class, G_STRUCT_OFFSET (NMDeviceGsmClass, properties_changed)); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), - nm_modem_get_serial_dbus_info ()); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_nm_device_gsm_object_info); } diff --git a/src/nm-device-gsm.h b/src/nm-device-gsm.h index 1981c8287c..9b403c63a7 100644 --- a/src/nm-device-gsm.h +++ b/src/nm-device-gsm.h @@ -43,7 +43,6 @@ typedef struct { /* Signals */ void (*signal_quality) (NMDeviceGsm *self, guint32 quality); - void (*ppp_stats) (NMDeviceGsm *self, guint32 in_bytes, guint32 out_bytes); void (*properties_changed) (NMDeviceGsm *self, GHashTable *properties); } NMDeviceGsmClass; diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index 1f74f39d5b..fd6b044c3f 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.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) 2008 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -23,24 +23,309 @@ #include "nm-device-modem.h" #include "nm-device-interface.h" #include "nm-modem.h" +#include "nm-device-private.h" +#include "nm-properties-changed-signal.h" +#include "nm-marshal.h" static void device_interface_init (NMDeviceInterface *iface_class); G_DEFINE_TYPE_EXTENDED (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE, G_TYPE_FLAG_ABSTRACT, G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) +#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate)) + +typedef struct { + NMModem *modem; +} NMDeviceModemPrivate; + +enum { + PROP_0, + PROP_MODEM +}; + +enum { + PPP_STATS, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +static void real_set_enabled (NMDeviceInterface *device, gboolean enabled); + +/*****************************************************************************/ + +static void +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (G_OBJECT (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + break; + default: + break; + } +} + +static void +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); + + if (success) + nm_device_activate_schedule_stage2_device_config (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static void +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (user_data); + NMActRequest *req; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + g_warning ("%s: retrieving IP4 configuration failed: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); + } +} + +static void +modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (user_data); + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + + real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); +} + +/*****************************************************************************/ + +NMModem * +nm_device_modem_get_modem (NMDeviceModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NULL); + + return NM_DEVICE_MODEM_GET_PRIVATE (self)->modem; +} + +/*****************************************************************************/ + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + nm_modem_device_state_changed (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + new_state, + old_state, + reason); +} + +static guint32 +real_get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_NM_SUPPORTED; +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *device, + GSList *connections, + char **specific_object) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + + return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); +} + +static void +real_connection_secrets_updated (NMDevice *device, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + NMActRequest *req; + + g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); + + req = nm_device_get_act_request (device); + g_assert (req); + + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + return; + } + + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; + + /* Otherwise, on success for modem secrets we need to schedule stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + nm_device_activate_schedule_stage1_device_prepare (device); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + + return nm_modem_check_connection_compatible (priv->modem, connection, error); +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_modem_hw_is_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device); +} + +static gboolean +real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +{ + return nm_modem_hw_bring_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device, no_firmware); +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + nm_modem_deactivate_quickly (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device); +} + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage1_prepare (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage2_config (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + return nm_modem_stage3_ip4_config_start (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_modem_parent_class), + reason); +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + return nm_modem_stage4_get_ip4_config (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_modem_parent_class), + config, + reason); +} + /*****************************************************************************/ static gboolean real_get_enabled (NMDeviceInterface *device) +{ + return nm_modem_get_mm_enabled (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem); +} + +static void +real_set_enabled (NMDeviceInterface *device, gboolean enabled) { NMDeviceModem *self = NM_DEVICE_MODEM (device); - NMModem *modem; + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + NMDeviceState state; - g_assert (NM_DEVICE_MODEM_GET_CLASS (self)->get_modem); - modem = NM_DEVICE_MODEM_GET_CLASS (self)->get_modem (self); + if (priv->modem) { + nm_modem_set_mm_enabled (priv->modem, enabled); - return modem ? nm_modem_get_mm_enabled (modem) : TRUE; + if (enabled == FALSE) { + state = nm_device_interface_get_state (device); + if (state == NM_DEVICE_STATE_ACTIVATED) { + nm_device_state_changed (NM_DEVICE (device), + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + } + } + } } /*****************************************************************************/ @@ -49,15 +334,120 @@ static void device_interface_init (NMDeviceInterface *iface_class) { iface_class->get_enabled = real_get_enabled; + iface_class->set_enabled = real_set_enabled; } static void nm_device_modem_init (NMDeviceModem *self) { + g_signal_connect (self, "state-changed", G_CALLBACK (device_state_changed), self); } static void -nm_device_modem_class_init (NMDeviceModemClass *config_class) +set_modem (NMDeviceModem *self, NMModem *modem) { + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + + g_return_if_fail (modem != NULL); + + priv->modem = g_object_ref (modem); + + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), self); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), self); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), self); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), self); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), self); + g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), self); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_MODEM: + /* construct-only */ + set_modem (NM_DEVICE_MODEM (object), g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_MODEM: + g_value_set_object (value, priv->modem); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object); + + g_object_unref (priv->modem); + priv->modem = NULL; + + G_OBJECT_CLASS (nm_device_modem_parent_class)->finalize (object); +} + +static void +nm_device_modem_class_init (NMDeviceModemClass *mclass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (mclass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (mclass); + + g_type_class_add_private (object_class, sizeof (NMDeviceModemPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + device_class->get_generic_capabilities = real_get_generic_capabilities; + device_class->get_best_auto_connection = real_get_best_auto_connection; + device_class->connection_secrets_updated = real_connection_secrets_updated; + device_class->check_connection_compatible = real_check_connection_compatible; + device_class->hw_is_up = real_hw_is_up; + device_class->hw_bring_up = real_hw_bring_up; + device_class->deactivate_quickly = real_deactivate_quickly; + device_class->act_stage1_prepare = real_act_stage1_prepare; + device_class->act_stage2_config = real_act_stage2_config; + device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_MODEM, + g_param_spec_object (NM_DEVICE_MODEM_MODEM, + "Modem", + "Modem", + NM_TYPE_MODEM, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceModemClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (mclass), + nm_modem_get_serial_dbus_info ()); } diff --git a/src/nm-device-modem.h b/src/nm-device-modem.h index 05c66ae776..40e89d4b7c 100644 --- a/src/nm-device-modem.h +++ b/src/nm-device-modem.h @@ -34,6 +34,8 @@ #define NM_IS_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_MODEM)) #define NM_DEVICE_MODEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass)) +#define NM_DEVICE_MODEM_MODEM "modem" + typedef struct { NMDevice parent; } NMDeviceModem; @@ -41,9 +43,12 @@ typedef struct { typedef struct { NMDeviceClass parent; - NMModem * (*get_modem) (NMDeviceModem *modem); + void (*ppp_stats) (NMDeviceModem *self, guint32 in_bytes, guint32 out_bytes); } NMDeviceModemClass; GType nm_device_modem_get_type (void); +/* Private for subclases */ +NMModem *nm_device_modem_get_modem (NMDeviceModem *self); + #endif /* NM_DEVICE_MODEM_H */ From fb5987df76c77697f4b8ed5871a5947905513bb9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Mar 2010 13:39:49 -0700 Subject: [PATCH 138/392] cli: fix uninitialized variable usage and clean up a bit --- cli/src/devices.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 8e27460b42..1c4023923a 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -414,7 +414,7 @@ show_device_info (gpointer data, gpointer user_data) APInfo *info; char *tmp; const char *hwaddr = NULL; - NMDeviceState state; + NMDeviceState state = NM_DEVICE_STATE_UNKNOWN; guint32 caps; guint32 speed; char *speed_str = NULL; @@ -463,6 +463,8 @@ show_device_info (gpointer data, gpointer user_data) was_output = FALSE; + state = nm_device_get_state (device); + /* section GENERAL */ if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[0].name)) { nmc->allowed_fields = nmc_fields_dev_list_general; @@ -470,7 +472,6 @@ show_device_info (gpointer data, gpointer user_data) nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - state = nm_device_get_state (device); if (NM_IS_DEVICE_ETHERNET (device)) hwaddr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); else if (NM_IS_DEVICE_WIFI (device)) @@ -548,7 +549,7 @@ show_device_info (gpointer data, gpointer user_data) /* section AP */ if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[3].name)) { - if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + if (state == NM_DEVICE_STATE_ACTIVATED) { active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; } From 07abcb60e735b2e8745cf9f6356f7bc10460182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 29 Mar 2010 10:06:51 +0200 Subject: [PATCH 139/392] libnm-util: add nm_setting_gsm_get_allowed_bands() to exported symbols --- libnm-util/libnm-util.ver | 1 + 1 file changed, 1 insertion(+) diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index bc64e1b64a..44d9ac5aec 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -132,6 +132,7 @@ global: nm_setting_gsm_get_apn; nm_setting_gsm_get_network_id; nm_setting_gsm_get_network_type; + nm_setting_gsm_get_allowed_bands; nm_setting_gsm_get_band; nm_setting_gsm_get_pin; nm_setting_gsm_get_puk; From c24d89ef80a2303943e36a4cbf85c16c578a7866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 29 Mar 2010 10:26:57 +0200 Subject: [PATCH 140/392] libnm-util: fix a typo --- libnm-util/nm-setting-ip4-config.c | 4 ++-- libnm-util/nm-setting-ip6-config.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index 580369fd13..46ebbd377f 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -879,7 +879,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * NMSettingIP4Config:ignore-auto-dns: * * When the method is set to 'auto' and this property to TRUE, automatically - * configured nameservers and search domains are ignored and only namservers + * configured nameservers and search domains are ignored and only nameservers * and search domains specified in #NMSettingIP4Config:dns and * #NMSettingIP4Config:dns-search, if any, are used. **/ @@ -889,7 +889,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "Ignore automatic DNS", "When the method is set to 'auto' and this property " "to TRUE, automatically configured nameservers and " - "search domains are ignored and only namservers and " + "search domains are ignored and only nameservers and " "search domains specified in the 'dns' and 'dns-search' " "properties, if any, are used.", FALSE, diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index a62b697416..3fbf1a2bc4 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -763,7 +763,7 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * * When the method is set to 'auto' or 'dhcp' and this property is set to * TRUE, automatically configured nameservers and search domains are ignored - * and only namservers and search domains specified in + * and only nameservers and search domains specified in * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are * used. **/ @@ -774,7 +774,7 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) "When the method is set to 'auto' or 'dhcp' and this " "property is set to TRUE, automatically configured " "nameservers and search domains are ignored and only " - "namservers and search domains specified in the 'dns' " + "nameservers and search domains specified in the 'dns' " "and 'dns-search' properties, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); From 52259499744b2c55d0667de1007b0db9b7b94540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 29 Mar 2010 15:10:25 +0200 Subject: [PATCH 141/392] libnm-util: fix dump of routes in 'ipv4' setting --- libnm-util/Makefile.am | 2 +- libnm-util/nm-utils.c | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 8841978778..8f6a0cc95d 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "4:1:3" + -version-info "4:2:3" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 9cf1be5749..5ca3014d79 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -624,7 +624,7 @@ nm_utils_convert_uint_array_to_string (const GValue *src_value, GValue *dest_val } static void -nm_utils_convert_ip4_addr_struct_array_to_string (const GValue *src_value, GValue *dest_value) +nm_utils_convert_ip4_addr_route_struct_array_to_string (const GValue *src_value, GValue *dest_value) { GPtrArray *ptr_array; GString *printable; @@ -639,6 +639,7 @@ nm_utils_convert_ip4_addr_struct_array_to_string (const GValue *src_value, GValu GArray *array; char buf[INET_ADDRSTRLEN + 1]; struct in_addr addr; + gboolean is_addr; /* array contains address x route */ if (i > 0) g_string_append (printable, ", "); @@ -649,13 +650,17 @@ nm_utils_convert_ip4_addr_struct_array_to_string (const GValue *src_value, GValu g_string_append (printable, "invalid"); continue; } + is_addr = (array->len < 4); memset (buf, 0, sizeof (buf)); addr.s_addr = g_array_index (array, guint32, 0); if (!inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN)) nm_warning ("%s: error converting IP4 address 0x%X", __func__, ntohl (addr.s_addr)); - g_string_append_printf (printable, "ip = %s", buf); + if (is_addr) + g_string_append_printf (printable, "ip = %s", buf); + else + g_string_append_printf (printable, "dst = %s", buf); g_string_append (printable, ", "); memset (buf, 0, sizeof (buf)); @@ -670,7 +675,18 @@ nm_utils_convert_ip4_addr_struct_array_to_string (const GValue *src_value, GValu if (!inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN)) nm_warning ("%s: error converting IP4 address 0x%X", __func__, ntohl (addr.s_addr)); - g_string_append_printf (printable, "gw = %s", buf); + if (is_addr) + g_string_append_printf (printable, "gw = %s", buf); + else + g_string_append_printf (printable, "nh = %s", buf); + } + + if (array->len > 3) { + g_string_append (printable, ", "); + + memset (buf, 0, sizeof (buf)); + g_string_append_printf (printable, "mt = %u", + g_array_index (array, guint32, 3)); } g_string_append (printable, " }"); @@ -978,7 +994,7 @@ _nm_utils_register_value_transformations (void) nm_utils_convert_uint_array_to_string); g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, G_TYPE_STRING, - nm_utils_convert_ip4_addr_struct_array_to_string); + nm_utils_convert_ip4_addr_route_struct_array_to_string); g_value_register_transform_func (DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_STRING, nm_utils_convert_gvalue_hash_to_string); From c8bfe2fcf4d61f172de59e8b80034d1b8c48a026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 31 Mar 2010 17:14:35 +0200 Subject: [PATCH 142/392] cli: use own code to output connection details (settings) nmcli uses its own code to dump connections' details instead of libnm-util's nm_connection_dump(). It allows to structure output and present values of the settings according to nmcli needs. --- cli/src/Makefile.am | 2 + cli/src/connections.c | 297 ++++++++- cli/src/settings.c | 1369 +++++++++++++++++++++++++++++++++++++++++ cli/src/settings.h | 59 ++ 4 files changed, 1702 insertions(+), 25 deletions(-) create mode 100644 cli/src/settings.c create mode 100644 cli/src/settings.h diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am index 2a1bd120f5..572e122fb6 100644 --- a/cli/src/Makefile.am +++ b/cli/src/Makefile.am @@ -15,6 +15,8 @@ nmcli_SOURCES = \ devices.h \ network-manager.c \ network-manager.h \ + settings.c \ + settings.h \ nmcli.c \ nmcli.h \ utils.c \ diff --git a/cli/src/connections.c b/cli/src/connections.c index 86e51e3988..3e72621100 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -50,10 +50,11 @@ #include #include "utils.h" +#include "settings.h" #include "connections.h" -/* Available field for 'con status' */ +/* Available fields for 'con status' */ static NmcOutputField nmc_fields_con_status[] = { {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ @@ -68,7 +69,7 @@ static NmcOutputField nmc_fields_con_status[] = { #define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,SPEC-OBJECT" #define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN" -/* Available field for 'con list' */ +/* Available fields for 'con list' */ static NmcOutputField nmc_fields_con_list[] = { {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ @@ -84,6 +85,45 @@ static NmcOutputField nmc_fields_con_list[] = { #define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,SCOPE,TIMESTAMP-REAL" +/* Helper macro to define fields */ +#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, 0 } + +/* Available settings for 'con list id/uuid ' */ +static NmcOutputField nmc_fields_settings_names[] = { + SETTING_FIELD (NM_SETTING_CONNECTION_SETTING_NAME, 0), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_SETTING_NAME, 0), /* 1 */ + SETTING_FIELD (NM_SETTING_802_1X_SETTING_NAME, 0), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SETTING_NAME, 0), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, 0), /* 4 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_SETTING_NAME, 0), /* 5 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_SETTING_NAME, 0), /* 6 */ + SETTING_FIELD (NM_SETTING_SERIAL_SETTING_NAME, 0), /* 7 */ + SETTING_FIELD (NM_SETTING_PPP_SETTING_NAME, 0), /* 8 */ + SETTING_FIELD (NM_SETTING_PPPOE_SETTING_NAME, 0), /* 9 */ + SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0), /* 10 */ + SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0), /* 11 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 12 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 */ + SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0), /* 14 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTINGS_NAMES_ALL NM_SETTING_CONNECTION_SETTING_NAME","\ + NM_SETTING_WIRED_SETTING_NAME","\ + NM_SETTING_802_1X_SETTING_NAME","\ + NM_SETTING_WIRELESS_SETTING_NAME","\ + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME","\ + NM_SETTING_IP4_CONFIG_SETTING_NAME","\ + NM_SETTING_IP6_CONFIG_SETTING_NAME","\ + NM_SETTING_SERIAL_SETTING_NAME","\ + NM_SETTING_PPP_SETTING_NAME","\ + NM_SETTING_PPPOE_SETTING_NAME","\ + NM_SETTING_GSM_SETTING_NAME","\ + NM_SETTING_CDMA_SETTING_NAME","\ + NM_SETTING_BLUETOOTH_SETTING_NAME","\ + NM_SETTING_OLPC_MESH_SETTING_NAME","\ + NM_SETTING_VPN_SETTING_NAME + + typedef struct { NmCli *nmc; int argc; @@ -129,6 +169,196 @@ quit (void) g_main_loop_quit (loop); /* quit main loop */ } +static gboolean +nmc_connection_detail (NMConnection *connection, NmCli *nmc) +{ + NMSetting *setting; + GError *error = NULL; + GArray *print_settings_array; + int i; + char *fields_str; + char *fields_all = NMC_FIELDS_SETTINGS_NAMES_ALL; + char *fields_common = NMC_FIELDS_SETTINGS_NAMES_ALL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + gboolean was_output = FALSE; + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + print_settings_array = parse_output_fields (fields_str, nmc_fields_settings_names, &error); + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error->message, NMC_FIELDS_SETTINGS_NAMES_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return FALSE; + } + + nmc->allowed_fields = nmc_fields_settings_names; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ONLY; + nmc->print_fields.header_name = _("Connection details"); + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTINGS_NAMES_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); + + /* Loop through the required settings and print them. */ + for (i = 0; i < print_settings_array->len; i++) { + int section_idx = g_array_index (print_settings_array, int, i); + + if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) + printf ("\n"); /* Empty line */ + + was_output = FALSE; + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[0].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (setting) { + setting_connection_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[1].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + if (setting) { + setting_wired_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[2].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + if (setting) { + setting_802_1X_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[3].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + if (setting) { + setting_wireless_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[4].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); + if (setting) { + setting_wireless_security_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[5].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (setting) { + setting_ip4_config_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[6].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (setting) { + setting_ip6_config_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[7].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL); + if (setting) { + setting_serial_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[8].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); + if (setting) { + setting_ppp_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[9].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); + if (setting) { + setting_pppoe_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[10].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); + if (setting) { + setting_gsm_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[11].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); + if (setting) { + setting_cdma_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[12].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (setting) { + setting_bluetooth_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[13].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH); + if (setting) { + setting_olpc_mesh_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[14].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (setting) { + setting_vpn_details (setting, nmc); + was_output = TRUE; + continue; + } + } + } + + if (print_settings_array) + g_array_free (print_settings_array, FALSE); + + return NMC_RESULT_SUCCESS; +} + static void show_connection (NMConnection *data, gpointer user_data) { @@ -150,7 +380,7 @@ show_connection (NMConnection *data, gpointer user_data) nmc->allowed_fields[2].value = nm_setting_connection_get_connection_type (s_con); nmc->allowed_fields[3].value = nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM ? _("system") : _("user"); nmc->allowed_fields[4].value = timestamp_str; - nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); + nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); @@ -193,7 +423,8 @@ find_connection (GSList *list, const char *filter_type, const char *filter_val) static NMCResultCode do_connections_list (NmCli *nmc, int argc, char **argv) { - GError *error = NULL; + GError *error1 = NULL; + GError *error2 = NULL; char *fields_str; char *fields_all = NMC_FIELDS_CON_LIST_ALL; char *fields_common = NMC_FIELDS_CON_LIST_COMMON; @@ -208,23 +439,18 @@ do_connections_list (NmCli *nmc, int argc, char **argv) fields_str = fields_common; else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) fields_str = fields_all; - else + else fields_str = nmc->required_fields; nmc->allowed_fields = nmc_fields_con_list; - nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); - - if (error) { - if (error->code == 0) - g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error->message); - else - g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_LIST_ALL); - g_error_free (error); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; - } + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error1); + /* error1 is checked later - it's not valid for connection details */ if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; valid_param_specified = TRUE; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; @@ -247,14 +473,14 @@ do_connections_list (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; + return nmc->return_value; } valid_param_specified = TRUE; con1 = find_connection (nmc->system_connections, selector, *argv); con2 = find_connection (nmc->user_connections, selector, *argv); - if (con1) nm_connection_dump (con1); - if (con2) nm_connection_dump (con2); + if (con1) nmc_connection_detail (con1, nmc); + if (con2) nmc_connection_detail (con2, nmc); if (!con1 && !con2) { g_string_printf (nmc->return_text, _("Error: %s - no such connection."), *argv); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; @@ -262,6 +488,10 @@ do_connections_list (NmCli *nmc, int argc, char **argv) break; } else if (strcmp (*argv, "system") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; valid_param_specified = TRUE; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; @@ -271,6 +501,10 @@ do_connections_list (NmCli *nmc, int argc, char **argv) break; } else if (strcmp (*argv, "user") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; valid_param_specified = TRUE; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; @@ -292,8 +526,23 @@ do_connections_list (NmCli *nmc, int argc, char **argv) g_string_printf (nmc->return_text, _("Error: no valid parameter specified.")); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } + return nmc->return_value; error: + if (error1) { + if (error1->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error1->message); + else + g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error1->message, NMC_FIELDS_CON_LIST_ALL); + g_error_free (error1); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + if (error2) { + g_string_printf (nmc->return_text, _("Error: %s."), error2->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + g_error_free (error2); + } + return nmc->return_value; } @@ -387,7 +636,7 @@ do_connections_status (NmCli *nmc, int argc, char **argv) fields_str = fields_common; else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) fields_str = fields_all; - else + else fields_str = nmc->required_fields; nmc->allowed_fields = nmc_fields_con_status; @@ -921,7 +1170,7 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpoin if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { printf (_("Connection activated\n")); quit (); - } else if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) { + } else if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) { g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; quit (); @@ -1278,8 +1527,8 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) } /* return and wait for the callback of the second settings is called */ - if ((args->nmc->system_settings_running && !system_cb_called) || - (args->nmc->user_settings_running && !user_cb_called)) + if ( (args->nmc->system_settings_running && !system_cb_called) + || (args->nmc->user_settings_running && !user_cb_called)) return; if (args->argc == 0) { @@ -1289,8 +1538,6 @@ get_connections_cb (NMSettingsInterface *settings, gpointer user_data) } else { if (matches (*args->argv, "list") == 0) { - if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) - goto opt_error; args->nmc->return_value = do_connections_list (args->nmc, args->argc-1, args->argv+1); } else if (matches(*args->argv, "status") == 0) { diff --git a/cli/src/settings.c b/cli/src/settings.c new file mode 100644 index 0000000000..5701c6bda0 --- /dev/null +++ b/cli/src/settings.c @@ -0,0 +1,1369 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "utils.h" +#include "settings.h" + + +/* Helper macro to define fields */ +#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, 0 } + +/* Available fields for NM_SETTING_CONNECTION_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_connection[] = { + SETTING_FIELD ("name", 15), /* 0 */ + SETTING_FIELD (NM_SETTING_CONNECTION_ID, 25), /* 1 */ + SETTING_FIELD (NM_SETTING_CONNECTION_UUID, 38), /* 2 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TYPE, 17), /* 3 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT, 13), /* 4 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TIMESTAMP, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_CONNECTION_READ_ONLY, 10), /* 6 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_CONNECTION_ALL "name"","\ + NM_SETTING_CONNECTION_ID","\ + NM_SETTING_CONNECTION_UUID","\ + NM_SETTING_CONNECTION_TYPE","\ + NM_SETTING_CONNECTION_AUTOCONNECT","\ + NM_SETTING_CONNECTION_TIMESTAMP","\ + NM_SETTING_CONNECTION_READ_ONLY +#define NMC_FIELDS_SETTING_CONNECTION_COMMON NMC_FIELDS_SETTING_CONNECTION_ALL + +/* Available fields for NM_SETTING_WIRED_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wired[] = { + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 6 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ + NM_SETTING_WIRED_PORT","\ + NM_SETTING_WIRED_SPEED","\ + NM_SETTING_WIRED_DUPLEX","\ + NM_SETTING_WIRED_AUTO_NEGOTIATE","\ + NM_SETTING_WIRED_MAC_ADDRESS","\ + NM_SETTING_WIRED_MTU +#define NMC_FIELDS_SETTING_WIRED_COMMON NMC_FIELDS_SETTING_WIRED_ALL + +/* Available fields for NM_SETTING_802_1X_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_8021X[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_802_1X_EAP, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_802_1X_IDENTITY, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_CERT, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_PATH, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT, 20), /* 12 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH, 20), /* 13 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, 20), /* 14 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD, 10), /* 15 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY, 15), /* 16 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, 20), /* 17 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, 20), /* 18 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, 20), /* 19 */ + SETTING_FIELD (NM_SETTING_802_1X_PIN, 8), /* 20 */ + SETTING_FIELD (NM_SETTING_802_1X_PSK, 8), /* 21 */ + SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS, 17), /* 22 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_802_1X_ALL "name"","\ + NM_SETTING_802_1X_EAP","\ + NM_SETTING_802_1X_IDENTITY","\ + NM_SETTING_802_1X_ANONYMOUS_IDENTITY","\ + NM_SETTING_802_1X_CA_CERT","\ + NM_SETTING_802_1X_CA_PATH","\ + NM_SETTING_802_1X_CLIENT_CERT","\ + NM_SETTING_802_1X_PHASE1_PEAPVER","\ + NM_SETTING_802_1X_PHASE1_PEAPLABEL","\ + NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING","\ + NM_SETTING_802_1X_PHASE2_AUTH","\ + NM_SETTING_802_1X_PHASE2_AUTHEAP","\ + NM_SETTING_802_1X_PHASE2_CA_CERT","\ + NM_SETTING_802_1X_PHASE2_CA_PATH","\ + NM_SETTING_802_1X_PHASE2_CLIENT_CERT","\ + NM_SETTING_802_1X_PASSWORD","\ + NM_SETTING_802_1X_PRIVATE_KEY","\ + NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD","\ + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY","\ + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD","\ + NM_SETTING_802_1X_PIN","\ + NM_SETTING_802_1X_PSK","\ + NM_SETTING_802_1X_SYSTEM_CA_CERTS +#define NMC_FIELDS_SETTING_802_1X_COMMON NMC_FIELDS_SETTING_802_1X_ALL + +/* Available fields for NM_SETTING_WIRELESS_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wireless[] = { + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SSID, 34), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MODE, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BAND, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CHANNEL, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BSSID, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_RATE, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS, 19), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 11 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ + NM_SETTING_WIRELESS_SSID","\ + NM_SETTING_WIRELESS_MODE","\ + NM_SETTING_WIRELESS_BAND","\ + NM_SETTING_WIRELESS_CHANNEL","\ + NM_SETTING_WIRELESS_BSSID","\ + NM_SETTING_WIRELESS_RATE","\ + NM_SETTING_WIRELESS_TX_POWER","\ + NM_SETTING_WIRELESS_MAC_ADDRESS","\ + NM_SETTING_WIRELESS_MTU","\ + NM_SETTING_WIRELESS_SEEN_BSSIDS","\ + NM_SETTING_WIRELESS_SEC +#define NMC_FIELDS_SETTING_WIRELESS_COMMON NMC_FIELDS_SETTING_WIRELESS_ALL + +/* Available fields for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wireless_security[] = { + SETTING_FIELD ("name", 25), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PROTO, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_GROUP, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, 15), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK, 6), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, 15), /* 13 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, 15), /* 14 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL "name"","\ + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT","\ + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX","\ + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG","\ + NM_SETTING_WIRELESS_SECURITY_PROTO","\ + NM_SETTING_WIRELESS_SECURITY_PAIRWISE","\ + NM_SETTING_WIRELESS_SECURITY_GROUP","\ + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3","\ + NM_SETTING_WIRELESS_SECURITY_PSK","\ + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE +#define NMC_FIELDS_SETTING_WIRELESS_SECURITY_COMMON NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL + +/* Available fields for NM_SETTING_IP4_CONFIG_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_ip4_config[] = { + SETTING_FIELD ("name", 8), /* 0 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_METHOD, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DNS, 20), /* 2 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DNS_SEARCH, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_ADDRESSES, 20), /* 4 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_ROUTES, 20), /* 5 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 6 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, 16), /* 7 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, 15), /* 8 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, 19), /* 9 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, 14), /* 10 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, 15), /* 11 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_IP4_CONFIG_ALL "name"","\ + NM_SETTING_IP4_CONFIG_METHOD","\ + NM_SETTING_IP4_CONFIG_DNS","\ + NM_SETTING_IP4_CONFIG_DNS_SEARCH","\ + NM_SETTING_IP4_CONFIG_ADDRESSES","\ + NM_SETTING_IP4_CONFIG_ROUTES","\ + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES","\ + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS","\ + NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID","\ + NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME","\ + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME","\ + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT +#define NMC_FIELDS_SETTING_IP4_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL + +/* Available fields for NM_SETTING_IP6_CONFIG_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_ip6_config[] = { + SETTING_FIELD ("name", 8), /* 0 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_METHOD, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_DNS, 20), /* 2 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_DNS_SEARCH, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_ADDRESSES, 20), /* 4 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_ROUTES, 20), /* 5 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 6 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, 16), /* 7 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, 15), /* 8 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_IP6_CONFIG_ALL "name"","\ + NM_SETTING_IP6_CONFIG_METHOD","\ + NM_SETTING_IP6_CONFIG_DNS","\ + NM_SETTING_IP6_CONFIG_DNS_SEARCH","\ + NM_SETTING_IP6_CONFIG_ADDRESSES","\ + NM_SETTING_IP6_CONFIG_ROUTES","\ + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES","\ + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS","\ + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT +#define NMC_FIELDS_SETTING_IP6_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL + +/* Available fields for NM_SETTING_SERIAL_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_serial[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_SERIAL_BAUD, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_SERIAL_BITS, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_SERIAL_PARITY, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_SERIAL_STOPBITS, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_SERIAL_SEND_DELAY, 12), /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_SERIAL_ALL "name"","\ + NM_SETTING_SERIAL_BAUD","\ + NM_SETTING_SERIAL_BITS","\ + NM_SETTING_SERIAL_PARITY","\ + NM_SETTING_SERIAL_STOPBITS","\ + NM_SETTING_SERIAL_SEND_DELAY +#define NMC_FIELDS_SETTING_SERIAL_COMMON NMC_FIELDS_SETTING_SERIAL_ALL + +/* Available fields for NM_SETTING_PPP_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_ppp[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_PPP_NOAUTH, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_EAP, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_PAP, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_CHAP, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAP, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAPV2, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_PPP_NOBSDCOMP, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_PPP_NODEFLATE, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_PPP_NO_VJ_COMP, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE_128, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_PPP_MPPE_STATEFUL, 10), /* 12 */ + SETTING_FIELD (NM_SETTING_PPP_CRTSCTS, 10), /* 13 */ + SETTING_FIELD (NM_SETTING_PPP_BAUD, 10), /* 14 */ + SETTING_FIELD (NM_SETTING_PPP_MRU, 10), /* 15 */ + SETTING_FIELD (NM_SETTING_PPP_MTU, 10), /* 16 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_FAILURE, 17), /* 17 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_INTERVAL, 18), /* 18 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_PPP_ALL "name"","\ + NM_SETTING_PPP_NOAUTH","\ + NM_SETTING_PPP_REFUSE_EAP","\ + NM_SETTING_PPP_REFUSE_PAP","\ + NM_SETTING_PPP_REFUSE_CHAP","\ + NM_SETTING_PPP_REFUSE_MSCHAP","\ + NM_SETTING_PPP_REFUSE_MSCHAPV2","\ + NM_SETTING_PPP_NOBSDCOMP","\ + NM_SETTING_PPP_NODEFLATE","\ + NM_SETTING_PPP_NO_VJ_COMP","\ + NM_SETTING_PPP_REQUIRE_MPPE","\ + NM_SETTING_PPP_REQUIRE_MPPE_128","\ + NM_SETTING_PPP_MPPE_STATEFUL","\ + NM_SETTING_PPP_CRTSCTS","\ + NM_SETTING_PPP_BAUD","\ + NM_SETTING_PPP_MRU","\ + NM_SETTING_PPP_MTU","\ + NM_SETTING_PPP_LCP_ECHO_FAILURE","\ + NM_SETTING_PPP_LCP_ECHO_INTERVAL +#define NMC_FIELDS_SETTING_PPP_COMMON NMC_FIELDS_SETTING_PPP_ALL + +/* Available fields for NM_SETTING_PPPOE_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_pppoe[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_PPPOE_SERVICE, 12), /* 1 */ + SETTING_FIELD (NM_SETTING_PPPOE_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD, 15), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_PPPOE_ALL "name"","\ + NM_SETTING_PPPOE_SERVICE","\ + NM_SETTING_PPPOE_USERNAME","\ + NM_SETTING_PPPOE_PASSWORD +#define NMC_FIELDS_SETTING_PPPOE_COMMON NMC_FIELDS_SETTING_PPP_ALL + +/* Available fields for NM_SETTING_GSM_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_gsm[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_GSM_NUMBER, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_GSM_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_GSM_PASSWORD, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_GSM_APN, 25), /* 4 */ + SETTING_FIELD (NM_SETTING_GSM_NETWORK_ID, 12), /* 5 */ + SETTING_FIELD (NM_SETTING_GSM_NETWORK_TYPE, 15), /* 6 */ + SETTING_FIELD (NM_SETTING_GSM_ALLOWED_BANDS, 15), /* 7 */ + SETTING_FIELD (NM_SETTING_GSM_PIN, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_GSM_HOME_ONLY, 10), /* 9 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_GSM_ALL "name"","\ + NM_SETTING_GSM_NUMBER","\ + NM_SETTING_GSM_USERNAME","\ + NM_SETTING_GSM_PASSWORD","\ + NM_SETTING_GSM_APN","\ + NM_SETTING_GSM_NETWORK_ID","\ + NM_SETTING_GSM_NETWORK_TYPE","\ + NM_SETTING_GSM_ALLOWED_BANDS","\ + NM_SETTING_GSM_PIN","\ + NM_SETTING_GSM_HOME_ONLY +#define NMC_FIELDS_SETTING_GSM_COMMON NMC_FIELDS_SETTING_GSM_ALL + +/* Available fields for NM_SETTING_CDMA_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_cdma[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_CDMA_NUMBER, 15), /* 1 */ + SETTING_FIELD (NM_SETTING_CDMA_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_CDMA_PASSWORD, 15), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_CDMA_ALL "name"","\ + NM_SETTING_CDMA_NUMBER","\ + NM_SETTING_CDMA_USERNAME","\ + NM_SETTING_CDMA_PASSWORD +#define NMC_FIELDS_SETTING_CDMA_COMMON NMC_FIELDS_SETTING_CDMA_ALL + +/* Available fields for NM_SETTING_BLUETOOTH_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_bluetooth[] = { + SETTING_FIELD ("name", 11), /* 0 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_BDADDR, 19), /* 1 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_TYPE, 10), /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_BLUETOOTH_ALL "name"","\ + NM_SETTING_BLUETOOTH_BDADDR","\ + NM_SETTING_BLUETOOTH_TYPE +#define NMC_FIELDS_SETTING_BLUETOOTH_COMMON NMC_FIELDS_SETTING_BLUETOOTH_ALL + +/* Available fields for NM_SETTING_OLPC_MESH_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_olpc_mesh[] = { + SETTING_FIELD ("name", 18), /* 0 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_SSID, 34), /* 1 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_CHANNEL, 12), /* 2 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, 17), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_OLPC_MESH_ALL "name"","\ + NM_SETTING_OLPC_MESH_SSID","\ + NM_SETTING_OLPC_MESH_CHANNEL","\ + NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS +#define NMC_FIELDS_SETTING_OLPC_MESH_COMMON NMC_FIELDS_SETTING_OLPC_MESH_ALL + +/* Available fields for NM_SETTING_VPN_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_vpn[] = { + SETTING_FIELD ("name", 6), /* 0 */ + SETTING_FIELD (NM_SETTING_VPN_SERVICE_TYPE, 40), /* 1 */ + SETTING_FIELD (NM_SETTING_VPN_USER_NAME, 12), /* 2 */ + SETTING_FIELD (NM_SETTING_VPN_DATA, 30), /* 3 */ + SETTING_FIELD (NM_SETTING_VPN_SECRETS, 15), /* 4 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_VPN_ALL "name"","\ + NM_SETTING_VPN_SERVICE_TYPE","\ + NM_SETTING_VPN_USER_NAME","\ + NM_SETTING_VPN_DATA","\ + NM_SETTING_VPN_SECRETS +#define NMC_FIELDS_SETTING_VPN_COMMON NMC_FIELDS_SETTING_VPN_ALL + + +static char * +wep_key_type_to_string (NMWepKeyType type) +{ + switch (type) { + case NM_WEP_KEY_TYPE_KEY: + return g_strdup_printf (_("%d (hex-ascii-key)"), type); + case NM_WEP_KEY_TYPE_PASSPHRASE: + return g_strdup_printf (_("%d (104/128-bit passphrase)"), type); + case NM_WEP_KEY_TYPE_UNKNOWN: + default: + return g_strdup_printf (_("%d (unknown)"), type); + } +} + +static char * +blob_cert_to_string (const GByteArray *array) +{ + GString *cert = NULL; + int i; + + if (array->len > 0) + cert = g_string_new (NULL); + + for (i = 0; i < array->len; i++) { + g_string_append_printf (cert, "%02X", array->data[i]); + } + + return cert ? g_string_free (cert, FALSE) : NULL; +} + +static char * +allowed_bands_to_string (guint32 bands) +{ + GString *band_str; + + if (bands == NM_SETTING_GSM_BAND_UNKNOWN) + return g_strdup (_("0 (unknown)")); + + band_str = g_string_new (NULL); + g_string_printf (band_str, "%d (", bands); + + if (bands & NM_SETTING_GSM_BAND_ANY) + g_string_append (band_str, _("any, ")); + if (bands & NM_SETTING_GSM_BAND_EGSM) + g_string_append (band_str, _("900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_DCS) + g_string_append (band_str, _("1800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_PCS) + g_string_append (band_str, _("1900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_G850) + g_string_append (band_str, _("850 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U2100) + g_string_append (band_str, _("WCDMA 3GPP UMTS 2100 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U1800) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U17IV) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1700/2100 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U800) + g_string_append (band_str, _("WCDMA 3GPP UMTS 800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U850) + g_string_append (band_str, _("WCDMA 3GPP UMTS 850 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U900) + g_string_append (band_str, _("WCDMA 3GPP UMTS 900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U17IX) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1700 MHz, ")); + + if (band_str->str[band_str->len-1] == '(') + g_string_assign (band_str, _("unknown")); + else + g_string_truncate (band_str, band_str->len-2); /* chop off trailing ', ' */ + + g_string_append_c (band_str, ')'); + + return g_string_free (band_str, FALSE); +} + + +gboolean +setting_connection_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingConnection *s_con; + guint64 timestamp; + char *timestamp_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE); + s_con = (NMSettingConnection *) setting; + + nmc->allowed_fields = nmc_fields_setting_connection; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CONNECTION_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + timestamp = nm_setting_connection_get_timestamp (s_con); + timestamp_str = g_strdup_printf ("%ld", timestamp); + + nmc->allowed_fields[0].value = NM_SETTING_CONNECTION_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_connection_get_id (s_con); + nmc->allowed_fields[2].value = nm_setting_connection_get_uuid (s_con); + nmc->allowed_fields[3].value = nm_setting_connection_get_connection_type (s_con); + nmc->allowed_fields[4].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = timestamp_str; + nmc->allowed_fields[6].value = nm_setting_connection_get_read_only (s_con) ? ("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (timestamp_str); + + return TRUE; +} + +gboolean +setting_wired_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWired *s_wired; + const GByteArray *mac; + char *speed_str, *mtu_str, *mac_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + s_wired = (NMSettingWired *) setting; + + nmc->allowed_fields = nmc_fields_setting_wired; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRED_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + speed_str = g_strdup_printf ("%d", nm_setting_wired_get_speed (s_wired)); + mtu_str = g_strdup_printf ("%d", nm_setting_wired_get_mtu (s_wired)); + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac) + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + + nmc->allowed_fields[0].value = NM_SETTING_WIRED_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_wired_get_port (s_wired); + nmc->allowed_fields[2].value = speed_str; + nmc->allowed_fields[3].value = nm_setting_wired_get_duplex (s_wired); + nmc->allowed_fields[4].value = nm_setting_wired_get_auto_negotiate (s_wired) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = mac_str; + nmc->allowed_fields[6].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (speed_str); + g_free (mac_str); + g_free (mtu_str); + + return TRUE; +} + +gboolean +setting_802_1X_details (NMSetting *setting, NmCli *nmc) +{ + NMSetting8021x *s_8021X; + NMSetting8021xCKScheme scheme; + GString *eap_str; + char *ca_cert_str = NULL, *client_cert_str = NULL, *phase2_ca_cert_str = NULL; + char *phase2_client_cert_str = NULL, *private_key_str = NULL, *phase2_private_key_str = NULL; + int i; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE); + s_8021X = (NMSetting8021x *) setting; + + nmc->allowed_fields = nmc_fields_setting_8021X; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_802_1X_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + eap_str = g_string_new (NULL); + for (i = 0; i < nm_setting_802_1x_get_num_eap_methods (s_8021X); i++) { + if (i > 0) + g_string_append_c (eap_str, ','); + g_string_append (eap_str, nm_setting_802_1x_get_eap_method (s_8021X, i)); + } + scheme = nm_setting_802_1x_get_ca_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + ca_cert_str = blob_cert_to_string (nm_setting_802_1x_get_ca_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + ca_cert_str = g_strdup (nm_setting_802_1x_get_ca_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_client_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + client_cert_str = blob_cert_to_string (nm_setting_802_1x_get_client_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + client_cert_str = g_strdup (nm_setting_802_1x_get_client_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_ca_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_ca_cert_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_ca_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_ca_cert_str = g_strdup (nm_setting_802_1x_get_phase2_ca_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_client_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_client_cert_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_client_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_client_cert_str = g_strdup (nm_setting_802_1x_get_phase2_client_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_private_key_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + private_key_str = blob_cert_to_string (nm_setting_802_1x_get_private_key_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + private_key_str = g_strdup (nm_setting_802_1x_get_private_key_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_private_key_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_private_key_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_private_key_str = g_strdup (nm_setting_802_1x_get_phase2_private_key_path (s_8021X)); + + nmc->allowed_fields[0].value = NM_SETTING_802_1X_SETTING_NAME; + nmc->allowed_fields[1].value = eap_str->str; + nmc->allowed_fields[2].value = nm_setting_802_1x_get_identity (s_8021X); + nmc->allowed_fields[3].value = nm_setting_802_1x_get_anonymous_identity (s_8021X); + nmc->allowed_fields[4].value = ca_cert_str; + nmc->allowed_fields[5].value = nm_setting_802_1x_get_ca_path (s_8021X); + nmc->allowed_fields[6].value = client_cert_str; + nmc->allowed_fields[7].value = nm_setting_802_1x_get_phase1_peapver (s_8021X); + nmc->allowed_fields[8].value = nm_setting_802_1x_get_phase1_peaplabel (s_8021X); + nmc->allowed_fields[9].value = nm_setting_802_1x_get_phase1_fast_provisioning (s_8021X); + nmc->allowed_fields[10].value = nm_setting_802_1x_get_phase2_auth (s_8021X); + nmc->allowed_fields[11].value = nm_setting_802_1x_get_phase2_autheap (s_8021X); + nmc->allowed_fields[12].value = phase2_ca_cert_str; + nmc->allowed_fields[13].value = nm_setting_802_1x_get_phase2_ca_path (s_8021X); + nmc->allowed_fields[14].value = phase2_client_cert_str; + nmc->allowed_fields[15].value = nm_setting_802_1x_get_password (s_8021X); + nmc->allowed_fields[16].value = private_key_str; + nmc->allowed_fields[17].value = nm_setting_802_1x_get_private_key_password (s_8021X); + nmc->allowed_fields[18].value = phase2_private_key_str; + nmc->allowed_fields[19].value = nm_setting_802_1x_get_phase2_private_key_password (s_8021X); + nmc->allowed_fields[20].value = nm_setting_802_1x_get_pin (s_8021X); + nmc->allowed_fields[21].value = nm_setting_802_1x_get_psk (s_8021X); + nmc->allowed_fields[22].value = nm_setting_802_1x_get_system_ca_certs (s_8021X) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ca_cert_str); + g_free (client_cert_str); + g_free (phase2_ca_cert_str); + g_free (phase2_client_cert_str); + g_free (private_key_str); + g_free (phase2_private_key_str); + g_string_free (eap_str, TRUE); + + return TRUE; +} + +gboolean +setting_wireless_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWireless *s_wireless; + int i; + const GByteArray *ssid, *bssid, *mac; + char *ssid_str, *channel_str, *rate_str, *tx_power_str, *mtu_str; + char *mac_str = NULL, *bssid_str = NULL; + GString *seen_bssids; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE); + s_wireless = (NMSettingWireless *) setting; + + nmc->allowed_fields = nmc_fields_setting_wireless; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + ssid = nm_setting_wireless_get_ssid (s_wireless); + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); + channel_str = g_strdup_printf ("%d", nm_setting_wireless_get_channel (s_wireless)); + rate_str = g_strdup_printf ("%d", nm_setting_wireless_get_rate (s_wireless)); + bssid = nm_setting_wireless_get_mac_address (s_wireless); + if (bssid) + bssid_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bssid->data[0], bssid->data[1], bssid->data[2], bssid->data[3], bssid->data[4], bssid->data[5]); + tx_power_str = g_strdup_printf ("%d", nm_setting_wireless_get_tx_power (s_wireless)); + mtu_str = g_strdup_printf ("%d", nm_setting_wireless_get_mtu (s_wireless)); + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac) + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + seen_bssids = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_get_num_seen_bssids (s_wireless); i++) { + if (i > 0) + g_string_append_c (seen_bssids, ','); + g_string_append (seen_bssids, nm_setting_wireless_get_seen_bssid (s_wireless, i)); + } + + nmc->allowed_fields[0].value = NM_SETTING_WIRELESS_SETTING_NAME; + nmc->allowed_fields[1].value = ssid_str; + nmc->allowed_fields[2].value = nm_setting_wireless_get_mode (s_wireless); + nmc->allowed_fields[3].value = nm_setting_wireless_get_band (s_wireless); + nmc->allowed_fields[4].value = channel_str; + nmc->allowed_fields[5].value = bssid_str ? bssid_str : _("not set"); + nmc->allowed_fields[6].value = rate_str; + nmc->allowed_fields[7].value = tx_power_str; + nmc->allowed_fields[8].value = mac_str ? mac_str : _("not set"); + nmc->allowed_fields[9].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[10].value = seen_bssids->str; + nmc->allowed_fields[11].value = nm_setting_wireless_get_security (s_wireless); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ssid_str); + g_free (channel_str); + g_free (bssid_str); + g_free (rate_str); + g_free (tx_power_str); + g_free (mac_str); + g_free (mtu_str); + g_string_free (seen_bssids, TRUE); + + return TRUE; +} + +gboolean +setting_wireless_security_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWirelessSecurity *s_wireless_sec; + int i; + char *wep_tx_keyidx_str, *wep_key_type_str; + GString *protos, *pairwises, *groups; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE); + s_wireless_sec = (NMSettingWirelessSecurity *) setting; + + nmc->allowed_fields = nmc_fields_setting_wireless_security; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + wep_tx_keyidx_str = g_strdup_printf ("%d", nm_setting_wireless_security_get_wep_tx_keyidx (s_wireless_sec)); + protos = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_protos (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (protos, ','); + g_string_append (protos, nm_setting_wireless_security_get_proto (s_wireless_sec, i)); + } + pairwises = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_pairwise (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (pairwises, ','); + g_string_append (pairwises, nm_setting_wireless_security_get_pairwise (s_wireless_sec, i)); + } + groups = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_groups (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (groups, ','); + g_string_append (groups, nm_setting_wireless_security_get_group (s_wireless_sec, i)); + } + wep_key_type_str = wep_key_type_to_string (nm_setting_wireless_security_get_wep_key_type (s_wireless_sec)); + + nmc->allowed_fields[0].value = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec); + nmc->allowed_fields[2].value = wep_tx_keyidx_str; + nmc->allowed_fields[3].value = nm_setting_wireless_security_get_auth_alg (s_wireless_sec); + nmc->allowed_fields[4].value = protos->str; + nmc->allowed_fields[5].value = pairwises->str; + nmc->allowed_fields[6].value = groups->str; + nmc->allowed_fields[7].value = nm_setting_wireless_security_get_leap_username (s_wireless_sec); + nmc->allowed_fields[8].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 0); + nmc->allowed_fields[9].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1); + nmc->allowed_fields[10].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2); + nmc->allowed_fields[11].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3); + nmc->allowed_fields[12].value = nm_setting_wireless_security_get_psk (s_wireless_sec); + nmc->allowed_fields[13].value = nm_setting_wireless_security_get_leap_password (s_wireless_sec); + nmc->allowed_fields[14].value = wep_key_type_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (wep_tx_keyidx_str); + g_free (wep_key_type_str); + g_string_free (protos, TRUE); + g_string_free (pairwises, TRUE); + g_string_free (groups, TRUE); + + return TRUE; +} + +gboolean +setting_ip4_config_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingIP4Config *s_ip4; + GString *dns_str, *dns_search_str, *addr_str, *route_str; + int i, num; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + s_ip4 = (NMSettingIP4Config *) setting; + + nmc->allowed_fields = nmc_fields_setting_ip4_config; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP4_CONFIG_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + dns_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_dns (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + guint32 ip; + + ip = nm_setting_ip4_config_get_dns (s_ip4, i); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + if (i > 0) + g_string_append (dns_str, ", "); + g_string_append (dns_str, buf); + } + + dns_search_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_dns_searches (s_ip4); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_setting_ip4_config_get_dns_search (s_ip4, i); + if (i > 0) + g_string_append (dns_search_str, ", "); + g_string_append (dns_search_str, domain); + } + + addr_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + char *tmp; + NMIP4Address *addr; + guint32 ip; + + if (i > 0) + g_string_append (addr_str, "; "); + + g_string_append (addr_str, "{ "); + + addr = nm_setting_ip4_config_get_address (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_address (addr); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (addr_str, "ip = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip4_address_get_prefix (addr)); + g_string_append (addr_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_gateway (addr); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (addr_str, ", gw = %s", buf); + + g_string_append (addr_str, " }"); + } + + route_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_routes (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + char *tmp; + NMIP4Route *route; + guint32 ip; + + if (i > 0) + g_string_append (route_str, "; "); + + g_string_append (route_str, "{ "); + + route = nm_setting_ip4_config_get_route (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_dest (route); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (route_str, "dst = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip4_route_get_prefix (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (route_str, ", nh = %s", buf); + + tmp = g_strdup_printf (", mt = %u", nm_ip4_route_get_metric (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + g_string_append (route_str, " }"); + } + + nmc->allowed_fields[0].value = NM_SETTING_IP4_CONFIG_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ip4_config_get_method (s_ip4); + nmc->allowed_fields[2].value = dns_str->str; + nmc->allowed_fields[3].value = dns_search_str->str; + nmc->allowed_fields[4].value = addr_str->str; + nmc->allowed_fields[5].value = route_str->str; + nmc->allowed_fields[6].value = nm_setting_ip4_config_get_ignore_auto_routes (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ip4_config_get_dhcp_client_id (s_ip4); + nmc->allowed_fields[9].value = nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[10].value = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + nmc->allowed_fields[11].value = nm_setting_ip4_config_get_never_default (s_ip4) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (dns_str, TRUE); + g_string_free (dns_search_str, TRUE); + g_string_free (addr_str, TRUE); + g_string_free (route_str, TRUE); + + return TRUE; +} + +gboolean +setting_ip6_config_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingIP6Config *s_ip6; + GString *dns_str, *dns_search_str, *addr_str, *route_str; + int i, num; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE); + s_ip6 = (NMSettingIP6Config *) setting; + + nmc->allowed_fields = nmc_fields_setting_ip6_config; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP6_CONFIG_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + dns_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_dns (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + const struct in6_addr *ip; + + ip = nm_setting_ip6_config_get_dns (s_ip6, i); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + if (i > 0) + g_string_append (dns_str, ", "); + g_string_append (dns_str, buf); + } + + dns_search_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_dns_searches (s_ip6); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_setting_ip6_config_get_dns_search (s_ip6, i); + if (i > 0) + g_string_append (dns_search_str, ", "); + g_string_append (dns_search_str, domain); + } + + addr_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + char *tmp; + NMIP6Address *addr; + const struct in6_addr *ip; + + if (i > 0) + g_string_append (addr_str, "; "); + + g_string_append (addr_str, "{ "); + + addr = nm_setting_ip6_config_get_address (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_address_get_address (addr); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (addr_str, "ip = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip6_address_get_prefix (addr)); + g_string_append (addr_str, tmp); + g_free (tmp); + + g_string_append (addr_str, " }"); + } + + route_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_routes (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + char *tmp; + NMIP6Route *route; + const struct in6_addr *ip; + + if (i > 0) + g_string_append (route_str, "; "); + + g_string_append (route_str, "{ "); + + route = nm_setting_ip6_config_get_route (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_route_get_dest (route); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (route_str, "dst = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip6_route_get_prefix (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_route_get_next_hop (route); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (route_str, ", nh = %s", buf); + + tmp = g_strdup_printf (", mt = %u", nm_ip6_route_get_metric (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + g_string_append (route_str, " }"); + } + + nmc->allowed_fields[0].value = NM_SETTING_IP6_CONFIG_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ip6_config_get_method (s_ip6); + nmc->allowed_fields[2].value = dns_str->str; + nmc->allowed_fields[3].value = dns_search_str->str; + nmc->allowed_fields[4].value = addr_str->str; + nmc->allowed_fields[5].value = route_str->str; + nmc->allowed_fields[6].value = nm_setting_ip6_config_get_ignore_auto_routes (s_ip6) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ip6_config_get_ignore_auto_dns (s_ip6) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ip6_config_get_never_default (s_ip6) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (dns_str, TRUE); + g_string_free (dns_search_str, TRUE); + g_string_free (addr_str, TRUE); + g_string_free (route_str, TRUE); + + return TRUE; +} + +gboolean +setting_serial_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingSerial *s_serial; + char *baud_str, *bits_str, *parity_str, *stopbits_str, *send_delay_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), FALSE); + s_serial = (NMSettingSerial *) setting; + + nmc->allowed_fields = nmc_fields_setting_serial; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_SERIAL_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + baud_str = g_strdup_printf ("%d", nm_setting_serial_get_baud (s_serial)); + bits_str = g_strdup_printf ("%d", nm_setting_serial_get_bits (s_serial)); + parity_str = g_strdup_printf ("%c", nm_setting_serial_get_parity (s_serial)); + stopbits_str = g_strdup_printf ("%d", nm_setting_serial_get_stopbits (s_serial)); + send_delay_str = g_strdup_printf ("%ld", nm_setting_serial_get_send_delay (s_serial)); + + nmc->allowed_fields[0].value = NM_SETTING_SERIAL_SETTING_NAME; + nmc->allowed_fields[1].value = baud_str; + nmc->allowed_fields[2].value = bits_str; + nmc->allowed_fields[3].value = parity_str; + nmc->allowed_fields[4].value = stopbits_str; + nmc->allowed_fields[5].value = send_delay_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (baud_str); + g_free (bits_str); + g_free (parity_str); + g_free (stopbits_str); + g_free (send_delay_str); + + return TRUE; +} + +gboolean +setting_ppp_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingPPP *s_ppp; + char *baud_str, *mru_str, *mtu_str, *lcp_echo_failure_str, *lcp_echo_interval_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + s_ppp = (NMSettingPPP *) setting; + + nmc->allowed_fields = nmc_fields_setting_ppp; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPP_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + baud_str = g_strdup_printf ("%d", nm_setting_ppp_get_baud (s_ppp)); + mru_str = g_strdup_printf ("%d", nm_setting_ppp_get_mru (s_ppp)); + mtu_str = g_strdup_printf ("%d", nm_setting_ppp_get_mtu (s_ppp)); + lcp_echo_failure_str = g_strdup_printf ("%d", nm_setting_ppp_get_lcp_echo_failure (s_ppp)); + lcp_echo_interval_str = g_strdup_printf ("%d", nm_setting_ppp_get_lcp_echo_interval (s_ppp)); + + nmc->allowed_fields[0].value = NM_SETTING_PPP_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ppp_get_noauth (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = nm_setting_ppp_get_refuse_eap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[3].value = nm_setting_ppp_get_refuse_pap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[4].value = nm_setting_ppp_get_refuse_chap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = nm_setting_ppp_get_refuse_mschap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[6].value = nm_setting_ppp_get_refuse_mschapv2 (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ppp_get_nobsdcomp (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ppp_get_nodeflate (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[9].value = nm_setting_ppp_get_no_vj_comp (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[10].value = nm_setting_ppp_get_require_mppe (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[11].value = nm_setting_ppp_get_require_mppe_128 (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[12].value = nm_setting_ppp_get_mppe_stateful (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[13].value = nm_setting_ppp_get_crtscts (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[14].value = baud_str; + nmc->allowed_fields[15].value = mru_str; + nmc->allowed_fields[16].value = mtu_str; + nmc->allowed_fields[17].value = lcp_echo_failure_str; + nmc->allowed_fields[18].value = lcp_echo_interval_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (baud_str); + g_free (mru_str); + g_free (mtu_str); + g_free (lcp_echo_failure_str); + g_free (lcp_echo_interval_str); + + return TRUE; +} + +gboolean +setting_pppoe_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingPPPOE *s_pppoe; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), FALSE); + s_pppoe = (NMSettingPPPOE *) setting; + + nmc->allowed_fields = nmc_fields_setting_pppoe; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPPOE_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + nmc->allowed_fields[0].value = NM_SETTING_PPPOE_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_pppoe_get_service (s_pppoe); + nmc->allowed_fields[2].value = nm_setting_pppoe_get_username (s_pppoe); + nmc->allowed_fields[3].value = nm_setting_pppoe_get_password (s_pppoe); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + return TRUE; +} + +gboolean +setting_gsm_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingGsm *s_gsm; + char *network_type_str, *allowed_bands_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE); + s_gsm = (NMSettingGsm *) setting; + + nmc->allowed_fields = nmc_fields_setting_gsm; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_GSM_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + network_type_str = g_strdup_printf ("%d", nm_setting_gsm_get_network_type (s_gsm)); + allowed_bands_str = allowed_bands_to_string (nm_setting_gsm_get_allowed_bands (s_gsm)); + + nmc->allowed_fields[0].value = NM_SETTING_GSM_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_gsm_get_number (s_gsm); + nmc->allowed_fields[2].value = nm_setting_gsm_get_username (s_gsm); + nmc->allowed_fields[3].value = nm_setting_gsm_get_password (s_gsm); + nmc->allowed_fields[4].value = nm_setting_gsm_get_apn (s_gsm); + nmc->allowed_fields[5].value = nm_setting_gsm_get_network_id (s_gsm); + nmc->allowed_fields[6].value = network_type_str; + nmc->allowed_fields[7].value = allowed_bands_str; + nmc->allowed_fields[8].value = nm_setting_gsm_get_pin (s_gsm); + nmc->allowed_fields[9].value = nm_setting_gsm_get_home_only (s_gsm) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (network_type_str); + g_free (allowed_bands_str); + + return TRUE; +} + +gboolean +setting_cdma_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingCdma *s_cdma; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), FALSE); + s_cdma = (NMSettingCdma *) setting; + + nmc->allowed_fields = nmc_fields_setting_cdma; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CDMA_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + nmc->allowed_fields[0].value = NM_SETTING_CDMA_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_cdma_get_number (s_cdma); + nmc->allowed_fields[2].value = nm_setting_cdma_get_username (s_cdma); + nmc->allowed_fields[3].value = nm_setting_cdma_get_password (s_cdma); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + return TRUE; +} + +gboolean +setting_bluetooth_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingBluetooth *s_bluetooth; + const GByteArray *bdaddr; + char *bdaddr_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (setting), FALSE); + s_bluetooth = (NMSettingBluetooth *) setting; + + nmc->allowed_fields = nmc_fields_setting_bluetooth; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_BLUETOOTH_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + bdaddr = nm_setting_bluetooth_get_bdaddr (s_bluetooth); + if (bdaddr) + bdaddr_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bdaddr->data[0], bdaddr->data[1], bdaddr->data[2], + bdaddr->data[3], bdaddr->data[4], bdaddr->data[5]); + nmc->allowed_fields[0].value = NM_SETTING_BLUETOOTH_SETTING_NAME; + nmc->allowed_fields[1].value = bdaddr_str; + nmc->allowed_fields[2].value = nm_setting_bluetooth_get_connection_type (s_bluetooth); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (bdaddr_str); + + return TRUE; +} + +gboolean +setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingOlpcMesh *s_olpc_mesh; + const GByteArray *ssid, *dhcp_anycast; + char *ssid_str, *channel_str, *dhcp_anycast_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), FALSE); + s_olpc_mesh = (NMSettingOlpcMesh *) setting; + + nmc->allowed_fields = nmc_fields_setting_olpc_mesh; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_OLPC_MESH_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + ssid = nm_setting_olpc_mesh_get_ssid (s_olpc_mesh); + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); + channel_str = g_strdup_printf ("%d", nm_setting_olpc_mesh_get_channel (s_olpc_mesh)); + dhcp_anycast = nm_setting_olpc_mesh_get_dhcp_anycast_address (s_olpc_mesh); + if (dhcp_anycast) + dhcp_anycast_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", dhcp_anycast->data[0], dhcp_anycast->data[1], dhcp_anycast->data[2], + dhcp_anycast->data[3], dhcp_anycast->data[4], dhcp_anycast->data[5]); + nmc->allowed_fields[0].value = NM_SETTING_OLPC_MESH_SETTING_NAME; + nmc->allowed_fields[1].value = ssid_str; + nmc->allowed_fields[2].value = channel_str; + nmc->allowed_fields[3].value = dhcp_anycast_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ssid_str); + g_free (channel_str); + g_free (dhcp_anycast_str); + + return TRUE; +} + +static void +vpn_data_item (const char *key, const char *value, gpointer user_data) +{ + GString *ret_str = (GString *) user_data; + + if (ret_str->len != 0) + g_string_append (ret_str, ", "); + + g_string_append_printf (ret_str, "%s = %s", key, value); +} + +gboolean +setting_vpn_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingVPN *s_vpn; + GString *data_item_str, *secret_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), FALSE); + s_vpn = (NMSettingVPN *) setting; + + nmc->allowed_fields = nmc_fields_setting_vpn; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_VPN_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + data_item_str = g_string_new (NULL); + secret_str = g_string_new (NULL); + nm_setting_vpn_foreach_data_item (s_vpn, &vpn_data_item, data_item_str); + nm_setting_vpn_foreach_secret (s_vpn, &vpn_data_item, secret_str); + + nmc->allowed_fields[0].value = NM_SETTING_VPN_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_vpn_get_service_type (s_vpn); + nmc->allowed_fields[2].value = nm_setting_vpn_get_user_name (s_vpn); + nmc->allowed_fields[3].value = data_item_str->str; + nmc->allowed_fields[4].value = secret_str->str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (data_item_str, TRUE); + g_string_free (secret_str, TRUE); + + return TRUE; +} + diff --git a/cli/src/settings.h b/cli/src/settings.h new file mode 100644 index 0000000000..aec71551da --- /dev/null +++ b/cli/src/settings.h @@ -0,0 +1,59 @@ +/* nmcli - command-line tool to control NetworkManager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_SETTINGS_H +#define NMC_SETTINGS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nmcli.h" +#include "utils.h" + + +gboolean setting_connection_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wired_details (NMSetting *setting, NmCli *nmc); +gboolean setting_802_1X_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wireless_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wireless_security_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ip4_config_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ip6_config_details (NMSetting *setting, NmCli *nmc); +gboolean setting_serial_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ppp_details (NMSetting *setting, NmCli *nmc); +gboolean setting_pppoe_details (NMSetting *setting, NmCli *nmc); +gboolean setting_gsm_details (NMSetting *setting, NmCli *nmc); +gboolean setting_cdma_details (NMSetting *setting, NmCli *nmc); +gboolean setting_bluetooth_details (NMSetting *setting, NmCli *nmc); +gboolean setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc); +gboolean setting_vpn_details (NMSetting *setting, NmCli *nmc); + +#endif /* NMC_SETTINGS_H */ From 7940f8c42a333993a9243881b025a6662a91f423 Mon Sep 17 00:00:00 2001 From: "Francisco Javier F. Serrador" Date: Fri, 2 Apr 2010 10:29:53 -0700 Subject: [PATCH 143/392] po: update Spanish translation (bgo #614187) --- po/es.po | 412 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 235 insertions(+), 177 deletions(-) diff --git a/po/es.po b/po/es.po index fe3f8297d2..0b0ed64691 100644 --- a/po/es.po +++ b/po/es.po @@ -1,11 +1,9 @@ -# translation of NetworkManager.HEAD.po to Español -# translation of NetworkManager.HEAD.po to -# Traducción de NetworkManager al español. +# translation of NetworkManager.HEAD.po to Spanish # Copyright (C) Spanish translation for NetworkManager # This file is distributed under the same license as the NetworkManager package. # # Antonio Ognio , 2004. -# Francisco Javier F. Serrador , 2004, 2005, 2006. +# Francisco Javier F. Serrador , 2004, 2005, 2006, 2010. # Lucas Vieites Fariña , 2005, 2006. # Jorge González , 2007, 2008, 2010. msgid "" @@ -14,7 +12,7 @@ msgstr "" "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-07 13:27+0100\n" +"PO-Revision-Date: 2010-03-28 18:46+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -35,6 +33,14 @@ msgid "" "]\n" " down id | uuid \n" msgstr "" +"Uso: nmcli con { COMANDO | help }\n" +" COMANDO := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--" +"nowait] [--timeout ]\n" +" down id | uuid \n" #: ../cli/src/connections.c:158 msgid "Connections" @@ -64,12 +70,12 @@ msgstr "Nombre" #: ../cli/src/connections.c:163 #, c-format msgid "System connections:\n" -msgstr "" +msgstr "Conexiones del sistema:\n" #: ../cli/src/connections.c:167 #, c-format msgid "User connections:\n" -msgstr "" +msgstr "Conexiones del usuario:\n" #: ../cli/src/connections.c:178 ../cli/src/connections.c:967 #: ../cli/src/connections.c:983 ../cli/src/connections.c:992 @@ -78,20 +84,20 @@ msgstr "" #: ../cli/src/devices.c:785 ../cli/src/devices.c:792 #, c-format msgid "Error: %s argument is missing." -msgstr "" +msgstr "Error: falta el argumento %s." #: ../cli/src/connections.c:189 #, c-format msgid "Error: %s - no such connection." -msgstr "" +msgstr "Error: %s; no existe tal conexión." #: ../cli/src/connections.c:196 msgid "System-wide connections" -msgstr "" +msgstr "Conexiones amplias del sistema" #: ../cli/src/connections.c:205 msgid "User connections" -msgstr "" +msgstr "Conexiones del usuario" #: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 #: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 @@ -99,12 +105,12 @@ msgstr "" #: ../cli/src/devices.c:798 #, c-format msgid "Unknown parameter: %s\n" -msgstr "" +msgstr "Parámetro desconocido: %s\n" #: ../cli/src/connections.c:221 #, c-format msgid "Error: no valid parameter specified." -msgstr "" +msgstr "Error: no se especificó un parámetro válido." #. FIXME: Fix the output #: ../cli/src/connections.c:268 ../cli/src/devices.c:302 @@ -119,7 +125,7 @@ msgstr "no" #: ../cli/src/connections.c:297 msgid "Active connections" -msgstr "Conexiones activas" +msgstr "Activar conexiones" #: ../cli/src/connections.c:297 ../cli/src/connections.c:299 #: ../cli/src/devices.c:302 ../cli/src/devices.c:304 @@ -137,12 +143,12 @@ msgstr "Dispositivos" #: ../cli/src/connections.c:659 #, c-format msgid "no active connection on device '%s'" -msgstr "" +msgstr "no existe una conexión activa en el dispositivo «%s»" #: ../cli/src/connections.c:667 #, c-format msgid "no active connection or device" -msgstr "" +msgstr "no existe una conexión o dispositivo activo" #: ../cli/src/connections.c:730 msgid "activating" @@ -160,31 +166,31 @@ msgstr "desconocido" #: ../cli/src/connections.c:744 msgid "VPN connecting (prepare)" -msgstr "" +msgstr "Conectando con la VPN (preparación)" #: ../cli/src/connections.c:746 msgid "VPN connecting (need authentication)" -msgstr "" +msgstr "Conectando con la VPN (necesita autorización)" #: ../cli/src/connections.c:748 msgid "VPN connecting" -msgstr "" +msgstr "Conectando con la VPN" #: ../cli/src/connections.c:750 msgid "VPN connecting (getting IP configuration)" -msgstr "" +msgstr "Conectando con la VPN (obteniendo configuración IP)" #: ../cli/src/connections.c:752 msgid "VPN connected" -msgstr "" +msgstr "VPN conectada" #: ../cli/src/connections.c:754 msgid "VPN connection failed" -msgstr "" +msgstr "Falló la conexión VPN" #: ../cli/src/connections.c:756 msgid "VPN disconnected" -msgstr "" +msgstr "VPN desconectada" #: ../cli/src/connections.c:767 msgid "unknown reason" @@ -196,43 +202,43 @@ msgstr "ninguna" #: ../cli/src/connections.c:771 msgid "the user was disconnected" -msgstr "" +msgstr "se desconectó al usuario" #: ../cli/src/connections.c:773 msgid "the base network connection was interrupted" -msgstr "" +msgstr "se interrumpió la conexión base de red" #: ../cli/src/connections.c:775 msgid "the VPN service stopped unexpectedly" -msgstr "" +msgstr "el servicio VPN finalizó inesperadamente" #: ../cli/src/connections.c:777 msgid "the VPN service returned invalid configuration" -msgstr "" +msgstr "el servicio VPN devolvió una configuración no válida" #: ../cli/src/connections.c:779 msgid "the connection attempt timed out" -msgstr "" +msgstr "expiró el intento de conexión" #: ../cli/src/connections.c:781 msgid "the VPN service did not start in time" -msgstr "" +msgstr "el servicio VPN no se inició a tiempo" #: ../cli/src/connections.c:783 msgid "the VPN service failed to start" -msgstr "" +msgstr "el servicio VPN falló al iniciar" #: ../cli/src/connections.c:785 msgid "no valid VPN secrets" -msgstr "" +msgstr "secretos VPN no válidos" #: ../cli/src/connections.c:787 msgid "invalid VPN secrets" -msgstr "" +msgstr "secretos VPN inválidos" #: ../cli/src/connections.c:789 msgid "the connection was removed" -msgstr "" +msgstr "se rechazó la conexión" #: ../cli/src/connections.c:803 #, c-format @@ -242,102 +248,104 @@ msgstr "estado: %s\n" #: ../cli/src/connections.c:806 ../cli/src/connections.c:832 #, c-format msgid "Connection activated\n" -msgstr "" +msgstr "Conexión activada\n" #: ../cli/src/connections.c:809 #, c-format msgid "Error: Connection activation failed." -msgstr "" +msgstr "Error: falló la activación de la conexión." #: ../cli/src/connections.c:828 #, c-format msgid "state: %s (%d)\n" -msgstr "" +msgstr "estado: %s (%d)\n" #: ../cli/src/connections.c:838 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "" +msgstr "Error: falló la activación de la conexión: %s." #: ../cli/src/connections.c:855 ../cli/src/devices.c:551 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "" +msgstr "Error: Expiró el tiempo de conexión de %d segs." #: ../cli/src/connections.c:898 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "" +msgstr "Error: falló la activación de la conexión: %s" #: ../cli/src/connections.c:912 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "" +msgstr "Error: falló la obtención de una conexión activa para «%s»." #: ../cli/src/connections.c:921 #, c-format msgid "Active connection state: %s\n" -msgstr "" +msgstr "Estado de la conexión activa: %s\n" #: ../cli/src/connections.c:922 #, c-format msgid "Active connection path: %s\n" -msgstr "" +msgstr "Ruta de la conexión activa: %s\n" #: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 #, c-format msgid "Error: Unknown connection: %s." -msgstr "" +msgstr "Error: conexión desconocida: %s." #: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "" +msgstr "Error: el valor «%s» no es válido para el tiempo de expiración." #: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "" +msgstr "Error: se debe especificar el «id» o «uuid»." #: ../cli/src/connections.c:1044 #, c-format msgid "Error: No suitable device found: %s." -msgstr "" +msgstr "Error: no se encontró un dispositivo apropiado: %s." #: ../cli/src/connections.c:1046 #, c-format msgid "Error: No suitable device found." -msgstr "" +msgstr "Error: no se encontró un dispositivo apropiado." #: ../cli/src/connections.c:1138 #, c-format msgid "Warning: Connection not active\n" -msgstr "" +msgstr "Aviso: la conexión no está activa\n" #: ../cli/src/connections.c:1189 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "" +msgstr "Error: el comando «con» «%s» no es válido." #: ../cli/src/connections.c:1216 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "" +msgstr "Error: no se pudo conectar con D-Bus." #: ../cli/src/connections.c:1223 #, c-format msgid "Error: Could not get system settings." -msgstr "" +msgstr "Error: no se pudo obtener la configuración del sistema." #: ../cli/src/connections.c:1231 #, c-format msgid "Error: Could not get user settings." -msgstr "" +msgstr "Error: no se pudo obtener la configuración del usuario." #: ../cli/src/connections.c:1241 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" +"Error: no se pueden obtener las conexiones: los servicios de configuración " +"no se están ejecutando." #: ../cli/src/devices.c:73 #, c-format @@ -352,106 +360,116 @@ msgid "" " wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" msgstr "" +"Uso: nmcli dev { COMANDO | help }\n" +"\n" +" COMANDO := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" #: ../cli/src/devices.c:93 msgid "unmanaged" -msgstr "" +msgstr "sin gestionar" #: ../cli/src/devices.c:95 msgid "unavailable" -msgstr "" +msgstr "no disponible" #: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 msgid "disconnected" -msgstr "" +msgstr "desconectado" #: ../cli/src/devices.c:99 msgid "connecting (prepare)" -msgstr "" +msgstr "conectando (preparación)" #: ../cli/src/devices.c:101 msgid "connecting (configuring)" -msgstr "" +msgstr "conectando (configuración)" #: ../cli/src/devices.c:103 msgid "connecting (need authentication)" -msgstr "" +msgstr "conectando (necesita autorización)" #: ../cli/src/devices.c:105 msgid "connecting (getting IP configuration)" -msgstr "" +msgstr "conectando (obteniendo configuración IP)" #: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 msgid "connected" -msgstr "" +msgstr "conectado" #: ../cli/src/devices.c:109 msgid "connection failed" -msgstr "" +msgstr "falló la conexión" #: ../cli/src/devices.c:132 ../cli/src/devices.c:876 msgid "Unknown" -msgstr "" +msgstr "Desconocido" #. print them #: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 #: ../cli/src/devices.c:879 msgid "(none)" -msgstr "" +msgstr "(nada)" #: ../cli/src/devices.c:209 #, c-format msgid "%s: error converting IP4 address 0x%X" -msgstr "" +msgstr "%s: error al convertir la dirección IP4 en 0x%X" #: ../cli/src/devices.c:238 #, c-format msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "" +msgstr "%s, %s, frecuencia %d MHz, tasa %d Mb/s, intensidad %d" #: ../cli/src/devices.c:239 msgid "Ad-Hoc" -msgstr "" +msgstr "Ad-Hoc" #: ../cli/src/devices.c:248 msgid ", Encrypted: " -msgstr "" +msgstr ", cifrado: " #: ../cli/src/devices.c:253 msgid " WEP" -msgstr "" +msgstr " WEP" #: ../cli/src/devices.c:255 msgid " WPA" -msgstr "" +msgstr " WPA" #: ../cli/src/devices.c:257 msgid " WPA2" -msgstr "" +msgstr " WPA2" #: ../cli/src/devices.c:260 msgid " Enterprise" -msgstr "" +msgstr " Enterprise" #: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 msgid "Device" -msgstr "" +msgstr "Dispositivo" #: ../cli/src/devices.c:299 msgid "Driver" -msgstr "" +msgstr "Controlador" #: ../cli/src/devices.c:299 ../cli/src/devices.c:567 msgid "(unknown)" -msgstr "" +msgstr "(desconocido)" #: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 msgid "State" -msgstr "" +msgstr "Estado" #: ../cli/src/devices.c:313 msgid "HW Address" -msgstr "" +msgstr "Dirección hardware" #: ../cli/src/devices.c:319 #, c-format @@ -459,19 +477,21 @@ msgid "" "\n" " Capabilities:\n" msgstr "" +"\n" +" Capacidades:\n" #: ../cli/src/devices.c:321 msgid "Carrier Detect" -msgstr "" +msgstr "Detector de portadora" #: ../cli/src/devices.c:336 #, c-format msgid "%u Mb/s" -msgstr "" +msgstr "%u Mb/s" #: ../cli/src/devices.c:337 msgid "Speed" -msgstr "" +msgstr "Velocidad" #: ../cli/src/devices.c:348 #, c-format @@ -479,26 +499,28 @@ msgid "" "\n" " Wireless Properties\n" msgstr "" +"\n" +" Propiedades de la conexión inalámbrica\n" #: ../cli/src/devices.c:353 msgid "WEP Encryption" -msgstr "" +msgstr "Cifrado WEP" #: ../cli/src/devices.c:355 msgid "WPA Encryption" -msgstr "" +msgstr "Cifrado WPA" #: ../cli/src/devices.c:357 msgid "WPA2 Encryption" -msgstr "" +msgstr "Cifrado WPA2" #: ../cli/src/devices.c:359 msgid "TKIP cipher" -msgstr "" +msgstr "Cifrado TKIP" #: ../cli/src/devices.c:361 msgid "CCMP cipher" -msgstr "" +msgstr "Cifrado CCMP" #: ../cli/src/devices.c:368 #, c-format @@ -506,10 +528,12 @@ msgid "" "\n" " Wireless Access Points %s\n" msgstr "" +"\n" +" Puntos de acceso inalámbricos %s\n" #: ../cli/src/devices.c:368 msgid "(* = current AP)" -msgstr "" +msgstr "(* = PA actual)" #: ../cli/src/devices.c:374 #, c-format @@ -517,18 +541,20 @@ msgid "" "\n" " Wired Properties\n" msgstr "" +"\n" +" Propiedades de la conexión cableada" #: ../cli/src/devices.c:377 ../cli/src/devices.c:379 msgid "Carrier" -msgstr "" +msgstr "Portadora" #: ../cli/src/devices.c:377 msgid "on" -msgstr "" +msgstr "encendido" #: ../cli/src/devices.c:379 msgid "off" -msgstr "" +msgstr "apagado" #: ../cli/src/devices.c:387 #, c-format @@ -536,151 +562,153 @@ msgid "" "\n" " IPv4 Settings:\n" msgstr "" +"\n" +" Ajustes de IPv4:\n" #: ../cli/src/devices.c:395 msgid "Address" -msgstr "" +msgstr "Dirección" #: ../cli/src/devices.c:401 msgid "Prefix" -msgstr "" +msgstr "Prefijo" #: ../cli/src/devices.c:405 msgid "Gateway" -msgstr "" +msgstr "Pasarela" #: ../cli/src/devices.c:416 msgid "DNS" -msgstr "" +msgstr "DNS" #: ../cli/src/devices.c:458 msgid "Status of devices" -msgstr "" +msgstr "Estado de los dispositivos" #: ../cli/src/devices.c:487 #, c-format msgid "Error: '%s' argument is missing." -msgstr "" +msgstr "Error: falta el argumento «%s»." #: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 #, c-format msgid "Error: Device '%s' not found." -msgstr "" +msgstr "Error: no se encontró el dispositivo «%s»" #: ../cli/src/devices.c:539 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "" +msgstr "Éxito: se desconectó correctamente el dispositivo «%s»." #: ../cli/src/devices.c:564 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "" +msgstr "Error: falló la desconexión del dispositivo «%s» (%s): %s" #: ../cli/src/devices.c:572 #, c-format msgid "Device state: %d (%s)\n" -msgstr "" +msgstr "Estado del dispositivo: %d (%s)\n" #: ../cli/src/devices.c:636 #, c-format msgid "Error: iface has to be specified." -msgstr "" +msgstr "Error: se debe especificar la interfaz." #: ../cli/src/devices.c:736 ../cli/src/devices.c:746 msgid "WiFi scan list" -msgstr "" +msgstr "Lista de la inspección inalámbrica" #: ../cli/src/devices.c:740 #, c-format msgid "Error: Device '%s' is not a WiFi device." -msgstr "" +msgstr "Error: el dispositivo «%s» no es un dispositivo inalámbrico." #: ../cli/src/devices.c:754 msgid "Device:" -msgstr "" +msgstr "Dispositivo:" #: ../cli/src/devices.c:806 #, c-format msgid "Error: hwaddr has to be specified." -msgstr "" +msgstr "Error: se debe especificar la dirección hardware." #: ../cli/src/devices.c:844 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "" +msgstr "Error: no se encontró el punto de acceso con dirección hardware «%s»." #: ../cli/src/devices.c:862 #, c-format msgid "%u MHz" -msgstr "" +msgstr "%u MHz" #: ../cli/src/devices.c:863 #, c-format msgid "%u MB/s" -msgstr "" +msgstr "%u MB/s" #: ../cli/src/devices.c:869 ../cli/src/devices.c:871 msgid "AP parameters" -msgstr "" +msgstr "Parámetros del PA" #: ../cli/src/devices.c:873 msgid "SSID:" -msgstr "" +msgstr "SSID:" #: ../cli/src/devices.c:874 msgid "BSSID:" -msgstr "" +msgstr "BSSID:" #: ../cli/src/devices.c:875 msgid "Frequency:" -msgstr "" +msgstr "Frecuencia:" #: ../cli/src/devices.c:876 msgid "Mode:" -msgstr "" +msgstr "Modo:" #: ../cli/src/devices.c:876 msgid "Ad-hoc" -msgstr "" +msgstr "Ad-hoc" #: ../cli/src/devices.c:876 msgid "Infrastructure" -msgstr "" +msgstr "Infraestructura" #: ../cli/src/devices.c:877 msgid "Maximal bitrate:" -msgstr "" +msgstr "Tasa de bits máxima:" #: ../cli/src/devices.c:878 msgid "Strength:" -msgstr "" +msgstr "Intensidad:" #: ../cli/src/devices.c:879 msgid "Flags:" -msgstr "" +msgstr "Opciones:" #: ../cli/src/devices.c:879 msgid "privacy" -msgstr "" +msgstr "privacidad" #: ../cli/src/devices.c:880 msgid "WPA flags:" -msgstr "" +msgstr "Opciones WPA:" #: ../cli/src/devices.c:881 msgid "RSN flags:" -msgstr "" +msgstr "Opciones RSN:" #: ../cli/src/devices.c:907 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "" +msgstr "Error: el comando «dev wifi» «%s» no es válido." #: ../cli/src/devices.c:943 #, c-format msgid "Error: 'dev' command '%s' is not valid." -msgstr "" +msgstr "Error: el comando «dev» «%s» no es válido." #: ../cli/src/network-manager.c:46 #, c-format @@ -696,79 +724,89 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" +"Uso: nmcli nm {COMANDO | help }\n" +"\n" +" COMANDO := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" #: ../cli/src/network-manager.c:67 msgid "asleep" -msgstr "" +msgstr "dormida" #: ../cli/src/network-manager.c:69 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 "" +msgstr "activado" #: ../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 "" +msgstr "desactivado" #: ../cli/src/network-manager.c:102 msgid "NetworkManager status" -msgstr "" +msgstr "Estado de NetworkManager" #: ../cli/src/network-manager.c:104 msgid "NM running:" -msgstr "" +msgstr "NM en ejecución:" #: ../cli/src/network-manager.c:104 msgid "running" -msgstr "" +msgstr "en ejecución" #: ../cli/src/network-manager.c:104 msgid "not running" -msgstr "" +msgstr "no está en ejecución" #: ../cli/src/network-manager.c:105 msgid "NM state:" -msgstr "" +msgstr "Estado de NM:" #: ../cli/src/network-manager.c:106 msgid "NM wireless hardware:" -msgstr "" +msgstr "Hardware inalámbrico de NM:" #. no argument, show current state #: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 msgid "NM wireless:" -msgstr "" +msgstr "Inalámbrico de NM:" #: ../cli/src/network-manager.c:108 msgid "NM WWAN hardware:" -msgstr "" +msgstr "Hardware WWAN de NM:" #. no argument, show current state #: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 msgid "NM WWAN:" -msgstr "" +msgstr "WWAN de NM:" #: ../cli/src/network-manager.c:150 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "" +msgstr "Error: parámetro «wifi» no válido: «%s»." #: ../cli/src/network-manager.c:167 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "" +msgstr "Error: parámetro «wwan» no válido: «%s»." #: ../cli/src/network-manager.c:178 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "" +msgstr "Error: el comando «nm» «%s» no es válido." #: ../cli/src/nmcli.c:65 #, c-format @@ -787,35 +825,48 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" +"Uso: %s [OPCIONES] OBJETO { COMANDO | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] salida breve\n" +" -p[retty] salida bonita\n" +" -v[ersion] mostrar la versión del programa\n" +" -h[elp] mostrar esta ayuda\n" +"\n" +"OBJECT\n" +" nm estado de NetworkManager\n" +" con conexiones de NetworkManager\n" +" dev dispositivos gestionados por NetworkManager\n" +"\n" #: ../cli/src/nmcli.c:106 #, c-format msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "" +msgstr "Se desconoce el objeto «%s», intente «nmcli help»." #: ../cli/src/nmcli.c:139 #, c-format msgid "nmcli tool, version %s\n" -msgstr "" +msgstr "herramienta nmcli, versión %s\n" #: ../cli/src/nmcli.c:145 #, c-format msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "" +msgstr "Se desconoce la opción «%s», intente «nmcli -help»." #: ../cli/src/nmcli.c:164 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "" +msgstr "Se capturó la señal %d, apagando..." #: ../cli/src/nmcli.c:189 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "" +msgstr "Error: no se pudo conectar con NetworkManager." #: ../cli/src/nmcli.c:205 msgid "Success" -msgstr "" +msgstr "Éxito" #: ../libnm-util/crypto.c:120 #, c-format @@ -937,7 +988,7 @@ msgstr "Falló al inicializar el motor MD5: %s / %s." #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "" +msgstr "Longitud IV no válida (debe ser al menos %zd)." #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format @@ -966,7 +1017,6 @@ msgstr "Falló al descifrar la clave privada: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key: unexpected padding length." msgstr "Falló al descifrar la clave privada: longitud inesperada del relleno." @@ -982,25 +1032,21 @@ msgstr "No se pudo reservar memoria para el cifrado." #: ../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 "Falló al inicializar el contexto de cifrado: %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 "Falló al establecer la clave simétrica para el cifrado: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "Falló al establecer IV para el cifrado: %s / %s." #: ../libnm-util/crypto_gnutls.c:322 #, c-format -#| msgid "Failed to decrypt the private key: %s / %s." msgid "Failed to encrypt the data: %s / %s." msgstr "Falló al cifrar los datos: %s / %s." @@ -1042,7 +1088,7 @@ msgstr "Falló al inicializar el contexto MD5: %d" #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "" +msgstr "Longitud de IV no válida (debe ser al menos %d)." #: ../libnm-util/crypto_nss.c:196 #, c-format @@ -1071,7 +1117,6 @@ msgstr "Falló al descifrar la clave privada: %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 "" "Falló al descifrar la clave privada: los datos descifrados son demasiado " @@ -1084,38 +1129,33 @@ msgstr "Falló la finalización del descifrado de la clave privada: %d." #: ../libnm-util/crypto_nss.c:364 #, c-format -#| msgid "Failed to initialize the decryption cipher slot." msgid "Failed to initialize the encryption cipher slot." msgstr "Falló al inicializar la ranura de cifrado." #: ../libnm-util/crypto_nss.c:372 #, c-format -#| msgid "Failed to set symmetric key for decryption." msgid "Failed to set symmetric key for encryption." msgstr "Falló al establecer la clave simétrica para el cifrado." #: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "Falló al establecer IV para el cifrado." #: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "Falló al inicializar el contexto de cifrado." #: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "Falló al cifrar: %d." #: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." -msgstr "" +msgstr "Cantidad de datos inesperada después de cifrar." #: ../libnm-util/crypto_nss.c:447 #, c-format @@ -1143,34 +1183,31 @@ msgid "Couldn't verify PKCS#12 file: %d" msgstr "No se pudo verificar el archivo PKCS#12: %d" #: ../libnm-util/crypto_nss.c:557 -#| msgid "Could not decode private key." msgid "Could not generate random data." msgstr "No se pudo generar datos aleatorios." -#: ../libnm-util/nm-utils.c:1545 +#: ../libnm-util/nm-utils.c:1802 #, c-format -#| msgid "Not enough memory to create private key decryption key." 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:1655 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:1912 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:1667 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Could not allocate memory for writing IV to PEM file." -msgstr "" +msgstr "No se pudo asignar memoria para escribir IV en el archivo PEM." -#: ../libnm-util/nm-utils.c:1679 +#: ../libnm-util/nm-utils.c:1936 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" +"No se pudo asignar memoria para escribir la clave cifrada en el archivo PEM." -#: ../libnm-util/nm-utils.c:1698 +#: ../libnm-util/nm-utils.c:1955 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." @@ -1217,17 +1254,17 @@ msgstr "ha ocurrido un error mientras esperaban datos en un socket" msgid "error updating link cache: %s" msgstr "error al actualizar el enlace caché: %s" -#: ../src/NetworkManager.c:494 +#: ../src/main.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +#: ../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:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1236,21 +1273,35 @@ msgstr "" "# Mezclado de %s\n" "\n" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "no se encontró ningún cliente de DHCP usable." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "no se pudo encontrar «dhclient»." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "no se pudo encontrar «dhcpd»." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "no se soporta el cliente de DHCP «%s»" + #: ../src/ip6-manager/nm-netlink-listener.c:200 #, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" msgid "unable to allocate netlink handle: %s" msgstr "no se puede asignar el manejador netlink: %s" #: ../src/ip6-manager/nm-netlink-listener.c:210 #, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" msgid "unable to connect to netlink: %s" msgstr "no se puede conectar con netlink: %s" #: ../src/ip6-manager/nm-netlink-listener.c:307 #, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" msgid "unable to join netlink group: %s" msgstr "no pudo unirse al grupo netlink: %s" @@ -1275,32 +1326,39 @@ msgstr "Sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" -msgstr "" +msgstr "Compartir la conexión a través de una red inalámbrica protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 msgid "Connection sharing via an open WiFi network" -msgstr "" +msgstr "Compartir la conexión a través de una red inalámbrica abierta" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 msgid "Modify persistent system hostname" -msgstr "" +msgstr "Modificar el nombre de equipo persistente del sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" -msgstr "" +msgstr "Modificar las conexiones del sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" msgstr "" +"La política del sistema impide modificaciones de los ajustes del sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" msgstr "" +"La política del sistema impide la modificaciones del nombre de equipo " +"persistente del sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" +"La política del sistema impide compartir conexiones a través de una red " +"inalámbrica protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" +"La política del sistema impide compartir conexiones a través de una red " +"inalámbrica abierta" From 84f69ad65a1b0c26eb5ee5e0c0d7b19155b8ba19 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 2 Apr 2010 10:34:11 -0700 Subject: [PATCH 144/392] po: fix Spanish translation Missing \n on one item. --- po/es.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/es.po b/po/es.po index 0b0ed64691..9e0a29ca44 100644 --- a/po/es.po +++ b/po/es.po @@ -542,7 +542,7 @@ msgid "" " Wired Properties\n" msgstr "" "\n" -" Propiedades de la conexión cableada" +" Propiedades de la conexión cableada\n" #: ../cli/src/devices.c:377 ../cli/src/devices.c:379 msgid "Carrier" From d4c5930c0f46f66eee3da370009e6b8d6d77da08 Mon Sep 17 00:00:00 2001 From: Amanpreet Singh Alam Date: Sun, 4 Apr 2010 09:23:49 -0700 Subject: [PATCH 145/392] po: updated Punjabi translation (bgo #614718) --- po/pa.po | 1573 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 1415 insertions(+), 158 deletions(-) diff --git a/po/pa.po b/po/pa.po index 859ec9f758..052406ebb4 100644 --- a/po/pa.po +++ b/po/pa.po @@ -4,221 +4,1478 @@ # # Amanpreet Singh Alam , 2004. # Amanpreet Singh Alam , 2005. -# A S Alam , 2007. +# A S Alam , 2007, 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-02-03 18:35+0000\n" -"PO-Revision-Date: 2007-02-04 08:37+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-03-24 03:26+0000\n" +"PO-Revision-Date: 2010-04-03 14:08+0530\n" "Last-Translator: A S Alam \n" -"Language-Team: Punjabi \n" +"Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" +"X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:417 -msgid "Cannot add VPN connection" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਜੋੜਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ ਹੈ" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:419 -msgid "" -"No suitable VPN software was found on your system. Contact your system " -"administrator." -msgstr "" -"ਤੁਹਾਡੇ ਸਿਸਟਮ ਉੱਤੇ ਕੋਈ ਠੀਕ VPN ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਾ ਹੈ। ਆਪਣੇ ਸਿਸਟਮ " -"ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:461 -msgid "Cannot import VPN connection" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਆਯਾਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#: ../cli/src/connections.c:86 #, c-format msgid "" -"Cannot find suitable software for VPN connection type '%s' to import the " -"file '%s'. Contact your system administrator." +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" msgstr "" -"VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ ਫਾਇਲ '%s' ਆਯਾਤ ਕਰਨ ਲਈ ਕੋਈ ਢੁੱਕਵਾਂ " -"ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਿਆ ਹੈ। ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" +"ਵਰਤੋਂ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#: ../cli/src/connections.c:158 +#| msgid "VPN Connections" +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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "ਨਾਂ" + +#: ../cli/src/connections.c:163 #, c-format -msgid "Error retrieving VPN connection '%s'" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ '%s' ਲੈਣ ਦੌਰਾਨ ਗਲਤੀ" +#| msgid "VPN Connections" +msgid "System connections:\n" +msgstr "ਸਿਸਟਮ ਕੁਨੈਕਸ਼ਨ:\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#: ../cli/src/connections.c:167 #, c-format -msgid "" -"Could not find the UI files for VPN connection type '%s'. Contact your " -"system administrator." -msgstr "" -"VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ UI ਫਾਇਲਾਂ ਨਹੀਂ ਲੱਭੀਆਂ ਹਨ। ਆਪਣੇ ਸਿਸਟਮ " -"ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" +#| msgid "VPN Connections" +msgid "User connections:\n" +msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ:\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 #, c-format -msgid "Delete VPN connection \"%s\"?" -msgstr "ਕੀ VPN \"%s\" ਕੁਨੈਕਸ਼ਨ ਹਟਾਉਣਾ ਹੈ?" +msgid "Error: %s argument is missing." +msgstr "ਗਲਤੀ: %s ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" -#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#: ../cli/src/connections.c:189 #, c-format -msgid "" -"All information about the VPN connection \"%s\" will be lost and you may " -"need your system administrator to provide information to create a new " -"connection." -msgstr "" -"VPN ਕੁਨੈਕਸ਼ਨ \"%s\" ਬਾਰੇ ਸਭ ਜਾਣਕਾਰੀ ਖਤਮ ਹੋ ਗਈ ਹੈ ਅਤੇ ਤੁਹਾਨੂੰ " -"ਨਵੇਂ ਕੁਨੈਕਸ਼ਨ ਬਣਾਉਣ ਲਈ ਜਾਣਕਾਰੀ ਵਾਸਤੇ ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ " -"ਨਾਲ ਸੰਪਰਕ ਕਰਨਾ ਪਵੇਗਾ।" +msgid "Error: %s - no such connection." +msgstr "ਗਲਤੀ: %s - ਇੰਝ ਦਾ ਕੋਈ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../gnome/vpn-properties/nm-vpn-properties.c:924 -msgid "Unable to load" -msgstr "ਲੋਡ ਕਰਨ ਲਈ ਫੇਲ੍ਹ" +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "ਸਿਸਟਮ-ਲਈ ਕੁਨੈਕਸ਼ਨ" -#: ../gnome/vpn-properties/nm-vpn-properties.c:926 -msgid "Cannot find some needed resources (the glade file)!" -msgstr "ਕੁਝ ਲੋੜੀਦੇ ਸਰੋਤ ਨਹੀਂ ਮਿਲੇ (ਗਲੇਡ ਫਾਇਲ)!" +#: ../cli/src/connections.c:205 +#| msgid "VPN Connections" +msgid "User connections" +msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ" -#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), -#. NULL, -#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -#. GTK_STOCK_CANCEL, -#. GTK_RESPONSE_REJECT, -#. GTK_STOCK_APPLY, -#. GTK_RESPONSE_ACCEPT, -#. NULL)); -#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 -msgid "Create VPN Connection" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਬਣਾਓ" +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ਅਣਜਾਣ ਪੈਰਾਮੀਟਰ: %s\n" -#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); -#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); -#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); -#. make the druid window modal wrt. our main window -#. gtk_window_set_modal (druid_window, TRUE); -#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); -#. Edit dialog -#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 -msgid "Edit VPN Connection" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਸੋਧ" +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਪੈਰਾਮੀਟਰ ਨਹੀਂ ਦਿੱਤਾ।" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 -msgid "Add a new VPN connection" -msgstr "ਇੱਕ ਨਵਾਂ VPN ਕੁਨੈਕਸ਼ਨ ਸ਼ਾਮਿਲ" +#. 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 "ਹਾਂ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 -msgid "Delete the selected VPN connection" -msgstr "ਚੁਣਿਆ VPN ਕੁਨੈਕਸ਼ਨ ਹਟਾਓ" +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +#| msgid "none" +msgid "no" +msgstr "ਨਹੀਂ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 -msgid "E_xport" -msgstr "ਨਿਰਯਾਤ(_x)" +#: ../cli/src/connections.c:297 +#| msgid "VPN Connections" +msgid "Active connections" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 -msgid "Edit the selected VPN connection" -msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ 'ਚ ਸੋਧ" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "ਡਿਫਾਲਟ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 -msgid "Export the VPN settings to a file" -msgstr "VPN ਸੈਟਿੰਗ ਨੂੰ ਫਾਇਲ 'ਚ ਭੇਜੋ" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "ਸਰਵਿਸ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 -msgid "Export the selected VPN connection to a file" -msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ ਫਾਇਲ 'ਚ ਭੇਜੋ" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "ਜੰਤਰ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 -msgid "Manage Virtual Private Network Connections" -msgstr "ਵੁਰਚੁਅਲ ਪ੍ਰਾਈਵੇਟ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ ਪਰਬੰਧ" +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ਜੰਤਰ '%s' ਉੱਤੇ ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 -msgid "VPN Connections" -msgstr "VPN ਕੁਨੈਕਸ਼ਨ" +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਜਾਂ ਜੰਤਰ ਨਹੀਂ ਹੈ" -#: ../src/nm-ap-security-wep.c:52 -msgid "40-bit WEP" -msgstr "40-ਬਿੱਟ WEP" +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "ਚਾਲੂ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../src/nm-ap-security-wep.c:54 -msgid "104-bit WEP" -msgstr "104-ਬਿੱਟ WEP" +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "ਚਾਲੂ ਕੀਤਾ" -#: ../src/nm-ap-security-wpa-psk.c:51 -msgid "WPA TKIP" -msgstr "WPA TKIP" +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "ਅਣਜਾਣ" -#: ../src/nm-ap-security-wpa-psk.c:53 -msgid "WPA CCMP" -msgstr "WPA CCMP" +#: ../cli/src/connections.c:744 +#| msgid "VPN Connections" +msgid "VPN connecting (prepare)" +msgstr "VPN ਕੁਨੈਕਸ਼ਨ (ਤਿਆਰੀ)" -#: ../src/nm-ap-security-wpa-psk.c:55 -msgid "WPA Automatic" -msgstr "WPA ਆਟੋਮੈਟਿਕ" +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ)" -#: ../src/nm-ap-security-wpa-psk.c:60 -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" +#: ../cli/src/connections.c:748 +#| msgid "VPN Connections" +msgid "VPN connecting" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../src/nm-ap-security-wpa-psk.c:62 -msgid "WPA2 CCMP" -msgstr "WPA2 CCMP" +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../src/nm-ap-security-wpa-psk.c:64 -msgid "WPA2 Automatic" -msgstr "WPA2 ਆਟੋਮੈਟਿਕ" +#: ../cli/src/connections.c:752 +#| msgid "VPN Connections" +msgid "VPN connected" +msgstr "VPN ਕੁਨੈਕਟ ਹੈ" -#: ../src/nm-ap-security.c:334 +#: ../cli/src/connections.c:754 +#| msgid "VPN Connections" +msgid "VPN connection failed" +msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੋਇਆ" + +#: ../cli/src/connections.c:756 +#| msgid "VPN Connections" +msgid "VPN disconnected" +msgstr "VPN ਡਿਸ-ਕੁਨੈਕਟ" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "ਅਣਜਾਣ ਕਾਰਨ" + +#: ../cli/src/connections.c:769 msgid "none" msgstr "ਕੋਈ ਨਹੀਂ" -#: ../src/nm-netlink-monitor.c:174 +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "ਯੂਜ਼ਰ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "ਬੇਸ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ 'ਚ ਰੁਕਾਵਟ" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ਸਰਵਿਸ ਅਚਾਨਕ ਰੁਕ ਗਈ" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ਸਰਵਿਸ ਨੇ ਅਢੁੱਕਵੀਂ ਸੰਰਚਨਾ ਵਾਪਸ ਕੀਤੀ" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "ਕੁਨੈਕਸ਼ਨ ਕੋਸ਼ਿਸ਼ ਦੌਰਾਨ ਸਮਾਂ ਸਮਾਪਤ ਹੋ ਗਿਆ" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN ਸਰਵਿਸ ਸਮੇਂ 'ਚ ਸ਼ੁਰੂ ਨਹੀਂ ਹੋਈ" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN ਸਰਵਿਸ ਸ਼ੁਰੂ ਹੋਣ ਲਈ ਫੇਲ੍ਹ ਹੋਈ" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "ਕੋਈ ਢੁੱਕਵਾਂ VPN ਭੇਦ ਨਹੀਂ" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "ਅਢੁੱਕਵਾਂ VPN ਭੇਦ" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "ਕੁਨੈਕਸ਼ਨ ਹਟਾਇਆ ਗਿਆ" + +#: ../cli/src/connections.c:803 #, c-format -msgid "unable to create netlink socket for monitoring wired ethernet devices - %s" -msgstr "" -"ਤਾਰ ਵਾਲੇ ਇਥਰਨੈੱਟ ਜੰਤਰ - %s ਦੀ ਨਿਗਰਾਨੀ ਲਈ netlink ਸਾਕਟ ਬਣਾਉਣ " -"ਲਈ ਅਸਫ਼ਲ" +msgid "state: %s\n" +msgstr "ਹਾਲਤ: %s\n" -#: ../src/nm-netlink-monitor.c:192 +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 #, c-format -msgid "unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgid "Connection activated\n" +msgstr "ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕੀਤਾ\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ਗਲਤ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ਹਾਲਤ: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s।" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ %d ਸਕਿੰਟ ਖਤਮ ਹੋਏ।" + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s" + +#: ../cli/src/connections.c:912 +#, c-format +#| msgid "Error retrieving VPN connection '%s'" +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ਗਲਤੀ: '%s' ਲਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਹਾਲਤ: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਪਾਥ: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +#| msgid "Error retrieving VPN connection '%s'" +msgid "Error: Unknown connection: %s." +msgstr "ਗਲਤੀ: ਅਣਜਾਣ ਕੁਨੈਕਸ਼ਨ: %s।" + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ ਮੁੱਲ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ਗਲਤੀ: id ਜਾਂ uuid ਨਹੀਂ ਦਿੱਤਾ।" + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ: %s।" + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਮਿਲਿਆ।" + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ਚੇਤਾਵਨੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਨਹੀਂ ਹੈ\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'con' ਕਮਾਂਡ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ।" + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ਗਲਤੀ: ਸਿਸਟਮ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ਗਲਤੀ: ਯੂਜ਼ਰ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਲਿਆ ਜਾ ਸਕਦਾ: ਸਿਸਟਮ ਸਰਵਿਸ ਨਹੀਂ ਚੱਲ ਰਹੀ ਹੈ।" + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" msgstr "" -"ਤਾਰ ਵਾਲੇ ਇਥਰਨੈੱਟ ਜੰਤਰ - %s ਦੀ ਨਿਗਰਾਨੀ ਲਈ netlink ਸਾਕਟ ਜੋੜਨ " -"ਲਈ ਅਸਫ਼ਲ" +"ਵਰਤੋਂ: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" -#: ../src/nm-netlink-monitor.c:427 -msgid "operation took too long" -msgstr "ਓਪਰੇਸ਼ਨ ਨੂੰ ਬਹੁਤ ਸਮਾਂ ਲੱਗ ਗਿਆ" +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "ਬਿਨ-ਪਰਬੰਧ" -#: ../src/nm-netlink-monitor.c:524 -msgid "received data from wrong type of sender" -msgstr "ਭੇਜਣ ਵਾਲੇ ਦੀ ਗਲਤ ਕਿਸਮ ਤੋਂ ਡਾਟਾ ਮਿਲਿਆ" +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "ਅਣ-ਉਪਲੱਬਧ" -#: ../src/nm-netlink-monitor.c:537 -msgid "received data from unexpected sender" -msgstr "ਅਣਜਾਣ ਭੇਜਣ ਵਾਲੇ ਵਲੋਂ ਡਾਟਾ ਮਿਲਿਆ" +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਕੀਤਾ" -#: ../src/nm-netlink-monitor.c:666 -msgid "too much data was sent over socket and some of it was lost" -msgstr "ਸਾਕਟ ਉੱਤੇ ਬਹੁਤ ਵੱਧ ਡਾਟਾ ਭੇਜਿਆ ਗਿਆ ਅਤੇ ਇਸ 'ਚੋਂ ਕੁਝ ਗੁੰਮ ਹੋ ਗਿਆ" +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਤਿਆਰੀ)" -#: ../src/nm-netlink-monitor.c:774 +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਸੰਰਚਨਾ ਜਾਰੀ)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "ਕੁਨੈਕਟ ਹੋਇਆ" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੈ" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "ਅਣਜਾਣ" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +#| msgid "none" +msgid "(none)" +msgstr "(ਕੋਈ ਨਹੀਂ)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ਐਡਰੈੱਸ 0x%X ਬਦਲਣ ਦੌਰਾਨ ਗਲਤੀ" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, ਫਰੀਕਿਊਂਸੀ %d MHz, ਦਰ %d Mb/s, ਤਾਕਤ %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +#| msgid "WPA Enterprise" +msgid " Enterprise" +msgstr " ਇੰਟਰਪਰਾਈਸ" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "ਜੰਤਰ" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ਡਰਾਇਵਰ" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(ਅਣਜਾਣ)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "ਹਾਲਤ" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW ਐਡਰੈੱਸ" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" ਸਮਰੱਥਾ:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "ਕੈਰੀਅਰ ਖੋਜ" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "ਸਪੀਡ" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" ਬੇਤਾਰ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#: ../cli/src/devices.c:355 +#| msgid "WPA Enterprise" +msgid "WPA Encryption" +msgstr "WPA ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#: ../cli/src/devices.c:357 +#| msgid "WPA2 Enterprise" +msgid "WPA2 Encryption" +msgstr "WPA2 ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP ਸਿਫਰ" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP ਸੀਫਰ" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" ਬੇਤਾਰ ਅਸੈੱਸ ਪੁਆਇੰਟ %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = ਮੌਜੂਦਾ AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" ਤਾਰ ਨਾਲ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "ਕੈਰੀਅਰ" + +#: ../cli/src/devices.c:377 +#| msgid "none" +msgid "on" +msgstr "ਚਾਲੂ" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "ਬੰਦ" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 ਵਿਸ਼ੇਸ਼ਤਾ:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "ਜੰਤਰਾਂ ਦੀ ਹਾਲਤ" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ਗਲਤੀ: '%s' ਆਰਗੂਮੈਂਟ ਗੁੰਮ ਹੈ।" + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ਸਫ਼ਲ: ਜੰਤਰ '%s' ਠੀਕ ਤਰ੍ਹਾਂ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ।" + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' (%s) ਡਿਸ-ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ਜੰਤਰ ਹਾਲਤ: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "ਵਾਈਫਾਈ ਸਕੈਨ ਲਿਸਟ" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਵਾਈ-ਫਾਈ ਜੰਤਰ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "ਜੰਤਰ:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "ਗਲਤੀ: hwaddr ਦੇਣ ਦੀ ਲੋੜ ਹੈ।" + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ਗਲਤੀ: hwaddr '%s' ਵਾਲਾ ਅਸੈੱਸ ਪੁਆਇੰਟ ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP ਪੈਰਾਮੀਟਰ" + +#: ../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 "ਫਰੀਕਿਊਨਸੀ:" + +#: ../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 "ਤਾਕਤ:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "ਫਲੈਗ:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "ਪਰਾਈਵੇਸੀ" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA ਫਲੈਗ:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN ਫਲੈਗ:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'dev wifi' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'dev' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ਵਰਤੋਂ: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:69 +#| msgid "VPN Connections" +msgid "connecting" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਹਾਲਤ" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM ਚੱਲ ਰਿਹਾ ਹੈ:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "ਨਹੀਂ ਚੱਲ ਰਿਹਾ ਹੈ" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM ਹਾਲਤ:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM ਬੇਤਾਰ ਹਾਰਡਵੇਅਰ:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM ਬੇਤਾਰ:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN ਹਾਰਡਵੇਅਰ:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wifi' ਪੈਰਾਮੀਟਰ: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wwan' ਪੈਰਾਮੀਟਰ: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'nm' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ਵਰਤੋਂ: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "ਆਬਜੈਕਟ '%s' ਅਣਜਾਣ ਹੈ, 'nmcli help' ਵਰਤ ਕੇ ਵੇਖੋ।" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ਟੂਲ, ਵਰਜਨ %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "ਚੋਣ '%s' ਅਣਜਾਣੀ ਹੈ 'nmcli -help' ਵਰਤ ਕੇ ਵੇਖੋ।" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d ਸਿਗਨਲ ਮਿਲਿਆ, ਬੰਦ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ਗਲਤੀ: ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "ਸਫ਼ਲ" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM ਕੁੰਜੀ ਫਾਇਲ ਵਿੱਚ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਫਾਇਲ ਵਾਂਗ ਨਹੀਂ ਜਾਪਦੀ।" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ਫਾਇਲ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: Proc-Type ਪਹਿਲਾਂ ਟੈਗ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: ਅਣਜਾਣ Proc-Type ਟੈਗ '%s' ਹੈ।" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਦੂਜਾ ਟੈਗ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਟੈਗ ਵਿੱਚ ਕੋਈ IV ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr " ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਟੈਗ ਵਿੱਚ ਗਲਤ ਫਾਰਮੈਟ IV" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: ਅਣਜਾਣ ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸੀਫਰ '%s'।" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM ਸਰਟੀਫਿਕੇਟ '%s' ਵਿੱਚ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "ਸਰਟੀਫਿਕੇਟ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ਫਾਇਲ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ਲਈ ਲੰਬਾਈ ਜਿਸਤ ਅੰਕ ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ।" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ਵਿੱਚ ਗ਼ੈਰ-ਹੈਕਸਾਡੈਸੀਮਲ ਅੰਕ ਹਨ।" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸੀਫ਼ਰ '%s' ਅਣਜਾਣ ਹੈ।" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡੀਕੋਡ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਕਿਸਮ ਜਾਣਨ ਲਈ ਅਸਮਰੱਥ ਹੈ।" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ਡਿਕ੍ਰਿਪਟ ਕੀਤੀ ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ਕ੍ਰਿਪਟੂ ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ਅਢੁੱਕਵੀਂ IV ਲੰਬਾਈ (ਘੱਟੋ-ਘੱਟ %zd ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ਡੀਕ੍ਰਿਪਟ ਕੀਤੇ ਕੁੰਜੀ ਬਫ਼ਰ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਸੀਫਰ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "%s / %s : ਡਿਕ੍ਰਿਪਟ ਲਈ IV ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: ਅਣਜਾਣ ਪੈਡਿੰਗ ਲੰਬਾਈ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਸੀਫ਼ਰ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ IV ਸੈੱਟ ਕਰਨ ਵਾਸਤੇ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ਡਾਟਾ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡਾਟਾ ਸ਼ੁਰੂ 'ਚ ਗਲਤੀ: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ਡੀਕੋਡਰ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ਫਾਇਲ ਡੀਕੋਡ ਨਹੀਂ ਜਾ ਸਕੀ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ਕ੍ਰਿਪਟੂ ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ਅਢੁੱਕਵੀਂ IV ਲੰਬਾਈ (ਘੱਟੋ-ਘੱਟ %d ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ)।" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਸੀਫਰ ਸਲਾਟ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ਡਿਕ੍ਰਿਪਟ ਲਈ IV ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: " + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: ਡਿਕ੍ਰਿਪਟ ਡਾਟਾ ਬਹੁਤ ਵੱਡਾ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜ ਲਈ ਡੀਕ੍ਰਿਪਸ਼ਨ ਮੁਕੰਮਲ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ: %d।" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "ਕ੍ਰਿਪਸ਼ਨ ਸੀਫ਼ਰ ਸਲਾਟ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ IV ਸੈੱਟ ਕਰਨ ਵਾਸਤੇ ਫੇਲ੍ਹ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਦੇ ਬਾਅਦ ਅਚਾਨਕ ਅਣਜਾਣ ਮਾਤਰਾ 'ਚ ਡਾਟਾ।" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "ਪਾਸਵਰਡ ਨੂੰ UCS2 'ਚ ਬਦਲਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ਡੀਕੋਡਰ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ਰਲਵਾਂ ਡਾਟਾ ਤਿਆਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../libnm-util/nm-utils.c:1802 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਕੁੰਜੀ ਬਣਾਉਣ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/nm-utils.c:1912 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ਫਾਇਲ ਬਣਾਉਣ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:1924 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ IV ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:1936 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ ਇੰਕ੍ਰਿਪਟ ਕੀਤੀ ਕੁੰਜੀ ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:1955 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ਫਾਇਲ ਡਾਟੇ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "ਨੈੱਟਲਿੰਕ ਸੁਨੇਹੇ ਉੱਤੇ ਕਾਰਵਾਈ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਨਾਲ ਕੁਨੈਕਟ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਲਿੰਕ ਕੈਸ਼ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %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 "ਸਾਕਟ ਉੱਤੇ ਡਾਟੇ ਦੀ ਉਡੀਕ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ" -#: ../src/nm-ap-security-wpa-eap.c:93 ../src/nm-ap-security-wpa-eap.c:117 -msgid "WPA2 Enterprise" -msgstr "WPA2 ਇੰਟਰਪਰਾਈਸ" +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "ਲਿੰਕ ਕੈਸ਼ ਅੱਪਡੇਟ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" -#: ../src/nm-ap-security-wpa-eap.c:95 ../src/nm-ap-security-wpa-eap.c:122 -msgid "WPA Enterprise" -msgstr "WPA ਇੰਟਰਪਰਾਈਸ" +#: ../src/main.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "ਗਲਤ ਚੋਣ। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" -#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 -msgid "LEAP" -msgstr "LEAP" +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +msgid "# Created by NetworkManager\n" +msgstr "#ਨੈੱਟਵਰਕ ਮੈਨੇਜਰ ਵਲੋਂ ਬਣਾਈ\n" +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"#%s ਤੋਂ ਮਿਲਾਇਆ\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ਕੋਈ ਵਰਤੋਂਯੋਗ DHCP ਕਲਾਇਟ ਨਹੀਂ ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ਗੈਰਸਹਾਇਕ DHCP ਕਲਾਇਟ '%s'" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "netlink ਹੈੱਡਲ ਦੇਣ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "netlink ਨਾਲ ਕੁਨੈਕਟ ਹੋਣ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਣਸਮਰੱਥ:: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ਆਟੋ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "ਸਿਸਟਮ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ਸਿਸਟਮ ਕੁਨੈਸ਼ਨ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਸੈਟਿੰਗ ਲਈ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਲਈ ਸੋਧਾਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ " +"ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਜੋੜਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ ਹੈ" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "ਤੁਹਾਡੇ ਸਿਸਟਮ ਉੱਤੇ ਕੋਈ ਠੀਕ VPN ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਾ ਹੈ। ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "Cannot import VPN connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਆਯਾਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ ਫਾਇਲ '%s' ਆਯਾਤ ਕਰਨ ਲਈ ਕੋਈ ਢੁੱਕਵਾਂ ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਿਆ ਹੈ। " +#~ "ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ UI ਫਾਇਲਾਂ ਨਹੀਂ ਲੱਭੀਆਂ ਹਨ। ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "ਕੀ VPN \"%s\" ਕੁਨੈਕਸ਼ਨ ਹਟਾਉਣਾ ਹੈ?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ \"%s\" ਬਾਰੇ ਸਭ ਜਾਣਕਾਰੀ ਖਤਮ ਹੋ ਗਈ ਹੈ ਅਤੇ ਤੁਹਾਨੂੰ ਨਵੇਂ ਕੁਨੈਕਸ਼ਨ ਬਣਾਉਣ ਲਈ " +#~ "ਜਾਣਕਾਰੀ ਵਾਸਤੇ ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰਨਾ ਪਵੇਗਾ।" + +#~ msgid "Unable to load" +#~ msgstr "ਲੋਡ ਕਰਨ ਲਈ ਫੇਲ੍ਹ" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "ਕੁਝ ਲੋੜੀਦੇ ਸਰੋਤ ਨਹੀਂ ਮਿਲੇ (ਗਲੇਡ ਫਾਇਲ)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਬਣਾਓ" + +#~ msgid "Edit VPN Connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਸੋਧ" + +#~ msgid "Add a new VPN connection" +#~ msgstr "ਇੱਕ ਨਵਾਂ VPN ਕੁਨੈਕਸ਼ਨ ਸ਼ਾਮਿਲ" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "ਚੁਣਿਆ VPN ਕੁਨੈਕਸ਼ਨ ਹਟਾਓ" + +#~ msgid "E_xport" +#~ msgstr "ਨਿਰਯਾਤ(_x)" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ 'ਚ ਸੋਧ" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "VPN ਸੈਟਿੰਗ ਨੂੰ ਫਾਇਲ 'ਚ ਭੇਜੋ" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ ਫਾਇਲ 'ਚ ਭੇਜੋ" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "ਵੁਰਚੁਅਲ ਪ੍ਰਾਈਵੇਟ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ ਪਰਬੰਧ" + +#~ msgid "40-bit WEP" +#~ msgstr "40-ਬਿੱਟ WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-ਬਿੱਟ WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA ਆਟੋਮੈਟਿਕ" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA2 ਆਟੋਮੈਟਿਕ" + +#~ msgid "operation took too long" +#~ msgstr "ਓਪਰੇਸ਼ਨ ਨੂੰ ਬਹੁਤ ਸਮਾਂ ਲੱਗ ਗਿਆ" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "ਭੇਜਣ ਵਾਲੇ ਦੀ ਗਲਤ ਕਿਸਮ ਤੋਂ ਡਾਟਾ ਮਿਲਿਆ" + +#~ msgid "received data from unexpected sender" +#~ msgstr "ਅਣਜਾਣ ਭੇਜਣ ਵਾਲੇ ਵਲੋਂ ਡਾਟਾ ਮਿਲਿਆ" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "ਸਾਕਟ ਉੱਤੇ ਬਹੁਤ ਵੱਧ ਡਾਟਾ ਭੇਜਿਆ ਗਿਆ ਅਤੇ ਇਸ 'ਚੋਂ ਕੁਝ ਗੁੰਮ ਹੋ ਗਿਆ" + +#~ msgid "LEAP" +#~ msgstr "LEAP" From a7e3d2acc29d3e7c267298df9a19a514ca628b37 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 01:55:04 -0700 Subject: [PATCH 146/392] olpc-mesh: fix companion device detection crash The original OLPC mesh patch confused g_source_remove() with g_signal_handler_disconnect(), so the signal handler that the mesh device creates for the managers 'device-added' signal was getting called after that mesh device instance was freed, which is of course bad. --- src/nm-device-olpc-mesh.c | 43 +++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 2a1a235330..807db94bd3 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -109,7 +109,7 @@ struct _NMDeviceOlpcMeshPrivate NMDevice * companion; gboolean stage1_waiting; - guint device_added_cb; + guint device_added_id; }; static GQuark @@ -345,9 +345,7 @@ device_cleanup (NMDeviceOlpcMesh *self) static void real_take_down (NMDevice *dev) { - NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (dev); - - device_cleanup (self); + device_cleanup (NM_DEVICE_OLPC_MESH (dev)); } static gboolean @@ -650,24 +648,24 @@ real_act_stage4_ip4_config_timeout (NMDevice *dev, static void -nm_device_olpc_mesh_dispose (GObject *object) +dispose (GObject *object) { NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (object); NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + NMManager *manager; if (priv->dispose_has_run) { G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object); return; } - priv->dispose_has_run = TRUE; device_cleanup (self); - if (priv->device_added_cb != 0) - g_source_remove (priv->device_added_cb); - - priv->device_added_cb = 0; + manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); + if (priv->device_added_id) + g_signal_handler_disconnect (manager, priv->device_added_id); + g_object_unref (manager); G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object); } @@ -731,7 +729,7 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass) object_class->constructor = constructor; object_class->get_property = get_property; object_class->set_property = set_property; - object_class->dispose = nm_device_olpc_mesh_dispose; + object_class->dispose = dispose; parent_class->get_type_capabilities = NULL; parent_class->get_generic_capabilities = real_get_generic_capabilities; @@ -862,6 +860,7 @@ is_companion (NMDeviceOlpcMesh *self, NMDevice *other) { NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); struct ether_addr their_addr; + NMManager *manager; if (!NM_IS_DEVICE_WIFI (other)) return FALSE; @@ -876,14 +875,21 @@ is_companion (NMDeviceOlpcMesh *self, NMDevice *other) /* FIXME detect when our companion leaves */ priv->companion = other; - g_source_remove (priv->device_added_cb); - priv->device_added_cb = 0; + /* When we've found the companion, stop listening for other devices */ + manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); + if (priv->device_added_id) { + g_signal_handler_disconnect (manager, priv->device_added_id); + priv->device_added_id = 0; + } + g_object_unref (manager); nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); - nm_debug ("Found companion device: %s", nm_device_get_iface (other)); + nm_info ("(%s): found companion WiFi device %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_iface (other)); g_signal_connect (G_OBJECT (other), "state-changed", G_CALLBACK (companion_state_changed_cb), self); @@ -922,18 +928,19 @@ check_companion_cb (gpointer user_data) return FALSE; } - if (priv->device_added_cb != 0) + if (priv->device_added_id != 0) return FALSE; manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); - priv->device_added_cb = g_signal_connect (manager, "device-added", + priv->device_added_id = g_signal_connect (manager, "device-added", G_CALLBACK (device_added_cb), self); - list = nm_manager_get_devices (manager); - for (; list != NULL ; list = list->next) + /* Try to find the companion if it's already known to the NMManager */ + for (list = nm_manager_get_devices (manager); list ; list = g_slist_next (list)) { if (is_companion (self, NM_DEVICE (list->data))) break; + } g_object_unref (manager); From e9b7ecef53e44ac3106be0623649009c95bd600e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 00:45:45 -0700 Subject: [PATCH 147/392] doc: fix default value retrieval for settings specification generator --- docs/generate-settings-spec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generate-settings-spec.c b/docs/generate-settings-spec.c index dd78fc9211..d7a391f9b0 100644 --- a/docs/generate-settings-spec.c +++ b/docs/generate-settings-spec.c @@ -128,6 +128,7 @@ write_one_setting (FILE *f, SettingNewFunc func) value_desc = g_param_spec_get_blurb (*iter); g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (*iter)); + g_param_value_set_default (*iter, &value); default_value = g_strdup_value_contents (&value); if (default_value && !strcmp (default_value, "NULL")) { g_free (default_value); From 87bf00b3d7679eac99bb00c45f25fcef55f6081e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 6 Apr 2010 16:22:01 +0200 Subject: [PATCH 148/392] cli: multiline mode is default for 'dev list' and 'con list id|uuid' Option '--multiline' was replaced with '--mode tabular|multiline'. It was neccessary to be able to switch to tabular output mode for 'dev list' and 'con list id|uuid' commands as they now print out in multiline mode by default. All other commands are in tabular mode by default. --- cli/src/connections.c | 2 ++ cli/src/devices.c | 2 ++ cli/src/nmcli.c | 22 +++++++++++++++++++--- cli/src/nmcli.h | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 3e72621100..e275467b8b 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -476,6 +476,8 @@ do_connections_list (NmCli *nmc, int argc, char **argv) return nmc->return_value; } valid_param_specified = TRUE; + if (!nmc->mode_specified) + nmc->multiline_output = TRUE; /* multiline mode is default for 'con list id|uuid' */ con1 = find_connection (nmc->system_connections, selector, *argv); con2 = find_connection (nmc->user_connections, selector, *argv); diff --git a/cli/src/devices.c b/cli/src/devices.c index 1c4023923a..7811e2aeda 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -1164,6 +1164,8 @@ do_devices (NmCli *nmc, int argc, char **argv) nmc->return_value = do_devices_status (nmc, argc-1, argv+1); } else if (matches (*argv, "list") == 0) { + if (!nmc->mode_specified) + nmc->multiline_output = TRUE; /* multiline mode is default for 'dev list' */ nmc->return_value = do_devices_list (nmc, argc-1, argv+1); } else if (matches (*argv, "disconnect") == 0) { diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index 21524185f8..110030644e 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -66,7 +66,7 @@ usage (const char *prog_name) "OPTIONS\n" " -t[erse] terse output\n" " -p[retty] pretty output\n" - " -m[ultiline] multiline output\n" + " -m[ode] tabular|multiline output mode\n" " -f[ields] |all|common specify fields to output\n" " -e[scape] yes|no escape columns separators in values\n" " -v[ersion] show program version\n" @@ -160,8 +160,23 @@ parse_command_line (NmCli *nmc, int argc, char **argv) } else nmc->print_output = NMC_PRINT_PRETTY; - } else if (matches (opt, "-multiline") == 0) { - nmc->multiline_output = TRUE; + } else if (matches (opt, "-mode") == 0) { + nmc->mode_specified = TRUE; + next_arg (&argc, &argv); + if (argc <= 1) { + g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + if (!strcmp (argv[1], "tabular")) + nmc->multiline_output = FALSE; + else if (!strcmp (argv[1], "multiline")) + nmc->multiline_output = TRUE; + else { + g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[1], opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } } else if (matches (opt, "-escape") == 0) { next_arg (&argc, &argv); if (argc <= 1) { @@ -269,6 +284,7 @@ nmc_init (NmCli *nmc) nmc->should_wait = FALSE; nmc->print_output = NMC_PRINT_NORMAL; nmc->multiline_output = FALSE; + nmc->mode_specified = FALSE; nmc->escape_values = TRUE; nmc->required_fields = NULL; nmc->allowed_fields = NULL; diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index a9c04d4d59..b4e4562bfe 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -104,6 +104,7 @@ typedef struct _NmCli { gboolean should_wait; /* Indication that nmcli should not end yet */ NMCPrintOutput print_output; /* Output mode */ gboolean multiline_output; /* Multiline output instead of default tabular */ + gboolean mode_specified; /* Whether tabular/multiline mode was specified via '--mode' option */ gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ char *required_fields; /* Required fields in output: '--fields' option */ NmcOutputField *allowed_fields; /* Array of allowed fields for particular commands */ From 043ce2c655d1bd6d99bf61c2b11b5cda7d0965af Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 12:48:53 -0700 Subject: [PATCH 149/392] core: clear secrets on successful connection too This ensures that the next time secrets are required, they will be requested from the settings service. Internally, NM shouldn't be caching secrets; it should always request them from the settings service so that the settings service can enforce policy about password lifetime, if it wants to. --- src/nm-policy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 6ee4e0eb6a..b1d3ba6ec7 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -803,10 +803,16 @@ device_state_changed (NMDevice *device, schedule_activate_check (policy, device, 3); break; case NM_DEVICE_STATE_ACTIVATED: - /* Clear the invalid tag on the connection */ - if (connection) + if (connection) { + /* Clear the invalid tag on the connection */ g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); + /* And clear secrets so they will always be requested from the + * settings service when the next connection is made. + */ + nm_connection_clear_secrets (connection); + } + update_routing_and_dns (policy, FALSE); break; case NM_DEVICE_STATE_UNMANAGED: From 32128b04cad02e6608617f530ca848b44da80ebe Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:23:08 -0700 Subject: [PATCH 150/392] logging: add basic logging capabilities --- src/main.c | 15 +++- src/nm-logging.c | 205 ++++++++++++++++++++++++++++++++++++++--------- src/nm-logging.h | 51 +++++++++++- 3 files changed, 230 insertions(+), 41 deletions(-) diff --git a/src/main.c b/src/main.c index f8312fa54e..59f0dcb823 100644 --- a/src/main.c +++ b/src/main.c @@ -442,6 +442,7 @@ main (int argc, char *argv[]) gboolean g_fatal_warnings = FALSE; char *pidfile = NULL, *state_file = NULL, *dhcp = NULL; char *config = NULL, *plugins = NULL, *conf_plugins = NULL; + char *log_level = NULL, *log_domains = NULL; gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE; gboolean success; NMPolicy *policy = NULL; @@ -460,6 +461,10 @@ main (int argc, char *argv[]) { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, "State file location", "/path/to/state.file" }, { "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" }, { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ,", "plugin1,plugin2" }, + { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, + { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, + "Log domains separated by ,: any combination of [HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", + "HW,RFKILL,WIFI" }, {NULL} }; @@ -495,6 +500,14 @@ main (int argc, char *argv[]) exit (1); } + /* Logging setup */ + if (!nm_logging_setup (log_level, log_domains, &error)) { + fprintf (stderr, + _("%s. Please use --help to see a list of valid options.\n"), + error->message); + exit (1); + } + pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE); state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE); @@ -600,7 +613,7 @@ main (int argc, char *argv[]) setup_signals (); - nm_logging_setup (become_daemon); + nm_logging_start (become_daemon); nm_info ("starting..."); success = FALSE; diff --git a/src/nm-logging.c b/src/nm-logging.c index f47461526f..b431949acc 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -30,10 +30,150 @@ #include #include #include +#include +#include + +#include #include "nm-logging.h" #include "nm-utils.h" +static guint32 log_level = LOGL_ERR; +static guint32 log_domains = LOGD_CORE & LOGD_HW; + +typedef struct { + guint32 num; + const char *name; +} LogDesc; + +static const LogDesc level_descs[] = { + { LOGL_ERR, "ERR" }, + { LOGL_WARN, "WARN" }, + { LOGL_INFO, "INFO" }, + { LOGL_DEBUG, "DEBUG" }, + { 0, NULL } +}; + +static const LogDesc domain_descs[] = { + { LOGD_HW, "HW" }, + { LOGD_RFKILL, "RFKILL" }, + { LOGD_ETHER, "ETHER" }, + { LOGD_WIFI, "WIFI" }, + { LOGD_BT, "BT" }, + { LOGD_MB, "MB" }, + { LOGD_DHCP4, "DHCP4" }, + { LOGD_DHCP6, "DHCP6" }, + { LOGD_PPP, "PPP" }, + { LOGD_WIFI_SCAN, "WIFI_SCAN" }, + { LOGD_IP4, "IP4" }, + { LOGD_IP6, "IP6" }, + { LOGD_AUTOIP4, "AUTOIP4" }, + { LOGD_DNS, "DNS" }, + { LOGD_VPN, "VPN" }, + { LOGD_SHARING, "SHARING" }, + { LOGD_SUPPLICANT,"SUPPLICANT" }, + { LOGD_USER_SET, "USER_SET" }, + { LOGD_SYS_SET, "SYS_SET" }, + { LOGD_SUSPEND, "SUSPEND" }, + { LOGD_CORE, "CORE" }, + { 0, NULL } +}; + + +/************************************************************************/ + +gboolean +nm_logging_setup (const char *level, const char *domains, GError **error) +{ + char **tmp, **iter; + guint32 new_level = 0; + guint32 new_domains = 0; + + /* levels */ + if (level && strlen (level)) { + tmp = g_strsplit (level, ",", 0); + for (iter = tmp; iter && *iter; iter++) { + const LogDesc *diter; + gboolean found = FALSE; + + for (diter = &level_descs[0]; diter->name; diter++) { + if (!strcasecmp (diter->name, *iter)) { + new_level &= diter->num; + found = TRUE; + break; + } + } + + if (!found) { + g_set_error (error, 0, 0, _("Unknown log level '%s'"), *iter); + return FALSE; + } + } + g_strfreev (tmp); + log_level = new_level; + } + + /* domains */ + if (domains && strlen (domains)) { + tmp = g_strsplit (domains, ",", 0); + for (iter = tmp; iter && *iter; iter++) { + const LogDesc *diter; + gboolean found = FALSE; + + for (diter = &domain_descs[0]; diter->name; diter++) { + if (!strcasecmp (diter->name, *iter)) { + new_domains &= diter->num; + found = TRUE; + break; + } + } + + if (!found) { + g_set_error (error, 0, 0, _("Unknown log domain '%s'"), *iter); + return FALSE; + } + } + g_strfreev (tmp); + log_domains = new_domains; + } + + return TRUE; +} + +void _nm_log (const char *loc, + const char *func, + guint32 domain, + guint32 level, + const char *fmt, + ...) +{ + va_list args; + char *msg; + GTimeVal tv; + + if (!(log_level & level) || !(log_domains & domain)) + return; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + + if (log_level & LOGL_DEBUG) { + g_get_current_time (&tv); + syslog (LOG_DEBUG, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + } else if (log_level & LOGL_INFO) + syslog (LOG_INFO, " [%s] %s(): %s\n", loc, func, msg); + else if (log_level & LOGL_WARN) + syslog (LOG_WARNING, " [%s] %s(): %s\n", loc, func, msg); + else if (log_level & LOGL_ERR) { + g_get_current_time (&tv); + syslog (LOG_ERR, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + } + g_free (msg); +} + +/************************************************************************/ + static void fallback_get_backtrace (void) { @@ -115,47 +255,40 @@ nm_logging_backtrace (void) static void -nm_log_handler (const gchar * log_domain, - GLogLevelFlags log_level, - const gchar * message, - gpointer ignored) +nm_log_handler (const gchar *log_domain, + GLogLevelFlags level, + const gchar *message, + gpointer ignored) { int syslog_priority; - switch (log_level) - { - case G_LOG_LEVEL_ERROR: - syslog_priority = LOG_CRIT; - break; - - case G_LOG_LEVEL_CRITICAL: - syslog_priority = LOG_ERR; - break; - - case G_LOG_LEVEL_WARNING: - syslog_priority = LOG_WARNING; - break; - - case G_LOG_LEVEL_MESSAGE: - syslog_priority = LOG_NOTICE; - break; - - case G_LOG_LEVEL_DEBUG: - syslog_priority = LOG_DEBUG; - break; - - case G_LOG_LEVEL_INFO: - default: - syslog_priority = LOG_INFO; - break; + switch (level) { + case G_LOG_LEVEL_ERROR: + syslog_priority = LOG_CRIT; + break; + case G_LOG_LEVEL_CRITICAL: + syslog_priority = LOG_ERR; + break; + case G_LOG_LEVEL_WARNING: + syslog_priority = LOG_WARNING; + break; + case G_LOG_LEVEL_MESSAGE: + syslog_priority = LOG_NOTICE; + break; + case G_LOG_LEVEL_DEBUG: + syslog_priority = LOG_DEBUG; + break; + case G_LOG_LEVEL_INFO: + default: + syslog_priority = LOG_INFO; + break; } syslog (syslog_priority, "%s", message); } - void -nm_logging_setup (gboolean become_daemon) +nm_logging_start (gboolean become_daemon) { if (become_daemon) openlog (G_LOG_DOMAIN, 0, LOG_DAEMON); @@ -163,9 +296,9 @@ nm_logging_setup (gboolean become_daemon) openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_USER); g_log_set_handler (G_LOG_DOMAIN, - G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, - nm_log_handler, - NULL); + G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + nm_log_handler, + NULL); } void diff --git a/src/nm-logging.h b/src/nm-logging.h index 70979fa3ab..60b15c2f57 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -24,8 +24,51 @@ #include -void nm_logging_setup (gboolean become_daemon); -void nm_logging_backtrace (void); -void nm_logging_shutdown (void); +/* Log domains */ +enum { + LOGD_NONE = 0x00000000, + LOGD_HW = 0x00000001, + LOGD_RFKILL = 0x00000002, + LOGD_ETHER = 0x00000004, + LOGD_WIFI = 0x00000008, + LOGD_BT = 0x00000010, + LOGD_MB = 0x00000020, /* mobile broadband */ + LOGD_DHCP4 = 0x00000040, + LOGD_DHCP6 = 0x00000080, + LOGD_PPP = 0x00000100, + LOGD_WIFI_SCAN = 0x00000200, + LOGD_IP4 = 0x00000400, + LOGD_IP6 = 0x00000800, + LOGD_AUTOIP4 = 0x00001000, + LOGD_DNS = 0x00002000, + LOGD_VPN = 0x00004000, + LOGD_SHARING = 0x00008000, + LOGD_SUPPLICANT = 0x00010000, + LOGD_USER_SET = 0x00020000, + LOGD_SYS_SET = 0x00040000, + LOGD_SUSPEND = 0x00080000, + LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */ +}; + +/* Log levels */ +enum { + LOGL_ERR = 0x00000000, + LOGL_WARN = 0x00000001, + LOGL_INFO = 0x00000002, + LOGL_DEBUG = 0x00000004 +}; + +#define nm_log(domain, level, fmt, args...) \ + { _nm_log (G_STRFUNC, G_STRLOC, domain, level, fmt, ##args); } + +void _nm_log (const char *func, const char *loc, + guint32 domain, guint32 level, + const char *fmt, ...); + + +gboolean nm_logging_setup (const char *level, const char *domains, GError **error); +void nm_logging_start (gboolean become_daemon); +void nm_logging_backtrace (void); +void nm_logging_shutdown (void); #endif /* NM_LOGGING_H */ From e19bac4cd0c4be5d8dd325f4c8d0fa42d8f4e6b8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:27:35 -0700 Subject: [PATCH 151/392] core: use fprintf before logging is set up --- src/main.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main.c b/src/main.c index 59f0dcb823..b76484a947 100644 --- a/src/main.c +++ b/src/main.c @@ -237,18 +237,18 @@ write_pidfile (const char *pidfile) gboolean success = FALSE; if ((fd = open (pidfile, O_CREAT|O_WRONLY|O_TRUNC, 00644)) < 0) { - nm_warning ("Opening %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Opening %s failed: %s", pidfile, strerror (errno)); return FALSE; } snprintf (pid, sizeof (pid), "%d", getpid ()); if (write (fd, pid, strlen (pid)) < 0) - nm_warning ("Writing to %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Writing to %s failed: %s", pidfile, strerror (errno)); else success = TRUE; if (close (fd)) - nm_warning ("Closing %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Closing %s failed: %s", pidfile, strerror (errno)); return success; } @@ -291,7 +291,7 @@ check_pidfile (const char *pidfile) if (strcmp (process_name, "NetworkManager") == 0) { /* Check that the process exists */ if (kill (pid, 0) == 0) { - g_warning ("NetworkManager is already running (pid %ld)", pid); + fprintf (stderr, "NetworkManager is already running (pid %ld)", pid); nm_running = TRUE; } } @@ -469,12 +469,12 @@ main (int argc, char *argv[]) }; if (getuid () != 0) { - g_printerr ("You must be root to run NetworkManager!\n"); + fprintf (stderr, "You must be root to run NetworkManager!\n"); exit (1); } if (!g_module_supported ()) { - g_printerr ("GModules are not supported on your platform!"); + fprintf (stderr, "GModules are not supported on your platform!"); exit (1); } @@ -518,10 +518,10 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { - g_warning ("Config file %s invalid: (%d) %s.", - config, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + fprintf (stderr, "Config file %s invalid: (%d) %s.", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); exit (1); } } else { @@ -532,10 +532,10 @@ main (int argc, char *argv[]) config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); parsed = parse_config_file (config, &conf_plugins, &dhcp, &error); if (!parsed) { - g_warning ("Default config file %s invalid: (%d) %s.", - config, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + fprintf (stderr, "Default config file %s invalid: (%d) %s.", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); g_free (config); config = NULL; g_clear_error (&error); @@ -547,10 +547,10 @@ main (int argc, char *argv[]) if (!parsed) { config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { - g_warning ("Default config file %s invalid: (%d) %s.", - config, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + fprintf (stderr, "Default config file %s invalid: (%d) %s.", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); g_free (config); config = NULL; g_clear_error (&error); @@ -565,10 +565,10 @@ main (int argc, char *argv[]) /* Parse the state file */ if (!parse_state_file (state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &error)) { - g_warning ("State file %s parsing failed: (%d) %s.", - state_file, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + fprintf (stderr, "State file %s parsing failed: (%d) %s.", + state_file, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); /* Not a hard failure */ } g_clear_error (&error); @@ -582,9 +582,9 @@ main (int argc, char *argv[]) int saved_errno; saved_errno = errno; - nm_error ("Could not daemonize: %s [error %u]", - g_strerror (saved_errno), - saved_errno); + fprintf (stderr, "Could not daemonize: %s [error %u]", + g_strerror (saved_errno), + saved_errno); exit (1); } if (write_pidfile (pidfile)) From 8e1ad970562e30faa7bd1aed9b43e044d0fe237a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:28:33 -0700 Subject: [PATCH 152/392] core: options help text cleanup --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index b76484a947..1e54cb0d83 100644 --- a/src/main.c +++ b/src/main.c @@ -460,10 +460,10 @@ main (int argc, char *argv[]) { "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &pidfile, "Specify the location of a PID file", "filename" }, { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, "State file location", "/path/to/state.file" }, { "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" }, - { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ,", "plugin1,plugin2" }, + { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, - "Log domains separated by ,: any combination of [HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", + "Log domains separated by ',': any combination of [HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", "HW,RFKILL,WIFI" }, {NULL} }; From f46e1f6a43682cc7374240c7f2144168d966553e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:45:49 -0700 Subject: [PATCH 153/392] logging: fix default log level and tweak info/warn output --- src/nm-logging.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index b431949acc..df49a6d300 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -38,8 +38,8 @@ #include "nm-logging.h" #include "nm-utils.h" -static guint32 log_level = LOGL_ERR; -static guint32 log_domains = LOGD_CORE & LOGD_HW; +static guint32 log_level = LOGL_INFO; +static guint32 log_domains = LOGD_CORE | LOGD_HW; typedef struct { guint32 num; @@ -137,6 +137,7 @@ nm_logging_setup (const char *level, const char *domains, GError **error) log_domains = new_domains; } + fprintf (stdout, "NetworkManager: log level: 0x%04X log domains: 0x%08X\n", log_level, log_domains); return TRUE; } @@ -162,9 +163,9 @@ void _nm_log (const char *loc, g_get_current_time (&tv); syslog (LOG_DEBUG, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); } else if (log_level & LOGL_INFO) - syslog (LOG_INFO, " [%s] %s(): %s\n", loc, func, msg); + syslog (LOG_INFO, " %s\n", msg); else if (log_level & LOGL_WARN) - syslog (LOG_WARNING, " [%s] %s(): %s\n", loc, func, msg); + syslog (LOG_WARNING, " %s\n", msg); else if (log_level & LOGL_ERR) { g_get_current_time (&tv); syslog (LOG_ERR, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); From 52c2422f727fbb0992cc61a04f8dea23f5bd1130 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:46:03 -0700 Subject: [PATCH 154/392] logging: add log level helpers --- src/nm-logging.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nm-logging.h b/src/nm-logging.h index 60b15c2f57..8880053143 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -58,6 +58,18 @@ enum { LOGL_DEBUG = 0x00000004 }; +#define nm_log_err(domain, fmt, args...) \ + { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_ERR, fmt, ##args); } + +#define nm_log_warn(domain, fmt, args...) \ + { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_WARN, fmt, ##args); } + +#define nm_log_info(domain, fmt, args...) \ + { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_INFO, fmt, ##args); } + +#define nm_log_dbg(domain, fmt, args...) \ + { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_DEBUG, fmt, ##args); } + #define nm_log(domain, level, fmt, args...) \ { _nm_log (G_STRFUNC, G_STRLOC, domain, level, fmt, ##args); } From e0df501e0ea0596826c185051bd0493827c35134 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:48:12 -0700 Subject: [PATCH 155/392] logging: remove initial log level & facility message --- src/nm-logging.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index df49a6d300..464dd024b2 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -137,7 +137,6 @@ nm_logging_setup (const char *level, const char *domains, GError **error) log_domains = new_domains; } - fprintf (stdout, "NetworkManager: log level: 0x%04X log domains: 0x%08X\n", log_level, log_domains); return TRUE; } From c0a455d34405f31dcb59bd57bdb951a642b05f1b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:48:31 -0700 Subject: [PATCH 156/392] core: clean up logging in main.c --- src/main.c | 74 ++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/src/main.c b/src/main.c index 1e54cb0d83..e0baad5df5 100644 --- a/src/main.c +++ b/src/main.c @@ -40,7 +40,6 @@ #include #include "NetworkManager.h" -#include "nm-utils.h" #include "NetworkManagerUtils.h" #include "nm-manager.h" #include "nm-policy.h" @@ -75,7 +74,7 @@ typedef struct { static gboolean detach_monitor (gpointer data) { - nm_info ("Detaching netlink event monitor"); + nm_log_warn (LOGD_HW, "detaching netlink event monitor"); nm_netlink_monitor_detach (NM_NETLINK_MONITOR (data)); return FALSE; } @@ -90,10 +89,11 @@ nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor, now = time (NULL); - if (info->domain != error->domain || info->code != error->code || (info->time && now > info->time + 10)) { + if ( (info->domain != error->domain) + || (info->code != error->code) + || (info->time && now > info->time + 10)) { /* FIXME: Try to handle the error instead of just printing it. */ - nm_warning ("error monitoring device for netlink events: %s\n", - error->message); + nm_log_warn (LOGD_HW, "error monitoring device for netlink events: %s\n", error->message); info->time = now; info->domain = error->domain; @@ -106,26 +106,20 @@ nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor, /* Broken drivers will sometimes cause a flood of netlink errors. * rh #459205, novell #443429, lp #284507 */ - nm_warning ("Excessive netlink errors ocurred, disabling netlink monitor."); - nm_warning ("Link change events will not be processed."); + nm_log_warn (LOGD_HW, "excessive netlink errors ocurred, disabling netlink monitor."); + nm_log_warn (LOGD_HW, "link change events will not be processed."); g_idle_add_full (G_PRIORITY_HIGH, detach_monitor, monitor, NULL); } } static gboolean -nm_monitor_setup (void) +nm_monitor_setup (GError **error) { - GError *error = NULL; NMNetlinkMonitor *monitor; MonitorInfo *info; monitor = nm_netlink_monitor_get (); - nm_netlink_monitor_open_connection (monitor, &error); - if (error != NULL) - { - nm_warning ("could not monitor wired ethernet devices: %s", - error->message); - g_error_free (error); + if (!nm_netlink_monitor_open_connection (monitor, error)) { g_object_unref (monitor); return FALSE; } @@ -136,7 +130,6 @@ nm_monitor_setup (void) info, (GClosureNotify) g_free, 0); - nm_netlink_monitor_attach (monitor); /* Request initial status of cards */ @@ -163,7 +156,7 @@ nm_signal_handler (int signo) case SIGBUS: case SIGILL: case SIGABRT: - nm_warning ("Caught signal %d. Generating backtrace...", signo); + nm_log_warn (LOGD_CORE, "caught signal %d. Generating backtrace...", signo); nm_logging_backtrace (); exit (1); break; @@ -173,7 +166,7 @@ nm_signal_handler (int signo) /* let the fatal signals interrupt us */ --in_fatal; - nm_warning ("Caught signal %d, shutting down abnormally. Generating backtrace...", signo); + nm_log_warn (LOGD_CORE, "caught signal %d, shutting down abnormally. Generating backtrace...", signo); nm_logging_backtrace (); g_main_loop_quit (main_loop); break; @@ -183,7 +176,7 @@ nm_signal_handler (int signo) /* let the fatal signals interrupt us */ --in_fatal; - nm_warning ("Caught signal %d, shutting down normally.", signo); + nm_log_info (LOGD_CORE, "caught signal %d, shutting down normally.", signo); quit_early = TRUE; g_main_loop_quit (main_loop); break; @@ -237,18 +230,18 @@ write_pidfile (const char *pidfile) gboolean success = FALSE; if ((fd = open (pidfile, O_CREAT|O_WRONLY|O_TRUNC, 00644)) < 0) { - fprintf (stderr, "Opening %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Opening %s failed: %s\n", pidfile, strerror (errno)); return FALSE; } snprintf (pid, sizeof (pid), "%d", getpid ()); if (write (fd, pid, strlen (pid)) < 0) - fprintf (stderr, "Writing to %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Writing to %s failed: %s\n", pidfile, strerror (errno)); else success = TRUE; if (close (fd)) - fprintf (stderr, "Closing %s failed: %s", pidfile, strerror (errno)); + fprintf (stderr, "Closing %s failed: %s\n", pidfile, strerror (errno)); return success; } @@ -291,7 +284,7 @@ check_pidfile (const char *pidfile) if (strcmp (process_name, "NetworkManager") == 0) { /* Check that the process exists */ if (kill (pid, 0) == 0) { - fprintf (stderr, "NetworkManager is already running (pid %ld)", pid); + fprintf (stderr, "NetworkManager is already running (pid %ld)\n", pid); nm_running = TRUE; } } @@ -474,7 +467,7 @@ main (int argc, char *argv[]) } if (!g_module_supported ()) { - fprintf (stderr, "GModules are not supported on your platform!"); + fprintf (stderr, "GModules are not supported on your platform!\n"); exit (1); } @@ -518,7 +511,7 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { - fprintf (stderr, "Config file %s invalid: (%d) %s.", + fprintf (stderr, "Config file %s invalid: (%d) %s\n", config, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); @@ -532,7 +525,7 @@ main (int argc, char *argv[]) config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); parsed = parse_config_file (config, &conf_plugins, &dhcp, &error); if (!parsed) { - fprintf (stderr, "Default config file %s invalid: (%d) %s.", + fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); @@ -547,7 +540,7 @@ main (int argc, char *argv[]) if (!parsed) { config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { - fprintf (stderr, "Default config file %s invalid: (%d) %s.", + fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); @@ -565,7 +558,7 @@ main (int argc, char *argv[]) /* Parse the state file */ if (!parse_state_file (state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &error)) { - fprintf (stderr, "State file %s parsing failed: (%d) %s.", + fprintf (stderr, "State file %s parsing failed: (%d) %s\n", state_file, error ? error->code : -1, (error && error->message) ? error->message : "unknown"); @@ -582,7 +575,7 @@ main (int argc, char *argv[]) int saved_errno; saved_errno = errno; - fprintf (stderr, "Could not daemonize: %s [error %u]", + fprintf (stderr, "Could not daemonize: %s [error %u]\n", g_strerror (saved_errno), saved_errno); exit (1); @@ -615,27 +608,30 @@ main (int argc, char *argv[]) nm_logging_start (become_daemon); - nm_info ("starting..."); + nm_log_info (LOGD_CORE, "starting..."); success = FALSE; main_loop = g_main_loop_new (NULL, FALSE); /* Create watch functions that monitor cards for link status. */ - if (!nm_monitor_setup ()) + if (!nm_monitor_setup (&error)) { + nm_log_err (LOGD_CORE, "failed to start monitoring devices: %s.", + error && error->message ? error->message : "(unknown)"); goto done; + } /* Initialize our DBus service & connection */ dbus_mgr = nm_dbus_manager_get (); vpn_manager = nm_vpn_manager_get (); if (!vpn_manager) { - nm_warning ("Failed to start the VPN manager."); + nm_log_err (LOGD_CORE, "failed to start the VPN manager."); goto done; } named_mgr = nm_named_manager_get (); if (!named_mgr) { - nm_warning ("Failed to start the named manager."); + nm_log_err (LOGD_CORE, "failed to start the named manager."); goto done; } @@ -647,28 +643,28 @@ main (int argc, char *argv[]) wwan_enabled, &error); if (manager == NULL) { - nm_error ("Failed to initialize the network manager: %s", + nm_log_err (LOGD_CORE, "failed to initialize the network manager: %s", error && error->message ? error->message : "(unknown)"); goto done; } policy = nm_policy_new (manager, vpn_manager); if (policy == NULL) { - nm_error ("Failed to initialize the policy."); + nm_log_err (LOGD_CORE, "failed to initialize the policy."); goto done; } /* Initialize the supplicant manager */ sup_mgr = nm_supplicant_manager_get (); if (!sup_mgr) { - nm_error ("Failed to initialize the supplicant manager."); + nm_log_err (LOGD_CORE, "failed to initialize the supplicant manager."); goto done; } /* Initialize DHCP manager */ dhcp_mgr = nm_dhcp_manager_new (dhcp, &error); if (!dhcp_mgr) { - nm_warning ("Failed to start the DHCP manager: %s.", error->message); + nm_log_err (LOGD_CORE, "failed to start the DHCP manager: %s.", error->message); goto done; } @@ -676,7 +672,7 @@ main (int argc, char *argv[]) /* Start our DBus service */ if (!nm_dbus_manager_start_service (dbus_mgr)) { - nm_warning ("Failed to start the dbus service."); + nm_log_err (LOGD_CORE, "failed to start the dbus service."); goto done; } @@ -727,6 +723,6 @@ done: g_free (plugins); g_free (dhcp); - nm_info ("exiting (%s)", success ? "success" : "error"); + nm_log_info (LOGD_CORE, "exiting (%s)", success ? "success" : "error"); exit (success ? 0 : 1); } From d03de42350e7cadd77e622543c076d96b99ff457 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:53:37 -0700 Subject: [PATCH 157/392] logging: one level at a time; levels are cumulative --- src/nm-logging.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index 464dd024b2..a07a5da69b 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -48,9 +48,9 @@ typedef struct { static const LogDesc level_descs[] = { { LOGL_ERR, "ERR" }, - { LOGL_WARN, "WARN" }, - { LOGL_INFO, "INFO" }, - { LOGL_DEBUG, "DEBUG" }, + { LOGL_WARN | LOGL_ERR, "WARN" }, + { LOGL_INFO | LOGL_WARN | LOGL_ERR, "INFO" }, + { LOGL_DEBUG | LOGL_INFO | LOGL_WARN | LOGL_ERR, "DEBUG" }, { 0, NULL } }; @@ -86,31 +86,25 @@ gboolean nm_logging_setup (const char *level, const char *domains, GError **error) { char **tmp, **iter; - guint32 new_level = 0; guint32 new_domains = 0; /* levels */ if (level && strlen (level)) { - tmp = g_strsplit (level, ",", 0); - for (iter = tmp; iter && *iter; iter++) { - const LogDesc *diter; - gboolean found = FALSE; + gboolean found = FALSE; + const LogDesc *diter; - for (diter = &level_descs[0]; diter->name; diter++) { - if (!strcasecmp (diter->name, *iter)) { - new_level &= diter->num; - found = TRUE; - break; - } - } - - if (!found) { - g_set_error (error, 0, 0, _("Unknown log level '%s'"), *iter); - return FALSE; + for (diter = &level_descs[0]; diter->name; diter++) { + if (!strcasecmp (diter->name, level)) { + log_level = diter->num; + found = TRUE; + break; } } - g_strfreev (tmp); - log_level = new_level; + + if (!found) { + g_set_error (error, 0, 0, _("Unknown log level '%s'"), level); + return FALSE; + } } /* domains */ From 3e8a05d28e193b654c98d395262501b8999a0557 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 15:57:24 -0700 Subject: [PATCH 158/392] logging: allow logging control from the config file --- src/main.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/main.c b/src/main.c index e0baad5df5..2b0085abba 100644 --- a/src/main.c +++ b/src/main.c @@ -299,6 +299,8 @@ static gboolean parse_config_file (const char *filename, char **plugins, char **dhcp_client, + char **log_level, + char **log_domains, GError **error) { GKeyFile *config; @@ -320,6 +322,9 @@ parse_config_file (const char *filename, *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); + *log_level = g_key_file_get_value (config, "main", "log-level", NULL); + *log_domains = g_key_file_get_value (config, "main", "log-domains", NULL); + g_key_file_free (config); return TRUE; } @@ -446,6 +451,7 @@ main (int argc, char *argv[]) NMDHCPManager *dhcp_mgr = NULL; GError *error = NULL; gboolean wrote_pidfile = FALSE; + char *cfg_log_level = NULL, *cfg_log_domains = NULL; GOptionEntry options[] = { { "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL }, @@ -493,14 +499,6 @@ main (int argc, char *argv[]) exit (1); } - /* Logging setup */ - if (!nm_logging_setup (log_level, log_domains, &error)) { - fprintf (stderr, - _("%s. Please use --help to see a list of valid options.\n"), - error->message); - exit (1); - } - pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE); state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE); @@ -510,7 +508,7 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { - if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { + if (!parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error)) { fprintf (stderr, "Config file %s invalid: (%d) %s\n", config, error ? error->code : -1, @@ -523,7 +521,7 @@ main (int argc, char *argv[]) /* Try NetworkManager.conf first */ if (g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); - parsed = parse_config_file (config, &conf_plugins, &dhcp, &error); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); if (!parsed) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, @@ -539,7 +537,7 @@ main (int argc, char *argv[]) /* Try old nm-system-settings.conf next */ if (!parsed) { config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); - if (!parse_config_file (config, &conf_plugins, &dhcp, &error)) { + if (!parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error)) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, error ? error->code : -1, @@ -552,6 +550,16 @@ main (int argc, char *argv[]) } } + /* Logging setup */ + if (!nm_logging_setup (log_level ? log_level : cfg_log_level, + log_domains ? log_domains : cfg_log_domains, + &error)) { + fprintf (stderr, + _("%s. Please use --help to see a list of valid options.\n"), + error->message); + exit (1); + } + /* Plugins specified with '--plugins' override those of config file */ plugins = plugins ? plugins : g_strdup (conf_plugins); g_free (conf_plugins); @@ -722,6 +730,10 @@ done: g_free (config); g_free (plugins); g_free (dhcp); + g_free (log_level); + g_free (log_domains); + g_free (cfg_log_level); + g_free (cfg_log_domains); nm_log_info (LOGD_CORE, "exiting (%s)", success ? "success" : "error"); exit (success ? 0 : 1); From 6e97fc444120d00da88348b180fdf328d555a160 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:19:30 -0700 Subject: [PATCH 159/392] logging: tweak default log levels --- src/main.c | 2 +- src/nm-logging.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 2b0085abba..d044d0e3b1 100644 --- a/src/main.c +++ b/src/main.c @@ -462,7 +462,7 @@ main (int argc, char *argv[]) { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, - "Log domains separated by ',': any combination of [HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", + "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", "HW,RFKILL,WIFI" }, {NULL} }; diff --git a/src/nm-logging.c b/src/nm-logging.c index a07a5da69b..06a6b1b6f1 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -39,7 +39,7 @@ #include "nm-utils.h" static guint32 log_level = LOGL_INFO; -static guint32 log_domains = LOGD_CORE | LOGD_HW; +static guint32 log_domains = LOGD_CORE | LOGD_HW | LOGD_RFKILL | LOGD_SUSPEND; typedef struct { guint32 num; @@ -55,6 +55,7 @@ static const LogDesc level_descs[] = { }; static const LogDesc domain_descs[] = { + { LOGD_NONE, "NONE" }, { LOGD_HW, "HW" }, { LOGD_RFKILL, "RFKILL" }, { LOGD_ETHER, "ETHER" }, From 28664e80fe7b71d6397c532e0e9a246246ec6cdc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:20:11 -0700 Subject: [PATCH 160/392] logging: update nm-manager.c logging --- src/nm-manager.c | 133 +++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 68 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 6c18bc2b6b..bb243e0c64 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2009 Novell, Inc. - * Copyright (C) 2007 - 2009 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -26,7 +26,7 @@ #include "nm-glib-compat.h" #include "nm-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-dbus-manager.h" #include "nm-vpn-manager.h" #include "nm-modem-manager.h" @@ -341,8 +341,7 @@ modem_added (NMModemManager *modem_manager, * by the Bluetooth code during the connection process. */ if (driver && !strcmp (driver, "bluetooth")) { - g_message ("%s: ignoring modem '%s' (no associated Bluetooth device)", - __func__, ip_iface); + nm_log_info (LOGD_MB, "ignoring modem '%s' (no associated Bluetooth device)", ip_iface); return; } @@ -352,7 +351,7 @@ modem_added (NMModemManager *modem_manager, else if (NM_IS_MODEM_CDMA (modem)) device = nm_device_cdma_new (NM_MODEM_CDMA (modem), driver); else - g_message ("%s: unhandled modem '%s'", __func__, ip_iface); + nm_log_info (LOGD_MB, "unhandled modem '%s'", ip_iface); if (device) add_device (self, device); @@ -488,7 +487,7 @@ aipd_handle_event (DBusGProxy *proxy, gboolean handled = FALSE; if (!event || !iface) { - nm_warning ("Incomplete message received from avahi-autoipd"); + nm_log_warn (LOGD_AUTOIP4, "incomplete message received from avahi-autoipd"); return; } @@ -496,7 +495,7 @@ aipd_handle_event (DBusGProxy *proxy, && (strcmp (event, "CONFLICT") != 0) && (strcmp (event, "UNBIND") != 0) && (strcmp (event, "STOP") != 0)) { - nm_warning ("Unknown event '%s' received from avahi-autoipd", event); + nm_log_warn (LOGD_AUTOIP4, "unknown event '%s' received from avahi-autoipd", event); return; } @@ -511,7 +510,7 @@ aipd_handle_event (DBusGProxy *proxy, } if (!handled) - nm_warning ("Unhandled avahi-autoipd event for '%s'", iface); + nm_log_warn (LOGD_AUTOIP4, "(%s): unhandled avahi-autoipd event", iface); } static const char * @@ -693,7 +692,8 @@ user_connection_get_settings_cb (DBusGProxy *proxy, if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, G_TYPE_INVALID)) { - nm_warning ("Couldn't retrieve connection settings: %s.", err->message); + nm_log_info (LOGD_USER_SET, "couldn't retrieve connection settings: %s.", + err && err->message ? err->message : "(unknown)"); g_error_free (err); goto out; } @@ -708,10 +708,9 @@ user_connection_get_settings_cb (DBusGProxy *proxy, connection = nm_connection_new_from_hash (settings, &error); if (connection == NULL) { - nm_warning ("%s: Invalid connection: '%s' / '%s' invalid: %d", - __func__, - g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), - error->message, error->code); + nm_log_warn (LOGD_USER_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); g_error_free (error); goto out; } @@ -754,7 +753,7 @@ user_connection_get_settings_cb (DBusGProxy *proxy, } } else { // FIXME: merge settings? or just replace? - nm_warning ("%s (#%d): implement merge settings", __func__, __LINE__); + nm_log_dbg (LOGD_USER_SET, "implement merge settings"); } out: @@ -802,10 +801,9 @@ user_connection_updated_cb (DBusGProxy *proxy, new_connection = nm_connection_new_from_hash (settings, &error); if (!new_connection) { /* New connection invalid, remove existing connection */ - nm_warning ("%s: Invalid connection: '%s' / '%s' invalid: %d", - __func__, - g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), - error->message, error->code); + nm_log_warn (LOGD_USER_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); g_error_free (error); remove_connection (manager, old_connection, priv->user_connections); return; @@ -842,7 +840,7 @@ user_internal_new_connection_cb (DBusGProxy *proxy, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); if (!con_proxy) { - nm_warning ("Error: could not init user connection proxy"); + nm_log_err (LOGD_USER_SET, "could not init user connection proxy"); return; } @@ -888,7 +886,8 @@ user_list_connections_cb (DBusGProxy *proxy, if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &ops, G_TYPE_INVALID)) { - nm_warning ("Couldn't retrieve connections: %s.", err->message); + nm_log_warn (LOGD_USER_SET, "couldn't retrieve connections: %s", + err && err->message ? err->message : "(unknown)"); g_error_free (err); goto out; } @@ -934,7 +933,7 @@ user_query_connections (NMManager *manager) NM_DBUS_PATH_SETTINGS, NM_DBUS_IFACE_SETTINGS); if (!priv->user_proxy) { - nm_warning ("Error: could not init settings proxy"); + nm_log_err (LOGD_USER_SET, "could not init user settings proxy"); return; } @@ -977,16 +976,15 @@ system_connection_updated_cb (NMSettingsConnectionInterface *connection, if (!existing) return; if (existing != connection) { - g_warning ("%s: existing connection didn't matched updated.", __func__); + nm_log_warn (LOGD_SYS_SET, "existing connection didn't matched updated."); return; } if (!nm_connection_verify (NM_CONNECTION (existing), &error)) { /* Updated connection invalid, remove existing connection */ - nm_warning ("%s: Invalid connection: '%s' / '%s' invalid: %d", - __func__, - g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), - error->message, error->code); + nm_log_warn (LOGD_SYS_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); g_error_free (error); remove_connection (manager, NM_CONNECTION (existing), priv->system_connections); return; @@ -1228,10 +1226,10 @@ manager_set_radio_enabled (NMManager *manager, "main", rstate->key, G_TYPE_BOOLEAN, (gpointer) &enabled, &error)) { - g_warning ("Writing to state file %s failed: (%d) %s.", - priv->state_file, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + nm_log_warn (LOGD_CORE, "writing to state file %s failed: (%d) %s.", + priv->state_file, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); } } @@ -1401,9 +1399,9 @@ manager_rfkill_update_one_type (NMManager *self, } if (new_he != rstate->hw_enabled) { - nm_info ("%s now %s by radio killswitch", - rstate->desc, - (new_e && new_he) ? "enabled" : "disabled"); + nm_log_info (LOGD_RFKILL, "%s now %s by radio killswitch", + rstate->desc, + (new_e && new_he) ? "enabled" : "disabled"); rstate->hw_enabled = new_he; g_object_notify (G_OBJECT (self), rstate->hw_prop); @@ -1510,14 +1508,14 @@ add_device (NMManager *self, NMDevice *device) driver = nm_device_get_driver (device); if (!driver) driver = "unknown"; - nm_info ("(%s): new %s device (driver: '%s')", iface, type_desc, driver); + nm_log_info (LOGD_HW, "(%s): new %s device (driver: '%s')", iface, type_desc, driver); path = g_strdup_printf ("/org/freedesktop/NetworkManager/Devices/%d", devcount++); nm_device_set_path (device, path); dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (priv->dbus_mgr), path, G_OBJECT (device)); - nm_info ("(%s): exported as %s", iface, path); + nm_log_info (LOGD_CORE, "(%s): exported as %s", iface, path); g_free (path); /* Check if we should assume the device's active connection by matching its @@ -1557,11 +1555,11 @@ add_device (NMManager *self, NMDevice *device) if (ac_path) g_object_notify (G_OBJECT (self), NM_MANAGER_ACTIVE_CONNECTIONS); else { - nm_warning ("Assumed connection (%d) %s failed to activate: (%d) %s", - nm_connection_get_scope (existing), - nm_connection_get_path (existing), - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_CORE, "assumed connection (%d) %s failed to activate: (%d) %s", + nm_connection_get_scope (existing), + nm_connection_get_path (existing), + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_error_free (error); } } @@ -1710,13 +1708,12 @@ bluez_manager_bdaddr_added_cb (NMBluezManager *bluez_mgr, device = nm_device_bt_new (object_path, bdaddr, name, capabilities, FALSE); if (device) { - g_message ("%s: BT device %s (%s) added (%s%s%s)", - __func__, - name, - bdaddr, - has_dun ? "DUN" : "", - has_dun && has_nap ? " " : "", - has_nap ? "NAP" : ""); + nm_log_info (LOGD_HW, "BT device %s (%s) added (%s%s%s)", + name, + bdaddr, + has_dun ? "DUN" : "", + has_dun && has_nap ? " " : "", + has_nap ? "NAP" : ""); add_device (manager, device); } @@ -1735,7 +1732,7 @@ bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, g_return_if_fail (bdaddr != NULL); g_return_if_fail (object_path != NULL); - g_message ("%s: BT device %s removed", __func__, bdaddr); + nm_log_info (LOGD_HW, "BT device %s removed", bdaddr); for (iter = priv->devices; iter; iter = iter->next) { NMDevice *device = NM_DEVICE (iter->data); @@ -2010,7 +2007,7 @@ user_get_secrets (NMManager *self, nm_connection_get_path (connection), NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS); if (!info->proxy) { - nm_warning ("%s: could not create user connection secrets proxy", __func__); + nm_log_warn (LOGD_USER_SET, "could not create user connection secrets proxy"); g_free (info); return NULL; } @@ -2225,8 +2222,8 @@ wait_for_connection_expired (gpointer data) g_set_error (&error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION, "%s", "Connection was not provided by any settings service"); - nm_warning ("Connection (%d) %s failed to activate (timeout): (%d) %s", - info->scope, info->connection_path, error->code, error->message); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate (timeout): (%d) %s", + info->scope, info->connection_path, error->code, error->message); dbus_g_method_return_error (info->context, error); g_error_free (error); @@ -2377,8 +2374,8 @@ connection_added_default_handler (NMManager *manager, g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); } else { dbus_g_method_return_error (info->context, error); - nm_warning ("Connection (%d) %s failed to activate: (%d) %s", - scope, info->connection_path, error->code, error->message); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", + scope, info->connection_path, error->code, error->message); g_error_free (error); } @@ -2561,8 +2558,8 @@ impl_manager_activate_connection (NMManager *manager, err: if (error) { dbus_g_method_return_error (context, error); - nm_warning ("Connection (%d) %s failed to activate: (%d) %s", - scope, connection_path, error->code, error->message); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", + scope, connection_path, error->code, error->message); g_error_free (error); } @@ -2656,16 +2653,16 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) "main", "NetworkingEnabled", G_TYPE_BOOLEAN, (gpointer) &networking_enabled, &err)) { - g_warning ("Writing to state file %s failed: (%d) %s.", - priv->state_file, - err ? err->code : -1, - (err && err->message) ? err->message : "unknown"); + nm_log_warn (LOGD_SUSPEND, "writing to state file %s failed: (%d) %s.", + priv->state_file, + err ? err->code : -1, + (err && err->message) ? err->message : "unknown"); } } if (sleep) { - nm_info ("Sleeping..."); + nm_log_info (LOGD_SUSPEND, "sleeping..."); /* Just deactivate and down all devices from the device list, * we'll remove them in 'wake' for speed's sake. @@ -2675,7 +2672,7 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) } else { const GSList *unmanaged_specs; - nm_info ("Waking up..."); + nm_log_info (LOGD_SUSPEND, "waking up..."); unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (priv->sys_settings); @@ -2798,7 +2795,7 @@ nm_manager_get_connections (NMManager *manager, else if (scope == NM_CONNECTION_SCOPE_SYSTEM) g_hash_table_foreach (priv->system_connections, connections_to_slist, &list); else - nm_warning ("Unknown NMConnectionScope %d", scope); + nm_log_err (LOGD_CORE, "unknown NMConnectionScope %d", scope); return list; } @@ -2819,7 +2816,7 @@ nm_manager_get_connection_by_object_path (NMManager *manager, else if (scope == NM_CONNECTION_SCOPE_SYSTEM) connection = (NMConnection *) g_hash_table_lookup (priv->system_connections, path); else - nm_warning ("Unknown NMConnectionScope %d", scope); + nm_log_err (LOGD_CORE, "unknown NMConnectionScope %d", scope); return connection; } @@ -2862,10 +2859,10 @@ nm_manager_start (NMManager *self) } rstate->hw_enabled = hw_enabled; - nm_info ("%s %s by radio killswitch; %s by state file", - rstate->desc, - (rstate->hw_enabled && enabled) ? "enabled" : "disabled", - (rstate->enabled) ? "enabled" : "disabled"); + nm_log_info (LOGD_RFKILL, "%s %s by radio killswitch; %s by state file", + rstate->desc, + (rstate->hw_enabled && enabled) ? "enabled" : "disabled", + (rstate->enabled) ? "enabled" : "disabled"); manager_set_radio_enabled (self, rstate, rstate->enabled && enabled); } @@ -3176,7 +3173,7 @@ nm_manager_init (NMManager *manager) manager, NULL); } else - nm_warning ("%s: could not initialize avahi-autoipd D-Bus proxy", __func__); + nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); } static void From 8faf8c91efbaae1b8546cb727a37332f9a85485d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:25:42 -0700 Subject: [PATCH 161/392] logging: add DEVICE logging domain --- src/main.c | 2 +- src/nm-logging.c | 1 + src/nm-logging.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index d044d0e3b1..142c1af1f8 100644 --- a/src/main.c +++ b/src/main.c @@ -462,7 +462,7 @@ main (int argc, char *argv[]) { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, - "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE]", + "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE,DEVICE]", "HW,RFKILL,WIFI" }, {NULL} }; diff --git a/src/nm-logging.c b/src/nm-logging.c index 06a6b1b6f1..fdb6e675d0 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -77,6 +77,7 @@ static const LogDesc domain_descs[] = { { LOGD_SYS_SET, "SYS_SET" }, { LOGD_SUSPEND, "SUSPEND" }, { LOGD_CORE, "CORE" }, + { LOGD_DEVICE, "DEVICE" }, { 0, NULL } }; diff --git a/src/nm-logging.h b/src/nm-logging.h index 8880053143..1b5327812d 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -48,6 +48,7 @@ enum { LOGD_SYS_SET = 0x00040000, LOGD_SUSPEND = 0x00080000, LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */ + LOGD_DEVICE = 0x00200000, /* Device state and activation */ }; /* Log levels */ From a8c61751941c503b60f720ddcc8970fc8192d8d0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:25:54 -0700 Subject: [PATCH 162/392] logging: update nm-udev-manager.c logging --- src/nm-udev-manager.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c index 956068de41..b1b49f510f 100644 --- a/src/nm-udev-manager.c +++ b/src/nm-udev-manager.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -33,7 +33,7 @@ #include "nm-udev-manager.h" #include "nm-marshal.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "NetworkManagerUtils.h" #include "nm-device-wifi.h" #include "nm-device-olpc-mesh.h" @@ -139,7 +139,7 @@ sysfs_state_to_nm_state (gint sysfs_state) case 2: return RFKILL_HARD_BLOCKED; default: - g_warning ("%s: Unhandled rfkill state %d", __func__, sysfs_state); + nm_log_warn (LOGD_RFKILL, "unhandled rfkill state %d", sysfs_state); break; } return RFKILL_UNBLOCKED; @@ -229,11 +229,11 @@ add_one_killswitch (NMUdevManager *self, GUdevDevice *device) ks = killswitch_new (device, rtype); priv->killswitches = g_slist_prepend (priv->killswitches, ks); - nm_info ("Found %s radio killswitch %s (at %s) (driver %s)", - str_type, - ks->name, - ks->path, - ks->driver ? ks->driver : ""); + nm_log_info (LOGD_RFKILL, "found %s radio killswitch %s (at %s) (driver %s)", + str_type, + ks->name, + ks->path, + ks->driver ? ks->driver : ""); } static void @@ -265,7 +265,7 @@ rfkill_remove (NMUdevManager *self, Killswitch *ks = iter->data; if (!strcmp (ks->name, name)) { - nm_info ("Radio killswitch %s disappeared", ks->path); + nm_log_info (LOGD_RFKILL, "radio killswitch %s disappeared", ks->path); priv->killswitches = g_slist_remove (priv->killswitches, ks); killswitch_destroy (ks); break; @@ -322,7 +322,7 @@ device_creator (NMUdevManager *manager, path = g_udev_device_get_sysfs_path (udev_device); if (!path) { - nm_warning ("couldn't determine device path; ignoring..."); + nm_log_warn (LOGD_HW, "couldn't determine device path; ignoring..."); return NULL; } @@ -345,13 +345,13 @@ device_creator (NMUdevManager *manager, } if (!driver) { - nm_warning ("%s: couldn't determine device driver; ignoring...", path); + nm_log_warn (LOGD_HW, "%s: couldn't determine device driver; ignoring...", path); goto out; } ifindex = g_udev_device_get_sysfs_attr_as_int (udev_device, "ifindex"); if (ifindex <= 0) { - nm_warning ("%s: device had invalid ifindex %d; ignoring...", path, (guint32) ifindex); + nm_log_warn (LOGD_HW, "%s: device had invalid ifindex %d; ignoring...", path, (guint32) ifindex); goto out; } From dda5a3da407ea39d19a63b33b92f5cc46596fa03 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:32:23 -0700 Subject: [PATCH 163/392] logging: update default log domains --- src/nm-logging.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index fdb6e675d0..ba5f877448 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -39,7 +39,8 @@ #include "nm-utils.h" static guint32 log_level = LOGL_INFO; -static guint32 log_domains = LOGD_CORE | LOGD_HW | LOGD_RFKILL | LOGD_SUSPEND; +static guint32 log_domains = \ + LOGD_CORE | LOGD_HW | LOGD_RFKILL | LOGD_SUSPEND | LOGD_MB | LOGD_BT; typedef struct { guint32 num; From b7288577fe4249304cc0a77ce4862cf1791b8b59 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:41:12 -0700 Subject: [PATCH 164/392] logging: update modem-manager logging --- src/modem-manager/nm-modem-cdma.c | 16 ++++----- src/modem-manager/nm-modem-gsm.c | 22 ++++++------ src/modem-manager/nm-modem-manager.c | 36 +++++++++---------- src/modem-manager/nm-modem.c | 53 ++++++++++++++-------------- 4 files changed, 64 insertions(+), 63 deletions(-) diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index f2a04dc076..c32c18222c 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. * Copyright (C) 2009 Novell, Inc. */ @@ -28,8 +28,8 @@ #include "nm-dbus-manager.h" #include "nm-setting-connection.h" #include "nm-setting-cdma.h" -#include "nm-utils.h" #include "NetworkManagerUtils.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM) @@ -119,9 +119,9 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); else { - nm_warning ("CDMA connection failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "CDMA connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_error_free (error); g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_NONE); } @@ -150,9 +150,9 @@ stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_da if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) do_connect (self); else { - nm_warning ("CDMA modem enable failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "CDMA modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_error_free (error); g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); } diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index 152b2a6a9c..abb96db1fd 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. * Copyright (C) 2009 Novell, Inc. */ @@ -26,7 +26,7 @@ #include "nm-setting-connection.h" #include "nm-setting-gsm.h" #include "nm-modem-types.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "NetworkManagerUtils.h" typedef enum { @@ -207,9 +207,9 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) ask_for_pin (self, TRUE); else { - nm_warning ("GSM connection failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "GSM connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, translate_mm_error (error)); } @@ -260,9 +260,9 @@ stage1_pin_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) /* Success; go back and try the enable again */ do_enable (self); } else { - nm_warning ("GSM PIN unlock failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "GSM PIN unlock failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_error_free (error); g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); @@ -303,9 +303,9 @@ stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_da if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) do_connect (self); else { - nm_warning ("GSM modem enable failed: (%d) %s", - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "GSM modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) handle_enable_pin_required (self); diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index 6a7de07ef9..28f7b94d0c 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -15,18 +15,18 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. * Copyright (C) 2009 Novell, Inc. * Copyright (C) 2009 Canonical Ltd. */ #include #include "nm-modem-manager.h" +#include "nm-logging.h" #include "nm-modem.h" #include "nm-modem-gsm.h" #include "nm-modem-cdma.h" #include "nm-dbus-manager.h" -#include "nm-utils.h" #include "nm-modem-types.h" #include "nm-marshal.h" @@ -95,7 +95,7 @@ get_modem_properties (DBusGConnection *connection, *type = g_value_get_uint (&value); g_value_unset (&value); } else { - g_warning ("Could not get device type: %s", err->message); + nm_log_warn (LOGD_MB, "could not get device type: %s", err->message); goto out; } @@ -108,7 +108,7 @@ get_modem_properties (DBusGConnection *connection, *device = g_value_dup_string (&value); g_value_unset (&value); } else { - g_warning ("Could not get device: %s", err->message); + nm_log_warn (LOGD_MB, "could not get device: %s", err->message); goto out; } @@ -121,7 +121,7 @@ get_modem_properties (DBusGConnection *connection, *ip_method = g_value_get_uint (&value); g_value_unset (&value); } else { - g_warning ("Could not get IP method: %s", err->message); + nm_log_warn (LOGD_MB, "could not get IP method: %s", err->message); goto out; } @@ -134,7 +134,7 @@ get_modem_properties (DBusGConnection *connection, *data_device = g_value_dup_string (&value); g_value_unset (&value); } else { - g_warning ("Could not get modem data device: %s", err->message); + nm_log_warn (LOGD_MB, "could not get modem data device: %s", err->message); goto out; } @@ -147,7 +147,7 @@ get_modem_properties (DBusGConnection *connection, *driver = g_value_dup_string (&value); g_value_unset (&value); } else { - g_warning ("Could not get modem driver: %s", err->message); + nm_log_warn (LOGD_MB, "could not get modem driver: %s", err->message); goto out; } @@ -164,13 +164,13 @@ static void create_modem (NMModemManager *manager, const char *path) { NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (manager); - NMModem *modem; + NMModem *modem = NULL; char *data_device = NULL, *driver = NULL, *master_device = NULL; uint modem_type = MM_MODEM_TYPE_UNKNOWN; uint ip_method = MM_MODEM_IP_METHOD_PPP; if (g_hash_table_lookup (priv->modems, path)) { - nm_warning ("Modem with path %s already exists, ignoring", path); + nm_log_warn (LOGD_MB, "modem with path %s already exists, ignoring", path); return; } @@ -180,22 +180,22 @@ create_modem (NMModemManager *manager, const char *path) return; if (modem_type == MM_MODEM_TYPE_UNKNOWN) { - nm_warning ("Modem with path %s has unknown type, ignoring", path); + nm_log_warn (LOGD_MB, "modem with path %s has unknown type, ignoring", path); return; } if (!master_device || !strlen (master_device)) { - nm_warning ("Modem with path %s has unknown device, ignoring", path); + nm_log_warn (LOGD_MB, "modem with path %s has unknown device, ignoring", path); return; } if (!driver || !strlen (driver)) { - nm_warning ("Modem with path %s has unknown driver, ignoring", path); + nm_log_warn (LOGD_MB, "modem with path %s has unknown driver, ignoring", path); return; } if (!data_device || !strlen (data_device)) { - nm_warning ("Modem with path %s has unknown data device, ignoring", path); + nm_log_warn (LOGD_MB, "modem with path %s has unknown data device, ignoring", path); return; } @@ -204,7 +204,7 @@ create_modem (NMModemManager *manager, const char *path) else if (modem_type == MM_MODEM_TYPE_CDMA) modem = nm_modem_cdma_new (path, master_device, data_device, ip_method); else - g_error ("Invalid modem type"); + nm_log_warn (LOGD_MB, "unknown modem type '%d'", modem_type); g_free (data_device); @@ -265,7 +265,7 @@ enumerate_devices_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer dat if (!dbus_g_proxy_end_call (proxy, call_id, &error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &modems, G_TYPE_INVALID)) { - nm_warning ("Could not get modem list: %s", error->message); + nm_log_warn (LOGD_MB, "could not get modem list: %s", error->message); g_error_free (error); } else { int i; @@ -291,7 +291,7 @@ modem_manager_appeared (NMModemManager *self, gboolean enumerate_devices) priv->poke_id = 0; } - nm_info ("modem-manager is now available"); + nm_log_info (LOGD_MB, "modem-manager is now available"); priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), MM_DBUS_SERVICE, MM_DBUS_PATH, MM_DBUS_INTERFACE); @@ -331,7 +331,7 @@ modem_manager_disappeared (NMModemManager *self) } /* Try to activate the modem-manager */ - nm_info ("Trying to start the modem-manager..."); + nm_log_info (LOGD_MB, "trying to start the modem manager..."); poke_modem_cb (self); priv->poke_id = g_timeout_add_seconds (MODEM_POKE_INTERVAL, poke_modem_cb, self); } @@ -356,7 +356,7 @@ nm_modem_manager_name_owner_changed (NMDBusManager *dbus_mgr, if (!old_owner_good && new_owner_good) { modem_manager_appeared (NM_MODEM_MANAGER (user_data), FALSE); } else if (old_owner_good && !new_owner_good) { - nm_info ("modem manager disappeared"); + nm_log_info (LOGD_MB, "the modem manager disappeared"); modem_manager_disappeared (NM_MODEM_MANAGER (user_data)); } } diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 4ce4c9ee48..d9413edf28 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. * Copyright (C) 2009 Novell, Inc. */ @@ -27,7 +27,7 @@ #include "nm-marshal.h" #include "nm-properties-changed-signal.h" #include "nm-modem-types.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "NetworkManagerUtils.h" #include "nm-device-private.h" #include "nm-device-interface.h" @@ -203,6 +203,7 @@ ppp_ip4_config (NMPPPManager *ppp_manager, } if (!num || dns_workaround) { + nm_log_warn (LOGD_PPP, "compensating for invalid PPP-provided nameservers"); nm_ip4_config_reset_nameservers (config); nm_ip4_config_add_nameserver (config, good_dns1); nm_ip4_config_add_nameserver (config, good_dns2); @@ -267,8 +268,7 @@ ppp_stage3_ip4_config_start (NMModem *self, ret = NM_ACT_STAGE_RETURN_POSTPONE; } else { - nm_warning ("%s: error starting PPP: (%d) %s", - __func__, + nm_log_err (LOGD_PPP, "error starting PPP: (%d) %s", error ? error->code : -1, error && error->message ? error->message : "(unknown)"); g_error_free (error); @@ -398,6 +398,7 @@ nm_modem_stage3_ip4_config_start (NMModem *self, NMDeviceClass *device_class, NMDeviceStateReason *reason) { + NMModemPrivate *priv; NMActRequest *req; NMActStageReturn ret; @@ -412,7 +413,8 @@ nm_modem_stage3_ip4_config_start (NMModem *self, req = nm_device_get_act_request (device); g_assert (req); - switch (NM_MODEM_GET_PRIVATE (self)->ip_method) { + priv = NM_MODEM_GET_PRIVATE (self); + switch (priv->ip_method) { case MM_MODEM_IP_METHOD_PPP: ret = ppp_stage3_ip4_config_start (self, req, reason); break; @@ -423,7 +425,7 @@ nm_modem_stage3_ip4_config_start (NMModem *self, ret = device_class->act_stage3_ip4_config_start (device, reason); break; default: - g_warning ("Invalid IP method"); + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); ret = NM_ACT_STAGE_RETURN_FAILURE; break; } @@ -438,6 +440,7 @@ nm_modem_stage4_get_ip4_config (NMModem *self, NMIP4Config **config, NMDeviceStateReason *reason) { + NMModemPrivate *priv; NMActRequest *req; NMActStageReturn ret; @@ -452,7 +455,8 @@ nm_modem_stage4_get_ip4_config (NMModem *self, req = nm_device_get_act_request (device); g_assert (req); - switch (NM_MODEM_GET_PRIVATE (self)->ip_method) { + priv = NM_MODEM_GET_PRIVATE (self); + switch (priv->ip_method) { case MM_MODEM_IP_METHOD_PPP: ret = ppp_stage4 (self, req, config, reason); break; @@ -463,7 +467,7 @@ nm_modem_stage4_get_ip4_config (NMModem *self, ret = device_class->act_stage4_get_ip4_config (device, config, reason); break; default: - g_warning ("Invalid IP method"); + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); ret = NM_ACT_STAGE_RETURN_FAILURE; break; } @@ -526,7 +530,7 @@ nm_modem_connection_secrets_updated (NMModem *self, if (!strcmp (candidate_setting_name, setting_name)) found = TRUE; else { - nm_warning ("Ignoring updated secrets for setting '%s'.", + nm_log_warn (LOGD_MB, "ignoring updated secrets for setting '%s'.", candidate_setting_name); } } @@ -662,7 +666,7 @@ real_deactivate_quickly (NMModem *self, NMDevice *device) nm_system_device_set_up_down_with_iface (iface, FALSE, NULL); break; default: - g_warning ("Invalid IP method"); + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); break; } } @@ -679,10 +683,9 @@ disconnect_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) GError *error = NULL; if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { - g_warning ("%s: disconnect failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_info (LOGD_MB, "disconnect failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); } } @@ -786,10 +789,9 @@ get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_VALUE, &value, G_TYPE_INVALID)) { - g_warning ("%s: failed get modem enabled state: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "failed get modem enabled state: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); return; } @@ -797,7 +799,7 @@ get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d NM_MODEM_GET_PRIVATE (self)->mm_enabled = g_value_get_boolean (&value); g_object_notify (G_OBJECT (self), NM_MODEM_ENABLED); } else - g_warning ("%s: failed get modem enabled state: unexpected reply type", __func__); + nm_log_warn (LOGD_MB, "failed get modem enabled state: unexpected reply type"); g_value_unset (&value); } @@ -819,10 +821,9 @@ set_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d GError *error = NULL; if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { - g_warning ("%s: failed to enable/disable modem: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB, "failed to enable/disable modem: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); } /* Update enabled/disabled state again */ @@ -904,17 +905,17 @@ constructor (GType type, priv = NM_MODEM_GET_PRIVATE (object); if (!priv->device) { - g_warning ("Modem parent device not provided"); + nm_log_err (LOGD_HW, "modem parent device not provided"); goto err; } if (!priv->device) { - g_warning ("Modem command interface not provided"); + nm_log_err (LOGD_HW, "modem command interface not provided"); goto err; } if (!priv->path) { - g_warning ("DBus path not provided"); + nm_log_err (LOGD_HW, "D-Bus path not provided"); goto err; } From 893315ece6b3ee8a2e72d7375b81d51038dd4e28 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:54:24 -0700 Subject: [PATCH 165/392] logging: update VPN manager logging --- src/vpn-manager/nm-vpn-connection.c | 101 +++++++++++++++------------- src/vpn-manager/nm-vpn-manager.c | 1 - src/vpn-manager/nm-vpn-service.c | 59 ++++++++-------- 3 files changed, 85 insertions(+), 76 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 01bd23c578..01f639acc5 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.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 - 2009 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -36,6 +36,7 @@ #include "nm-dbus-manager.h" #include "nm-manager.h" #include "nm-system.h" +#include "nm-logging.h" #include "nm-utils.h" #include "nm-vpn-plugin-bindings.h" #include "nm-marshal.h" @@ -269,7 +270,7 @@ plugin_failed (DBusGProxy *proxy, { NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (user_data); - nm_info ("VPN plugin failed: %d", plugin_failure); + nm_log_warn (LOGD_VPN, "VPN plugin failed: %d", plugin_failure); switch (plugin_failure) { case NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED: @@ -291,7 +292,7 @@ plugin_state_changed (DBusGProxy *proxy, NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); - nm_info ("VPN plugin state changed: %d", state); + nm_log_info (LOGD_VPN, "VPN plugin state changed: %d", state); if (state == NM_VPN_SERVICE_STATE_STOPPED) { /* Clear connection secrets to ensure secrets get requested each time the @@ -305,7 +306,7 @@ plugin_state_changed (DBusGProxy *proxy, case NM_VPN_CONNECTION_STATE_CONNECT: case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: case NM_VPN_CONNECTION_STATE_ACTIVATED: - nm_info ("VPN plugin state change reason: %d", priv->failure_reason); + nm_log_info (LOGD_VPN, "VPN plugin state change reason: %d", priv->failure_reason); nm_vpn_connection_set_vpn_state (connection, NM_VPN_CONNECTION_STATE_FAILED, priv->failure_reason); @@ -331,8 +332,8 @@ ip_address_to_string (guint32 numeric) if (inet_ntop (AF_INET, &temp_addr, buf, INET_ADDRSTRLEN)) { return buf; } else { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (temp_addr.s_addr)); + nm_log_warn (LOGD_VPN, "error converting IP4 address 0x%X", + ntohl (temp_addr.s_addr)); return NULL; } } @@ -351,38 +352,44 @@ print_vpn_config (NMIP4Config *config, addr = nm_ip4_config_get_address (config, 0); - nm_info ("VPN Gateway: %s", ip_address_to_string (nm_ip4_address_get_gateway (addr))); + nm_log_info (LOGD_VPN, "VPN Gateway: %s", ip_address_to_string (nm_ip4_address_get_gateway (addr))); if (internal_gw) - nm_info ("Internal Gateway: %s", ip_address_to_string (internal_gw)); - nm_info ("Tunnel Device: %s", tundev); - nm_info ("Internal IP4 Address: %s", ip_address_to_string (nm_ip4_address_get_address (addr))); - nm_info ("Internal IP4 Prefix: %d", nm_ip4_address_get_prefix (addr)); - nm_info ("Internal IP4 Point-to-Point Address: %s", - ip_address_to_string (nm_ip4_config_get_ptp_address (config))); - nm_info ("Maximum Segment Size (MSS): %d", nm_ip4_config_get_mss (config)); + nm_log_info (LOGD_VPN, "Internal Gateway: %s", ip_address_to_string (internal_gw)); + nm_log_info (LOGD_VPN, "Tunnel Device: %s", tundev); + nm_log_info (LOGD_VPN, "Internal IP4 Address: %s", ip_address_to_string (nm_ip4_address_get_address (addr))); + nm_log_info (LOGD_VPN, "Internal IP4 Prefix: %d", nm_ip4_address_get_prefix (addr)); + nm_log_info (LOGD_VPN, "Internal IP4 Point-to-Point Address: %s", + ip_address_to_string (nm_ip4_config_get_ptp_address (config))); + nm_log_info (LOGD_VPN, "Maximum Segment Size (MSS): %d", nm_ip4_config_get_mss (config)); num = nm_ip4_config_get_num_routes (config); for (i = 0; i < num; i++) { NMIP4Route *route; route = nm_ip4_config_get_route (config, i); - nm_info ("Static Route: %s/%d Next Hop: %s", - ip_address_to_string (nm_ip4_route_get_dest (route)), - nm_ip4_route_get_prefix (route), - ip_address_to_string (nm_ip4_route_get_next_hop (route))); + nm_log_info (LOGD_VPN, "Static Route: %s/%d Next Hop: %s", + ip_address_to_string (nm_ip4_route_get_dest (route)), + nm_ip4_route_get_prefix (route), + ip_address_to_string (nm_ip4_route_get_next_hop (route))); } num = nm_ip4_config_get_num_nameservers (config); - for (i = 0; i < num; i++) - nm_info ("Internal IP4 DNS: %s", ip_address_to_string (nm_ip4_config_get_nameserver (config, i))); + for (i = 0; i < num; i++) { + nm_log_info (LOGD_VPN, "Internal IP4 DNS: %s", + ip_address_to_string (nm_ip4_config_get_nameserver (config, i))); + } if (nm_ip4_config_get_num_domains (config) > 0) dns_domain = (char *) nm_ip4_config_get_domain (config, 0); - nm_info ("DNS Domain: '%s'", dns_domain ? dns_domain : "(none)"); - nm_info ("Login Banner:"); - nm_info ("-----------------------------------------"); - nm_info ("%s", banner); - nm_info ("-----------------------------------------"); + + nm_log_info (LOGD_VPN, "DNS Domain: '%s'", dns_domain ? dns_domain : "(none)"); + + if (banner && strlen (banner)) { + nm_log_info (LOGD_VPN, "Login Banner:"); + nm_log_info (LOGD_VPN, "-----------------------------------------"); + nm_log_info (LOGD_VPN, "%s", banner); + nm_log_info (LOGD_VPN, "-----------------------------------------"); + } } static void @@ -399,8 +406,8 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, int i; guint32 vpn_ext_gw = 0; - nm_info ("VPN connection '%s' (IP Config Get) reply received.", - nm_vpn_connection_get_name (connection)); + nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) reply received.", + nm_vpn_connection_get_name (connection)); g_source_remove (priv->ipconfig_timeout); priv->ipconfig_timeout = 0; @@ -411,7 +418,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, if (val) priv->tundev = g_strdup (g_value_get_string (val)); else { - nm_warning ("%s: invalid or missing tunnel device received!", __func__); + nm_log_err (LOGD_VPN, "invalid or missing tunnel device received!"); goto error; } @@ -445,7 +452,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, if (nm_ip4_address_get_address (addr) && nm_ip4_address_get_prefix (addr)) { nm_ip4_config_take_address (config, addr); } else { - nm_warning ("%s: invalid IP4 config received!", __func__); + nm_log_err (LOGD_VPN, "invalid IP4 config received!"); nm_ip4_address_unref (addr); goto error; } @@ -532,8 +539,8 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, priv->ip4_config = config; - nm_info ("VPN connection '%s' (IP Config Get) complete.", - nm_vpn_connection_get_name (connection)); + nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) complete.", + nm_vpn_connection_get_name (connection)); nm_vpn_connection_set_vpn_state (connection, NM_VPN_CONNECTION_STATE_ACTIVATED, NM_VPN_CONNECTION_STATE_REASON_NONE); @@ -541,8 +548,8 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, } error: - nm_warning ("VPN connection '%s' did not receive valid IP config information.", - nm_vpn_connection_get_name (connection)); + nm_log_warn (LOGD_VPN, "VPN connection '%s' did not receive valid IP config information.", + nm_vpn_connection_get_name (connection)); nm_vpn_connection_set_vpn_state (connection, NM_VPN_CONNECTION_STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID); @@ -561,8 +568,8 @@ nm_vpn_connection_ip_config_timeout (gpointer user_data) * in this timeout, cancel activation because it's taken too long. */ if (nm_vpn_connection_get_vpn_state (connection) == NM_VPN_CONNECTION_STATE_IP_CONFIG_GET) { - nm_info ("VPN connection '%s' (IP Config Get) timeout exceeded.", - nm_vpn_connection_get_name (connection)); + nm_log_warn (LOGD_VPN, "VPN connection '%s' (IP Config Get) timeout exceeded.", + nm_vpn_connection_get_name (connection)); nm_vpn_connection_set_vpn_state (connection, NM_VPN_CONNECTION_STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT); @@ -577,12 +584,12 @@ nm_vpn_connection_connect_cb (DBusGProxy *proxy, GError *err, gpointer user_data NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); - nm_info ("VPN connection '%s' (Connect) reply received.", - nm_vpn_connection_get_name (connection)); + nm_log_info (LOGD_VPN, "VPN connection '%s' (Connect) reply received.", + nm_vpn_connection_get_name (connection)); if (err) { - nm_warning ("VPN connection '%s' failed to connect: '%s'.", - nm_vpn_connection_get_name (connection), err->message); + nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.", + nm_vpn_connection_get_name (connection), err->message); nm_vpn_connection_set_vpn_state (connection, NM_VPN_CONNECTION_STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED); @@ -777,9 +784,9 @@ secrets_update_setting (NMSecretsProviderInterface *interface, return FALSE; if (!nm_connection_update_secrets (priv->connection, NM_SETTING_VPN_SETTING_NAME, new, &error)) { - nm_warning ("Failed to update VPN secrets: %d %s", - error ? error->code : -1, - error && error->message ? error->message : "(none)"); + nm_log_warn (LOGD_VPN, "Failed to update VPN secrets: %d %s", + error ? error->code : -1, + error && error->message ? error->message : "(none)"); g_clear_error (&error); return FALSE; } @@ -823,9 +830,9 @@ connection_need_secrets_cb (DBusGProxy *proxy, NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self); if (error) { - g_warning ("%s.%d: NeedSecrets failed: %s %s", - __FILE__, __LINE__, - g_quark_to_string (error->domain), error->message); + nm_log_err (LOGD_VPN, "NeedSecrets failed: %s %s", + g_quark_to_string (error->domain), + error->message); nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS); return; } @@ -893,7 +900,7 @@ vpn_cleanup (NMVPNConnection *connection) nm_device_get_ip4_config (priv->parent_dev), nm_device_get_priority (priv->parent_dev), NM_IP4_COMPARE_FLAG_ADDRESSES | NM_IP4_COMPARE_FLAG_ROUTES)) { - nm_warning ("%s: failed to re-apply VPN parent device addresses and routes.", __func__); + nm_log_err (LOGD_VPN, "failed to re-apply VPN parent device addresses and routes."); } } } @@ -940,7 +947,7 @@ connection_state_changed (NMVPNConnection *connection, org_freedesktop_NetworkManager_VPN_Plugin_disconnect (priv->proxy, &err); if (err) { - nm_warning ("%s", err->message); + nm_log_warn (LOGD_VPN, "error disconnecting VPN: %s", err->message); g_error_free (err); } diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c index e8fa24c8db..221a8b548c 100644 --- a/src/vpn-manager/nm-vpn-manager.c +++ b/src/vpn-manager/nm-vpn-manager.c @@ -27,7 +27,6 @@ #include "nm-setting-vpn.h" #include "nm-dbus-manager.h" #include "NetworkManagerVPN.h" -#include "nm-utils.h" #include "nm-marshal.h" G_DEFINE_TYPE (NMVPNManager, nm_vpn_manager, G_TYPE_OBJECT) diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c index 15aa56db5e..bdbb3774a0 100644 --- a/src/vpn-manager/nm-vpn-service.c +++ b/src/vpn-manager/nm-vpn-service.c @@ -29,7 +29,7 @@ #include "nm-vpn-service.h" #include "nm-dbus-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-vpn-manager.h" #include "nm-glib-compat.h" @@ -198,18 +198,20 @@ vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) if (WIFEXITED (status)) { guint err = WEXITSTATUS (status); - if (err != 0) - nm_warning ("VPN service '%s' exited with error: %d", - nm_vpn_service_get_name (service), WSTOPSIG (status)); - } else if (WIFSTOPPED (status)) - nm_warning ("VPN service '%s' stopped unexpectedly with signal %d", - nm_vpn_service_get_name (service), WSTOPSIG (status)); - else if (WIFSIGNALED (status)) - nm_warning ("VPN service '%s' died with signal %d", - nm_vpn_service_get_name (service), WTERMSIG (status)); - else - nm_warning ("VPN service '%s' died from an unknown cause", - nm_vpn_service_get_name (service)); + if (err != 0) { + nm_log_warn (LOGD_VPN, "VPN service '%s' exited with error: %d", + nm_vpn_service_get_name (service), WSTOPSIG (status)); + } + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_VPN, "VPN service '%s' stopped unexpectedly with signal %d", + nm_vpn_service_get_name (service), WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_VPN, "VPN service '%s' died with signal %d", + nm_vpn_service_get_name (service), WTERMSIG (status)); + } else { + nm_log_warn (LOGD_VPN, "VPN service '%s' died from an unknown cause", + nm_vpn_service_get_name (service)); + } priv->pid = 0; priv->service_child_watch = 0; @@ -222,8 +224,8 @@ nm_vpn_service_timeout (gpointer data) { NMVPNService *service = NM_VPN_SERVICE (data); - nm_info ("VPN service '%s' did not start in time, cancelling connections", - nm_vpn_service_get_name (service)); + 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); @@ -250,14 +252,14 @@ nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) nm_vpn_service_child_setup, NULL, &priv->pid, &spawn_error); if (success) { - nm_info ("VPN service '%s' started (%s), PID %d", - nm_vpn_service_get_name (service), priv->dbus_service, priv->pid); + nm_log_info (LOGD_VPN, "VPN service '%s' started (%s), PID %d", + nm_vpn_service_get_name (service), priv->dbus_service, priv->pid); priv->service_child_watch = g_child_watch_add (priv->pid, vpn_service_watch_cb, service); priv->service_start_timeout = g_timeout_add_seconds (5, nm_vpn_service_timeout, service); } else { - nm_warning ("VPN service '%s': could not launch the VPN service. error: (%d) %s.", - nm_vpn_service_get_name (service), spawn_error->code, spawn_error->message); + nm_log_warn (LOGD_VPN, "VPN service '%s': could not launch the VPN service. error: (%d) %s.", + nm_vpn_service_get_name (service), spawn_error->code, spawn_error->message); g_set_error (error, NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, @@ -334,7 +336,8 @@ nm_vpn_service_activate (NMVPNService *service, // FIXME: fill in error when errors happen nm_vpn_connection_activate (vpn); } else if (priv->service_start_timeout == 0) { - nm_info ("Starting VPN service '%s'...", nm_vpn_service_get_name (service)); + nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", + nm_vpn_service_get_name (service)); if (!nm_vpn_service_daemon_exec (service, error)) vpn = NULL; } @@ -378,16 +381,16 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, /* service just appeared */ GSList *iter; - nm_info ("VPN service '%s' just appeared, activating connections", - nm_vpn_service_get_name (service)); + nm_log_info (LOGD_VPN, "VPN service '%s' appeared, activating connections", + nm_vpn_service_get_name (service)); for (iter = priv->connections; iter; iter = iter->next) nm_vpn_connection_activate (NM_VPN_CONNECTION (iter->data)); } else if (old_owner_good && !new_owner_good) { /* service went away */ - nm_info ("VPN service '%s' disappeared, cancelling connections", - nm_vpn_service_get_name (service)); + nm_log_info (LOGD_VPN, "VPN service '%s' disappeared, cancelling connections", + nm_vpn_service_get_name (service)); nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); } } @@ -415,9 +418,9 @@ ensure_killed (gpointer data) kill (pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for vpn service pid %d to exit", pid); + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", pid); waitpid (pid, NULL, 0); - nm_debug ("vpn service pid %d cleaned up", pid); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", pid); return FALSE; } @@ -446,9 +449,9 @@ finalize (GObject *object) kill (priv->pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for vpn service pid %d to exit", priv->pid); + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", priv->pid); waitpid (priv->pid, NULL, 0); - nm_debug ("vpn service pid %d cleaned up", priv->pid); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", priv->pid); } priv->pid = 0; From aa374d711a83599f8300d044fe11eed9f28e10cb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:55:50 -0700 Subject: [PATCH 166/392] named-manager: whitespace cleanups --- src/named-manager/nm-named-manager.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 2d4a132b78..1c1b895743 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2004 - 2005 Colin Walters - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. * and others */ @@ -60,9 +60,9 @@ G_DEFINE_TYPE(NMNamedManager, nm_named_manager, G_TYPE_OBJECT) struct NMNamedManagerPrivate { - NMIP4Config * vpn_config; - NMIP4Config * device_config; - GSList * configs; + NMIP4Config *vpn_config; + NMIP4Config *device_config; + GSList *configs; }; @@ -71,11 +71,10 @@ nm_named_manager_get (void) { static NMNamedManager * singleton = NULL; - if (!singleton) { + if (!singleton) singleton = NM_NAMED_MANAGER (g_object_new (NM_TYPE_NAMED_MANAGER, NULL)); - } else { + else g_object_ref (singleton); - } g_assert (singleton); return singleton; From 2c7d63919ab65b2cdf233fd6add8e312db7372ab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 16:59:31 -0700 Subject: [PATCH 167/392] named-manager: update logging --- src/named-manager/nm-named-manager.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 1c1b895743..2963652f06 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -38,7 +38,7 @@ #include "nm-named-manager.h" #include "nm-ip4-config.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-system.h" #include "NetworkManagerUtils.h" @@ -184,7 +184,7 @@ run_netconfig (GError **error, gint *stdin_fd) argv[4] = NULL; tmp = g_strjoinv (" ", argv); - nm_debug ("Spawning '%s'", tmp); + nm_log_debug (LOGD_DNS, "spawning '%s'", tmp); g_free (tmp); if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup, @@ -201,7 +201,7 @@ write_to_netconfig (gint fd, const char *key, const char *value) int x; str = g_strdup_printf ("%s='%s'\n", key, value); - nm_debug ("Writing to netconfig: %s", str); + nm_log_debug (LOGD_DNS, "writing to netconfig: %s", str); x = write (fd, str, strlen (str)); g_free (str); } @@ -326,7 +326,7 @@ write_resolv_conf (FILE *f, const char *domain, } if (fprintf (f, "%s%s%s", - domain_str ? domain_str : "", + domain_str ? domain_str : "", searches_str ? searches_str : "", nameservers_str ? nameservers_str : "") != -1) retval = TRUE; @@ -355,7 +355,7 @@ dispatch_resolvconf (const char *domain, if (domain || searches || nameservers) { cmd = g_strconcat (RESOLVCONF_PATH, " -a ", "NetworkManager", NULL); - nm_info ("(%s): writing resolv.conf to %s", iface, RESOLVCONF_PATH); + nm_log_info (LOGD_DNS, "(%s): writing resolv.conf to %s", iface, RESOLVCONF_PATH); if ((f = popen (cmd, "w")) == NULL) g_set_error (error, NM_NAMED_MANAGER_ERROR, @@ -369,7 +369,7 @@ dispatch_resolvconf (const char *domain, } } else { cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL); - nm_info ("(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH); + nm_log_info (LOGD_DNS, "(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH); if (nm_spawn_process (cmd) == 0) retval = TRUE; } @@ -586,7 +586,7 @@ nm_named_manager_add_ip4_config (NMNamedManager *mgr, priv->configs = g_slist_append (priv->configs, g_object_ref (config)); if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_warning ("Could not commit DNS changes. Error: '%s'", error ? error->message : "(none)"); + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); g_error_free (error); } @@ -622,7 +622,7 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, g_object_unref (config); if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_warning ("Could not commit DNS changes. Error: '%s'", error ? error->message : "(none)"); + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); if (error) g_error_free (error); } @@ -652,7 +652,7 @@ nm_named_manager_add_ip6_config (NMNamedManager *mgr, priv->configs = g_slist_append (priv->configs, g_object_ref (config)); if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_warning ("Could not commit DNS changes. Error: '%s'", error ? error->message : "(none)"); + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); g_error_free (error); } @@ -682,7 +682,7 @@ nm_named_manager_remove_ip6_config (NMNamedManager *mgr, g_object_unref (config); if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_warning ("Could not commit DNS changes. Error: '%s'", error ? error->message : "(none)"); + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); if (error) g_error_free (error); } From a07968179efb0f21455062f8c06ffd28cf82f3f2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 17:00:16 -0700 Subject: [PATCH 168/392] ppp: plugin doesn't need to #include --- src/ppp-manager/nm-pppd-plugin.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c index b98ec2800f..c64bb87f63 100644 --- a/src/ppp-manager/nm-pppd-plugin.c +++ b/src/ppp-manager/nm-pppd-plugin.c @@ -34,7 +34,6 @@ #include "nm-pppd-plugin.h" #include "nm-ppp-status.h" #include "nm-dbus-glib-types.h" -#include "nm-utils.h" int plugin_init (void); From 4ff8f21e4c28368927cda094404fe8fd454f903e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 17:13:45 -0700 Subject: [PATCH 169/392] ppp: update logging --- src/ppp-manager/nm-ppp-manager.c | 72 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index d3c9f6e94b..de905b49db 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -49,7 +49,7 @@ #include "nm-setting-gsm.h" #include "nm-setting-cdma.h" #include "nm-dbus-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" static void impl_ppp_manager_need_secrets (NMPPPManager *manager, @@ -296,12 +296,13 @@ monitor_cb (gpointer user_data) req.stats_ptr = (caddr_t) &req.stats; strncpy (req.ifr__name, priv->ip_iface, sizeof (req.ifr__name)); - if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) - nm_warning ("Could not read ppp stats: %s", strerror (errno)); - else + if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) { + nm_log_warn (LOGD_PPP, "could not read ppp stats: %s", strerror (errno)); + } else { g_signal_emit (manager, signals[STATS], 0, - req.stats.p.ppp_ibytes, - req.stats.p.ppp_obytes); + req.stats.p.ppp_ibytes, + req.stats.p.ppp_obytes); + } return TRUE; } @@ -315,7 +316,7 @@ monitor_stats (NMPPPManager *manager) if (priv->monitor_fd > 0) priv->monitor_id = g_timeout_add_seconds (5, monitor_cb, manager); else - nm_warning ("Could not open pppd monitor: %s", strerror (errno)); + nm_log_warn (LOGD_PPP, "could not monitor PPP stats: %s", strerror (errno)); } /*******************************************/ @@ -387,8 +388,8 @@ impl_ppp_manager_need_secrets (NMPPPManager *manager, GError *err = NULL; g_set_error (&err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN, - "Missing type-specific setting; no secrets could be found."); - nm_warning ("%s", err->message); + "Missing type-specific setting; no secrets could be found."); + nm_log_warn (LOGD_PPP, "%s", err->message); dbus_g_method_return_error (context, err); } return; @@ -442,7 +443,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager, GValue *val; int i; - nm_info ("PPP manager(IP Config Get) reply received."); + nm_log_info (LOGD_PPP, "PPP manager(IP Config Get) reply received."); remove_timeout_handler (manager); @@ -467,7 +468,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager, if (nm_ip4_address_get_address (addr) && nm_ip4_address_get_prefix (addr)) { nm_ip4_config_take_address (config, addr); } else { - nm_warning ("%s: invalid IPv4 address received!", __func__); + nm_log_err (LOGD_PPP, "invalid IPv4 address received!"); nm_ip4_address_unref (addr); goto out; } @@ -490,7 +491,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager, val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_INTERFACE); if (!val || !G_VALUE_HOLDS_STRING (val)) { - nm_warning ("No interface"); + nm_log_err (LOGD_PPP, "no interface received!"); goto out; } priv->ip_iface = g_value_dup_string (val); @@ -582,13 +583,12 @@ nm_cmd_line_add_int (NMCmdLine *cmd, int i) static inline const char * nm_find_pppd (void) { - static const char *pppd_binary_paths[] = - { - "/usr/local/sbin/pppd", - "/usr/sbin/pppd", - "/sbin/pppd", - NULL - }; + static const char *pppd_binary_paths[] = { + "/usr/local/sbin/pppd", + "/usr/sbin/pppd", + "/sbin/pppd", + NULL + }; const char **pppd_binary = pppd_binary_paths; @@ -670,7 +670,7 @@ ppp_exit_code (guint pppd_exit_status, GPid pid) msg = "Unknown error"; } - nm_warning ("ppp pid %d exited with error: %s", pid, msg); + nm_log_warn (LOGD_PPP, "pppd pid %d exited with error: %s", pid, msg); } static void @@ -686,14 +686,14 @@ ppp_watch_cb (GPid pid, gint status, gpointer user_data) err = WEXITSTATUS (status); if (err != 0) ppp_exit_code (err, priv->pid); - } else if (WIFSTOPPED (status)) - nm_warning ("ppp pid %d stopped unexpectedly with signal %d", priv->pid, WSTOPSIG (status)); - else if (WIFSIGNALED (status)) - nm_warning ("ppp pid %d died with signal %d", priv->pid, WTERMSIG (status)); - else - nm_warning ("ppp pid %d died from an unknown cause", priv->pid); + } else if (WIFSTOPPED (status)) { + nm_log_info (LOGD_PPP, "pppd pid %d stopped unexpectedly with signal %d", priv->pid, WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_info (LOGD_PPP, "pppd pid %d died with signal %d", priv->pid, WTERMSIG (status)); + } else + nm_log_info (LOGD_PPP, "pppd pid %d died from an unknown cause", priv->pid); - nm_debug ("ppp pid %d cleaned up", priv->pid); + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid); priv->pid = 0; g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); } @@ -703,7 +703,7 @@ pppd_timed_out (gpointer data) { NMPPPManager *manager = NM_PPP_MANAGER (data); - nm_warning ("Looks like pppd didn't initialize our dbus module"); + nm_log_warn (LOGD_PPP, "pppd timed out or didn't initialize our dbus module"); nm_ppp_manager_stop (manager); g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); @@ -913,10 +913,10 @@ nm_ppp_manager_start (NMPPPManager *manager, priv = NM_PPP_MANAGER_GET_PRIVATE (manager); - nm_info ("Starting pppd connection"); + nm_log_info (LOGD_PPP, "starting PPP connection"); cmd_str = nm_cmd_line_to_str (ppp_cmd); - nm_debug ("Command line: %s", cmd_str); + nm_log_dbg (LOGD_PPP, "command line: %s", cmd_str); g_free (cmd_str); priv->pid = 0; @@ -927,7 +927,7 @@ nm_ppp_manager_start (NMPPPManager *manager, goto out; } - nm_debug ("ppp started with pid %d", priv->pid); + nm_log_info (LOGD_PPP, "pppd started with pid %d", priv->pid); priv->ppp_watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) ppp_watch_cb, manager); priv->ppp_timeout_handler = g_timeout_add_seconds (timeout_secs, pppd_timed_out, manager); @@ -965,7 +965,7 @@ nm_ppp_manager_update_secrets (NMPPPManager *manager, GError *err = NULL; g_set_error (&err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN, "%s", error_message); - nm_warning ("%s", error_message); + nm_log_warn (LOGD_PPP, "%s", error_message); dbus_g_method_return_error (priv->pending_secrets_context, err); g_error_free (err); } else { @@ -989,9 +989,9 @@ ensure_killed (gpointer data) kill (pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for ppp pid %d to exit", pid); + nm_log_dbg (LOGD_PPP, "waiting for pppd pid %d to exit", pid); waitpid (pid, NULL, 0); - nm_debug ("ppp pid %d cleaned up", pid); + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", pid); return FALSE; } @@ -1034,9 +1034,9 @@ nm_ppp_manager_stop (NMPPPManager *manager) kill (priv->pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for ppp pid %d to exit", priv->pid); + nm_log_dbg (LOGD_PPP, "waiting for pppd pid %d to exit", priv->pid); waitpid (priv->pid, NULL, 0); - nm_debug ("ppp pid %d cleaned up", priv->pid); + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid); } priv->pid = 0; From 3d6108f2451277a15a4f497eb1cbfc3f988d5ea8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 17:16:45 -0700 Subject: [PATCH 170/392] bt-manager: update logging --- src/bluez-manager/nm-bluez-adapter.c | 12 ++++++------ src/bluez-manager/nm-bluez-device.c | 12 ++++++------ src/bluez-manager/nm-bluez-manager.c | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bluez-manager/nm-bluez-adapter.c b/src/bluez-manager/nm-bluez-adapter.c index ba8f7114f2..27a85e78eb 100644 --- a/src/bluez-manager/nm-bluez-adapter.c +++ b/src/bluez-manager/nm-bluez-adapter.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -27,7 +27,7 @@ #include "nm-bluez-device.h" #include "nm-bluez-common.h" #include "nm-dbus-glib-types.h" -#include "nm-utils.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMBluezAdapter, nm_bluez_adapter, G_TYPE_OBJECT) @@ -175,8 +175,8 @@ get_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call, &err, DBUS_TYPE_G_MAP_OF_VARIANT, &properties, G_TYPE_INVALID)) { - nm_warning ("bluez error getting adapter properties: %s", - err && err->message ? err->message : "(unknown)"); + nm_log_warn (LOGD_BT, "bluez error getting adapter properties: %s", + err && err->message ? err->message : "(unknown)"); g_error_free (err); goto done; } @@ -209,8 +209,8 @@ query_properties (NMBluezAdapter *self) self, NULL, G_TYPE_INVALID); if (!call) { - nm_warning ("failed to request Bluetooth adapter properties for %s.", - priv->path); + nm_log_warn (LOGD_BT, "failed to request Bluetooth adapter properties for %s.", + priv->path); } } diff --git a/src/bluez-manager/nm-bluez-device.c b/src/bluez-manager/nm-bluez-device.c index 6ecd6b43c0..72acaa6906 100644 --- a/src/bluez-manager/nm-bluez-device.c +++ b/src/bluez-manager/nm-bluez-device.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -26,7 +26,7 @@ #include "nm-bluez-device.h" #include "nm-bluez-common.h" #include "nm-dbus-glib-types.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" @@ -228,8 +228,8 @@ get_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call, &err, DBUS_TYPE_G_MAP_OF_VARIANT, &properties, G_TYPE_INVALID)) { - nm_warning ("bluez error getting device properties: %s", - err && err->message ? err->message : "(unknown)"); + nm_log_warn (LOGD_BT, "bluez error getting device properties: %s", + err && err->message ? err->message : "(unknown)"); g_error_free (err); g_signal_emit (self, signals[INITIALIZED], 0, FALSE); return; @@ -270,8 +270,8 @@ query_properties (NMBluezDevice *self) self, NULL, G_TYPE_INVALID); if (!call) { - nm_warning ("failed to request Bluetooth device properties for %s.", - priv->path); + nm_log_warn (LOGD_BT, "failed to request Bluetooth device properties for %s.", + priv->path); } } diff --git a/src/bluez-manager/nm-bluez-manager.c b/src/bluez-manager/nm-bluez-manager.c index 96cb3e725e..fe027c4ff5 100644 --- a/src/bluez-manager/nm-bluez-manager.c +++ b/src/bluez-manager/nm-bluez-manager.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2009 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -24,7 +24,7 @@ #include #include -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-dbus-glib-types.h" #include "nm-marshal.h" #include "nm-bluez-manager.h" @@ -181,8 +181,8 @@ default_adapter_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call, &err, DBUS_TYPE_G_OBJECT_PATH, &default_adapter, G_TYPE_INVALID)) { - nm_warning ("bluez error getting default adapter: %s", - err && err->message ? err->message : "(unknown)"); + nm_log_warn (LOGD_BT, "bluez error getting default adapter: %s", + err && err->message ? err->message : "(unknown)"); g_error_free (err); return; } @@ -201,7 +201,7 @@ query_default_adapter (NMBluezManager *self) self, NULL, G_TYPE_INVALID); if (!call) - nm_warning ("failed to request default Bluetooth adapter."); + nm_log_warn (LOGD_BT, "failed to request default Bluetooth adapter."); } static void From a00a6e5d876412a1cc6e22bddf1200193b6f90ce Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 17:39:57 -0700 Subject: [PATCH 171/392] logging: move logging into its own subdir Some stuff we build (the DHCP manager) gets built independently so that we can use it for unit tests. For that, we need to build the logging bits separately too, since the independent DHCP library can't use them if they are embedded in NM. --- configure.ac | 1 + src/Makefile.am | 5 +++-- src/bluez-manager/Makefile.am | 2 ++ src/logging/Makefile.am | 14 ++++++++++++++ src/{ => logging}/nm-logging.c | 1 - src/{ => logging}/nm-logging.h | 11 +++++++++++ src/modem-manager/Makefile.am | 2 ++ src/named-manager/Makefile.am | 12 ++++++++++-- src/ppp-manager/Makefile.am | 2 ++ src/vpn-manager/Makefile.am | 2 ++ 10 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 src/logging/Makefile.am rename src/{ => logging}/nm-logging.c (99%) rename src/{ => logging}/nm-logging.h (91%) diff --git a/configure.ac b/configure.ac index f5872c1b0c..aedc8ec903 100644 --- a/configure.ac +++ b/configure.ac @@ -440,6 +440,7 @@ include/Makefile src/Makefile src/tests/Makefile marshallers/Makefile +src/logging/Makefile src/named-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index f2a791c6ca..214f7545c3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS= \ + logging \ named-manager \ vpn-manager \ dhcp-manager \ @@ -16,6 +17,7 @@ SUBDIRS= \ INCLUDES = -I${top_srcdir} \ -I${top_srcdir}/include \ -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/src/named-manager \ -I${top_srcdir}/src/vpn-manager \ -I${top_srcdir}/src/dhcp-manager \ @@ -125,8 +127,6 @@ NetworkManager_SOURCES = \ NetworkManagerUtils.h \ nm-system.c \ nm-system.h \ - nm-logging.c \ - nm-logging.h \ nm-manager.c \ nm-manager.h \ nm-netlink-monitor.c \ @@ -224,6 +224,7 @@ NetworkManager_CPPFLAGS = \ NetworkManager_LDADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + ./logging/libnm-logging.la \ ./named-manager/libnamed-manager.la \ ./vpn-manager/libvpn-manager.la \ ./dhcp-manager/libdhcp-manager.la \ diff --git a/src/bluez-manager/Makefile.am b/src/bluez-manager/Makefile.am index a96cbe8910..6c199e8ca7 100644 --- a/src/bluez-manager/Makefile.am +++ b/src/bluez-manager/Makefile.am @@ -3,6 +3,7 @@ INCLUDES = \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ -I${top_builddir}/marshallers \ -I$(top_srcdir)/src/nm-bluez-manager @@ -30,6 +31,7 @@ libbluez_manager_la_CPPFLAGS = \ libbluez_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(BLUEZ_LIBS) diff --git a/src/logging/Makefile.am b/src/logging/Makefile.am new file mode 100644 index 0000000000..d2e3e25112 --- /dev/null +++ b/src/logging/Makefile.am @@ -0,0 +1,14 @@ +noinst_LTLIBRARIES = libnm-logging.la + +libnm_logging_la_SOURCES = \ + nm-logging.c \ + nm-logging.h + +libnm_logging_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DG_DISABLE_DEPRECATED + +libnm_logging_la_LIBADD = \ + $(GLIB_LIBS) + diff --git a/src/nm-logging.c b/src/logging/nm-logging.c similarity index 99% rename from src/nm-logging.c rename to src/logging/nm-logging.c index ba5f877448..3d8e99b3df 100644 --- a/src/nm-logging.c +++ b/src/logging/nm-logging.c @@ -36,7 +36,6 @@ #include #include "nm-logging.h" -#include "nm-utils.h" static guint32 log_level = LOGL_INFO; static guint32 log_domains = \ diff --git a/src/nm-logging.h b/src/logging/nm-logging.h similarity index 91% rename from src/nm-logging.h rename to src/logging/nm-logging.h index 1b5327812d..086d74b92e 100644 --- a/src/nm-logging.h +++ b/src/logging/nm-logging.h @@ -78,6 +78,17 @@ void _nm_log (const char *func, const char *loc, guint32 domain, guint32 level, const char *fmt, ...); +/* Undefine the nm-utils.h logging stuff to ensure errors */ +#undef nm_print_backtrace +#undef nm_get_timestamp +#undef nm_info +#undef nm_info_str +#undef nm_debug +#undef nm_debug_str +#undef nm_warning +#undef nm_warning_str +#undef nm_error +#undef nm_error_str gboolean nm_logging_setup (const char *level, const char *domains, GError **error); void nm_logging_start (gboolean become_daemon); diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am index 932a041c0d..a0f65c1bae 100644 --- a/src/modem-manager/Makefile.am +++ b/src/modem-manager/Makefile.am @@ -1,5 +1,6 @@ INCLUDES = \ -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ -I${top_builddir}/marshallers @@ -22,6 +23,7 @@ libmodem_manager_la_CPPFLAGS = \ libmodem_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml diff --git a/src/named-manager/Makefile.am b/src/named-manager/Makefile.am index fe1ec918d5..a33f7d50a9 100644 --- a/src/named-manager/Makefile.am +++ b/src/named-manager/Makefile.am @@ -1,4 +1,8 @@ -INCLUDES = -I${top_srcdir}/libnm-util -I${top_srcdir}/src -I${top_srcdir}/include +INCLUDES = \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include noinst_LTLIBRARIES = libnamed-manager.la @@ -10,4 +14,8 @@ libnamed_manager_la_CPPFLAGS = \ -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ -DNM_LOCALSTATEDIR=\"$(localstatedir)\" -libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) +libnamed_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/ppp-manager/Makefile.am b/src/ppp-manager/Makefile.am index 41cb537c25..2dc7ad94c6 100644 --- a/src/ppp-manager/Makefile.am +++ b/src/ppp-manager/Makefile.am @@ -3,6 +3,7 @@ INCLUDES = \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ -I${top_builddir}/marshallers noinst_LTLIBRARIES = libppp-manager.la @@ -28,6 +29,7 @@ libppp_manager_la_CPPFLAGS = \ libppp_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) diff --git a/src/vpn-manager/Makefile.am b/src/vpn-manager/Makefile.am index 1078603382..56e4a4ced3 100644 --- a/src/vpn-manager/Makefile.am +++ b/src/vpn-manager/Makefile.am @@ -2,6 +2,7 @@ INCLUDES = \ -I${top_srcdir} \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/src \ -I${top_builddir}/marshallers \ -I${top_srcdir}/src/named-manager \ @@ -25,6 +26,7 @@ libvpn_manager_la_CPPFLAGS = \ libvpn_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) From ecbb8af10ad3a7d53bf947aff21ba379e8a99a65 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 18:06:36 -0700 Subject: [PATCH 172/392] logging: add DHCP meta-domain --- src/logging/nm-logging.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 086d74b92e..6511289e21 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -51,6 +51,8 @@ enum { LOGD_DEVICE = 0x00200000, /* Device state and activation */ }; +#define LOGD_DHCP (LOGD_DHCP4 | LOGD_DHCP6) + /* Log levels */ enum { LOGL_ERR = 0x00000000, From 75e789399cc59f3f9473d62713b61e6a117fbe88 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Apr 2010 18:06:47 -0700 Subject: [PATCH 173/392] dhcp: update logging --- src/dhcp-manager/Makefile.am | 2 + src/dhcp-manager/nm-dhcp-client.c | 119 +++++++++++++++------------- src/dhcp-manager/nm-dhcp-dhclient.c | 64 ++++++++------- src/dhcp-manager/nm-dhcp-dhcpcd.c | 23 +++--- src/dhcp-manager/nm-dhcp-manager.c | 26 +++--- 5 files changed, 127 insertions(+), 107 deletions(-) diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index ff9041c390..f75e6b3d07 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -2,6 +2,7 @@ INCLUDES = \ -I${top_srcdir} \ -I${top_srcdir}/include \ -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/src \ -I${top_srcdir}/src/named-manager @@ -32,6 +33,7 @@ libdhcp_manager_la_CPPFLAGS = \ libdhcp_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 41b4301197..888e7c5402 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -29,6 +29,7 @@ #include #include "nm-utils.h" +#include "nm-logging.h" #include "nm-dbus-glib-types.h" #include "nm-dhcp-client.h" @@ -159,14 +160,14 @@ stop_process (GPid pid, const char *iface) if (i <= 0) { if (iface) { - g_warning ("%s: dhcp client pid %d didn't exit, will kill it.", - iface, pid); + nm_log_warn (LOGD_DHCP, "(%s): DHCP client pid %d didn't exit, will kill it.", + iface, pid); } kill (pid, SIGKILL); - g_warning ("waiting for dhcp client pid %d to exit", pid); + nm_log_dbg (LOGD_DHCP, "waiting for DHCP client pid %d to exit", pid); waitpid (pid, NULL, 0); - g_warning ("dhcp client pid %d cleaned up", pid); + nm_log_dbg (LOGD_DHCP, "DHCP client pid %d cleaned up", pid); } } @@ -193,8 +194,11 @@ daemon_timeout (gpointer user_data) NMDHCPClient *self = NM_DHCP_CLIENT (user_data); NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); - g_message ("(%s): DHCPv%c request timed out.", - priv->iface, priv->ipv6 ? '6' : '4'); + if (priv->ipv6) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 request timed out.", priv->iface); + } else { + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 request timed out.", priv->iface); + } g_signal_emit (G_OBJECT (self), signals[TIMEOUT], 0); return FALSE; } @@ -207,7 +211,7 @@ daemon_watch_cb (GPid pid, gint status, gpointer user_data) if (!WIFEXITED (status)) { priv->state = DHC_ABEND; - g_warning ("dhcp client died abnormally"); + nm_log_warn (LOGD_DHCP, "DHCP client died abnormally"); } priv->pid = 0; @@ -248,8 +252,8 @@ nm_dhcp_client_start_ip4 (NMDHCPClient *self, g_return_val_if_fail (priv->ipv6 == FALSE, FALSE); g_return_val_if_fail (priv->uuid != NULL, FALSE); - g_message ("Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)", - priv->iface, priv->timeout); + nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, s_ip4, dhcp_anycast_addr); if (priv->pid) @@ -274,8 +278,8 @@ nm_dhcp_client_start_ip6 (NMDHCPClient *self, g_return_val_if_fail (priv->ipv6 == TRUE, FALSE); g_return_val_if_fail (priv->uuid != NULL, FALSE); - g_message ("Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", - priv->iface, priv->timeout); + nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr, info_only); if (priv->pid > 0) @@ -333,9 +337,8 @@ nm_dhcp_client_stop (NMDHCPClient *self) if (priv->pid > 0) { NM_DHCP_CLIENT_GET_CLASS (self)->stop (self); - g_message ("(%s): canceled DHCP transaction, dhcp client pid %d", - priv->iface, - priv->pid); + nm_log_info (LOGD_DHCP, "(%s): canceled DHCP transaction, DHCP client pid %d", + priv->iface, priv->pid); } /* And clean stuff up */ @@ -452,7 +455,7 @@ garray_to_string (GArray *array, const char *key) converted = str->str; if (!g_utf8_validate (converted, -1, NULL)) - g_warning ("%s: DHCP option '%s' couldn't be converted to UTF-8", __func__, key); + nm_log_warn (LOGD_DHCP, "DHCP option '%s' couldn't be converted to UTF-8", key); g_string_free (str, FALSE); return converted; } @@ -467,9 +470,9 @@ copy_option (gpointer key, char *str_value = NULL; if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { - g_warning ("Unexpected key %s value type was not " - "DBUS_TYPE_G_UCHAR_ARRAY", - str_key); + nm_log_warn (LOGD_DHCP, "unexpected key %s value type was not " + "DBUS_TYPE_G_UCHAR_ARRAY", + str_key); return; } @@ -510,11 +513,17 @@ nm_dhcp_client_new_options (NMDHCPClient *self, } priv->state = new_state; - g_message ("DHCPv%c: device %s state changed %s -> %s", - priv->ipv6 ? '6' : '4', - priv->iface, - state_to_string (old_state), - state_to_string (priv->state)); + if (priv->ipv6) { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 state changed %s -> %s", + priv->iface, + state_to_string (old_state), + state_to_string (priv->state)); + } else { + nm_log_info (LOGD_DHCP4, "(%s): DHCPv4 state changed %s -> %s", + priv->iface, + state_to_string (old_state), + state_to_string (priv->state)); + } g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], @@ -575,7 +584,11 @@ nm_dhcp_client_foreach_option (NMDHCPClient *self, priv = NM_DHCP_CLIENT_GET_PRIVATE (self); if (!state_is_bound (priv->state)) { - g_warning ("%s: dhclient didn't bind to a lease.", priv->iface); + if (priv->ipv6) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 client didn't bind to a lease.", priv->iface); + } else { + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 client didn't bind to a lease.", priv->iface); + } return FALSE; } @@ -599,7 +612,7 @@ process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) searches = g_strsplit (str, " ", 0); if ((g_strv_length (searches) % 2)) { - g_message (" static routes provided, but invalid"); + nm_log_info (LOGD_DHCP, " static routes provided, but invalid"); goto out; } @@ -609,11 +622,11 @@ process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) struct in_addr rt_route; if (inet_pton (AF_INET, *s, &rt_addr) <= 0) { - g_warning ("DHCP provided invalid static route address: '%s'", *s); + nm_log_warn (LOGD_DHCP, "DHCP provided invalid static route address: '%s'", *s); continue; } if (inet_pton (AF_INET, *(s + 1), &rt_route) <= 0) { - g_warning ("DHCP provided invalid static route gateway: '%s'", *(s + 1)); + nm_log_warn (LOGD_DHCP, "DHCP provided invalid static route gateway: '%s'", *(s + 1)); continue; } @@ -625,7 +638,7 @@ process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); nm_ip4_config_take_route (ip4_config, route); - g_message (" static route %s gw %s", *s, *(s + 1)); + nm_log_info (LOGD_DHCP, " static route %s gw %s", *s, *(s + 1)); } out: @@ -654,14 +667,14 @@ process_domain_search (const char *str, GFunc add_func, gpointer user_data) } while (*p++); if (strchr (unescaped, '\\')) { - g_message (" invalid domain search: '%s'", unescaped); + nm_log_warn (LOGD_DHCP, " invalid domain search: '%s'", unescaped); goto out; } searches = g_strsplit (unescaped, " ", 0); for (s = searches; *s; s++) { if (strlen (*s)) { - g_message (" domain search '%s'", *s); + nm_log_info (LOGD_DHCP, " domain search '%s'", *s); add_func (*s, user_data); } } @@ -697,31 +710,31 @@ ip4_options_to_config (NMDHCPClient *self) ip4_config = nm_ip4_config_new (); if (!ip4_config) { - g_warning ("%s: couldn't allocate memory for an IP4Config!", priv->iface); + nm_log_warn (LOGD_DHCP4, "(%s): couldn't allocate memory for an IP4Config!", priv->iface); return NULL; } addr = nm_ip4_address_new (); if (!addr) { - g_warning ("%s: couldn't allocate memory for an IP4 Address!", priv->iface); + nm_log_warn (LOGD_DHCP4, "(%s): couldn't allocate memory for an IP4 Address!", priv->iface); goto error; } str = g_hash_table_lookup (priv->options, "new_ip_address"); if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { nm_ip4_address_set_address (addr, tmp_addr.s_addr); - g_message (" address %s", str); + nm_log_info (LOGD_DHCP4, " address %s", str); } else goto error; str = g_hash_table_lookup (priv->options, "new_subnet_mask"); if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { prefix = nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr); - g_message (" prefix %d (%s)", prefix, str); + nm_log_info (LOGD_DHCP4, " prefix %d (%s)", prefix, str); } else { /* Get default netmask for the IP according to appropriate class. */ prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); - g_message (" prefix %d (default)", prefix); + nm_log_info (LOGD_DHCP4, " prefix %d (default)", prefix); } nm_ip4_address_set_prefix (addr, prefix); @@ -744,7 +757,7 @@ ip4_options_to_config (NMDHCPClient *self) char buf[INET_ADDRSTRLEN + 1]; inet_ntop (AF_INET, &gwaddr, buf, sizeof (buf)); - g_message (" gateway %s", buf); + nm_log_info (LOGD_DHCP4, " gateway %s", buf); nm_ip4_address_set_gateway (addr, gwaddr); } else { /* If the gateway wasn't provided as a classless static route with a @@ -759,10 +772,10 @@ ip4_options_to_config (NMDHCPClient *self) /* FIXME: how to handle multiple routers? */ if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { nm_ip4_address_set_gateway (addr, tmp_addr.s_addr); - g_message (" gateway %s", *s); + nm_log_info (LOGD_DHCP4, " gateway %s", *s); break; } else - g_warning ("Ignoring invalid gateway '%s'", *s); + nm_log_warn (LOGD_DHCP4, "ignoring invalid gateway '%s'", *s); } g_strfreev (routers); } @@ -773,7 +786,7 @@ ip4_options_to_config (NMDHCPClient *self) str = g_hash_table_lookup (priv->options, "new_host_name"); if (str) - g_message (" hostname '%s'", str); + nm_log_info (LOGD_DHCP4, " hostname '%s'", str); str = g_hash_table_lookup (priv->options, "new_domain_name_servers"); if (str) { @@ -783,9 +796,9 @@ ip4_options_to_config (NMDHCPClient *self) for (s = searches; *s; s++) { if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { nm_ip4_config_add_nameserver (ip4_config, tmp_addr.s_addr); - g_message (" nameserver '%s'", *s); + nm_log_info (LOGD_DHCP4, " nameserver '%s'", *s); } else - g_warning ("Ignoring invalid nameserver '%s'", *s); + nm_log_warn (LOGD_DHCP4, "ignoring invalid nameserver '%s'", *s); } g_strfreev (searches); } @@ -796,7 +809,7 @@ ip4_options_to_config (NMDHCPClient *self) char **s; for (s = domains; *s; s++) { - g_message (" domain name '%s'", *s); + nm_log_info (LOGD_DHCP4, " domain name '%s'", *s); nm_ip4_config_add_domain (ip4_config, *s); } g_strfreev (domains); @@ -814,9 +827,9 @@ ip4_options_to_config (NMDHCPClient *self) for (s = searches; *s; s++) { if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { nm_ip4_config_add_wins (ip4_config, tmp_addr.s_addr); - g_message (" wins '%s'", *s); + nm_log_info (LOGD_DHCP4, " wins '%s'", *s); } else - g_warning ("Ignoring invalid WINS server '%s'", *s); + nm_log_warn (LOGD_DHCP4, "ignoring invalid WINS server '%s'", *s); } g_strfreev (searches); } @@ -854,7 +867,7 @@ nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); if (test && !state_is_bound (priv->state)) { - g_warning ("%s: dhcp client didn't bind to a lease.", priv->iface); + nm_log_warn (LOGD_DHCP4, "(%s): DHCP client didn't bind to a lease.", priv->iface); return NULL; } @@ -887,20 +900,20 @@ ip6_options_to_config (NMDHCPClient *self) ip6_config = nm_ip6_config_new (); if (!ip6_config) { - g_warning ("%s: couldn't allocate memory for an IP6Config!", priv->iface); + nm_log_warn (LOGD_DHCP6, "(%s): couldn't allocate memory for an IP6Config!", priv->iface); return NULL; } addr = nm_ip6_address_new (); if (!addr) { - g_warning ("%s: couldn't allocate memory for an IP6 Address!", priv->iface); + nm_log_warn (LOGD_DHCP6, "(%s): couldn't allocate memory for an IP6 Address!", priv->iface); goto error; } str = g_hash_table_lookup (priv->options, "new_ip6_address"); if (str && (inet_pton (AF_INET6, str, &tmp_addr) > 0)) { nm_ip6_address_set_address (addr, &tmp_addr); - g_message (" address %s", str); + nm_log_info (LOGD_DHCP6, " address %s", str); } else goto error; @@ -914,7 +927,7 @@ ip6_options_to_config (NMDHCPClient *self) goto error; nm_ip6_address_set_prefix (addr, (guint32) prefix); - g_message (" prefix %lu", prefix); + nm_log_info (LOGD_DHCP6, " prefix %lu", prefix); } nm_ip6_config_take_address (ip6_config, addr); @@ -922,7 +935,7 @@ ip6_options_to_config (NMDHCPClient *self) str = g_hash_table_lookup (priv->options, "new_host_name"); if (str) - g_message (" hostname '%s'", str); + nm_log_info (LOGD_DHCP6, " hostname '%s'", str); str = g_hash_table_lookup (priv->options, "new_dhcp6_name_servers"); if (str) { @@ -932,9 +945,9 @@ ip6_options_to_config (NMDHCPClient *self) for (s = searches; *s; s++) { if (inet_pton (AF_INET6, *s, &tmp_addr) > 0) { nm_ip6_config_add_nameserver (ip6_config, &tmp_addr); - g_message (" nameserver '%s'", *s); + nm_log_info (LOGD_DHCP6, " nameserver '%s'", *s); } else - g_warning ("Ignoring invalid nameserver '%s'", *s); + nm_log_warn (LOGD_DHCP6, "ignoring invalid nameserver '%s'", *s); } g_strfreev (searches); } @@ -963,7 +976,7 @@ nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); if (test && !state_is_bound (priv->state)) { - g_warning ("%s: dhcp client didn't bind to a lease.", priv->iface); + nm_log_warn (LOGD_DHCP6, "(%s): dhcp client didn't bind to a lease.", priv->iface); return NULL; } diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index bf892bcfd7..37543edc0b 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -38,6 +38,7 @@ #include "nm-dhcp-dhclient.h" #include "nm-utils.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) @@ -101,7 +102,7 @@ add_lease_option (GHashTable *hash, char *line) spc = strchr (line, ' '); if (!spc) { - g_warning ("%s: line '%s' did not contain a space", __func__, line); + nm_log_warn (LOGD_DHCP, "DHCP lease file line '%s' did not contain a space", line); return; } @@ -109,8 +110,8 @@ add_lease_option (GHashTable *hash, char *line) if (g_str_has_prefix (line, "option ")) { spc = strchr (spc + 1, ' '); if (!spc) { - g_warning ("%s: option line '%s' did not contain a second space", - __func__, line); + nm_log_warn (LOGD_DHCP, "DHCP lease file option line '%s' did not contain a second space", + line); return; } } @@ -168,9 +169,9 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) } else if (!strcmp (*line, "lease {")) { /* Beginning of a new lease */ if (hash) { - g_warning ("%s: lease file %s malformed; new lease started " - "without ending previous lease", - __func__, leasefile); + nm_log_warn (LOGD_DHCP, "DHCP lease file %s malformed; new lease started " + "without ending previous lease", + leasefile); g_hash_table_destroy (hash); } @@ -182,9 +183,9 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) /* Check if the last lease in the file was properly ended */ if (hash) { - g_warning ("%s: lease file %s malformed; new lease started " - "without ending previous lease", - __func__, leasefile); + nm_log_warn (LOGD_DHCP, "DHCP lease file %s malformed; new lease started " + "without ending previous lease", + leasefile); g_hash_table_destroy (hash); hash = NULL; } @@ -211,8 +212,8 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) /* Read lease expiration (in UTC) */ if (!strptime (data, "%w %Y/%m/%d %H:%M:%S", &expire)) { - g_warning ("%s: couldn't parse expire time '%s'", - __func__, data); + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file expire time '%s'", + data); continue; } @@ -254,7 +255,7 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) /* IP4 address */ if (!inet_pton (AF_INET, data, &tmp)) { - g_warning ("%s: couldn't parse IP4 address '%s'", __func__, data); + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 address '%s'", data); goto error; } nm_ip4_address_set_address (addr, tmp.s_addr); @@ -263,7 +264,7 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) data = g_hash_table_lookup (hash, "option subnet-mask"); if (data) { if (!inet_pton (AF_INET, data, &tmp)) { - g_warning ("%s: couldn't parse IP4 subnet mask '%s'", __func__, data); + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 subnet mask '%s'", data); goto error; } prefix = nm_utils_ip4_netmask_to_prefix (tmp.s_addr); @@ -277,7 +278,7 @@ nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) data = g_hash_table_lookup (hash, "option routers"); if (data) { if (!inet_pton (AF_INET, data, &tmp)) { - g_warning ("%s: couldn't parse IP4 gateway '%s'", __func__, data); + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 gateway '%s'", data); goto error; } nm_ip4_address_set_gateway (addr, tmp.s_addr); @@ -327,8 +328,8 @@ merge_dhclient_config (const char *iface, GError *read_error = NULL; if (!g_file_get_contents (orig_path, &orig_contents, NULL, &read_error)) { - nm_warning ("%s: error reading dhclient configuration %s: %s", - iface, orig_path, read_error->message); + nm_log_warn (LOGD_DHCP, "(%s): error reading dhclient configuration %s: %s", + iface, orig_path, read_error->message); g_error_free (read_error); } } @@ -445,7 +446,7 @@ create_dhclient_config (const char *iface, #endif if (!orig) { - nm_warning ("%s: not enough memory for dhclient options.", iface); + nm_log_warn (LOGD_DHCP, "(%s): not enough memory for dhclient options.", iface); return FALSE; } @@ -456,8 +457,8 @@ create_dhclient_config (const char *iface, error = NULL; success = merge_dhclient_config (iface, conf_file, s_ip4, dhcp_anycast_addr, orig, &error); if (!success) { - nm_warning ("%s: error creating dhclient configuration: %s", - iface, error->message); + nm_log_warn (LOGD_DHCP, "(%s): error creating dhclient configuration: %s", + iface, error->message); g_error_free (error); } @@ -486,6 +487,7 @@ dhclient_start (NMDHCPClient *client, const char *iface, *uuid; char *binary_name, *cmd_str; gboolean ipv6; + guint log_domain; g_return_val_if_fail (priv->pid_file == NULL, -1); g_return_val_if_fail (ip_opt != NULL, -1); @@ -494,16 +496,18 @@ dhclient_start (NMDHCPClient *client, uuid = nm_dhcp_client_get_uuid (client); ipv6 = nm_dhcp_client_get_ipv6 (client); + log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", ipv6 ? "6" : "", iface); if (!priv->pid_file) { - nm_warning ("%s: not enough memory for dhcpcd options.", iface); + nm_log_warn (log_domain, "(%s): not enough memory for dhcpcd options.", iface); return -1; } if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { - nm_warning ("%s does not exist.", priv->path); + nm_log_warn (log_domain, "%s does not exist.", priv->path); return -1; } @@ -514,7 +518,7 @@ dhclient_start (NMDHCPClient *client, priv->lease_file = get_leasefile_for_iface (iface, uuid, ipv6); if (!priv->lease_file) { - nm_warning ("%s: not enough memory for dhclient options.", iface); + nm_log_warn (log_domain, "(%s): not enough memory for dhclient options.", iface); return -1; } @@ -546,16 +550,16 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, NULL); cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); - nm_info ("running: %s", cmd_str); + nm_log_dbg (log_domain, "running: %s", cmd_str); g_free (cmd_str); if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhclient_child_setup, NULL, &pid, &error)) { - nm_warning ("dhclient failed to start. error: '%s'", error->message); + nm_log_warn (log_domain, "dhclient failed to start: '%s'", error->message); g_error_free (error); pid = -1; } else - nm_info ("dhclient started with pid %d", pid); + nm_log_info (log_domain, "dhclient started with pid %d", pid); g_ptr_array_free (argv, TRUE); return pid; @@ -573,7 +577,7 @@ real_ip4_start (NMDHCPClient *client, priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); if (!priv->conf_file) { - nm_warning ("%s: error creating dhclient configuration file.", iface); + nm_log_warn (LOGD_DHCP4, "(%s): error creating dhclient configuration file.", iface); return -1; } @@ -694,7 +698,7 @@ real_ip4_process_classless_routes (NMDHCPClient *client, o = octets = g_strsplit (str, " ", 0); if (g_strv_length (octets) < 5) { - nm_warning ("Ignoring invalid classless static routes '%s'", str); + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); goto out; } @@ -702,7 +706,7 @@ real_ip4_process_classless_routes (NMDHCPClient *client, route = NULL; o = (char **) process_rfc3442_route ((const char **) o, &route); if (!route) { - nm_warning ("Ignoring invalid classless static routes"); + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes"); break; } @@ -723,8 +727,8 @@ real_ip4_process_classless_routes (NMDHCPClient *client, inet_ntop (AF_INET, &tmp, addr, sizeof (addr)); tmp.s_addr = nm_ip4_route_get_next_hop (route); inet_ntop (AF_INET, &tmp, nh, sizeof (nh)); - nm_info (" classless static route %s/%d gw %s", - addr, nm_ip4_route_get_prefix (route), nh); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", + addr, nm_ip4_route_get_prefix (route), nh); } } diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 123ac06ab7..56b74810dc 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -34,6 +34,7 @@ #include "nm-dhcp-dhcpcd.h" #include "nm-utils.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_DHCPCD) @@ -103,12 +104,12 @@ real_ip4_start (NMDHCPClient *client, priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhcpcd-%s.pid", iface); if (!priv->pid_file) { - nm_warning ("%s: not enough memory for dhcpcd options.", iface); + nm_log_warn (LOGD_DHCP4, "(%s): not enough memory for dhcpcd options.", iface); return -1; } if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { - nm_warning ("%s does not exist.", priv->path); + nm_log_warn (LOGD_DHCP4, "%s does not exist.", priv->path); return -1; } @@ -139,15 +140,15 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, NULL); cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); - nm_info ("running: %s", cmd_str); + nm_log_dbg (LOGD_DHCP4, "running: %s", cmd_str); g_free (cmd_str); if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &dhcpcd_child_setup, NULL, &pid, &error)) { - nm_warning ("dhcpcd failed to start. error: '%s'", error->message); + nm_log_warn (LOGD_DHCP4, "dhcpcd failed to start. error: '%s'", error->message); g_error_free (error); } else - nm_info ("dhcpcd started with pid %d", pid); + nm_log_info (LOGD_DHCP4, "dhcpcd started with pid %d", pid); g_free (pid_contents); g_ptr_array_free (argv, TRUE); @@ -160,7 +161,7 @@ real_ip6_start (NMDHCPClient *client, guint8 *dhcp_anycast_addr, gboolean info_only) { - g_warning ("The dhcpcd backend does not support IPv6."); + nm_log_warn (LOGD_DHCP6, "the dhcpcd backend does not support IPv6."); return -1; } @@ -202,7 +203,7 @@ real_ip4_process_classless_routes (NMDHCPClient *client, goto out; if ((g_strv_length (routes) % 2) != 0) { - nm_info (" classless static routes provided, but invalid"); + nm_log_warn (LOGD_DHCP4, " classless static routes provided, but invalid"); goto out; } @@ -219,16 +220,16 @@ real_ip4_process_classless_routes (NMDHCPClient *client, errno = 0; rt_cidr = strtol (slash + 1, NULL, 10); if ((errno == EINVAL) || (errno == ERANGE)) { - nm_warning ("DHCP provided invalid classless static route cidr: '%s'", slash + 1); + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route cidr: '%s'", slash + 1); continue; } } if (inet_pton (AF_INET, *r, &rt_addr) <= 0) { - nm_warning ("DHCP provided invalid classless static route address: '%s'", *r); + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route address: '%s'", *r); continue; } if (inet_pton (AF_INET, *(r + 1), &rt_route) <= 0) { - nm_warning ("DHCP provided invalid classless static route gateway: '%s'", *(r + 1)); + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route gateway: '%s'", *(r + 1)); continue; } @@ -244,7 +245,7 @@ real_ip4_process_classless_routes (NMDHCPClient *client, nm_ip4_config_take_route (ip4_config, route); - nm_info (" classless static route %s/%d gw %s", *r, rt_cidr, *(r + 1)); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", *r, rt_cidr, *(r + 1)); } } diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 765606788f..94109adcf6 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -38,7 +38,7 @@ #include "nm-dhcp-dhclient.h" #include "nm-dhcp-dhcpcd.h" #include "nm-marshal.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-dbus-manager.h" #include "nm-hostname-provider.h" #include "nm-dbus-glib-types.h" @@ -125,7 +125,7 @@ garray_to_string (GArray *array, const char *key) converted = str->str; if (!g_utf8_validate (converted, -1, NULL)) - nm_warning ("%s: DHCP option '%s' couldn't be converted to UTF-8", __func__, key); + nm_log_warn (LOGD_DHCP, "DHCP option '%s' couldn't be converted to UTF-8", key); g_string_free (str, FALSE); return converted; } @@ -190,9 +190,9 @@ get_option (GHashTable *hash, const char *key) return NULL; if (G_VALUE_TYPE (value) != DBUS_TYPE_G_UCHAR_ARRAY) { - g_warning ("Unexpected key %s value type was not " - "DBUS_TYPE_G_UCHAR_ARRAY", - (char *) key); + nm_log_warn (LOGD_DHCP, "unexpected key %s value type was not " + "DBUS_TYPE_G_UCHAR_ARRAY", + (char *) key); return NULL; } @@ -217,37 +217,37 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, iface = get_option (options, "interface"); if (iface == NULL) { - nm_warning ("DHCP event didn't have associated interface."); + nm_log_warn (LOGD_DHCP, "DHCP event didn't have associated interface."); goto out; } pid_str = get_option (options, "pid"); if (pid_str == NULL) { - nm_warning ("DHCP event didn't have associated PID."); + nm_log_warn (LOGD_DHCP, "DHCP event didn't have associated PID."); goto out; } temp = strtoul (pid_str, NULL, 10); if ((temp == ULONG_MAX) && (errno == ERANGE)) { - nm_warning ("Couldn't convert PID"); + nm_log_warn (LOGD_DHCP, "couldn't convert PID"); goto out; } client = get_client_for_pid (manager, (GPid) temp); if (client == NULL) { - nm_warning ("Unhandled DHCP event for interface %s", iface); + nm_log_warn (LOGD_DHCP, "unhandled DHCP event for interface %s", iface); goto out; } if (strcmp (iface, nm_dhcp_client_get_iface (client))) { - nm_warning ("Received DHCP event from unexpected interface '%s' (expected '%s')", - iface, nm_dhcp_client_get_iface (client)); + nm_log_warn (LOGD_DHCP, "received DHCP event from unexpected interface '%s' (expected '%s')", + iface, nm_dhcp_client_get_iface (client)); goto out; } reason = get_option (options, "reason"); if (reason == NULL) { - nm_warning ("DHCP event didn't have a reason"); + nm_log_warn (LOGD_DHCP, "DHCP event didn't have a reason"); goto out; } @@ -573,7 +573,7 @@ nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client, client_type = get_client_type (dhcp_client, &error); if (!client_type) { - g_warning ("Error: %s", error ? error->message : "(unknown)"); + nm_log_err (LOGD_DHCP4, "error: %s", error ? error->message : "(unknown)"); g_clear_error (&error); return NULL; } From 15e32cd4dc4644d3cb7cdff3f0762ccd3c1865fb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:13:12 -0700 Subject: [PATCH 174/392] supplicant: update logging --- src/supplicant-manager/Makefile.am | 2 + src/supplicant-manager/nm-supplicant-config.c | 67 ++++++++++--------- .../nm-supplicant-interface.c | 52 +++++++------- .../nm-supplicant-manager.c | 6 +- 4 files changed, 68 insertions(+), 59 deletions(-) diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am index 540ef76481..e59ae84319 100644 --- a/src/supplicant-manager/Makefile.am +++ b/src/supplicant-manager/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS=. tests INCLUDES = \ -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ -I${top_builddir}/marshallers \ @@ -28,6 +29,7 @@ libsupplicant_manager_la_CPPFLAGS = \ libsupplicant_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index 5f8c4f45df..b516de520b 100644 --- a/src/supplicant-manager/nm-supplicant-config.c +++ b/src/supplicant-manager/nm-supplicant-config.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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -31,7 +31,7 @@ #include "nm-supplicant-config.h" #include "nm-supplicant-settings-verify.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-setting.h" #include "NetworkManagerUtils.h" @@ -123,26 +123,26 @@ nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self, char buf[255]; memset (&buf[0], 0, sizeof (buf)); memcpy (&buf[0], value, len > 254 ? 254 : len); - nm_debug ("Key '%s' and/or value '%s' invalid.", key, buf); + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' and/or value '%s' invalid.", key, buf); return FALSE; } } old_opt = (ConfigOption *) g_hash_table_lookup (priv->config, key); if (old_opt) { - nm_debug ("Key '%s' already in table.", key); + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' already in table.", key); return FALSE; } opt = g_slice_new0 (ConfigOption); if (opt == NULL) { - nm_debug ("Couldn't allocate memory for new config option."); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); return FALSE; } opt->value = g_malloc0 ((sizeof (char) * len) + 1); if (opt->value == NULL) { - nm_debug ("Couldn't allocate memory for new config option value."); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); g_slice_free (ConfigOption, opt); return FALSE; } @@ -151,12 +151,13 @@ nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self, opt->len = len; opt->type = type; -{ -char buf[255]; -memset (&buf[0], 0, sizeof (buf)); -memcpy (&buf[0], opt->value, opt->len > 254 ? 254 : opt->len); -nm_info ("Config: added '%s' value '%s'", key, secret ? "" : &buf[0]); -} + { + char buf[255]; + memset (&buf[0], 0, sizeof (buf)); + memcpy (&buf[0], opt->value, opt->len > 254 ? 254 : opt->len); + nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, secret ? "" : &buf[0]); + } + g_hash_table_insert (priv->config, g_strdup (key), opt); return TRUE; @@ -194,33 +195,33 @@ nm_supplicant_config_add_blob (NMSupplicantConfig *self, type = nm_supplicant_settings_verify_setting (key, (const char *) value->data, value->len); if (type == TYPE_INVALID) { - nm_debug ("Key '%s' and/or it's contained value is invalid.", key); + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' and/or it's contained value is invalid.", key); return FALSE; } old_opt = (ConfigOption *) g_hash_table_lookup (priv->config, key); if (old_opt) { - nm_debug ("Key '%s' already in table.", key); + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' already in table.", key); return FALSE; } blob = g_byte_array_sized_new (value->len); if (!blob) { - nm_debug ("Couldn't allocate memory for new config blob."); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config blob."); return FALSE; } g_byte_array_append (blob, value->data, value->len); opt = g_slice_new0 (ConfigOption); if (opt == NULL) { - nm_debug ("Couldn't allocate memory for new config option."); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); g_byte_array_free (blob, TRUE); return FALSE; } opt->value = g_strdup_printf ("blob://%s", blobid); if (opt->value == NULL) { - nm_debug ("Couldn't allocate memory for new config option value."); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); g_byte_array_free (blob, TRUE); g_slice_free (ConfigOption, opt); return FALSE; @@ -229,7 +230,7 @@ nm_supplicant_config_add_blob (NMSupplicantConfig *self, opt->len = strlen (opt->value); opt->type = type; -nm_info ("Config: added '%s' value '%s'", key, opt->value); + nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, opt->value); g_hash_table_insert (priv->config, g_strdup (key), opt); g_hash_table_insert (priv->blobs, g_strdup (blobid), blob); @@ -378,13 +379,13 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, id = nm_setting_wireless_get_ssid (setting); if (!nm_supplicant_config_add_option (self, "ssid", (char *) id->data, id->len, FALSE)) { - nm_warning ("Error adding SSID to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding SSID to supplicant config."); return FALSE; } if (is_adhoc) { if (!nm_supplicant_config_add_option (self, "mode", "1", -1, FALSE)) { - nm_warning ("Error adding mode to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding mode to supplicant config."); return FALSE; } @@ -394,7 +395,7 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, str_freq = g_strdup_printf ("%u", adhoc_freq); if (!nm_supplicant_config_add_option (self, "frequency", str_freq, -1, FALSE)) { g_free (str_freq); - nm_warning ("Error adding Ad-Hoc frequency to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding Ad-Hoc frequency to supplicant config."); return FALSE; } g_free (str_freq); @@ -418,7 +419,7 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, str_bssid, strlen (str_bssid), FALSE)) { g_free (str_bssid); - nm_warning ("Error adding BSSID to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding BSSID to supplicant config."); return FALSE; } g_free (str_bssid); @@ -445,7 +446,7 @@ add_string_val (NMSupplicantConfig *self, value = ucase ? g_ascii_strup (field, -1) : g_strdup (field); success = nm_supplicant_config_add_option (self, name, value, strlen (field), secret); if (!success) - nm_warning ("Error adding %s to supplicant config.", name); + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); g_free (value); return success; } @@ -471,7 +472,7 @@ add_string_val (NMSupplicantConfig *self, success = TRUE; \ g_string_free (str, TRUE); \ if (!success) { \ - nm_warning ("Error adding %s to supplicant config.", name); \ + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); \ return FALSE; \ } \ } @@ -494,7 +495,7 @@ get_blob_id (const char *name, const char *seed_uid) success = nm_supplicant_config_add_blob (self, name, field, uid); \ g_free (uid); \ if (!success) { \ - nm_warning ("Error adding %s to supplicant config.", name); \ + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); \ return FALSE; \ } \ } @@ -550,16 +551,16 @@ add_wep_key (NMSupplicantConfig *self, success = nm_supplicant_config_add_option (self, name, value, key_len / 2, TRUE); g_free (value); if (!success) { - nm_warning ("Error adding %s to supplicant config.", name); + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); return FALSE; } } else if ((key_len == 5) || (key_len == 13)) { if (!nm_supplicant_config_add_option (self, name, key, key_len, TRUE)) { - nm_warning ("Error adding %s to supplicant config.", name); + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); return FALSE; } } else { - nm_warning ("Invalid WEP key '%s'", name); + nm_log_warn (LOGD_SUPPLICANT, "Invalid WEP key '%s'", name); return FALSE; } } else if (wep_type == NM_WEP_KEY_TYPE_PASSPHRASE) { @@ -570,7 +571,7 @@ add_wep_key (NMSupplicantConfig *self, if (success) success = nm_supplicant_config_add_option (self, name, (const char *) digest, digest_len, TRUE); if (!success) { - nm_warning ("Error adding %s to supplicant config.", name); + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); return FALSE; } } @@ -611,7 +612,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, success = nm_supplicant_config_add_option (self, "psk", value, psk_len / 2, TRUE); g_free (value); if (!success) { - nm_warning ("Error adding 'psk' to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding 'psk' to supplicant config."); return FALSE; } } else if (psk_len >= 8 && psk_len <= 63) { @@ -621,12 +622,12 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, * passphrase and not a hex key. */ if (!nm_supplicant_config_add_option_with_type (self, "psk", psk, -1, TYPE_STRING, TRUE)) { - nm_warning ("Error adding 'psk' to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding 'psk' to supplicant config."); return FALSE; } } else { /* Invalid PSK */ - nm_warning ("Invalid PSK length %u: not between 8 and 63 characters inclusive.", (guint32) psk_len); + nm_log_warn (LOGD_SUPPLICANT, "Invalid PSK length %u: not between 8 and 63 characters inclusive.", (guint32) psk_len); return FALSE; } } @@ -662,7 +663,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, success = nm_supplicant_config_add_option (self, "wep_tx_keyidx", value, -1, FALSE); g_free (value); if (!success) { - nm_warning ("Error adding wep_tx_keyidx to supplicant config."); + nm_log_warn (LOGD_SUPPLICANT, "Error adding wep_tx_keyidx to supplicant config."); return FALSE; } } diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 00f0c307ee..4307a9ebc2 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -25,7 +25,7 @@ #include "nm-supplicant-interface.h" #include "nm-supplicant-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" #include "nm-supplicant-config.h" #include "nm-dbus-manager.h" @@ -498,8 +498,10 @@ bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_ if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_MAP_OF_VARIANT, &hash, G_TYPE_INVALID)) { - if (!strstr (err->message, "The BSSID requested was invalid")) - nm_warning ("Couldn't retrieve BSSID properties: %s.", err->message); + if (!strstr (err->message, "The BSSID requested was invalid")) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't retrieve BSSID properties: %s.", + err->message); + } g_error_free (err); } else { g_signal_emit (info->interface, @@ -543,7 +545,7 @@ scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &array, G_TYPE_INVALID)) { - nm_warning ("could not get scan results: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "could not get scan results: %s.", err->message); g_error_free (err); } else { int i; @@ -672,7 +674,7 @@ iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_STRING, &state_str, G_TYPE_INVALID)) { - nm_warning ("could not get interface state: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "could not get interface state: %s.", err->message); g_error_free (err); } else { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; @@ -780,7 +782,8 @@ nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpoi /* Interface already added, just try to get the interface */ nm_supplicant_interface_add_to_supplicant (info->interface, TRUE); } else { - nm_warning ("Unexpected supplicant error getting interface: %s", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Unexpected supplicant error getting interface: %s", + err->message); } g_error_free (err); @@ -893,7 +896,7 @@ nm_supplicant_interface_start (NMSupplicantInterface * self) * that its state has changed. */ } else - nm_warning ("Unknown supplicant manager state!"); + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); } static void @@ -914,7 +917,7 @@ nm_supplicant_interface_handle_supplicant_manager_idle_state (NMSupplicantInterf /* Don't do anything here; interface can't get out of DOWN state */ break; default: - nm_warning ("Unknown supplicant interface state!"); + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant interface state!"); break; } } @@ -970,7 +973,7 @@ nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr, nm_supplicant_interface_handle_supplicant_manager_idle_state (self); break; default: - nm_warning ("Unknown supplicant manager state!"); + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); break; } } @@ -983,7 +986,8 @@ remove_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_dat guint tmp; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't remove network from supplicant interface: %s.", err->message); + nm_log_dbg (LOGD_SUPPLICANT, "Couldn't remove network from supplicant interface: %s.", + err->message); g_error_free (err); } } @@ -995,7 +999,8 @@ disconnect_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) guint tmp; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't disconnect supplicant interface: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't disconnect supplicant interface: %s.", + err->message); g_error_free (err); } } @@ -1057,7 +1062,7 @@ select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_dat guint tmp; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't select network config: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't select network config: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); } @@ -1072,7 +1077,7 @@ set_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) guint tmp; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't set network config: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network config: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); } else { @@ -1116,7 +1121,7 @@ set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) guint tmp; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't set network blobs: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); } else { @@ -1165,7 +1170,8 @@ call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) (GDestroyNotify) blob_free); if (!blobs) { const char *msg = "Not enough memory to create blob table."; - nm_warning ("%s", msg); + + nm_log_warn (LOGD_SUPPLICANT, "%s", msg); g_signal_emit (info->interface, nm_supplicant_interface_signals[CONNECTION_ERROR], 0, "SendBlobError", msg); @@ -1194,7 +1200,8 @@ add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID)) { - nm_warning ("Couldn't add a network to the supplicant interface: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't add a network to the supplicant interface: %s.", + err->message); emit_error_helper (info->interface, err); g_error_free (err); } else { @@ -1225,22 +1232,21 @@ static void set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; guint32 tmp; DBusGProxyCall *call; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_warning ("Couldn't send AP scan mode to the supplicant interface: %s.", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Couldn't send AP scan mode to the supplicant interface: %s.", + err->message); emit_error_helper (info->interface, err); g_error_free (err); return; } -{ -NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); -int ap_scan = nm_supplicant_config_get_ap_scan (priv->cfg); -nm_info ("Config: set interface ap_scan to %d", ap_scan); -} + nm_log_info (LOGD_SUPPLICANT, "Config: set interface ap_scan to %d", + nm_supplicant_config_get_ap_scan (priv->cfg)); info = nm_supplicant_info_new (info->interface, proxy, info->store); call = dbus_g_proxy_begin_call (proxy, "addNetwork", @@ -1306,7 +1312,7 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &success, G_TYPE_INVALID)) { - nm_warning ("Could not get scan request result: %s", err->message); + nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", err->message); g_error_free (err); } diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 7a177ab181..f8390437dc 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -27,7 +27,7 @@ #include "nm-supplicant-interface.h" #include "nm-dbus-manager.h" #include "nm-marshal.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-glib-compat.h" #define SUPPLICANT_POKE_INTERVAL 120 @@ -97,11 +97,11 @@ poke_supplicant_cb (gpointer user_data) WPAS_DBUS_PATH, WPAS_DBUS_INTERFACE); if (!proxy) { - nm_warning ("Error: could not init wpa_supplicant proxy"); + nm_log_warn (LOGD_SUPPLICANT, "Error: could not init wpa_supplicant proxy"); goto out; } - nm_info ("Trying to start the supplicant..."); + nm_log_info (LOGD_SUPPLICANT, "Trying to start the supplicant..."); dbus_g_proxy_call_no_reply (proxy, "getInterface", G_TYPE_STRING, tmp, G_TYPE_INVALID); g_object_unref (proxy); From 6021761081145a5cbdd7812044f094a3e04f1d64 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:13:44 -0700 Subject: [PATCH 175/392] backends: update logging --- src/backends/Makefile.am | 20 +++++++++++++------- src/backends/NetworkManagerDebian.c | 4 ++-- src/backends/NetworkManagerGeneric.c | 8 +++++--- src/backends/NetworkManagerGentoo.c | 4 ++-- src/backends/NetworkManagerPaldo.c | 4 ++-- src/backends/NetworkManagerSuSE.c | 4 ++-- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am index 0e037c41d1..c3485e5f9b 100644 --- a/src/backends/Makefile.am +++ b/src/backends/Makefile.am @@ -1,9 +1,11 @@ -INCLUDES = -I${top_srcdir} \ - -I${top_srcdir}/include \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/vpn-manager \ - -I${top_srcdir}/src/named-manager \ - -I${top_srcdir}/libnm-util +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/vpn-manager \ + -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/libnm-util noinst_LTLIBRARIES = libnmbackend.la @@ -53,7 +55,11 @@ if TARGET_PARDUS libnmbackend_la_SOURCES += NetworkManagerPardus.c endif -libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GLIB_LIBS) +libnmbackend_la_LIBADD += \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + libnmbackend_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c index cba1363f3a..ef9475af6d 100644 --- a/src/backends/NetworkManagerDebian.c +++ b/src/backends/NetworkManagerDebian.c @@ -34,7 +34,7 @@ #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" -#include "nm-utils.h" +#include "nm-logging.h" /* * nm_system_enable_loopback @@ -57,7 +57,7 @@ void nm_system_enable_loopback (void) void nm_system_update_dns (void) { if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { - nm_info ("Clearing nscd hosts cache."); + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); nm_spawn_process ("/usr/sbin/nscd -i hosts"); } } diff --git a/src/backends/NetworkManagerGeneric.c b/src/backends/NetworkManagerGeneric.c index 26076fa678..4f8336d9bb 100644 --- a/src/backends/NetworkManagerGeneric.c +++ b/src/backends/NetworkManagerGeneric.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * * Timothee Lecomte @@ -36,7 +37,7 @@ #include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-netlink.h" -#include "nm-utils.h" +#include "nm-logging.h" /* Because of a bug in libnl, rtnl.h should be included before route.h */ #include @@ -93,8 +94,9 @@ void nm_generic_enable_loopback (void) rtnl_addr_set_label (addr, "lo"); if ((err = rtnl_addr_add (nlh, addr, 0)) < 0) { - if (err != -EEXIST) - nm_warning ("error %d returned from rtnl_addr_add():\n%s", err, nl_geterror()); + if (err != -EEXIST) { + nm_log_warn (LOGD_CORE, "error %d returned from rtnl_addr_add():\n%s", err, nl_geterror()); + } } out: if (addr) diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index 8616941f1a..8d9e68c59c 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -34,7 +34,7 @@ #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" -#include "nm-utils.h" +#include "nm-logging.h" /* * nm_system_enable_loopback @@ -59,7 +59,7 @@ void nm_system_enable_loopback (void) void nm_system_update_dns (void) { if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { - nm_info ("Clearing nscd hosts cache."); + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); nm_spawn_process ("/usr/sbin/nscd -i hosts"); } } diff --git a/src/backends/NetworkManagerPaldo.c b/src/backends/NetworkManagerPaldo.c index 777d4e23e1..0c67e5bdf6 100644 --- a/src/backends/NetworkManagerPaldo.c +++ b/src/backends/NetworkManagerPaldo.c @@ -33,7 +33,7 @@ #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" -#include "nm-utils.h" +#include "nm-logging.h" /* * nm_system_enable_loopback @@ -55,7 +55,7 @@ void nm_system_enable_loopback (void) */ void nm_system_update_dns (void) { - nm_info ("Clearing nscd hosts cache."); + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); nm_spawn_process ("/usr/sbin/nscd -i hosts"); } diff --git a/src/backends/NetworkManagerSuSE.c b/src/backends/NetworkManagerSuSE.c index ef4ff15b37..6c8ec1a5d6 100644 --- a/src/backends/NetworkManagerSuSE.c +++ b/src/backends/NetworkManagerSuSE.c @@ -34,7 +34,7 @@ #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" -#include "nm-utils.h" +#include "nm-logging.h" /* * nm_system_enable_loopback @@ -56,7 +56,7 @@ void nm_system_enable_loopback (void) */ void nm_system_update_dns (void) { - nm_info ("Clearing nscd hosts cache."); + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); nm_spawn_process ("/usr/sbin/nscd -i hosts"); } From e56fc836114a1f8be6c7b4201616669fe0058117 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:20:30 -0700 Subject: [PATCH 176/392] dnsmasq: update logging --- src/dnsmasq-manager/Makefile.am | 5 +- src/dnsmasq-manager/nm-dnsmasq-manager.c | 60 ++++++++++++------------ 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/dnsmasq-manager/Makefile.am b/src/dnsmasq-manager/Makefile.am index 71d3873ecb..66bbdd83f8 100644 --- a/src/dnsmasq-manager/Makefile.am +++ b/src/dnsmasq-manager/Makefile.am @@ -1,5 +1,6 @@ INCLUDES = \ -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/src \ -I${top_srcdir}/include @@ -13,4 +14,6 @@ libdnsmasq_manager_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ -DLOCALSTATEDIR=\"$(localstatedir)\" -libdnsmasq_manager_la_LIBADD = $(GLIB_LIBS) +libdnsmasq_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(GLIB_LIBS) diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c index 5538c82ff2..ea529c77eb 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.c +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.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) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -27,7 +27,7 @@ #include #include "nm-dnsmasq-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-glib-compat.h" typedef struct { @@ -168,13 +168,12 @@ nm_cmd_line_add_string (NMCmdLine *cmd, const char *str) static inline const char * nm_find_dnsmasq (void) { - static const char *dnsmasq_binary_paths[] = - { - "/usr/local/sbin/dnsmasq", - "/usr/sbin/dnsmasq", - "/sbin/dnsmasq", - NULL - }; + static const char *dnsmasq_binary_paths[] = { + "/usr/local/sbin/dnsmasq", + "/usr/sbin/dnsmasq", + "/sbin/dnsmasq", + NULL + }; const char **dnsmasq_binary = dnsmasq_binary_paths; @@ -214,7 +213,7 @@ dm_exit_code (guint dm_exit_status) break; } - g_warning ("dnsmasq exited with error: %s (%d)", msg, dm_exit_status); + nm_log_warn (LOGD_SHARING, "dnsmasq exited with error: %s (%d)", msg, dm_exit_status); } static void @@ -228,12 +227,13 @@ dm_watch_cb (GPid pid, gint status, gpointer user_data) err = WEXITSTATUS (status); if (err != 0) dm_exit_code (err); - } else if (WIFSTOPPED (status)) - g_warning ("dnsmasq stopped unexpectedly with signal %d", WSTOPSIG (status)); - else if (WIFSIGNALED (status)) - g_warning ("dnsmasq died with signal %d", WTERMSIG (status)); - else - g_warning ("dnsmasq died from an unknown cause"); + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_SHARING, "dnsmasq stopped unexpectedly with signal %d", WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_SHARING, "dnsmasq died with signal %d", WTERMSIG (status)); + } else { + nm_log_warn (LOGD_SHARING, "dnsmasq died from an unknown cause"); + } priv->pid = 0; @@ -288,8 +288,8 @@ create_dm_cmd_line (const char *iface, s = g_string_new ("--listen-address="); addr.s_addr = nm_ip4_address_get_address (tmp); if (!inet_ntop (AF_INET, &addr, &localaddr[0], INET_ADDRSTRLEN)) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); goto error; } g_string_append (s, localaddr); @@ -301,8 +301,8 @@ create_dm_cmd_line (const char *iface, /* Add start of address range */ addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (9); if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); goto error; } g_string_append (s, buf); @@ -312,8 +312,8 @@ create_dm_cmd_line (const char *iface, /* Add end of address range */ addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (99); if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); goto error; } g_string_append (s, buf); @@ -370,7 +370,7 @@ kill_existing_for_iface (const char *iface, const char *pidfile) if (strstr (cmdline_contents, "bin/dnsmasq")) { if (kill (pid, 0)) { - nm_info ("Killing stale dnsmasq process %ld", pid); + nm_log_dbg (LOGD_SHARING, "Killing stale dnsmasq process %ld", pid); kill (pid, SIGKILL); } unlink (pidfile); @@ -405,10 +405,10 @@ nm_dnsmasq_manager_start (NMDnsMasqManager *manager, g_ptr_array_add (dm_cmd->array, NULL); - nm_info ("Starting dnsmasq..."); + nm_log_info (LOGD_SHARING, "Starting dnsmasq..."); cmd_str = nm_cmd_line_to_str (dm_cmd); - nm_debug ("Command line: %s", cmd_str); + nm_log_dbg (LOGD_SHARING, "Command line: %s", cmd_str); g_free (cmd_str); priv->pid = 0; @@ -419,7 +419,7 @@ nm_dnsmasq_manager_start (NMDnsMasqManager *manager, goto out; } - nm_debug ("dnsmasq started with pid %d", priv->pid); + nm_log_dbg (LOGD_SHARING, "dnsmasq started with pid %d", priv->pid); priv->dm_watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) dm_watch_cb, manager); @@ -439,9 +439,9 @@ ensure_killed (gpointer data) kill (pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for dnsmasq pid %d to exit", pid); + nm_log_dbg (LOGD_SHARING, "waiting for dnsmasq pid %d to exit", pid); waitpid (pid, NULL, 0); - nm_debug ("dnsmasq pid %d cleaned up", pid); + nm_log_dbg (LOGD_SHARING, "dnsmasq pid %d cleaned up", pid); return FALSE; } @@ -467,9 +467,9 @@ nm_dnsmasq_manager_stop (NMDnsMasqManager *manager) kill (priv->pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for dnsmasq pid %d to exit", priv->pid); + nm_log_dbg (LOGD_SHARING, "waiting for dnsmasq pid %d to exit", priv->pid); waitpid (priv->pid, NULL, 0); - nm_debug ("dnsmasq pid %d cleaned up", priv->pid); + nm_log_dbg (LOGD_SHARING, "dnsmasq pid %d cleaned up", priv->pid); } priv->pid = 0; From ee109b94d9119ba37152e2f1354955fcdfa52035 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:41:53 -0700 Subject: [PATCH 177/392] ip6-manager: update logging --- src/ip6-manager/Makefile.am | 7 +++++-- src/ip6-manager/nm-ip6-manager.c | 28 +++++++++++++-------------- src/ip6-manager/nm-netlink-listener.c | 1 - 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/ip6-manager/Makefile.am b/src/ip6-manager/Makefile.am index 50db421fcd..9f5229f77b 100644 --- a/src/ip6-manager/Makefile.am +++ b/src/ip6-manager/Makefile.am @@ -3,6 +3,7 @@ INCLUDES = \ -I${top_srcdir}/include \ -I${top_builddir}/marshallers \ -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/src \ -I${top_srcdir}/src/named-manager @@ -21,6 +22,8 @@ libip6_manager_la_CPPFLAGS = \ -DG_DISABLE_DEPRECATED libip6_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ - $(GLIB_LIBS) \ - $(top_builddir)/marshallers/libmarshallers.la + $(GLIB_LIBS) + diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 20e1a7f939..be85ab0dc0 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -28,7 +28,7 @@ #include "nm-netlink-listener.h" #include "NetworkManagerUtils.h" #include "nm-marshal.h" -#include "nm-utils.h" +#include "nm-logging.h" /* Pre-DHCP addrconf timeout, in seconds */ #define NM_IP6_TIMEOUT 10 @@ -213,7 +213,7 @@ nm_ip6_manager_new (void) priv = NM_IP6_MANAGER_GET_PRIVATE (manager); if (!priv->devices_by_iface || !priv->devices_by_index) { - nm_warning ("Error: not enough memory to initialize IP6 manager tables"); + nm_log_err (LOGD_IP6, "not enough memory to initialize IP6 manager tables"); g_object_unref (manager); manager = NULL; } @@ -250,8 +250,8 @@ finish_addrconf (gpointer user_data) g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, device->iface, info->dhcp_opts, TRUE); } else { - nm_info ("Device '%s' IP6 addrconf timed out or failed.", - device->iface); + nm_log_info (LOGD_IP6, "(%s): IP6 addrconf timed out or failed.", + device->iface); iface_copy = g_strdup (device->iface); @@ -647,13 +647,13 @@ nm_ip6_device_new (NMIP6Manager *manager, const char *iface) device = g_slice_new0 (NMIP6Device); if (!device) { - nm_warning ("%s: Out of memory creating IP6 addrconf object.", iface); + nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object.", iface); return NULL; } device->iface = g_strdup (iface); if (!device->iface) { - nm_warning ("%s: Out of memory creating IP6 addrconf object " + nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object " "property 'iface'.", iface); goto error; @@ -662,7 +662,7 @@ nm_ip6_device_new (NMIP6Manager *manager, const char *iface) device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", iface); if (!device->accept_ra_path) { - nm_warning ("%s: Out of memory creating IP6 addrconf object " + nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object " "property 'accept_ra_path'.", iface); goto error; @@ -679,10 +679,10 @@ nm_ip6_device_new (NMIP6Manager *manager, const char *iface) * device is taken down. */ if (!g_file_get_contents (device->accept_ra_path, &contents, NULL, &error)) { - nm_warning ("%s: error reading %s: (%d) %s", - iface, device->accept_ra_path, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", + iface, device->accept_ra_path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_clear_error (&error); } else { long int tmp; @@ -755,7 +755,7 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, device = (NMIP6Device *) g_hash_table_lookup (priv->devices_by_iface, iface); g_return_if_fail (device != NULL); - nm_info ("Activation (%s) Beginning IP6 addrconf.", iface); + nm_log_info (LOGD_IP6, "Activation (%s) Beginning IP6 addrconf.", iface); device->addrconf_complete = FALSE; @@ -818,13 +818,13 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, device = (NMIP6Device *) g_hash_table_lookup (priv->devices_by_iface, iface); if (!device) { - nm_warning ("Device '%s' addrconf not started.", iface); + nm_log_warn (LOGD_IP6, "(%s): addrconf not started.", iface); return NULL; } config = nm_ip6_config_new (); if (!config) { - nm_warning ("%s: Out of memory creating IP6 config object.", + nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 config object.", iface); return NULL; } diff --git a/src/ip6-manager/nm-netlink-listener.c b/src/ip6-manager/nm-netlink-listener.c index ea7462c308..55c4d76ad4 100644 --- a/src/ip6-manager/nm-netlink-listener.c +++ b/src/ip6-manager/nm-netlink-listener.c @@ -45,7 +45,6 @@ #include "NetworkManager.h" #include "nm-system.h" #include "nm-netlink-listener.h" -#include "nm-utils.h" #include "nm-marshal.h" #include "nm-netlink.h" From 8e7a25114b68d87e9fc562fc4292ab8b5c82b963 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:55:30 -0700 Subject: [PATCH 178/392] logging: clarify some log domains --- src/logging/nm-logging.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 6511289e21..953883bf3a 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -27,7 +27,7 @@ /* Log domains */ enum { LOGD_NONE = 0x00000000, - LOGD_HW = 0x00000001, + LOGD_HW = 0x00000001, /* Hardware detection and info */ LOGD_RFKILL = 0x00000002, LOGD_ETHER = 0x00000004, LOGD_WIFI = 0x00000008, @@ -42,11 +42,11 @@ enum { LOGD_AUTOIP4 = 0x00001000, LOGD_DNS = 0x00002000, LOGD_VPN = 0x00004000, - LOGD_SHARING = 0x00008000, - LOGD_SUPPLICANT = 0x00010000, - LOGD_USER_SET = 0x00020000, - LOGD_SYS_SET = 0x00040000, - LOGD_SUSPEND = 0x00080000, + LOGD_SHARING = 0x00008000, /* Connection sharing/dnsmasq */ + LOGD_SUPPLICANT = 0x00010000, /* WiFi and 802.1x */ + LOGD_USER_SET = 0x00020000, /* User settings */ + LOGD_SYS_SET = 0x00040000, /* System settings */ + LOGD_SUSPEND = 0x00080000, /* Suspend/Resume */ LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */ LOGD_DEVICE = 0x00200000, /* Device state and activation */ }; From 3520fb273d8323f469f90dfbb1afe780f55181cd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 10:57:39 -0700 Subject: [PATCH 179/392] core: update policy logging --- src/nm-policy.c | 63 +++++++++++++++--------------- src/nm-properties-changed-signal.c | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index b1d3ba6ec7..7159eafb57 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -29,7 +29,7 @@ #include "NetworkManagerUtils.h" #include "nm-wifi-ap.h" #include "nm-activation-request.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-device-interface.h" #include "nm-device.h" #include "nm-device-wifi.h" @@ -269,9 +269,9 @@ update_etc_hosts (const char *hostname, gboolean *out_changed) g_return_val_if_fail (out_changed != NULL, FALSE); if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { - nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s", - __func__, error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); g_clear_error (&error); return FALSE; } @@ -287,14 +287,14 @@ update_etc_hosts (const char *hostname, gboolean *out_changed) g_free (contents); if (new_contents) { - nm_info ("Updating /etc/hosts with new system hostname"); + nm_log_info (LOGD_DNS, "Updating /etc/hosts with new system hostname"); g_clear_error (&error); /* And actually update /etc/hosts */ if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { - nm_warning ("%s: couldn't update " SYSCONFDIR "/hosts: (%d) %s", - __func__, error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); + nm_log_warn (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); g_clear_error (&error); } else { success = TRUE; @@ -306,8 +306,8 @@ update_etc_hosts (const char *hostname, gboolean *out_changed) /* No change required */ success = TRUE; } else { - nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s", - __func__, error->code, error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error->code, error->message ? error->message : "(unknown)"); g_clear_error (&error); } @@ -326,8 +326,8 @@ set_system_hostname (const char *new_hostname, const char *msg) errno = 0; ret = gethostname (old_hostname, HOST_NAME_MAX); if (ret != 0) { - nm_warning ("%s: couldn't get the system hostname: (%d) %s", - __func__, errno, strerror (errno)); + nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", + errno, strerror (errno)); } else { /* Don't set the hostname if it isn't actually changing */ if ( (new_hostname && !strcmp (old_hostname, new_hostname)) @@ -336,11 +336,11 @@ set_system_hostname (const char *new_hostname, const char *msg) } if (set_hostname) { - nm_info ("Setting system hostname to '%s' (%s)", name, msg); + nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); ret = sethostname (name, strlen (name)); if (ret != 0) { - nm_warning ("%s: couldn't set the system hostname to '%s': (%d) %s", - __func__, name, errno, strerror (errno)); + nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", + name, errno, strerror (errno)); return; } } @@ -353,11 +353,11 @@ set_system_hostname (const char *new_hostname, const char *msg) */ if (!update_etc_hosts (name, &changed)) { /* error updating /etc/hosts; fallback to localhost.localdomain */ - nm_info ("Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); + nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); if (ret != 0) { - nm_warning ("%s: couldn't set the fallback system hostname (%s): (%d) %s", - __func__, FALLBACK_HOSTNAME, errno, strerror (errno)); + nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", + FALLBACK_HOSTNAME, errno, strerror (errno)); } } @@ -450,8 +450,8 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) return; } } - nm_warning ("%s: DHCP-provided hostname '%s' looks invalid; ignoring it", - __func__, dhcp4_hostname); + nm_log_warn (LOGD_DNS, "DHCP-provided hostname '%s' looks invalid; ignoring it", + dhcp4_hostname); } } @@ -563,8 +563,8 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) } if (!ip_iface || !ip4_config) { - nm_warning ("%s: couldn't determine IP interface (%p) or IPv4 config (%p)!", - __func__, ip_iface, ip4_config); + nm_log_warn (LOGD_CORE, "couldn't determine IP interface (%p) or IPv4 config (%p)!", + ip_iface, ip4_config); goto out; } @@ -597,10 +597,11 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); connection_id = s_con ? nm_setting_connection_get_id (s_con) : NULL; - if (connection_id) - nm_info ("Policy set '%s' (%s) as default for routing and DNS.", connection_id, ip_iface); - else - nm_info ("Policy set (%s) as default for routing and DNS.", ip_iface); + if (connection_id) { + nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for routing and DNS.", connection_id, ip_iface); + } else { + nm_log_info (LOGD_CORE, "Policy set (%s) as default for routing and DNS.", ip_iface); + } out: /* Update the system hostname */ @@ -669,8 +670,8 @@ auto_activate_device (gpointer user_data) s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (best_connection, NM_TYPE_SETTING_CONNECTION)); g_assert (s_con); - nm_warning ("Connection '%s' auto-activation failed: (%d) %s", - nm_setting_connection_get_id (s_con), error->code, error->message); + nm_log_info (LOGD_DEVICE, "Connection '%s' auto-activation failed: (%d) %s", + nm_setting_connection_get_id (s_con), error->code, error->message); g_error_free (error); } } @@ -797,7 +798,7 @@ device_state_changed (NMDevice *device, */ if (connection && IS_ACTIVATING_STATE (old_state)) { g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - nm_info ("Marking connection '%s' invalid.", get_connection_id (connection)); + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); nm_connection_clear_secrets (connection); } schedule_activate_check (policy, device, 3); @@ -988,8 +989,8 @@ connection_removed (NMManager *manager, GError *error = NULL; if (!nm_manager_deactivate_connection (manager, path, NM_DEVICE_STATE_REASON_CONNECTION_REMOVED, &error)) { - nm_warning ("Connection '%s' disappeared, but error deactivating it: (%d) %s", - nm_setting_connection_get_id (s_con), error->code, error->message); + nm_log_warn (LOGD_DEVICE, "Connection '%s' disappeared, but error deactivating it: (%d) %s", + nm_setting_connection_get_id (s_con), error->code, error->message); g_error_free (error); } g_free (path); diff --git a/src/nm-properties-changed-signal.c b/src/nm-properties-changed-signal.c index 8d6c3a4a22..4a9db8afa9 100644 --- a/src/nm-properties-changed-signal.c +++ b/src/nm-properties-changed-signal.c @@ -106,7 +106,7 @@ properties_changed (gpointer data) { char buf[2048] = { 0, }; g_hash_table_foreach (info->hash, add_to_string, &buf); - g_message ("%s: %s -> %s", __func__, G_OBJECT_TYPE_NAME (object), buf); + nm_log_dbg (LOGD_CORE, "%s -> %s", G_OBJECT_TYPE_NAME (object), buf); } #endif From b2f0c0fc6516c15b7e082030693777abb9a90aa9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:07:19 -0700 Subject: [PATCH 180/392] bt: update logging --- src/nm-device-bt.c | 55 +++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index c60afe7d14..8cf179e1ed 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -28,7 +28,7 @@ #include "nm-device-bt.h" #include "nm-device-interface.h" #include "nm-device-private.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" #include "ppp-manager/nm-ppp-manager.h" #include "nm-properties-changed-signal.h" @@ -366,10 +366,11 @@ modem_ip4_config_result (NMModem *self, g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); if (error) { - nm_warning ("%s: retrieving IP4 configuration failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB | LOGD_IP4 | LOGD_BT, + "(%s): retrieving IP4 configuration failed: (%d) %s", + nm_device_get_ip_iface (device), + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); } else { @@ -483,14 +484,16 @@ nm_device_bt_modem_added (NMDeviceBt *self, */ state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); if (state != NM_DEVICE_STATE_CONFIG) { - nm_warning ("(%s): modem found but device not in correct state (%d)", - nm_device_get_iface (NM_DEVICE (self)), - nm_device_get_state (NM_DEVICE (self))); + nm_log_warn (LOGD_BT | LOGD_MB, + "(%s): modem found but device not in correct state (%d)", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_state (NM_DEVICE (self))); return TRUE; } - nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) modem found.", - nm_device_get_iface (NM_DEVICE (self))); + nm_log_info (LOGD_BT | LOGD_MB, + "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) modem found.", + nm_device_get_iface (NM_DEVICE (self))); if (priv->modem) { g_warn_if_reached (); @@ -561,11 +564,11 @@ check_connect_continue (NMDeviceBt *self) if (!priv->connected || !priv->have_iface) return; - nm_info ("Activation (%s %s/bluetooth) Stage 2 of 5 (Device Configure) " - "successful. Will connect via %s.", - nm_device_get_iface (device), - nm_device_get_ip_iface (device), - dun ? "DUN" : (pan ? "PAN" : "unknown")); + nm_log_info (LOGD_BT, "Activation (%s %s/bluetooth) Stage 2 of 5 (Device Configure) " + "successful. Will connect via %s.", + nm_device_get_iface (device), + nm_device_get_ip_iface (device), + dun ? "DUN" : (pan ? "PAN" : "unknown")); if (pan) { /* Bluez says we're connected now. Start IP config. */ @@ -576,9 +579,9 @@ check_connect_continue (NMDeviceBt *self) g_source_remove (priv->timeout_id); priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); - nm_info ("Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " - "waiting for modem to appear.", - nm_device_get_iface (device)); + nm_log_info (LOGD_BT | LOGD_MB, "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " + "waiting for modem to appear.", + nm_device_get_iface (device)); } else g_assert_not_reached (); } @@ -596,8 +599,8 @@ bluez_connect_cb (DBusGProxy *proxy, if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_STRING, &device, G_TYPE_INVALID) == FALSE) { - nm_warning ("Error connecting with bluez: %s", - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_BT, "Error connecting with bluez: %s", + error && error->message ? error->message : "(unknown)"); g_clear_error (&error); nm_device_state_changed (NM_DEVICE (self), @@ -607,7 +610,7 @@ bluez_connect_cb (DBusGProxy *proxy, } if (!device || !strlen (device)) { - nm_warning ("Invalid network device returned by bluez"); + nm_log_warn (LOGD_BT, "Invalid network device returned by bluez"); nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, @@ -655,11 +658,13 @@ bluez_property_changed (DBusGProxy *proxy, /* Bluez says we're disconnected from the device. Suck. */ if (nm_device_is_activating (device)) { - nm_info ("Activation (%s/bluetooth): bluetooth link disconnected.", - nm_device_get_iface (device)); + nm_log_info (LOGD_BT, + "Activation (%s/bluetooth): bluetooth link disconnected.", + nm_device_get_iface (device)); fail = TRUE; } else if (state == NM_DEVICE_STATE_ACTIVATED) { - nm_info ("%s: bluetooth link disconnected.", nm_device_get_iface (device)); + nm_log_info (LOGD_BT, "(%s): bluetooth link disconnected.", + nm_device_get_iface (device)); fail = TRUE; } From 4bc59be464b5b617c4da461768a3ac54fc8797dd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:08:43 -0700 Subject: [PATCH 181/392] mobile-broadband: update logging --- src/nm-device-modem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index fd6b044c3f..b13ce6c3bb 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.c @@ -26,6 +26,7 @@ #include "nm-device-private.h" #include "nm-properties-changed-signal.h" #include "nm-marshal.h" +#include "nm-logging.h" static void device_interface_init (NMDeviceInterface *iface_class); @@ -131,10 +132,9 @@ modem_ip4_config_result (NMModem *self, g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); if (error) { - g_warning ("%s: retrieving IP4 configuration failed: (%d) %s", - __func__, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_MB | LOGD_IP4, "retrieving IP4 configuration failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); } else { From 75fa7b804ddd2e670e839817b76ee7490f6d1359 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:13:25 -0700 Subject: [PATCH 182/392] logging: add OLPC mesh log domain --- src/logging/nm-logging.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 953883bf3a..1b34614c7e 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -49,6 +49,7 @@ enum { LOGD_SUSPEND = 0x00080000, /* Suspend/Resume */ LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */ LOGD_DEVICE = 0x00200000, /* Device state and activation */ + LOGD_OLPC_MESH = 0x00400000, }; #define LOGD_DHCP (LOGD_DHCP4 | LOGD_DHCP6) From 796671d424dad653e840a2f355badbc21c1ae21a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:22:41 -0700 Subject: [PATCH 183/392] olpc-mesh: update logging --- src/nm-device-olpc-mesh.c | 59 ++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 807db94bd3..41fc83acd7 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -19,7 +19,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2005 - 2008 Red Hat, Inc. + * (C) Copyright 2005 - 2010 Red Hat, Inc. * (C) Copyright 2008 Collabora Ltd. * (C) Copyright 2009 One Laptop per Child */ @@ -42,6 +42,7 @@ #include "nm-device-interface.h" #include "nm-device-private.h" #include "nm-utils.h" +#include "nm-logging.h" #include "NetworkManagerUtils.h" #include "nm-activation-request.h" #include "nm-properties-changed-signal.h" @@ -157,7 +158,7 @@ real_get_generic_capabilities (NMDevice *dev) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_warn (LOGD_OLPC_MESH, "couldn't open control socket."); goto out; } @@ -168,13 +169,14 @@ real_get_generic_capabilities (NMDevice *dev) wrq.u.data.length = sizeof (struct iw_range); if (ioctl (fd, SIOCGIWRANGE, &wrq) < 0) { - nm_warning ("couldn't get driver range information."); + nm_log_warn (LOGD_OLPC_MESH, "couldn't get driver range information."); goto out; } if ((wrq.u.data.length < 300) || (range.we_version_compiled < 16)) { - nm_warning ("%s: driver's Wireless Extensions version (%d) is too old.", - iface, range.we_version_compiled); + nm_log_warn (LOGD_OLPC_MESH, + "(%s): driver's Wireless Extensions version (%d) is too old.", + iface, range.we_version_compiled); goto out; } else { caps |= NM_DEVICE_CAP_NM_SUPPORTED; @@ -404,7 +406,7 @@ create_socket_with_request (NMDevice *self, struct iwreq *req) sk = socket (AF_INET, SOCK_DGRAM, 0); if (!sk) { - nm_error ("Couldn't create socket: %d.", errno); + nm_log_err (LOGD_OLPC_MESH, "Couldn't create socket: %d.", errno); return -1; } @@ -430,8 +432,8 @@ nm_device_olpc_mesh_get_channel (NMDeviceOlpcMesh *self) return 0; if ((ioctl (sk, SIOCGIWFREQ, &req)) != 0) { - nm_warning ("%s: failed to get channel (errno: %d))", - nm_device_get_iface (NM_DEVICE (self)), errno); + nm_log_warn (LOGD_OLPC_MESH, "(%s): failed to get channel (errno: %d)", + nm_device_get_iface (NM_DEVICE (self)), errno); goto out; } @@ -469,10 +471,10 @@ nm_device_olpc_mesh_set_channel (NMDeviceOlpcMesh *self, guint32 channel) req.u.freq.m = channel; } - if (ioctl (sk, SIOCSIWFREQ, &req) != 0) - nm_warning ("%s: failed to set to channel %d (errno: %d))", - nm_device_get_iface (NM_DEVICE (self)), channel, errno); - else + if (ioctl (sk, SIOCSIWFREQ, &req) != 0) { + nm_log_warn (LOGD_OLPC_MESH, "(%s): failed to set to channel %d (errno: %d)", + nm_device_get_iface (NM_DEVICE (self)), channel, errno); + } else g_object_notify (G_OBJECT (self), NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL); close (sk); @@ -492,7 +494,7 @@ nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid) sk = socket (AF_INET, SOCK_DGRAM, 0); if (!sk) { - nm_error ("Couldn't create socket: %d.", errno); + nm_log_err (LOGD_OLPC_MESH, "Couldn't create socket: %d.", errno); return; } @@ -524,9 +526,10 @@ nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid) if (ioctl (sk, SIOCSIWESSID, &wrq) < 0) { if (errno != ENODEV) { - nm_warning ("error setting SSID to '%s' for device %s: %s", + nm_log_err (LOGD_OLPC_MESH, "(%s): error setting SSID to '%s': %s", + iface, ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(null)", - iface, strerror (errno)); + strerror (errno)); } } @@ -554,7 +557,7 @@ real_update_hw_address (NMDevice *dev) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - g_warning ("could not open control socket."); + nm_log_warn (LOGD_OLPC_MESH, "could not open control socket."); return; } @@ -562,8 +565,8 @@ real_update_hw_address (NMDevice *dev) strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); ret = ioctl (fd, SIOCGIFHWADDR, &req); if (ret) { - nm_warning ("%s: (%s) error getting hardware address: %d", - __func__, nm_device_get_iface (dev), errno); + nm_log_warn (LOGD_OLPC_MESH, "(%s): error getting hardware address: %d", + nm_device_get_iface (dev), errno); goto out; } @@ -585,17 +588,20 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) /* disconnect companion device, if it is connected */ if (nm_device_get_act_request (NM_DEVICE (priv->companion))) { - nm_warning ("disconnecting companion device"); + nm_log_info (LOGD_OLPC_MESH, "(%s): disconnecting companion device %s", + nm_device_get_iface (dev), + nm_device_get_iface (priv->companion)); /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ nm_device_state_changed (NM_DEVICE (priv->companion), NM_DEVICE_STATE_DISCONNECTED, NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); - nm_warning ("companion disconnected"); + nm_log_info (LOGD_OLPC_MESH, "(%s): companion %s disconnected", + nm_device_get_iface (dev), + nm_device_get_iface (priv->companion)); } - /* wait with continuing configuration untill the companion device is done - * scanning */ + /* wait with continuing configuration untill the companion device is done scanning */ g_object_get (priv->companion, "scanning", &scanning, NULL); if (scanning) { priv->stage1_waiting = TRUE; @@ -823,7 +829,8 @@ companion_state_changed_cb (NMDeviceWifi *companion, || state > NM_DEVICE_STATE_ACTIVATED) return; - nm_debug ("disconnecting mesh due to companion connectivity"); + nm_log_dbg (LOGD_OLPC_MESH, "(%s): disconnecting mesh due to companion connectivity", + nm_device_get_iface (NM_DEVICE (self))); /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, @@ -887,9 +894,9 @@ is_companion (NMDeviceOlpcMesh *self, NMDevice *other) NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); - nm_info ("(%s): found companion WiFi device %s", - nm_device_get_iface (NM_DEVICE (self)), - nm_device_get_iface (other)); + nm_log_info (LOGD_OLPC_MESH, "(%s): found companion WiFi device %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_iface (other)); g_signal_connect (G_OBJECT (other), "state-changed", G_CALLBACK (companion_state_changed_cb), self); From da987805063e089d9af6ac2785f8342daf42cb04 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:31:02 -0700 Subject: [PATCH 184/392] system-settings: update logging --- src/system-settings/Makefile.am | 2 ++ src/system-settings/nm-inotify-helper.c | 5 ++-- src/system-settings/nm-sysconfig-settings.c | 33 +++++++++++---------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/system-settings/Makefile.am b/src/system-settings/Makefile.am index baec81412a..3b616b9084 100644 --- a/src/system-settings/Makefile.am +++ b/src/system-settings/Makefile.am @@ -2,6 +2,7 @@ INCLUDES = -I${top_srcdir} \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/src/logging \ -I${top_srcdir}/src \ -I${top_builddir}/marshallers @@ -44,6 +45,7 @@ libsystem_settings_la_LIBADD = \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la \ $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ diff --git a/src/system-settings/nm-inotify-helper.c b/src/system-settings/nm-inotify-helper.c index 589dbd6917..0ee168e542 100644 --- a/src/system-settings/nm-inotify-helper.c +++ b/src/system-settings/nm-inotify-helper.c @@ -25,6 +25,7 @@ #include "nm-marshal.h" #include "nm-inotify-helper.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMInotifyHelper, nm_inotify_helper, G_TYPE_OBJECT) @@ -122,14 +123,14 @@ init_inotify (NMInotifyHelper *self) priv->ifd = inotify_init (); if (priv->ifd == -1) { - g_warning ("%s: couldn't initialize inotify", __func__); + nm_log_warn (LOGD_SYS_SET, "couldn't initialize inotify"); return FALSE; } /* Watch the inotify descriptor for file/directory change events */ channel = g_io_channel_unix_new (priv->ifd); if (!channel) { - g_warning ("%s: couldn't create new GIOChannel", __func__); + nm_log_warn (LOGD_SYS_SET, "couldn't create new GIOChannel"); close (priv->ifd); priv->ifd = -1; return FALSE; diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 53369067dc..b120953a3e 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -19,7 +19,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2008 Novell, Inc. */ @@ -57,8 +57,8 @@ #include "nm-sysconfig-connection.h" #include "nm-polkit-helpers.h" #include "nm-system-config-error.h" -#include "nm-utils.h" #include "nm-default-wired-connection.h" +#include "nm-logging.h" #define CONFIG_KEY_NO_AUTO_DEFAULT "no-auto-default" @@ -368,7 +368,7 @@ add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) NM_SYSTEM_CONFIG_INTERFACE_INFO, &pinfo, NULL); - g_message ("Loaded plugin %s: %s", pname, pinfo); + nm_log_info (LOGD_SYS_SET, "Loaded plugin %s: %s", pname, pinfo); g_free (pname); g_free (pinfo); } @@ -859,11 +859,11 @@ permission_call_done (GObject *object, GAsyncResult *result, gpointer user_data) &error); /* Some random error happened */ if (error) { - g_warning ("%s.%d (%s): error checking '%s' permission: (%d) %s", - __FILE__, __LINE__, __func__, - call->pk_action, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_err (LOGD_SYS_SET, "error checking '%s' permission: (%d) %s", + __FILE__, __LINE__, __func__, + call->pk_action, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); if (error) g_error_free (error); } else { @@ -1064,7 +1064,7 @@ is_mac_auto_wired_blacklisted (NMSysconfigSettings *self, const GByteArray *mac) config = g_key_file_new (); if (!config) { - g_warning ("%s: not enough memory to load config file.", __func__); + nm_log_warn (LOGD_SYS_SET, "not enough memory to load config file."); return FALSE; } @@ -1216,14 +1216,14 @@ default_wired_try_update (NMDefaultWiredConnection *wired, g_object_set_data (G_OBJECT (nm_default_wired_connection_get_device (wired)), DEFAULT_WIRED_TAG, NULL); - g_message ("Saved default wired connection '%s' to persistent storage", id); + nm_log_info (LOGD_SYS_SET, "Saved default wired connection '%s' to persistent storage", id); return FALSE; } - g_warning ("%s: couldn't save default wired connection '%s': %d / %s", - __func__, id, - error ? error->code : -1, - (error && error->message) ? error->message : "(unknown)"); + nm_log_warn (LOGD_SYS_SET, "couldn't save default wired connection '%s': %d / %s", + id, + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); /* If there was an error, don't destroy the default wired connection, * but add it back to the system settings service. Connection is already @@ -1275,7 +1275,8 @@ nm_sysconfig_settings_device_added (NMSysconfigSettings *self, NMDevice *device) id = nm_setting_connection_get_id (s_con); g_assert (id); - g_message ("Added default wired connection '%s' for %s", id, nm_device_get_udi (device)); + nm_log_info (LOGD_SYS_SET, "Added default wired connection '%s' for %s", + id, nm_device_get_udi (device)); g_signal_connect (wired, "try-update", (GCallback) default_wired_try_update, self); g_signal_connect (wired, "deleted", (GCallback) default_wired_deleted, self); @@ -1507,6 +1508,6 @@ nm_sysconfig_settings_init (NMSysconfigSettings *self) G_CALLBACK (pk_authority_changed_cb), self); } else - g_warning ("%s: failed to create PolicyKit authority.", __func__); + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority."); } From adc9ef60fc014e91111c5f80aeb879f9e451c928 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:31:38 -0700 Subject: [PATCH 185/392] logging: move config file logging options into their own section --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 142c1af1f8..1974ec19b7 100644 --- a/src/main.c +++ b/src/main.c @@ -322,8 +322,8 @@ parse_config_file (const char *filename, *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); - *log_level = g_key_file_get_value (config, "main", "log-level", NULL); - *log_domains = g_key_file_get_value (config, "main", "log-domains", NULL); + *log_level = g_key_file_get_value (config, "logging", "level", NULL); + *log_domains = g_key_file_get_value (config, "logging", "domains", NULL); g_key_file_free (config); return TRUE; From ce8631eea2c2b266a5f301d17a548e3d182d1f64 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:36:02 -0700 Subject: [PATCH 186/392] core: update dbus-manager logging --- src/nm-dbus-manager.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c index 37039f1872..9b621b42ba 100644 --- a/src/nm-dbus-manager.c +++ b/src/nm-dbus-manager.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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -29,7 +29,7 @@ #include #include #include -#include "nm-utils.h" +#include "nm-logging.h" enum { DBUS_CONNECTION_CHANGED = 0, @@ -158,7 +158,7 @@ nm_dbus_manager_reconnect (gpointer user_data) if (nm_dbus_manager_init_bus (self)) { if (nm_dbus_manager_start_service (self)) { - nm_info ("reconnected to the system bus."); + nm_log_info (LOGD_CORE, "reconnected to the system bus."); g_signal_emit (self, signals[DBUS_CONNECTION_CHANGED], 0, priv->connection); priv->reconnect_id = 0; @@ -223,8 +223,8 @@ nm_dbus_manager_name_has_owner (NMDBusManager *self, G_TYPE_INVALID, G_TYPE_BOOLEAN, &has_owner, G_TYPE_INVALID)) { - nm_warning ("NameHasOwner request failed: %s", - (err && err->message) ? err->message : "(unknown)"); + nm_log_warn (LOGD_CORE, "NameHasOwner request failed: %s", + (err && err->message) ? err->message : "(unknown)"); g_clear_error (&err); } @@ -248,7 +248,7 @@ destroy_cb (DBusGProxy *proxy, gpointer user_data) NMDBusManager *self = NM_DBUS_MANAGER (user_data); /* Clean up existing connection */ - nm_info ("disconnected by the system bus."); + nm_log_warn (LOGD_CORE, "disconnected by the system bus."); NM_DBUS_MANAGER_GET_PRIVATE (self)->proxy = NULL; nm_dbus_manager_cleanup (self, FALSE); @@ -265,7 +265,7 @@ nm_dbus_manager_init_bus (NMDBusManager *self) GError *err = NULL; if (priv->connection) { - nm_warning ("DBus Manager already has a valid connection."); + nm_log_warn (LOGD_CORE, "DBus Manager already has a valid connection."); return FALSE; } @@ -273,7 +273,7 @@ nm_dbus_manager_init_bus (NMDBusManager *self) priv->g_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); if (!priv->g_connection) { - nm_warning ("Could not get the system bus. Make sure " + nm_log_err (LOGD_CORE, "Could not get the system bus. Make sure " "the message bus daemon is running! Message: %s", err->message); g_error_free (err); @@ -317,7 +317,7 @@ nm_dbus_manager_start_service (NMDBusManager *self) priv = NM_DBUS_MANAGER_GET_PRIVATE (self); if (priv->started) { - nm_warning ("Service has already started."); + nm_log_err (LOGD_CORE, "Service has already started."); return FALSE; } @@ -327,7 +327,7 @@ nm_dbus_manager_start_service (NMDBusManager *self) G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) { - nm_warning ("Could not acquire the NetworkManager service.\n" + nm_log_err (LOGD_CORE, "Could not acquire the NetworkManager service.\n" " Error: '%s'", (err && err->message) ? err->message : "(unknown)"); g_error_free (err); @@ -335,7 +335,7 @@ nm_dbus_manager_start_service (NMDBusManager *self) } if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { - nm_warning ("Could not acquire the NetworkManager service as it is already taken."); + nm_log_err (LOGD_CORE, "Could not acquire the NetworkManager service as it is already taken."); return FALSE; } @@ -345,15 +345,15 @@ nm_dbus_manager_start_service (NMDBusManager *self) G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) { - g_warning ("Could not acquire the NetworkManagerSystemSettings service.\n" - " Message: '%s'", err->message); + nm_log_warn (LOGD_CORE, "Could not acquire the NetworkManagerSystemSettings service.\n" + " Message: '%s'", err->message); g_error_free (err); return FALSE; } if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { - g_warning ("Could not acquire the NetworkManagerSystemSettings service " - "as it is already taken."); + nm_log_warn (LOGD_CORE, "Could not acquire the NetworkManagerSystemSettings service " + "as it is already taken."); return FALSE; } From acf8f7f53115d2e59cff6a73d73230c7d97531a3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 11:36:38 -0700 Subject: [PATCH 187/392] core: update activation request logging --- src/nm-activation-request.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c index f85c12d610..1335c35e46 100644 --- a/src/nm-activation-request.c +++ b/src/nm-activation-request.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) 2007 - 2008 Novell, Inc. */ @@ -27,7 +27,7 @@ #include "nm-activation-request.h" #include "nm-marshal.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-setting-wireless-security.h" #include "nm-setting-8021x.h" #include "nm-dbus-manager.h" @@ -418,9 +418,9 @@ secrets_update_setting (NMSecretsProviderInterface *interface, nm_connection_add_setting (priv->connection, setting); else { if (!nm_connection_update_secrets (priv->connection, setting_name, new, &error)) { - nm_warning ("Failed to update connection secrets: %d %s", - error ? error->code : -1, - error && error->message ? error->message : "(none)"); + nm_log_warn (LOGD_DEVICE, "Failed to update connection secrets: %d %s", + error ? error->code : -1, + error && error->message ? error->message : "(none)"); g_clear_error (&error); } } @@ -591,15 +591,17 @@ nm_act_request_set_shared (NMActRequest *req, gboolean shared) int status; GError *error = NULL; - nm_info ("Executing: %s", cmd); + nm_log_info (LOGD_SHARING, "Executing: %s", cmd); if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, share_child_setup, NULL, NULL, NULL, &status, &error)) { - nm_info ("Error executing command: (%d) %s", - error ? error->code : -1, - (error && error->message) ? error->message : "(unknown)"); + nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s", + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); g_clear_error (&error); - } else if (WEXITSTATUS (status)) - nm_info ("** Command returned exit status %d.", WEXITSTATUS (status)); + } else if (WEXITSTATUS (status)) { + nm_log_warn (LOGD_SHARING, "** Command returned exit status %d.", + WEXITSTATUS (status)); + } } g_free (cmd); if (argv) From 3f1604f3f0a488261d2a505766efb6e9c114e90d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:27:34 -0700 Subject: [PATCH 188/392] system-settings: update logging --- src/system-settings/nm-sysconfig-connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c index 7d6074c63d..09cec4000f 100644 --- a/src/system-settings/nm-sysconfig-connection.c +++ b/src/system-settings/nm-sysconfig-connection.c @@ -28,6 +28,7 @@ #include "nm-settings-connection-interface.h" #include "nm-settings-interface.h" #include "nm-polkit-helpers.h" +#include "nm-logging.h" static void settings_connection_interface_init (NMSettingsConnectionInterface *klass); @@ -613,8 +614,9 @@ nm_sysconfig_connection_init (NMSysconfigConnection *self) NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); priv->authority = polkit_authority_get (); - if (!priv->authority) - g_warning ("%s: error creating PolicyKit authority", __func__); + if (!priv->authority) { + nm_log_err (LOGD_SYS_SET, "%s: error creating PolicyKit authority"); + } } static void From 1f1a28ae20813df93912b771340f33c534257437 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:28:57 -0700 Subject: [PATCH 189/392] core: update logging in misc files --- src/NetworkManagerUtils.c | 9 +++++---- src/nm-active-connection.c | 5 +++-- src/nm-call-store.c | 9 +++++---- src/nm-netlink-monitor.c | 10 +++++----- src/nm-netlink.c | 12 ++++++------ src/nm-secrets-provider-interface.c | 6 +++--- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 100ccd363d..4bd57d9944 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.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) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -28,6 +28,7 @@ #include "NetworkManagerUtils.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-device.h" #include "nm-device-wifi.h" #include "nm-device-ethernet.h" @@ -85,13 +86,13 @@ nm_spawn_process (const char *args) g_return_val_if_fail (args != NULL, -1); if (!g_shell_parse_argv (args, &num_args, &argv, &error)) { - nm_warning ("could not parse arguments for '%s': %s", args, error->message); + nm_log_warn (LOGD_CORE, "could not parse arguments for '%s': %s", args, error->message); g_error_free (error); return -1; } if (!g_spawn_sync ("/", argv, NULL, 0, NULL, NULL, NULL, NULL, &status, &error)) { - nm_warning ("could not spawn process '%s': %s", args, error->message); + nm_log_warn (LOGD_CORE, "could not spawn process '%s': %s", args, error->message); g_error_free (error); } @@ -394,7 +395,7 @@ nm_utils_call_dispatcher (const char *action, NM_DISPATCHER_DBUS_PATH, NM_DISPATCHER_DBUS_IFACE); if (!proxy) { - nm_warning ("Error: could not get dispatcher proxy!"); + nm_log_err (LOGD_CORE, "could not get dispatcher proxy!"); g_object_unref (dbus_mgr); return; } diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index 019b5c3fc0..4207e14504 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -15,13 +15,14 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include #include "nm-active-connection.h" #include "NetworkManager.h" #include "nm-active-connection-glue.h" +#include "nm-logging.h" char * nm_active_connection_get_next_object_path (void) @@ -54,7 +55,7 @@ nm_active_connection_scope_to_value (NMConnection *connection, GValue *value) g_value_set_string (value, NM_DBUS_SERVICE_USER_SETTINGS); break; default: - g_warning ("%s: unknown connection scope!", __func__); + nm_log_err (LOGD_CORE, "unknown connection scope!"); break; } } diff --git a/src/nm-call-store.c b/src/nm-call-store.c index 837edf023d..df400d0ff6 100644 --- a/src/nm-call-store.c +++ b/src/nm-call-store.c @@ -16,10 +16,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 Novell, Inc. + * Copyright (C) 2010 Red Hat, Inc. */ #include "nm-call-store.h" -#include "nm-utils.h" +#include "nm-logging.h" NMCallStore * nm_call_store_new (void) @@ -68,12 +69,12 @@ nm_call_store_remove (NMCallStore *store, call_ids_hash = g_hash_table_lookup (store, object); if (!call_ids_hash) { - nm_warning ("Trying to remove a non-existant call id."); + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); return; } if (!g_hash_table_remove (call_ids_hash, call_id)) - nm_warning ("Trying to remove a non-existant call id."); + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); if (g_hash_table_size (call_ids_hash) == 0) { g_hash_table_remove (store, object); @@ -162,7 +163,7 @@ nm_call_store_foreach (NMCallStore *store, call_ids_hash = g_hash_table_lookup (store, object); if (!call_ids_hash) { - nm_warning ("Object not in store"); + nm_log_warn (LOGD_CORE, "Object not in store"); return -1; } diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 04f87b4b1d..36cd99e2d0 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.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. * Copyright (C) 2005 Ray Strode * @@ -43,7 +43,7 @@ #include "NetworkManager.h" #include "nm-system.h" #include "nm-netlink-monitor.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" #include "nm-netlink.h" @@ -407,9 +407,9 @@ deferred_emit_carrier_state (gpointer user_data) /* Update the link cache with latest state, and if there are no errors * emit the link states for all the interfaces in the cache. */ - if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) - nm_warning ("error updating link cache: %s", nl_geterror ()); - else { + if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); + } else { nl_cache_foreach_filter (priv->nlh_link_cache, NULL, netlink_object_message_handler, diff --git a/src/nm-netlink.c b/src/nm-netlink.c index ad68790db1..c55c093ae8 100644 --- a/src/nm-netlink.c +++ b/src/nm-netlink.c @@ -21,7 +21,7 @@ #include "config.h" #include "nm-netlink.h" -#include "nm-utils.h" +#include "nm-logging.h" #include #include @@ -40,7 +40,7 @@ get_link_cache (void) nlh = nm_netlink_get_default_handle (); if (G_UNLIKELY (!nlh)) { - nm_warning ("couldn't allocate netlink handle."); + nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); return NULL; } @@ -48,7 +48,7 @@ get_link_cache (void) link_cache = rtnl_link_alloc_cache (nlh); if (G_UNLIKELY (!link_cache)) { - nm_warning ("couldn't allocate netlink link cache: %s", nl_geterror ()); + nm_log_err (LOGD_HW, "couldn't allocate netlink link cache: %s", nl_geterror ()); return NULL; } @@ -71,12 +71,12 @@ nm_netlink_get_default_handle (void) cb = nl_cb_alloc(NL_CB_VERBOSE); def_nl_handle = nl_handle_alloc_cb (cb); if (!def_nl_handle) { - nm_warning ("couldn't allocate netlink handle."); + nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); return NULL; } if (nl_connect (def_nl_handle, NETLINK_ROUTE) < 0) { - nm_error ("couldn't connect to netlink: %s", nl_geterror ()); + nm_log_err (LOGD_HW, "couldn't connect to netlink: %s", nl_geterror ()); return NULL; } @@ -123,7 +123,7 @@ nm_netlink_index_to_iface (int idx) buf = g_malloc0 (MAX_IFACE_LEN); if (buf == NULL) { - nm_warning ("Not enough memory to allocate interface name buffer."); + nm_log_warn (LOGD_HW, "Not enough memory to allocate interface name buffer."); return NULL; } diff --git a/src/nm-secrets-provider-interface.c b/src/nm-secrets-provider-interface.c index 9bbde7a394..47b8e57efa 100644 --- a/src/nm-secrets-provider-interface.c +++ b/src/nm-secrets-provider-interface.c @@ -25,7 +25,7 @@ #include #include -#include "nm-utils.h" +#include "nm-logging.h" static void nm_secrets_provider_interface_init (gpointer g_iface) @@ -108,7 +108,7 @@ nm_secrets_provider_interface_get_secrets (NMSecretsProviderInterface *self, connection, setting_name, request_new, caller, hint1, hint2, &success); if (!success) { - nm_warning ("failed to get connection secrets."); + nm_log_warn (LOGD_CORE, "failed to get connection secrets."); return FALSE; } @@ -193,7 +193,7 @@ nm_secrets_provider_interface_get_secrets_result (NMSecretsProviderInterface *se hash = g_hash_table_lookup (settings, name); if (!hash) { - nm_warning ("couldn't get setting secrets for '%s'", name); + nm_log_warn (LOGD_CORE, "couldn't get setting secrets for '%s'", name); continue; } From f636c5048d2cb35e3be04dd30c4410a4e846cc89 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:31:29 -0700 Subject: [PATCH 190/392] wifi: update logging for APs --- src/nm-wifi-ap.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index f3365176ad..ba865cfbff 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -26,6 +26,7 @@ #include "nm-wifi-ap.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-dbus-manager.h" #include "wpa.h" #include "nm-properties-changed-signal.h" @@ -333,7 +334,7 @@ nm_ap_export_to_dbus (NMAccessPoint *ap) priv = NM_AP_GET_PRIVATE (ap); if (priv->dbus_path) { - nm_warning ("Tried to export AP %s twice.", priv->dbus_path); + nm_log_err (LOGD_CORE, "Tried to export AP %s twice.", priv->dbus_path); return; } @@ -700,21 +701,21 @@ nm_ap_print_self (NMAccessPoint *ap, priv = NM_AP_GET_PRIVATE (ap); - nm_info ("%s'%s' (%p) stamp=%ld flags=0x%X wpa-flags=0x%X rsn-flags=0x%x " - "bssid=" MAC_FMT " strength=%d freq=%d rate=%d mode=%d seen=%ld", - prefix, - priv->ssid ? nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len) : "(none)", - ap, - priv->timestamp.tv_sec, - priv->flags, - priv->wpa_flags, - priv->rsn_flags, - MAC_ARG (priv->address.ether_addr_octet), - priv->strength, - priv->freq, - priv->max_bitrate, - priv->mode, - priv->last_seen); + nm_log_dbg (LOGD_WIFI_SCAN, "%s'%s' (%p) stamp=%ld flags=0x%X wpa-flags=0x%X rsn-flags=0x%x " + "bssid=" MAC_FMT " strength=%d freq=%d rate=%d mode=%d seen=%ld", + prefix, + priv->ssid ? nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len) : "(none)", + ap, + priv->timestamp.tv_sec, + priv->flags, + priv->wpa_flags, + priv->rsn_flags, + MAC_ARG (priv->address.ether_addr_octet), + priv->strength, + priv->freq, + priv->max_bitrate, + priv->mode, + priv->last_seen); } const char * @@ -940,7 +941,7 @@ void nm_ap_set_mode (NMAccessPoint *ap, const NM80211Mode mode) g_object_notify (G_OBJECT (ap), NM_AP_MODE); } } else - nm_warning ("Invalid AP mode '%d'", mode); + nm_log_warn (LOGD_WIFI, "Invalid AP mode '%d'", mode); } From 058f1edb4055414d9a11e876b1e2f928cfad7528 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:31:39 -0700 Subject: [PATCH 191/392] core: update base device logging --- src/nm-device-interface.c | 6 +- src/nm-device.c | 230 ++++++++++++++++++++++---------------- 2 files changed, 137 insertions(+), 99 deletions(-) diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index 74ab9d2986..4040626c2b 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -22,7 +22,7 @@ #include "nm-marshal.h" #include "nm-setting-connection.h" #include "nm-device-interface.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-properties-changed-signal.h" #include "nm-rfkill.h" @@ -282,8 +282,8 @@ nm_device_interface_activate (NMDeviceInterface *device, g_assert (s_con); iface = nm_device_interface_get_iface (device); - nm_info ("Activation (%s) starting connection '%s'", iface, - nm_setting_connection_get_id (s_con)); + nm_log_info (LOGD_DEVICE, "Activation (%s) starting connection '%s'", iface, + nm_setting_connection_get_id (s_con)); g_free (iface); success = NM_DEVICE_INTERFACE_GET_INTERFACE (device)->activate (device, req, error); diff --git a/src/nm-device.c b/src/nm-device.c index 556cc187ed..716401a583 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -44,6 +44,7 @@ #include "nm-dbus-manager.h" #include "nm-named-manager.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-netlink.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" @@ -218,18 +219,18 @@ constructor (GType type, priv = NM_DEVICE_GET_PRIVATE (dev); if (!priv->udi) { - nm_warning ("No device udi provided, ignoring"); + nm_log_err (LOGD_DEVICE, "No device udi provided, ignoring"); goto error; } if (!priv->iface) { - nm_warning ("No device interface provided, ignoring"); + nm_log_err (LOGD_DEVICE, "No device interface provided, ignoring"); goto error; } priv->capabilities |= NM_DEVICE_GET_CLASS (dev)->get_generic_capabilities (dev); if (!(priv->capabilities & NM_DEVICE_CAP_NM_SUPPORTED)) { - nm_warning ("(%s): Device unsupported, ignoring.", priv->iface); + nm_log_warn (LOGD_DEVICE, "(%s): Device unsupported, ignoring.", priv->iface); goto error; } @@ -526,8 +527,9 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family) act_source_func = &priv->act_source_func; } - if (*act_source_id) - nm_warning ("activation stage already scheduled"); + if (*act_source_id) { + nm_log_err (LOGD_DEVICE, "activation stage already scheduled"); + } /* Don't bother rescheduling the same function that's about to * run anyway. Fixes issues with crappy wireless drivers sending @@ -589,9 +591,10 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, if ((state != NM_DEVICE_STATE_IP_CONFIG) || priv->dhcp6_client) return; - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) starting DHCPv6" - " as requested by IPv6 router...", - priv->iface); + nm_log_info (LOGD_DEVICE | LOGD_DHCP6, + "Activation (%s) Stage 3 of 5 (IP Configure Start) starting DHCPv6" + " as requested by IPv6 router...", + priv->iface); ret = dhcp6_start (self, connection, dhcp_opts, &reason); switch (ret) { @@ -726,7 +729,7 @@ nm_device_activate_stage1_device_prepare (gpointer user_data) priv->ip4_ready = priv->ip6_ready = FALSE; iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 1 of 5 (Device Prepare) started...", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) started...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_PREPARE, NM_DEVICE_STATE_REASON_NONE); ret = NM_DEVICE_GET_CLASS (self)->act_stage1_prepare (self, &reason); @@ -741,7 +744,7 @@ nm_device_activate_stage1_device_prepare (gpointer user_data) nm_device_activate_schedule_stage2_device_config (self); out: - nm_info ("Activation (%s) Stage 1 of 5 (Device Prepare) complete.", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) complete.", iface); return FALSE; } @@ -764,8 +767,8 @@ nm_device_activate_schedule_stage1_device_prepare (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage1_device_prepare, 0); - nm_info ("Activation (%s) Stage 1 of 5 (Device Prepare) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) scheduled...", + nm_device_get_iface (self)); } static NMActStageReturn @@ -795,7 +798,7 @@ nm_device_activate_stage2_device_config (gpointer user_data) activation_source_clear (self, FALSE, 0); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 2 of 5 (Device Configure) starting...", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) starting...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); if (!nm_device_bring_up (self, FALSE, &no_firmware)) { @@ -816,12 +819,12 @@ nm_device_activate_stage2_device_config (gpointer user_data) } g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); - nm_info ("Activation (%s) Stage 2 of 5 (Device Configure) successful.", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) successful.", iface); nm_device_activate_schedule_stage3_ip_config_start (self); out: - nm_info ("Activation (%s) Stage 2 of 5 (Device Configure) complete.", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) complete.", iface); return FALSE; } @@ -844,7 +847,7 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage2_device_config, 0); - nm_info ("Activation (%s) Stage 2 of 5 (Device Configure) scheduled...", + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) scheduled...", nm_device_get_iface (self)); } @@ -873,9 +876,9 @@ aipd_cleanup (NMDevice *self) kill (priv->aipd_pid, SIGKILL); /* ensure the child is reaped */ - nm_debug ("waiting for ppp pid %d to exit", priv->aipd_pid); + nm_log_dbg (LOGD_AUTOIP4, "waiting for avahi-autoipd pid %d to exit", priv->aipd_pid); waitpid (priv->aipd_pid, NULL, 0); - nm_debug ("ppp pid %d cleaned up", priv->aipd_pid); + nm_log_dbg (LOGD_AUTOIP4, "avahi-autoip pid %d cleaned up", priv->aipd_pid); priv->aipd_pid = -1; } @@ -919,7 +922,7 @@ handle_autoip_change (NMDevice *self, NMDeviceStateReason *reason) config = aipd_get_ip4_config (self, reason); if (!config) { - nm_warning ("failed to get autoip config for rebind"); + nm_log_err (LOGD_AUTOIP4, "failed to get autoip config for rebind"); return FALSE; } @@ -931,7 +934,7 @@ handle_autoip_change (NMDevice *self, NMDeviceStateReason *reason) g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, config); if (!nm_device_set_ip4_config (self, config, FALSE, reason)) { - nm_warning ("(%s): failed to update IP4 config in response to autoip event.", + nm_log_err (LOGD_AUTOIP4, "(%s): failed to update IP4 config in response to autoip event.", nm_device_get_iface (self)); return FALSE; } @@ -980,14 +983,14 @@ nm_device_handle_autoip4_event (NMDevice *self, NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; if (inet_pton (AF_INET, address, &ip) <= 0) { - nm_warning ("(%s): invalid address %s received from avahi-autoipd.", + nm_log_err (LOGD_AUTOIP4, "(%s): invalid address %s received from avahi-autoipd.", iface, address); nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR); return; } if ((ip.s_addr & IPV4LL_NETMASK) != IPV4LL_NETWORK) { - nm_warning ("(%s): invalid address %s received from avahi-autoipd.", + nm_log_err (LOGD_AUTOIP4, "(%s): invalid address %s received from avahi-autoipd (not link-local).", iface, address); nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR); return; @@ -996,7 +999,7 @@ nm_device_handle_autoip4_event (NMDevice *self, switch (state) { case NM_DEVICE_STATE_IP_CONFIG: if (priv->aipd_addr) { - nm_warning ("(%s): already have autoip address!", iface); + nm_log_warn (LOGD_AUTOIP4, "(%s): already have autoip address!", iface); return; } @@ -1010,12 +1013,12 @@ nm_device_handle_autoip4_event (NMDevice *self, nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); break; default: - nm_warning ("(%s): unexpected avahi-autoip event %s for %s.", + nm_log_warn (LOGD_AUTOIP4, "(%s): unexpected avahi-autoip event %s for %s.", iface, event, address); break; } } else { - nm_warning ("%s: autoip address %s no longer valid because '%s'.", + nm_log_warn (LOGD_AUTOIP4, "(%s): autoip address %s no longer valid because '%s'.", iface, address, event); /* The address is gone; terminate the connection or fail activation */ @@ -1037,14 +1040,18 @@ aipd_watch_cb (GPid pid, gint status, gpointer user_data) iface = nm_device_get_iface (self); - if (WIFEXITED (status)) - nm_warning ("%s: avahi-autoipd exited with error code %d", iface, WEXITSTATUS (status)); - else if (WIFSTOPPED (status)) - nm_warning ("%s: avahi-autoipd stopped unexpectedly with signal %d", iface, WSTOPSIG (status)); - else if (WIFSIGNALED (status)) - nm_warning ("%s: avahi-autoipd died with signal %d", iface, WTERMSIG (status)); - else - nm_warning ("%s: avahi-autoipd died from an unknown cause", iface); + if (WIFEXITED (status)) { + nm_log_dbg (LOGD_AUTOIP4, "(%s): avahi-autoipd exited with error code %d", + iface, WEXITSTATUS (status)); + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd stopped unexpectedly with signal %d", + iface, WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd died with signal %d", + iface, WTERMSIG (status)); + } else { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd died from an unknown cause", iface); + } aipd_cleanup (self); @@ -1063,7 +1070,7 @@ aipd_timeout_cb (gpointer user_data) return FALSE; priv->aipd_timeout = 0; - nm_info ("%s: avahi-autoipd timed out.", nm_device_get_iface (self)); + nm_log_info (LOGD_AUTOIP4, "(%s): avahi-autoipd timed out.", nm_device_get_iface (self)); aipd_cleanup (self); if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) @@ -1169,7 +1176,8 @@ handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) if (ipv6) { ip6_config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); if (!ip6_config) { - nm_warning ("failed to get DHCPv6 config for rebind"); + nm_log_warn (LOGD_DHCP6, "(%s): failed to get DHCPv6 config for rebind", + nm_device_get_ip_iface (device)); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); return; } @@ -1185,13 +1193,15 @@ handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) dhcp6_add_option_cb, priv->dhcp6_config); } else { - nm_warning ("Failed to update IPv6 config in response to DHCP event."); + nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv6 config in response to DHCP event.", + nm_device_get_ip_iface (device)); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); } } else { ip4_config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); if (!ip4_config) { - nm_warning ("failed to get DHCPv4 config for rebind"); + nm_log_warn (LOGD_DHCP6, "(%s): failed to get DHCPv4 config for rebind", + nm_device_get_ip_iface (device)); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); return; } @@ -1207,7 +1217,8 @@ handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) dhcp4_add_option_cb, priv->dhcp4_config); } else { - nm_warning ("Failed to update IPv4 config in response to DHCP event."); + nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv4 config in response to DHCP event.", + nm_device_get_ip_iface (device)); nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); } } @@ -1365,12 +1376,14 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) /* Start avahi-autoipd */ if (aipd_exec (self, &error)) { - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) started" - " avahi-autoipd...", iface); + nm_log_info (LOGD_DEVICE | LOGD_AUTOIP4, + "Activation (%s) Stage 3 of 5 (IP Configure Start) started" + " avahi-autoipd...", iface); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else { - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) failed" - " to start avahi-autoipd: %s", iface, error->message); + nm_log_info (LOGD_DEVICE | LOGD_AUTOIP4, + "Activation (%s) Stage 3 of 5 (IP Configure Start) failed" + " to start avahi-autoipd: %s", iface, error->message); g_error_free (error); aipd_cleanup (self); *reason = NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED; @@ -1495,7 +1508,7 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data) activation_source_clear (self, FALSE, 0); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) started...", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) started...", iface); nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_NONE); ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip4_config_start (self, &reason); @@ -1517,7 +1530,7 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data) g_assert (ret == NM_ACT_STAGE_RETURN_POSTPONE); out: - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) complete.", iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) complete.", iface); return FALSE; } @@ -1539,8 +1552,8 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage3_ip_config_start, 0); - nm_info ("Activation (%s) Stage 3 of 5 (IP Configure Start) scheduled.", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) scheduled.", + nm_device_get_iface (self)); } static GHashTable *shared_ips = NULL; @@ -1560,7 +1573,7 @@ reserve_shared_ip (void) while (g_hash_table_lookup (shared_ips, GUINT_TO_POINTER (start + count))) { count += ntohl (0x100); if (count > ntohl (0xFE00)) { - nm_warning ("%s: ran out of shared IP addresses!", __func__); + nm_log_err (LOGD_SHARING, "ran out of shared IP addresses!"); return 0; } } @@ -1692,7 +1705,9 @@ nm_device_activate_stage4_ip4_config_get (gpointer user_data) activation_source_clear (self, FALSE, AF_INET); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Get) started...", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) started...", + iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip4_config (self, &ip4_config, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) @@ -1710,7 +1725,9 @@ nm_device_activate_stage4_ip4_config_get (gpointer user_data) nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET); out: - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Get) complete.", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) complete.", + iface); return FALSE; } @@ -1733,8 +1750,9 @@ nm_device_activate_schedule_stage4_ip4_config_get (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage4_ip4_config_get, AF_INET); - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Get) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) scheduled...", + nm_device_get_iface (self)); } @@ -1774,7 +1792,9 @@ nm_device_activate_stage4_ip4_config_timeout (gpointer user_data) activation_source_clear (self, FALSE, AF_INET); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) started...", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) started...", + iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip4_config_timeout (self, &ip4_config, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { @@ -1792,7 +1812,9 @@ nm_device_activate_stage4_ip4_config_timeout (gpointer user_data) nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET); out: - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) complete.", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) complete.", + iface); return FALSE; } @@ -1815,8 +1837,9 @@ nm_device_activate_schedule_stage4_ip4_config_timeout (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage4_ip4_config_timeout, AF_INET); - nm_info ("Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) scheduled...", + nm_device_get_iface (self)); } static NMActStageReturn @@ -1901,7 +1924,9 @@ nm_device_activate_stage4_ip6_config_get (gpointer user_data) activation_source_clear (self, FALSE, AF_INET6); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Get) started...", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) started...", + iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip6_config (self, &ip6_config, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) @@ -1919,7 +1944,9 @@ nm_device_activate_stage4_ip6_config_get (gpointer user_data) nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET6); out: - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Get) complete.", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) complete.", + iface); return FALSE; } @@ -1942,8 +1969,9 @@ nm_device_activate_schedule_stage4_ip6_config_get (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage4_ip6_config_get, AF_INET6); - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Get) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) scheduled...", + nm_device_get_iface (self)); } @@ -1982,7 +2010,9 @@ nm_device_activate_stage4_ip6_config_timeout (gpointer user_data) activation_source_clear (self, FALSE, AF_INET6); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) started...", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) started...", + iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip6_config_timeout (self, &ip6_config, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { @@ -2000,7 +2030,9 @@ nm_device_activate_stage4_ip6_config_timeout (gpointer user_data) nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET6); out: - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) complete.", iface); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) complete.", + iface); return FALSE; } @@ -2023,8 +2055,9 @@ nm_device_activate_schedule_stage4_ip6_config_timeout (NMDevice *self) activation_source_schedule (self, nm_device_activate_stage4_ip6_config_timeout, AF_INET6); - nm_info ("Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) scheduled...", + nm_device_get_iface (self)); } static void @@ -2045,14 +2078,14 @@ share_init (void) char **iter; if (!nm_utils_do_sysctl ("/proc/sys/net/ipv4/ip_forward", "1\n")) { - nm_warning ("%s: Error starting IP forwarding: (%d) %s", - __func__, errno, strerror (errno)); + nm_log_err (LOGD_SHARING, "Error starting IP forwarding: (%d) %s", + errno, strerror (errno)); return FALSE; } if (!nm_utils_do_sysctl ("/proc/sys/net/ipv4/ip_dynaddr", "1\n")) { - nm_warning ("%s: Error starting IP forwarding: (%d) %s", - __func__, errno, strerror (errno)); + nm_log_err (LOGD_SHARING, "error starting IP forwarding: (%d) %s", + errno, strerror (errno)); } for (iter = modules; *iter; iter++) { @@ -2062,9 +2095,9 @@ share_init (void) if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, share_child_setup, NULL, NULL, NULL, &status, &error)) { - nm_info ("%s: Error loading NAT module %s: (%d) %s", - __func__, *iter, error ? error->code : 0, - (error && error->message) ? error->message : "unknown"); + nm_log_err (LOGD_SHARING, "error loading NAT module %s: (%d) %s", + *iter, error ? error->code : 0, + (error && error->message) ? error->message : "unknown"); if (error) g_error_free (error); } @@ -2138,7 +2171,7 @@ start_sharing (NMDevice *self) nm_act_request_set_shared (req, TRUE); if (!nm_dnsmasq_manager_start (priv->dnsmasq_manager, ip4_config, &error)) { - nm_warning ("(%s/%s): failed to start dnsmasq: %s", + nm_log_err (LOGD_SHARING, "(%s/%s): failed to start dnsmasq: %s", nm_device_get_iface (self), ip_iface, error->message); g_error_free (error); nm_act_request_set_shared (req, FALSE); @@ -2192,8 +2225,8 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) activation_source_clear (self, FALSE, 0); iface = nm_device_get_iface (self); - nm_info ("Activation (%s) Stage 5 of 5 (IP Configure Commit) started...", - iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 5 of 5 (IP Configure Commit) started...", + iface); assumed = nm_act_request_get_assumed (priv->act_request); @@ -2203,8 +2236,9 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) } if (ip6_config && !nm_device_set_ip6_config (self, ip6_config, assumed, &reason)) { - nm_info ("Activation (%s) Stage 5 of 5 (IP Configure Commit) IPv6 failed", - iface); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) IPv6 failed", + iface); } connection = nm_act_request_get_connection (nm_device_get_act_request (self)); @@ -2216,7 +2250,7 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) if (s_ip4 && !strcmp (method, "shared")) { if (!start_sharing (self)) { - nm_warning ("Activation (%s) Stage 5 of 5 (IP Configure Commit) start sharing failed.", iface); + nm_log_warn (LOGD_SHARING, "Activation (%s) Stage 5 of 5 (IP Configure Commit) start sharing failed.", iface); nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SHARED_START_FAILED); goto out; } @@ -2226,8 +2260,8 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) nm_device_state_changed (self, NM_DEVICE_STATE_ACTIVATED, NM_DEVICE_STATE_REASON_NONE); out: - nm_info ("Activation (%s) Stage 5 of 5 (IP Configure Commit) complete.", - iface); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 5 of 5 (IP Configure Commit) complete.", + iface); /* Balance IP config creation; device takes ownership in set_ip*_config() */ if (ip4_config) @@ -2269,8 +2303,9 @@ nm_device_activate_schedule_stage5_ip_config_commit (NMDevice *self, int family) activation_source_schedule (self, nm_device_activate_stage5_ip_config_commit, 0); - nm_info ("Activation (%s) Stage 5 of 5 (IP Configure Commit) scheduled...", - nm_device_get_iface (self)); + nm_log_info (LOGD_DEVICE, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) scheduled...", + nm_device_get_iface (self)); } @@ -2452,9 +2487,8 @@ nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason) g_return_if_fail (self != NULL); - nm_info ("(%s): deactivating device (reason: %d).", - nm_device_get_iface (self), - reason); + nm_log_info (LOGD_DEVICE, "(%s): deactivating device (reason: %d).", + nm_device_get_iface (self), reason); nm_device_deactivate_quickly (self); @@ -2750,7 +2784,7 @@ nm_device_update_ip4_address (NMDevice *self) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_err (LOGD_IP4, "couldn't open control socket."); return; } @@ -2865,7 +2899,7 @@ nm_device_hw_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) if (nm_device_hw_is_up (self)) goto out; - nm_info ("(%s): bringing up device.", nm_device_get_iface (self)); + nm_log_info (LOGD_HW, "(%s): bringing up device.", nm_device_get_iface (self)); if (NM_DEVICE_GET_CLASS (self)->hw_bring_up) { success = NM_DEVICE_GET_CLASS (self)->hw_bring_up (self, no_firmware); @@ -2878,7 +2912,7 @@ nm_device_hw_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) g_usleep (200); if (!nm_device_hw_is_up (self)) { - nm_warning ("(%s): device not up after timeout!", nm_device_get_iface (self)); + nm_log_warn (LOGD_HW, "(%s): device not up after timeout!", nm_device_get_iface (self)); return FALSE; } @@ -2901,7 +2935,7 @@ nm_device_hw_take_down (NMDevice *self, gboolean block) if (!nm_device_hw_is_up (self)) return; - nm_info ("(%s): taking down device.", nm_device_get_iface (self)); + nm_log_info (LOGD_HW, "(%s): taking down device.", nm_device_get_iface (self)); if (NM_DEVICE_GET_CLASS (self)->hw_take_down) NM_DEVICE_GET_CLASS (self)->hw_take_down (self); @@ -2924,7 +2958,7 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) if (nm_device_is_up (self)) return TRUE; - nm_info ("(%s): preparing device.", nm_device_get_iface (self)); + nm_log_info (LOGD_HW, "(%s): preparing device.", nm_device_get_iface (self)); if (NM_DEVICE_GET_CLASS (self)->bring_up) success = NM_DEVICE_GET_CLASS (self)->bring_up (self); @@ -2941,7 +2975,7 @@ nm_device_take_down (NMDevice *self, gboolean block, NMDeviceStateReason reason) nm_device_interface_deactivate (NM_DEVICE_INTERFACE (self), reason); if (nm_device_is_up (self)) { - nm_info ("(%s): cleaning up...", nm_device_get_iface (self)); + nm_log_info (LOGD_HW, "(%s): cleaning up...", nm_device_get_iface (self)); if (NM_DEVICE_GET_CLASS (self)->take_down) NM_DEVICE_GET_CLASS (self)->take_down (self); @@ -3294,8 +3328,8 @@ nm_device_state_changed (NMDevice *device, old_state = priv->state; priv->state = state; - nm_info ("(%s): device state change: %d -> %d (reason %d)", - nm_device_get_iface (device), old_state, state, reason); + nm_log_info (LOGD_DEVICE, "(%s): device state change: %d -> %d (reason %d)", + nm_device_get_iface (device), old_state, state, reason); /* Clear any delayed transitions */ delayed_transitions_clear (device); @@ -3313,8 +3347,9 @@ nm_device_state_changed (NMDevice *device, break; case NM_DEVICE_STATE_UNAVAILABLE: if (old_state == NM_DEVICE_STATE_UNMANAGED) { - if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) - nm_warning ("%s: firmware may be missing.", nm_device_get_iface (device)); + if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) { + nm_log_warn (LOGD_HW, "%s: firmware may be missing.", nm_device_get_iface (device)); + } } /* Ensure the device gets deactivated in response to stuff like * carrier changes or rfkill. But don't deactivate devices that are @@ -3350,11 +3385,12 @@ nm_device_state_changed (NMDevice *device, priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device); break; case NM_DEVICE_STATE_ACTIVATED: - nm_info ("Activation (%s) successful, device activated.", nm_device_get_iface (device)); + nm_log_info (LOGD_DEVICE, "Activation (%s) successful, device activated.", + nm_device_get_iface (device)); nm_utils_call_dispatcher ("up", nm_act_request_get_connection (req), device, NULL); break; case NM_DEVICE_STATE_FAILED: - nm_info ("Activation (%s) failed.", nm_device_get_iface (device)); + nm_log_warn (LOGD_DEVICE, "Activation (%s) failed.", nm_device_get_iface (device)); /* Schedule the transition to DISCONNECTED. The device can't transition * immediately becuase we can't change states again from the state * handler for a variety of reasons. @@ -3403,7 +3439,9 @@ nm_device_set_managed (NMDevice *device, return; priv->managed = managed; - nm_info ("(%s): now %s", nm_device_get_iface (device), managed ? "managed" : "unmanaged"); + nm_log_info (LOGD_DEVICE, "(%s): now %s", + nm_device_get_iface (device), + managed ? "managed" : "unmanaged"); g_object_notify (G_OBJECT (device), NM_DEVICE_INTERFACE_MANAGED); From 826243d5d1da693de15af6a9fd6b7c1dd99af9f6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:37:48 -0700 Subject: [PATCH 192/392] wifi: update wpa utils logging --- src/wpa.c | 91 ++++++++++++++++++++++++------------------------------- 1 file changed, 39 insertions(+), 52 deletions(-) diff --git a/src/wpa.c b/src/wpa.c index 8f500476cd..5f4fd024f4 100644 --- a/src/wpa.c +++ b/src/wpa.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * WPA Supplicant - WPA state machine and EAPOL-Key processing * Copyright (c) 2003-2005, Jouni Malinen @@ -19,7 +20,7 @@ #include #include "wpa.h" -#include "nm-utils.h" +#include "nm-logging.h" typedef guint16 u16; typedef guint8 u8; @@ -207,8 +208,8 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, } if (wpa_ie_len < sizeof(struct wpa_ie_hdr)) { - nm_debug ("%s: ie len too short %lu", - __func__, (unsigned long) wpa_ie_len); + nm_log_dbg (LOGD_WIFI, "IE len too short %lu", + (unsigned long) wpa_ie_len); return -1; } @@ -218,8 +219,7 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, hdr->len != wpa_ie_len - 2 || memcmp(hdr->oui, WPA_OUI_TYPE, WPA_SELECTOR_LEN) != 0 || WPA_GET_LE16(hdr->version) != WPA_VERSION) { - nm_debug ("%s: malformed ie or unknown version", - __func__); + nm_log_dbg (LOGD_WIFI, "malformed IE or unknown version"); return -1; } @@ -231,8 +231,7 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, pos += WPA_SELECTOR_LEN; left -= WPA_SELECTOR_LEN; } else if (left > 0) { - nm_debug ("%s: ie length mismatch, %u too much", - __func__, left); + nm_log_dbg (LOGD_WIFI, "IE length mismatch, %u too much", left); return -1; } @@ -242,8 +241,8 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, pos += 2; left -= 2; if (count == 0 || left < count * WPA_SELECTOR_LEN) { - nm_debug ("%s: ie count botch (pairwise), " - "count %u left %u", __func__, count, left); + nm_log_dbg (LOGD_WIFI, "IE count botch (pairwise), " + "count %u left %u", count, left); return -1; } for (i = 0; i < count; i++) { @@ -252,8 +251,7 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, left -= WPA_SELECTOR_LEN; } } else if (left == 1) { - nm_debug ("%s: ie too short (for key mgmt)", - __func__); + nm_log_dbg (LOGD_WIFI, "IE too short (for key mgmt)"); return -1; } @@ -263,8 +261,8 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, pos += 2; left -= 2; if (count == 0 || left < count * WPA_SELECTOR_LEN) { - nm_debug ("%s: ie count botch (key mgmt), " - "count %u left %u", __func__, count, left); + nm_log_dbg (LOGD_WIFI, "IE count botch (key mgmt), " + "count %u left %u", count, left); return -1; } for (i = 0; i < count; i++) { @@ -273,8 +271,7 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, left -= WPA_SELECTOR_LEN; } } else if (left == 1) { - nm_debug ("%s: ie too short (for capabilities)", - __func__); + nm_log_dbg (LOGD_WIFI, "IE too short (for capabilities)"); return -1; } @@ -286,8 +283,7 @@ static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, } if (left > 0) { - nm_debug ("%s: ie has %u trailing bytes", - __func__, left); + nm_log_dbg (LOGD_WIFI, "IE has %u trailing bytes", left); return -1; } @@ -317,8 +313,8 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, } if (rsn_ie_len < sizeof(struct rsn_ie_hdr)) { - nm_debug ("%s: ie len too short %lu", - __func__, (unsigned long) rsn_ie_len); + nm_log_dbg (LOGD_WIFI, "IE len too short %lu", + (unsigned long) rsn_ie_len); return -1; } @@ -327,8 +323,7 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, if (hdr->elem_id != WPA_RSN_INFO_ELEM || hdr->len != rsn_ie_len - 2 || WPA_GET_LE16(hdr->version) != RSN_VERSION) { - nm_debug ("%s: malformed ie or unknown version", - __func__); + nm_log_dbg (LOGD_WIFI, "malformed IE or unknown version"); return -1; } @@ -340,8 +335,7 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, pos += RSN_SELECTOR_LEN; left -= RSN_SELECTOR_LEN; } else if (left > 0) { - nm_debug ("%s: ie length mismatch, %u too much", - __func__, left); + nm_log_dbg (LOGD_WIFI, "IE length mismatch, %u too much", left); return -1; } @@ -351,8 +345,8 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, pos += 2; left -= 2; if (count == 0 || left < count * RSN_SELECTOR_LEN) { - nm_debug ("%s: ie count botch (pairwise), " - "count %u left %u", __func__, count, left); + nm_log_dbg (LOGD_WIFI, "IE count botch (pairwise), " + "count %u left %u", count, left); return -1; } for (i = 0; i < count; i++) { @@ -361,8 +355,7 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, left -= RSN_SELECTOR_LEN; } } else if (left == 1) { - nm_debug ("%s: ie too short (for key mgmt)", - __func__); + nm_log_dbg (LOGD_WIFI, "IE too short (for key mgmt)"); return -1; } @@ -372,8 +365,8 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, pos += 2; left -= 2; if (count == 0 || left < count * RSN_SELECTOR_LEN) { - nm_debug ("%s: ie count botch (key mgmt), " - "count %u left %u", __func__, count, left); + nm_log_dbg (LOGD_WIFI, "IE count botch (key mgmt), " + "count %u left %u", count, left); return -1; } for (i = 0; i < count; i++) { @@ -382,8 +375,7 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, left -= RSN_SELECTOR_LEN; } } else if (left == 1) { - nm_debug ("%s: ie too short (for capabilities)", - __func__); + nm_log_dbg (LOGD_WIFI, "IE too short (for capabilities)"); return -1; } @@ -399,9 +391,9 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, pos += 2; left -= 2; if (left < data->num_pmkid * PMKID_LEN) { - nm_debug ("%s: PMKID underflow " - "(num_pmkid=%d left=%d)", - __func__, data->num_pmkid, left); + nm_log_dbg (LOGD_WIFI, "PMKID underflow " + "(num_pmkid=%d left=%d)", + data->num_pmkid, left); data->num_pmkid = 0; } else { data->pmkid = pos; @@ -411,8 +403,7 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, } if (left > 0) { - nm_debug ("%s: ie has %u trailing bytes - ignored", - __func__, left); + nm_log_dbg (LOGD_WIFI, "IE has %u trailing bytes - ignored", left); } return 0; @@ -430,8 +421,8 @@ static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, */ wpa_ie_data * wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len) { - wpa_ie_data * data = NULL; - int err = -1; + wpa_ie_data *data = NULL; + int err = -1; if (!wpa_ie || wpa_ie_len <= 0) return NULL; @@ -443,25 +434,21 @@ wpa_ie_data * wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len) else err = wpa_parse_wpa_ie_wpa(wpa_ie, wpa_ie_len, data); - if (err != 0) - { + if (err != 0) { g_slice_free (wpa_ie_data, data); data = NULL; } -#if 0 - if (data) - { - nm_debug ("WPA IE: -------------------"); - nm_debug (" proto 0x%X", data->proto); - nm_debug (" pw cipher 0x%X", data->pairwise_cipher); - nm_debug (" gr cipher 0x%X", data->group_cipher); - nm_debug (" key mgmt 0x%X", data->key_mgmt); - nm_debug (" capabilities 0x%X", data->capabilities); - nm_debug (" # pmkid 0x%X", data->num_pmkid); - nm_debug (""); + if (data) { + nm_log_dbg (LOGD_WIFI, "WPA IE: -------------------"); + nm_log_dbg (LOGD_WIFI, " proto 0x%X", data->proto); + nm_log_dbg (LOGD_WIFI, " pw cipher 0x%X", data->pairwise_cipher); + nm_log_dbg (LOGD_WIFI, " gr cipher 0x%X", data->group_cipher); + nm_log_dbg (LOGD_WIFI, " key mgmt 0x%X", data->key_mgmt); + nm_log_dbg (LOGD_WIFI, " capabilities 0x%X", data->capabilities); + nm_log_dbg (LOGD_WIFI, " # pmkid 0x%X", data->num_pmkid); + nm_log_dbg (LOGD_WIFI, ""); } -#endif return data; } From 9186db769ac65c78100d0d4e4401181310c45dc3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:02:32 -0700 Subject: [PATCH 193/392] wifi: update logging --- src/nm-device-wifi.c | 302 ++++++++++++++++++++++--------------------- 1 file changed, 156 insertions(+), 146 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 6f473e1b1c..68f59b6f96 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.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 - 2009 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -37,6 +37,7 @@ #include "nm-device-interface.h" #include "nm-device-private.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" #include "NetworkManagerUtils.h" #include "nm-activation-request.h" @@ -376,7 +377,7 @@ wireless_get_range (NMDeviceWifi *self, fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("(%s): couldn't open control socket.", iface); + nm_log_err (LOGD_HW, "(%s): couldn't open control socket.", iface); return FALSE; } @@ -396,15 +397,19 @@ wireless_get_range (NMDeviceWifi *self, success = TRUE; break; } else if (errno != EAGAIN) { - nm_warning ("(%s): couldn't get driver range information (%d).", iface, errno); + nm_log_err (LOGD_HW, "(%s): couldn't get driver range information (%d).", + iface, errno); break; } g_usleep (G_USEC_PER_SEC / 4); } - if (i <= 0) - nm_warning ("(%s): driver took too long to respond to IWRANGE query.", iface); + if (i <= 0) { + nm_log_warn (LOGD_HW, + "(%s): driver took too long to respond to IWRANGE query.", + iface); + } close (fd); return success; @@ -427,14 +432,14 @@ real_get_generic_capabilities (NMDevice *dev) /* Check for Wireless Extensions support >= 16 for wireless devices */ if ((response_len < 300) || (range.we_version_compiled < 16)) { - nm_warning ("(%s): driver's Wireless Extensions version (%d) is too old.", + nm_log_err (LOGD_HW, "(%s): driver's Wireless Extensions version (%d) is too old.", iface, range.we_version_compiled); return NM_DEVICE_CAP_NONE; } fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("(%s): couldn't open control socket.", iface); + nm_log_err (LOGD_HW, "(%s): couldn't open control socket.", iface); goto out; } @@ -492,16 +497,16 @@ get_wireless_capabilities (NMDeviceWifi *self, /* Check for cipher support but not WPA support */ if ( (caps & (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) && !(caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN))) { - nm_warning ("%s: device supports WPA ciphers but not WPA protocol; " - "WPA unavailable.", iface); + nm_log_warn (LOGD_WIFI, "%s: device supports WPA ciphers but not WPA protocol; " + "WPA unavailable.", iface); caps &= ~WPA_CAPS; } /* Check for WPA support but not cipher support */ if ( (caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN)) && !(caps & (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | NM_WIFI_DEVICE_CAP_CIPHER_CCMP))) { - nm_warning ("%s: device supports WPA protocol but not WPA ciphers; " - "WPA unavailable.", iface); + nm_log_warn (LOGD_WIFI, "%s: device supports WPA protocol but not WPA ciphers; " + "WPA unavailable.", iface); caps &= ~WPA_CAPS; } } @@ -592,13 +597,13 @@ constructor (GType type, scan_capa_range = (struct iw_range_with_scan_capa *) ⦥ if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) { priv->has_scan_capa_ssid = TRUE; - nm_info ("(%s): driver supports SSID scans (scan_capa 0x%02X).", - nm_device_get_iface (NM_DEVICE (self)), - scan_capa_range->scan_capa); + nm_log_info (LOGD_HW, "(%s): driver supports SSID scans (scan_capa 0x%02X).", + nm_device_get_iface (NM_DEVICE (self)), + scan_capa_range->scan_capa); } else { - nm_info ("(%s): driver does not support SSID scans (scan_capa 0x%02X).", - nm_device_get_iface (NM_DEVICE (self)), - scan_capa_range->scan_capa); + nm_log_info (LOGD_HW, "(%s): driver does not support SSID scans (scan_capa 0x%02X).", + nm_device_get_iface (NM_DEVICE (self)), + scan_capa_range->scan_capa); } /* 802.11 wireless-specific capabilities */ @@ -652,7 +657,7 @@ supplicant_interface_acquire (NMDeviceWifi *self) nm_device_get_iface (NM_DEVICE (self)), TRUE); if (priv->supplicant.iface == NULL) { - nm_warning ("Couldn't initialize supplicant interface for %s.", + nm_log_err (LOGD_WIFI, "Couldn't initialize supplicant interface for %s.", nm_device_get_iface (NM_DEVICE (self))); return FALSE; } @@ -809,35 +814,30 @@ get_active_ap (NMDeviceWifi *self, const GByteArray *ssid; GSList *iter; int i = 0; - gboolean ap_debug = getenv ("NM_ACTIVE_AP_DEBUG") ? TRUE : FALSE; nm_device_wifi_get_bssid (self, &bssid); - if (G_UNLIKELY (ap_debug)) { - nm_debug ("(%s) BSSID: %02x:%02x:%02x:%02x:%02x:%02x", - iface, - bssid.ether_addr_octet[0], bssid.ether_addr_octet[1], - bssid.ether_addr_octet[2], bssid.ether_addr_octet[3], - bssid.ether_addr_octet[4], bssid.ether_addr_octet[5]); - } + nm_log_dbg (LOGD_WIFI, "(%s): active BSSID: %02x:%02x:%02x:%02x:%02x:%02x", + iface, + bssid.ether_addr_octet[0], bssid.ether_addr_octet[1], + bssid.ether_addr_octet[2], bssid.ether_addr_octet[3], + bssid.ether_addr_octet[4], bssid.ether_addr_octet[5]); + if (!nm_ethernet_address_is_valid (&bssid)) return NULL; ssid = nm_device_wifi_get_ssid (self); - if G_UNLIKELY (ap_debug) { - nm_debug ("(%s) SSID: %s%s%s", - iface, - ssid ? "'" : "", - ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", - ssid ? "'" : ""); - } + nm_log_dbg (LOGD_WIFI, "(%s): active SSID: %s%s%s", + iface, + ssid ? "'" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", + ssid ? "'" : ""); /* When matching hidden APs, do a second pass that ignores the SSID check, * because NM might not yet know the SSID of the hidden AP in the scan list * and therefore it won't get matched the first time around. */ while (i++ < (match_hidden ? 2 : 1)) { - if G_UNLIKELY (ap_debug) - nm_debug (" Pass #%d %s", i, i > 1 ? "(ignoring SSID)" : ""); + nm_log_dbg (LOGD_WIFI, " Pass #%d %s", i, i > 1 ? "(ignoring SSID)" : ""); /* Find this SSID + BSSID in the device's AP list */ for (iter = priv->ap_list; iter; iter = g_slist_next (iter)) { @@ -847,63 +847,52 @@ get_active_ap (NMDeviceWifi *self, NM80211Mode devmode, apmode; guint32 devfreq, apfreq; - if G_UNLIKELY (ap_debug) { - nm_debug (" AP: %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", - ap_ssid ? "'" : "", - ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)", - ap_ssid ? "'" : "", - ap_bssid->ether_addr_octet[0], ap_bssid->ether_addr_octet[1], - ap_bssid->ether_addr_octet[2], ap_bssid->ether_addr_octet[3], - ap_bssid->ether_addr_octet[4], ap_bssid->ether_addr_octet[5]); - } + nm_log_dbg (LOGD_WIFI, " AP: %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", + ap_ssid ? "'" : "", + ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)", + ap_ssid ? "'" : "", + ap_bssid->ether_addr_octet[0], ap_bssid->ether_addr_octet[1], + ap_bssid->ether_addr_octet[2], ap_bssid->ether_addr_octet[3], + ap_bssid->ether_addr_octet[4], ap_bssid->ether_addr_octet[5]); if (ignore_ap && (ap == ignore_ap)) { - if G_UNLIKELY (ap_debug) - nm_debug (" ignored"); + nm_log_dbg (LOGD_WIFI, " ignored"); continue; } if (memcmp (bssid.ether_addr_octet, ap_bssid->ether_addr_octet, ETH_ALEN)) { - if G_UNLIKELY (ap_debug) - nm_debug (" BSSID mismatch"); + nm_log_dbg (LOGD_WIFI, " BSSID mismatch"); continue; } if ((i == 0) && !nm_utils_same_ssid (ssid, ap_ssid, TRUE)) { - if G_UNLIKELY (ap_debug) - nm_debug (" SSID mismatch"); + nm_log_dbg (LOGD_WIFI, " SSID mismatch"); continue; } devmode = nm_device_wifi_get_mode (self); apmode = nm_ap_get_mode (ap); if (devmode != apmode) { - if G_UNLIKELY (ap_debug) { - nm_debug (" mode mismatch (device %d, ap %d)", - devmode, apmode); - } + nm_log_dbg (LOGD_WIFI, " mode mismatch (device %d, ap %d)", + devmode, apmode); continue; } devfreq = nm_device_wifi_get_frequency (self); apfreq = nm_ap_get_freq (ap); if (devfreq != apfreq) { - if G_UNLIKELY (ap_debug) { - nm_debug (" frequency mismatch (device %u, ap %u)", - devfreq, apfreq); - } + nm_log_dbg (LOGD_WIFI, " frequency mismatch (device %u, ap %u)", + devfreq, apfreq); continue; } // FIXME: handle security settings here too - if G_UNLIKELY (ap_debug) - nm_debug (" matched"); + nm_log_dbg (LOGD_WIFI, " matched"); return ap; } } - if G_UNLIKELY (ap_debug) - nm_debug (" No matching AP found."); + nm_log_dbg (LOGD_WIFI, " No matching AP found."); return NULL; } @@ -996,11 +985,12 @@ periodic_update (NMDeviceWifi *self) old_ssid = nm_ap_get_ssid (priv->current_ap); } - nm_debug ("Roamed from BSSID %s (%s) to %s (%s)", - old_addr ? old_addr : "(none)", - old_ssid ? nm_utils_escape_ssid (old_ssid->data, old_ssid->len) : "(none)", - new_addr ? new_addr : "(none)", - new_ssid ? nm_utils_escape_ssid (new_ssid->data, new_ssid->len) : "(none)"); + nm_log_info (LOGD_WIFI, "(%s): roamed from BSSID %s (%s) to %s (%s)", + nm_device_get_iface (NM_DEVICE (self)), + old_addr ? old_addr : "(none)", + old_ssid ? nm_utils_escape_ssid (old_ssid->data, old_ssid->len) : "(none)", + new_addr ? new_addr : "(none)", + new_ssid ? nm_utils_escape_ssid (new_ssid->data, new_ssid->len) : "(none)"); g_free (old_addr); g_free (new_addr); @@ -1297,7 +1287,6 @@ nm_device_wifi_get_address (NMDeviceWifi *self, memcpy (addr, &(priv->hw_addr), sizeof (struct ether_addr)); } -#if DEBUG static void nm_device_wifi_ap_list_print (NMDeviceWifi *self) { @@ -1307,14 +1296,13 @@ nm_device_wifi_ap_list_print (NMDeviceWifi *self) g_return_if_fail (NM_IS_DEVICE_WIFI (self)); - nm_info ("AP_LIST_PRINT:"); + nm_log_dbg (LOGD_WIFI_SCAN, "AP_LIST_PRINT:"); for (elt = priv->ap_list; elt; elt = g_slist_next (elt), i++) { NMAccessPoint * ap = NM_AP (elt->data); nm_ap_print_self (ap, "::\t"); } - nm_info ("AP_LIST_PRINT: done"); + nm_log_dbg (LOGD_WIFI_SCAN, "AP_LIST_PRINT: done"); } -#endif static gboolean impl_device_get_access_points (NMDeviceWifi *self, @@ -1371,8 +1359,10 @@ nm_device_wifi_get_mode (NMDeviceWifi *self) break; } } else { - if (errno != ENODEV) - nm_warning ("error getting card mode on %s: %s", iface, strerror (errno)); + if (errno != ENODEV) { + nm_log_warn (LOGD_HW, "(%s): error %d getting card mode", + iface, strerror (errno)); + } } close (fd); @@ -1422,7 +1412,7 @@ nm_device_wifi_set_mode (NMDeviceWifi *self, const NM80211Mode mode) if (ioctl (fd, SIOCSIWMODE, &wrq) < 0) { if (errno != ENODEV) { - nm_warning ("error setting card %s to mode %d: %s", + nm_log_err (LOGD_HW, "(%s): error setting mode %d", iface, mode, strerror (errno)); } } else @@ -1458,9 +1448,10 @@ nm_device_wifi_get_frequency (NMDeviceWifi *self) iface = nm_device_get_iface (NM_DEVICE (self)); strncpy (wrq.ifr_name, iface, IFNAMSIZ); - if (ioctl (fd, SIOCGIWFREQ, &wrq) < 0) - nm_warning ("(%s): error getting frequency: %s", iface, strerror (errno)); - else + if (ioctl (fd, SIOCGIWFREQ, &wrq) < 0) { + nm_log_warn (LOGD_HW, "(%s): error getting frequency: %s", + iface, strerror (errno)); + } else freq = iw_freq_to_uint32 (&wrq.u.freq); close (fd); @@ -1597,7 +1588,7 @@ nm_device_wifi_get_ssid (NMDeviceWifi *self) sk = socket (AF_INET, SOCK_DGRAM, 0); if (!sk) { - nm_error ("Couldn't create socket: %d.", errno); + nm_log_err (LOGD_HW, "couldn't create socket: %d.", errno); return NULL; } @@ -1608,7 +1599,8 @@ nm_device_wifi_get_ssid (NMDeviceWifi *self) strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); if (ioctl (sk, SIOCGIWESSID, &wrq) < 0) { - nm_warning ("Couldn't get SSID: %d", errno); + nm_log_err (LOGD_HW, "(%s): couldn't get SSID: %d", + nm_device_get_iface (NM_DEVICE (self)), errno); goto out; } @@ -1683,7 +1675,7 @@ nm_device_wifi_get_bssid (NMDeviceWifi *self, fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - g_warning ("failed to open control socket."); + nm_log_err (LOGD_WIFI, "failed to open control socket."); return; } @@ -2146,6 +2138,8 @@ supplicant_iface_scanned_ap_cb (NMSupplicantInterface *iface, /* Remove outdated access points */ cull_scan_list (self); + nm_device_wifi_ap_list_print (self); + g_object_unref (ap); } @@ -2203,7 +2197,7 @@ link_timeout_cb (gpointer user_data) ap = nm_device_wifi_get_activation_ap (self); if (req == NULL || ap == NULL) { /* shouldn't ever happen */ - nm_warning ("couldn't get activation request or activation AP."); + nm_log_err (LOGD_WIFI, "couldn't get activation request or activation AP."); if (nm_device_is_activating (dev)) { cleanup_association_attempt (self, TRUE); nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); @@ -2250,8 +2244,9 @@ link_timeout_cb (gpointer user_data) * bad encryption key and the authenticating entity (AP, RADIUS server, etc) * denied the association due to bad credentials. */ - nm_info ("Activation (%s/wireless): disconnected during association," - " asking for new key.", nm_device_get_iface (dev)); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): disconnected during association," + " asking for new key.", nm_device_get_iface (dev)); cleanup_association_attempt (self, TRUE); nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); nm_act_request_get_secrets (req, @@ -2265,7 +2260,7 @@ link_timeout_cb (gpointer user_data) } time_out: - nm_info ("%s: link timed out.", nm_device_get_iface (dev)); + nm_log_warn (LOGD_WIFI, "(%s): link timed out.", nm_device_get_iface (dev)); return FALSE; } @@ -2289,7 +2284,7 @@ schedule_state_handler (NMDeviceWifi *self, task = g_slice_new0 (SupplicantStateTask); if (!task) { - nm_warning ("Not enough memory to process supplicant manager state change."); + nm_log_err (LOGD_WIFI, "Not enough memory to process supplicant manager state change."); return FALSE; } @@ -2319,10 +2314,10 @@ supplicant_iface_state_cb_handler (gpointer user_data) self = task->self; priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - nm_info ("(%s): supplicant interface state: %s -> %s", - nm_device_get_iface (NM_DEVICE (self)), - nm_supplicant_interface_state_to_string (task->old_state), - nm_supplicant_interface_state_to_string (task->new_state)); + nm_log_info (LOGD_WIFI, "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_supplicant_interface_state_to_string (task->old_state), + nm_supplicant_interface_state_to_string (task->new_state)); if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { priv->scan_interval = SCAN_INTERVAL_MIN; @@ -2381,10 +2376,10 @@ supplicant_iface_connection_state_cb_handler (gpointer user_data) goto out; } - nm_info ("(%s): supplicant connection state: %s -> %s", - nm_device_get_iface (dev), - nm_supplicant_interface_connection_state_to_string (task->old_state), - nm_supplicant_interface_connection_state_to_string (task->new_state)); + nm_log_info (LOGD_WIFI, "(%s): supplicant connection state: %s -> %s", + nm_device_get_iface (dev), + nm_supplicant_interface_connection_state_to_string (task->old_state), + nm_supplicant_interface_connection_state_to_string (task->new_state)); scanning = nm_supplicant_interface_get_scanning (priv->supplicant.iface); @@ -2399,10 +2394,11 @@ supplicant_iface_connection_state_cb_handler (gpointer user_data) NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self); const GByteArray * ssid = nm_ap_get_ssid (ap); - nm_info ("Activation (%s/wireless) Stage 2 of 5 (Device Configure) " - "successful. Connected to wireless network '%s'.", - nm_device_get_iface (dev), - ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless) Stage 2 of 5 (Device Configure) " + "successful. Connected to wireless network '%s'.", + nm_device_get_iface (dev), + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); nm_device_activate_schedule_stage3_ip_config_start (dev); } } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { @@ -2455,10 +2451,10 @@ supplicant_mgr_state_cb_handler (gpointer user_data) priv = NM_DEVICE_WIFI_GET_PRIVATE (self); dev = NM_DEVICE (self); - nm_info ("(%s): supplicant manager state: %s -> %s", - nm_device_get_iface (NM_DEVICE (self)), - nm_supplicant_manager_state_to_string (task->old_state), - nm_supplicant_manager_state_to_string (task->new_state)); + nm_log_info (LOGD_WIFI, "(%s): supplicant manager state: %s -> %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_supplicant_manager_state_to_string (task->old_state), + nm_supplicant_manager_state_to_string (task->new_state)); /* If the supplicant went away, release the supplicant interface */ if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { @@ -2529,11 +2525,12 @@ supplicant_iface_connection_error_cb_handler (gpointer user_data) if (!nm_device_is_activating (NM_DEVICE (self))) goto out; - nm_info ("Activation (%s/wireless): association request to the supplicant " - "failed: %s - %s", - nm_device_get_iface (NM_DEVICE (self)), - cb_data->name, - cb_data->message); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association request to the supplicant " + "failed: %s - %s", + nm_device_get_iface (NM_DEVICE (self)), + cb_data->name, + cb_data->message); cleanup_association_attempt (self, TRUE); nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); @@ -2562,7 +2559,7 @@ supplicant_iface_connection_error_cb (NMSupplicantInterface * iface, cb_data = g_slice_new0 (struct iface_con_error_cb_data); if (cb_data == NULL) { - nm_warning ("Not enough memory to process supplicant connection error."); + nm_log_err (LOGD_WIFI, "Not enough memory to process supplicant connection error."); return; } @@ -2643,7 +2640,7 @@ handle_auth_or_fail (NMDeviceWifi *self, g_object_set_data (G_OBJECT (connection), WIRELESS_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); } else { - nm_warning ("Cleared secrets, but setting didn't need any secrets."); + nm_log_warn (LOGD_DEVICE, "Cleared secrets, but setting didn't need any secrets."); } return NM_ACT_STAGE_RETURN_POSTPONE; } @@ -2686,19 +2683,22 @@ supplicant_connection_timeout_cb (gpointer user_data) auth_enforced = ap_auth_enforced (connection, ap, &encrypted); if (!encrypted) { - nm_info ("Activation (%s/wireless): association took too long, " - "failing activation.", - nm_device_get_iface (dev)); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association took too long, " + "failing activation.", + nm_device_get_iface (dev)); nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); } else { /* Authentication failed, encryption key is probably bad */ - nm_info ("Activation (%s/wireless): association took too long.", - nm_device_get_iface (dev)); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association took too long.", + nm_device_get_iface (dev)); if (handle_auth_or_fail (self, req, TRUE) == NM_ACT_STAGE_RETURN_POSTPONE) { - nm_info ("Activation (%s/wireless): asking for new secrets", - nm_device_get_iface (dev)); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): asking for new secrets", + nm_device_get_iface (dev)); } else { nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); @@ -2721,8 +2721,9 @@ start_supplicant_connection_timeout (NMDeviceWifi *self) /* Set up a timeout on the connection attempt to fail it after 25 seconds */ id = g_timeout_add_seconds (25, supplicant_connection_timeout_cb, self); - if (id <= 0) { - nm_warning ("Activation (%s/wireless): couldn't start supplicant " + if (id == 0) { + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't start supplicant " "timeout timer.", nm_device_get_iface (NM_DEVICE (self))); return FALSE; @@ -2808,7 +2809,7 @@ build_supplicant_config (NMDeviceWifi *self, nm_ap_get_broadcast (ap), adhoc_freq, priv->has_scan_capa_ssid)) { - nm_warning ("Couldn't add 802-11-wireless setting to supplicant config."); + nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless setting to supplicant config."); goto error; } @@ -2823,13 +2824,13 @@ build_supplicant_config (NMDeviceWifi *self, s_wireless_sec, s_8021x, con_path)) { - nm_warning ("Couldn't add 802-11-wireless-security setting to " + nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless-security setting to " "supplicant config."); goto error; } } else { if (!nm_supplicant_config_add_no_security (config)) { - nm_warning ("Couldn't add unsecured option to supplicant config."); + nm_log_err (LOGD_WIFI, "Couldn't add unsecured option to supplicant config."); goto error; } } @@ -2853,15 +2854,15 @@ real_update_hw_address (NMDevice *dev) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - g_warning ("could not open control socket."); + nm_log_err (LOGD_HW, "could not open control socket."); return; } memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { - nm_warning ("%s: (%s) error getting hardware address: %d", - __func__, nm_device_get_iface (dev), errno); + nm_log_err (LOGD_HW, "(%s) error getting hardware address: %d", + nm_device_get_iface (dev), errno); goto out; } @@ -2962,7 +2963,8 @@ real_connection_secrets_updated (NMDevice *dev, || !strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME)) { valid = TRUE; } else { - nm_warning ("Ignoring updated secrets for setting '%s'.", setting_name); + nm_log_warn (LOGD_DEVICE, "Ignoring updated secrets for setting '%s'.", + setting_name); } } @@ -3012,9 +3014,10 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) /* If we need secrets, get them */ setting_name = nm_connection_need_secrets (connection, NULL); if (setting_name) { - nm_info ("Activation (%s/wireless): access point '%s' has security," - " but secrets are required.", - iface, nm_setting_connection_get_id (s_connection)); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): access point '%s' has security," + " but secrets are required.", + iface, nm_setting_connection_get_id (s_connection)); ret = handle_auth_or_fail (self, req, FALSE); if (ret == NM_ACT_STAGE_RETURN_FAILURE) @@ -3024,19 +3027,22 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) /* have secrets, or no secrets required */ if (nm_setting_wireless_get_security (s_wireless)) { - nm_info ("Activation (%s/wireless): connection '%s' has security" - ", and secrets exist. No new secrets needed.", - iface, nm_setting_connection_get_id (s_connection)); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): connection '%s' has security" + ", and secrets exist. No new secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); } else { - nm_info ("Activation (%s/wireless): connection '%s' requires no " - "security. No secrets needed.", - iface, nm_setting_connection_get_id (s_connection)); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): connection '%s' requires no " + "security. No secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); } config = build_supplicant_config (self, connection, ap); if (config == NULL) { - nm_warning ("Activation (%s/wireless): couldn't build wireless " - "configuration.", iface); + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't build wireless configuration.", + iface); *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED; goto out; } @@ -3049,8 +3055,9 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) priv->supplicant.iface_error_id = id; if (!nm_supplicant_interface_set_config (priv->supplicant.iface, config)) { - nm_warning ("Activation (%s/wireless): couldn't send wireless " - "configuration to the supplicant.", iface); + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't send wireless " + "configuration to the supplicant.", iface); *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED; goto out; } @@ -3142,14 +3149,16 @@ real_act_stage4_ip4_config_timeout (NMDevice *dev, s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); /* Activation failed, we must have bad encryption key */ - nm_info ("Activation (%s/wireless): could not get IP configuration for " - "connection '%s'.", - nm_device_get_iface (dev), nm_setting_connection_get_id (s_con)); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): could not get IP configuration for " + "connection '%s'.", + nm_device_get_iface (dev), nm_setting_connection_get_id (s_con)); ret = handle_auth_or_fail (self, req, TRUE); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { - nm_info ("Activation (%s/wireless): asking for new secrets", - nm_device_get_iface (dev)); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): asking for new secrets", + nm_device_get_iface (dev)); } else { *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; } @@ -3276,9 +3285,10 @@ activation_failure_handler (NMDevice *dev) } ssid = nm_ap_get_ssid (ap); - nm_info ("Activation (%s) failed for access point (%s)", - nm_device_get_iface (dev), - ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s) failed for access point (%s)", + nm_device_get_iface (dev), + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); } static gboolean @@ -3441,7 +3451,7 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) struct iw_range range; if (state != NM_DEVICE_STATE_UNAVAILABLE) - nm_warning ("not in expected unavailable state!"); + nm_log_warn (LOGD_CORE, "not in expected unavailable state!"); if (!nm_device_hw_bring_up (NM_DEVICE (self), TRUE, &no_firmware)) { /* The device sucks, or HAL was lying to us about the killswitch state */ From 4e828c1bceb4c160665d69d75c1494acd4b82c64 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:10:33 -0700 Subject: [PATCH 194/392] system: update logging --- src/nm-system.c | 63 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 78a3381eb0..bd5f57f51d 100644 --- a/src/nm-system.c +++ b/src/nm-system.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) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. * Copyright (C) 1996 - 1997 Yoichi Hariguchi * Copyright (C) January, 1998 Sergei Viznyuk @@ -47,6 +47,7 @@ #include "nm-named-manager.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-netlink.h" /* Because of a bug in libnl, rtnl.h should be included before route.h */ @@ -95,10 +96,11 @@ create_route (int iface_idx, int mss) if (route) { rtnl_route_set_oif (route, iface_idx); - if (mss && rtnl_route_set_metric (route, RTAX_ADVMSS, mss) < 0) - nm_warning ("Could not set mss"); + if (mss && rtnl_route_set_metric (route, RTAX_ADVMSS, mss) < 0) { + nm_log_warn (LOGD_DEVICE, "could not set mss"); + } } else - nm_warning ("Could not allocate route"); + nm_log_err (LOGD_DEVICE, "could not allocate route"); return route; } @@ -141,7 +143,7 @@ nm_system_device_set_ip4_route (const char *iface, rtnl_route_set_gateway (route, gw_addr); rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); } else { - nm_warning ("Invalid gateway"); + nm_log_err (LOGD_DEVICE | LOGD_IP4, "Invalid gateway 0x%X", ip4_gateway); rtnl_route_put (route); return NULL; } @@ -176,7 +178,9 @@ nm_system_device_set_ip4_route (const char *iface, nl_addr_put (gw_addr); if (err) { - nm_warning ("Failed to set IPv4 route on '%s': %s", iface, nl_geterror ()); + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 route: %s", + iface, nl_geterror ()); rtnl_route_put (route); route = NULL; } @@ -193,6 +197,9 @@ sync_addresses (const char *iface, int ifindex, int family, struct rtnl_addr *filter_addr, *match_addr; struct nl_object *match; int i, err; + guint32 log_domain = (family == AF_INET) ? LOGD_IP4 : LOGD_IP6; + + log_domain |= LOGD_DEVICE; nlh = nm_netlink_get_default_handle (); if (!nlh) @@ -247,7 +254,7 @@ sync_addresses (const char *iface, int ifindex, int family, /* Otherwise, match_addr should be removed from the interface. */ err = rtnl_addr_delete (nlh, match_addr, 0); if (err < 0) { - nm_warning ("(%s) error %d returned from rtnl_addr_delete(): %s", + nm_log_err (log_domain, "(%s): error %d returned from rtnl_addr_delete(): %s", iface, err, nl_geterror ()); } } @@ -262,7 +269,8 @@ sync_addresses (const char *iface, int ifindex, int family, err = rtnl_addr_add (nlh, addrs[i], 0); if (err < 0) { - nm_warning ("(%s) error %d returned from rtnl_addr_add():\n%s", + nm_log_err (log_domain, + "(%s): error %d returned from rtnl_addr_add():\n%s", iface, err, nl_geterror ()); } @@ -301,7 +309,9 @@ add_ip4_addresses (NMIP4Config *config, const char *iface) addrs[i] = nm_ip4_config_to_rtnl_addr (config, i, flags); if (!addrs[i]) { - nm_warning ("couldn't create rtnl address!\n"); + nm_log_warn (LOGD_DEVICE | LOGD_IP4, + "(%s): couldn't create rtnl address!", + iface); continue; } rtnl_addr_set_ifindex (addrs[i], iface_idx); @@ -464,7 +474,7 @@ nm_system_device_set_ip6_route (const char *iface, rtnl_route_set_gateway (route, gw_addr); rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); } else { - nm_warning ("Invalid gateway"); + nm_log_warn (LOGD_DEVICE | LOGD_IP6, "Invalid gateway"); rtnl_route_put (route); return NULL; } @@ -499,7 +509,9 @@ nm_system_device_set_ip6_route (const char *iface, nl_addr_put (gw_addr); if (err) { - nm_warning ("Failed to set IPv6 route on '%s': %s", iface, nl_geterror ()); + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 route: %s", + iface, nl_geterror ()); rtnl_route_put (route); route = NULL; } @@ -526,7 +538,9 @@ add_ip6_addresses (NMIP6Config *config, const char *iface) addrs[i] = nm_ip6_config_to_rtnl_addr (config, i, NM_RTNL_ADDR_DEFAULT); if (!addrs[i]) { - nm_warning ("couldn't create rtnl address!\n"); + nm_log_warn (LOGD_DEVICE | LOGD_IP6, + "(%s): couldn't create rtnl address!", + iface); continue; } rtnl_addr_set_ifindex (addrs[i], iface_idx); @@ -661,7 +675,7 @@ nm_system_device_is_up_with_iface (const char *iface) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_err (LOGD_HW, "couldn't open control socket."); return FALSE; } @@ -670,8 +684,8 @@ nm_system_device_is_up_with_iface (const char *iface) strncpy (ifr.ifr_name, iface, IFNAMSIZ); if (ioctl (fd, SIOCGIFFLAGS, &ifr) < 0) { if (errno != ENODEV) { - nm_warning ("%s: could not get flags for device %s. errno = %d", - __func__, iface, errno); + nm_log_err (LOGD_HW, "(%s): could not get flags: errno %d", + iface, errno); } } else { up = !!(ifr.ifr_flags & IFF_UP); @@ -753,7 +767,9 @@ add_ip4_route_to_gateway (const char *iface, guint32 gw, guint32 mss) /* Add direct route to the gateway */ err = rtnl_route_add (nlh, route, 0); if (err) { - nm_warning ("(%s): failed to add IPv4 route to gateway (%d)", iface, err); + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to add IPv4 route to gateway (%d)", + iface, err); goto error; } @@ -853,7 +869,8 @@ nm_system_replace_default_ip4_route_vpn (const char *iface, if (err == 0) { return TRUE; } else if (err != -ESRCH) { - nm_warning ("(%s): failed to set IPv4 default route: %d", + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route: %d", iface, err); return FALSE; } @@ -867,7 +884,8 @@ nm_system_replace_default_ip4_route_vpn (const char *iface, err = replace_default_ip4_route (iface, int_gw, mss); if (err != 0) { rtnl_route_del (nlh, gw_route, 0); - nm_warning ("(%s): failed to set IPv4 default route (pass #2): %d", + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route (pass #2): %d", iface, err); } else success = TRUE; @@ -897,7 +915,8 @@ nm_system_replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss) if (err == 0) { return TRUE; } else if (err != -ESRCH) { - nm_warning ("(%s): failed to set IPv4 default route: %d", + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route: %d", iface, err); return FALSE; } @@ -911,7 +930,8 @@ nm_system_replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss) err = replace_default_ip4_route (iface, gw, mss); if (err != 0) { rtnl_route_del (nlh, gw_route, 0); - nm_warning ("(%s): failed to set IPv4 default route (pass #2): %d", + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route (pass #2): %d", iface, err); } else success = TRUE; @@ -993,7 +1013,8 @@ check_one_route (struct nl_object *object, void *user_data) err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); if (err < 0) { - nm_warning ("(%s) error %d returned from rtnl_route_del(): %s", + nm_log_err (LOGD_DEVICE, + "(%s): error %d returned from rtnl_route_del(): %s", data->iface, err, nl_geterror()); } } From 27a9ea5bede4de8d526261188a09f8deb3be6a36 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:13:38 -0700 Subject: [PATCH 195/392] wifi: enable quality debugging --- src/nm-device-wifi.c | 49 +++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 68f59b6f96..146d93cbff 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -60,8 +60,6 @@ static gboolean impl_device_get_access_points (NMDeviceWifi *device, #include "nm-device-wifi-glue.h" -/* #define IW_QUAL_DEBUG */ - /* All of these are in seconds */ #define SCAN_INTERVAL_MIN 0 #define SCAN_INTERVAL_STEP 20 @@ -1475,17 +1473,16 @@ wireless_qual_to_percent (const struct iw_quality *qual, g_return_val_if_fail (qual != NULL, -1); g_return_val_if_fail (max_qual != NULL, -1); -#ifdef IW_QUAL_DEBUG -nm_debug ("QL: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X ** MAX: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X", -(__s8)qual->qual, qual->qual, qual->qual, -(__s8)qual->level, qual->level, qual->level, -(__s8)qual->noise, qual->noise, qual->noise, -qual->updated, -(__s8)max_qual->qual, max_qual->qual, max_qual->qual, -(__s8)max_qual->level, max_qual->level, max_qual->level, -(__s8)max_qual->noise, max_qual->noise, max_qual->noise, -max_qual->updated); -#endif + nm_log_dbg (LOGD_WIFI, + "QL: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X ** MAX: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X", + (__s8) qual->qual, qual->qual, qual->qual, + (__s8) qual->level, qual->level, qual->level, + (__s8) qual->noise, qual->noise, qual->noise, + qual->updated, + (__s8) max_qual->qual, max_qual->qual, max_qual->qual, + (__s8) max_qual->level, max_qual->level, max_qual->level, + (__s8) max_qual->noise, max_qual->noise, max_qual->noise, + max_qual->updated); /* Try using the card's idea of the signal quality first as long as it tells us what the max quality is. * Drivers that fill in quality values MUST treat them as percentages, ie the "Link Quality" MUST be @@ -1510,8 +1507,7 @@ max_qual->updated); && !(qual->updated & IW_QUAL_LEVEL_INVALID) /* Must have valid qual->level */ && ( ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) /* Must have valid max_qual->noise */ || ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID))) /* OR valid qual->noise */ - ) - { + ) { /* Absolute power values (dBm) */ /* Reasonable fallbacks for dumb drivers that don't specify either level. */ @@ -1533,9 +1529,8 @@ max_qual->updated); level_percent = (int)(100 - 70 *( ((double)max_level - (double)level) / ((double)max_level - (double)noise))); -#ifdef IW_QUAL_DEBUG - nm_debug ("QL1: level_percent is %d. max_level %d, level %d, noise_floor %d.", level_percent, max_level, level, noise); -#endif + nm_log_dbg (LOGD_WIFI, "QL1: level_percent is %d. max_level %d, level %d, noise_floor %d.", + level_percent, max_level, level, noise); } else if ( (max_qual->level != 0) && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level as upper bound */ && !(qual->updated & IW_QUAL_LEVEL_INVALID)) { @@ -1546,24 +1541,18 @@ max_qual->updated); /* Signal level is relavtive (0 -> max_qual->level) */ level = CLAMP (level, 0, max_qual->level); level_percent = (int)(100 * ((double)level / (double)max_qual->level)); -#ifdef IW_QUAL_DEBUG - nm_debug ("QL2: level_percent is %d. max_level %d, level %d.", level_percent, max_qual->level, level); -#endif - } - else if (percent == -1) - { -#ifdef IW_QUAL_DEBUG - nm_debug ("QL: Could not get quality %% value from driver. Driver is probably buggy."); -#endif + nm_log_dbg (LOGD_WIFI, "QL2: level_percent is %d. max_level %d, level %d.", + level_percent, max_qual->level, level); + } else if (percent == -1) { + nm_log_dbg (LOGD_WIFI, "QL: Could not get quality %% value from driver. Driver is probably buggy."); } /* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */ if ((percent < 1) && (level_percent >= 0)) percent = level_percent; -#ifdef IW_QUAL_DEBUG - nm_debug ("QL: Final quality percent is %d (%d).", percent, CLAMP (percent, 0, 100)); -#endif + nm_log_dbg (LOGD_WIFI, "QL: Final quality percent is %d (%d).", + percent, CLAMP (percent, 0, 100)); return (CLAMP (percent, 0, 100)); } From e8b36c2318b5f3bca842cd359755fb3b4203ed46 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:24:12 -0700 Subject: [PATCH 196/392] wifi: log in the wifi domain too --- src/nm-device-wifi.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 146d93cbff..edab55d02c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -395,7 +395,8 @@ wireless_get_range (NMDeviceWifi *self, success = TRUE; break; } else if (errno != EAGAIN) { - nm_log_err (LOGD_HW, "(%s): couldn't get driver range information (%d).", + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): couldn't get driver range information (%d).", iface, errno); break; } @@ -404,7 +405,7 @@ wireless_get_range (NMDeviceWifi *self, } if (i <= 0) { - nm_log_warn (LOGD_HW, + nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): driver took too long to respond to IWRANGE query.", iface); } @@ -430,7 +431,8 @@ real_get_generic_capabilities (NMDevice *dev) /* Check for Wireless Extensions support >= 16 for wireless devices */ if ((response_len < 300) || (range.we_version_compiled < 16)) { - nm_log_err (LOGD_HW, "(%s): driver's Wireless Extensions version (%d) is too old.", + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): driver's Wireless Extensions version (%d) is too old.", iface, range.we_version_compiled); return NM_DEVICE_CAP_NONE; } @@ -595,11 +597,13 @@ constructor (GType type, scan_capa_range = (struct iw_range_with_scan_capa *) ⦥ if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) { priv->has_scan_capa_ssid = TRUE; - nm_log_info (LOGD_HW, "(%s): driver supports SSID scans (scan_capa 0x%02X).", + nm_log_info (LOGD_HW | LOGD_WIFI, + "(%s): driver supports SSID scans (scan_capa 0x%02X).", nm_device_get_iface (NM_DEVICE (self)), scan_capa_range->scan_capa); } else { - nm_log_info (LOGD_HW, "(%s): driver does not support SSID scans (scan_capa 0x%02X).", + nm_log_info (LOGD_HW | LOGD_WIFI, + "(%s): driver does not support SSID scans (scan_capa 0x%02X).", nm_device_get_iface (NM_DEVICE (self)), scan_capa_range->scan_capa); } @@ -1358,7 +1362,8 @@ nm_device_wifi_get_mode (NMDeviceWifi *self) } } else { if (errno != ENODEV) { - nm_log_warn (LOGD_HW, "(%s): error %d getting card mode", + nm_log_warn (LOGD_HW | LOGD_WIFI, + "(%s): error %d getting card mode", iface, strerror (errno)); } } @@ -1410,7 +1415,8 @@ nm_device_wifi_set_mode (NMDeviceWifi *self, const NM80211Mode mode) if (ioctl (fd, SIOCSIWMODE, &wrq) < 0) { if (errno != ENODEV) { - nm_log_err (LOGD_HW, "(%s): error setting mode %d", + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): error setting mode %d", iface, mode, strerror (errno)); } } else @@ -1447,7 +1453,8 @@ nm_device_wifi_get_frequency (NMDeviceWifi *self) strncpy (wrq.ifr_name, iface, IFNAMSIZ); if (ioctl (fd, SIOCGIWFREQ, &wrq) < 0) { - nm_log_warn (LOGD_HW, "(%s): error getting frequency: %s", + nm_log_warn (LOGD_HW | LOGD_WIFI, + "(%s): error getting frequency: %s", iface, strerror (errno)); } else freq = iw_freq_to_uint32 (&wrq.u.freq); @@ -1588,7 +1595,7 @@ nm_device_wifi_get_ssid (NMDeviceWifi *self) strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); if (ioctl (sk, SIOCGIWESSID, &wrq) < 0) { - nm_log_err (LOGD_HW, "(%s): couldn't get SSID: %d", + nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): couldn't get SSID: %d", nm_device_get_iface (NM_DEVICE (self)), errno); goto out; } @@ -2850,7 +2857,7 @@ real_update_hw_address (NMDevice *dev) memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { - nm_log_err (LOGD_HW, "(%s) error getting hardware address: %d", + nm_log_err (LOGD_HW | LOGD_WIFI, "(%s) error getting hardware address: %d", nm_device_get_iface (dev), errno); goto out; } From 5eeef57581145a6ff3561ed2a8ef0bf5df87e132 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:24:25 -0700 Subject: [PATCH 197/392] wired: update logging --- src/nm-device-ethernet.c | 159 +++++++++++++++++++++++---------------- 1 file changed, 94 insertions(+), 65 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index abc282c6f0..4515ceffb1 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -51,7 +51,7 @@ #include "nm-setting-8021x.h" #include "nm-setting-pppoe.h" #include "ppp-manager/nm-ppp-manager.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-properties-changed-signal.h" #include "nm-dhcp-manager.h" @@ -227,11 +227,11 @@ set_carrier (NMDeviceEthernet *self, g_object_notify (G_OBJECT (self), NM_DEVICE_ETHERNET_CARRIER); state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); - nm_info ("(%s): carrier now %s (device state %d%s)", - nm_device_get_iface (NM_DEVICE (self)), - carrier ? "ON" : "OFF", - state, - defer_action ? ", deferring action for 4 seconds" : ""); + nm_log_info (LOGD_HW | LOGD_ETHER, "(%s): carrier now %s (device state %d%s)", + nm_device_get_iface (NM_DEVICE (self)), + carrier ? "ON" : "OFF", + state, + defer_action ? ", deferring action for 4 seconds" : ""); if (defer_action) priv->carrier_action_defer_id = g_timeout_add_seconds (4, carrier_action_defer_cb, self); @@ -331,30 +331,36 @@ constructor (GType type, priv->ifindex, &ifflags, &error)) { - nm_warning ("couldn't get initial carrier state: (%d) %s", - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + nm_log_warn (LOGD_HW | LOGD_ETHER, + "(%s): couldn't get initial carrier state: (%d) %s", + nm_device_get_iface (NM_DEVICE (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); g_clear_error (&error); } else priv->carrier = !!(ifflags & IFF_LOWER_UP); - nm_info ("(%s): carrier is %s", - nm_device_get_iface (NM_DEVICE (self)), - priv->carrier ? "ON" : "OFF"); + nm_log_info (LOGD_HW | LOGD_ETHER, + "(%s): carrier is %s", + nm_device_get_iface (NM_DEVICE (self)), + priv->carrier ? "ON" : "OFF"); /* Request link state again just in case an error occurred getting the * initial link state. */ if (!nm_netlink_monitor_request_status (priv->monitor, &error)) { - nm_warning ("couldn't request carrier state: (%d) %s", - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); + nm_log_warn (LOGD_HW | LOGD_ETHER, + "(%s): couldn't request carrier state: (%d) %s", + nm_device_get_iface (NM_DEVICE (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); g_clear_error (&error); } } else { - nm_info ("(%s): driver '%s' does not support carrier detection.", - nm_device_get_iface (self), - nm_device_get_driver (self)); + nm_log_info (LOGD_HW | LOGD_ETHER, + "(%s): driver '%s' does not support carrier detection.", + nm_device_get_iface (self), + nm_device_get_driver (self)); priv->carrier = TRUE; } @@ -473,7 +479,7 @@ nm_device_ethernet_get_speed (NMDeviceEthernet *self) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_warn (LOGD_HW, "couldn't open control socket."); return 0; } @@ -508,15 +514,16 @@ real_update_hw_address (NMDevice *dev) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_warn (LOGD_HW, "couldn't open control socket."); return; } memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { - nm_warning ("%s: (%s) error getting hardware address: %d", - __func__, nm_device_get_iface (dev), errno); + nm_log_err (LOGD_HW | LOGD_ETHER, + "(%s) error getting hardware address: %d", + nm_device_get_iface (dev), errno); goto out; } @@ -670,7 +677,8 @@ real_connection_secrets_updated (NMDevice *dev, if (!strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME)) { valid = TRUE; } else { - nm_warning ("Ignoring updated secrets for setting '%s'.", setting_name); + nm_log_warn (LOGD_DEVICE, "Ignoring updated secrets for setting '%s'.", + setting_name); } } @@ -827,8 +835,10 @@ link_timeout_cb (gpointer user_data) if (!setting_name) goto time_out; - nm_info ("Activation (%s/wired): disconnected during authentication," - " asking for new key.", nm_device_get_iface (dev)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): disconnected during authentication," + " asking for new key.", + nm_device_get_iface (dev)); supplicant_interface_release (self); nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); @@ -842,7 +852,8 @@ link_timeout_cb (gpointer user_data) return FALSE; time_out: - nm_info ("%s: link timed out.", nm_device_get_iface (dev)); + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "(%s): link timed out.", nm_device_get_iface (dev)); nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); return FALSE; @@ -863,7 +874,7 @@ schedule_state_handler (NMDeviceEthernet *self, task = g_slice_new0 (SupplicantStateTask); if (!task) { - nm_warning ("Not enough memory to process supplicant manager state change."); + nm_log_err (LOGD_DEVICE, "Not enough memory to process supplicant manager state change."); return FALSE; } @@ -906,10 +917,11 @@ supplicant_mgr_state_cb (NMSupplicantInterface * iface, guint32 old_state, gpointer user_data) { - nm_info ("(%s): supplicant manager state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_manager_state_to_string (old_state), - nm_supplicant_manager_state_to_string (new_state)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s): supplicant manager state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_manager_state_to_string (old_state), + nm_supplicant_manager_state_to_string (new_state)); schedule_state_handler (NM_DEVICE_ETHERNET (user_data), supplicant_mgr_state_cb_handler, @@ -936,7 +948,7 @@ build_supplicant_config (NMDeviceEthernet *self) security = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); if (!nm_supplicant_config_add_setting_8021x (config, security, con_path, TRUE)) { - nm_warning ("Couldn't add 802.1X security setting to supplicant config."); + nm_log_warn (LOGD_DEVICE, "Couldn't add 802.1X security setting to supplicant config."); g_object_unref (config); config = NULL; } @@ -962,11 +974,17 @@ supplicant_iface_state_cb_handler (gpointer user_data) success = nm_supplicant_interface_set_config (priv->supplicant.iface, config); g_object_unref (config); - if (!success) - nm_warning ("Activation (%s/wired): couldn't send security " - "configuration to the supplicant.", iface); - } else - nm_warning ("Activation (%s/wired): couldn't build security configuration.", iface); + if (!success) { + nm_log_err (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): couldn't send security " + "configuration to the supplicant.", + iface); + } + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): couldn't build security configuration.", + iface); + } if (!success) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED); @@ -990,10 +1008,11 @@ supplicant_iface_state_cb (NMSupplicantInterface * iface, gpointer user_data) { - nm_info ("(%s): supplicant interface state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_interface_state_to_string (old_state), - nm_supplicant_interface_state_to_string (new_state)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_interface_state_to_string (old_state), + nm_supplicant_interface_state_to_string (new_state)); schedule_state_handler (NM_DEVICE_ETHERNET (user_data), supplicant_iface_state_cb_handler, @@ -1016,8 +1035,9 @@ supplicant_iface_connection_state_cb_handler (gpointer user_data) * schedule the next activation stage. */ if (nm_device_get_state (dev) == NM_DEVICE_STATE_CONFIG) { - nm_info ("Activation (%s/wired) Stage 2 of 5 (Device Configure) successful.", - nm_device_get_iface (dev)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired) Stage 2 of 5 (Device Configure) successful.", + nm_device_get_iface (dev)); nm_device_activate_schedule_stage3_ip_config_start (dev); } } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { @@ -1040,10 +1060,11 @@ supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, guint32 old_state, gpointer user_data) { - nm_info ("(%s) supplicant connection state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_interface_connection_state_to_string (old_state), - nm_supplicant_interface_connection_state_to_string (new_state)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s) supplicant connection state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_interface_connection_state_to_string (old_state), + nm_supplicant_interface_connection_state_to_string (new_state)); schedule_state_handler (NM_DEVICE_ETHERNET (user_data), supplicant_iface_connection_state_cb_handler, @@ -1075,8 +1096,9 @@ supplicant_iface_connection_error_cb (NMSupplicantInterface *iface, NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); guint id; - nm_info ("Activation (%s/wired): association request to the supplicant failed: %s - %s", - nm_device_get_iface (NM_DEVICE (self)), name, message); + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): association request to the supplicant failed: %s - %s", + nm_device_get_iface (NM_DEVICE (self)), name, message); if (priv->supplicant.iface_con_error_cb_id) g_source_remove (priv->supplicant.iface_con_error_cb_id); @@ -1120,8 +1142,9 @@ handle_auth_or_fail (NMDeviceEthernet *self, NULL); g_object_set_data (G_OBJECT (connection), WIRED_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); - } else - nm_warning ("Cleared secrets, but setting didn't need any secrets."); + } else { + nm_log_info (LOGD_DEVICE, "Cleared secrets, but setting didn't need any secrets."); + } return NM_ACT_STAGE_RETURN_POSTPONE; } @@ -1140,15 +1163,17 @@ supplicant_connection_timeout_cb (gpointer user_data) iface = nm_device_get_iface (device); /* Authentication failed, encryption key is probably bad */ - nm_info ("Activation (%s/wired): association took too long.", iface); + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): association took too long.", iface); supplicant_interface_release (self); req = nm_device_get_act_request (device); g_assert (req); - if (handle_auth_or_fail (self, req, TRUE) == NM_ACT_STAGE_RETURN_POSTPONE) - nm_info ("Activation (%s/wired): asking for new secrets", iface); - else + if (handle_auth_or_fail (self, req, TRUE) == NM_ACT_STAGE_RETURN_POSTPONE) { + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): asking for new secrets", iface); + } else nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); return FALSE; @@ -1165,7 +1190,9 @@ supplicant_interface_init (NMDeviceEthernet *self) /* Create supplicant interface */ priv->supplicant.iface = nm_supplicant_manager_get_iface (priv->supplicant.mgr, iface, FALSE); if (!priv->supplicant.iface) { - nm_warning ("Couldn't initialize supplicant interface for %s.", iface); + nm_log_err (LOGD_DEVICE | LOGD_ETHER, + "Couldn't initialize supplicant interface for %s.", + iface); supplicant_interface_release (self); return FALSE; @@ -1213,7 +1240,7 @@ nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) connection = nm_act_request_get_connection (nm_device_get_act_request (NM_DEVICE (self))); security = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); if (!security) { - nm_warning ("Invalid or missing 802.1X security"); + nm_log_err (LOGD_DEVICE, "Invalid or missing 802.1X security"); *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; return ret; } @@ -1226,15 +1253,17 @@ nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) if (setting_name) { NMActRequest *req = nm_device_get_act_request (NM_DEVICE (self)); - nm_info ("Activation (%s/wired): connection '%s' has security, but secrets are required.", - iface, nm_setting_connection_get_id (s_connection)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): connection '%s' has security, but secrets are required.", + iface, nm_setting_connection_get_id (s_connection)); ret = handle_auth_or_fail (self, req, FALSE); if (ret != NM_ACT_STAGE_RETURN_POSTPONE) *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; } else { - nm_info ("Activation (%s/wired): connection '%s' requires no security. No secrets needed.", - iface, nm_setting_connection_get_id (s_connection)); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): connection '%s' requires no security. No secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); if (supplicant_interface_init (self)) ret = NM_ACT_STAGE_RETURN_POSTPONE; @@ -1311,8 +1340,8 @@ pppoe_stage3_ip4_config_start (NMDeviceEthernet *self, NMDeviceStateReason *reas self); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else { - nm_warning ("(%s): PPPoE failed to start: %s", - nm_device_get_iface (NM_DEVICE (self)), err->message); + nm_log_warn (LOGD_DEVICE, "(%s): PPPoE failed to start: %s", + nm_device_get_iface (NM_DEVICE (self)), err->message); g_error_free (err); g_object_unref (priv->ppp_manager); @@ -1880,7 +1909,7 @@ supports_ethtool_carrier_detect (NMDeviceEthernet *self) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_err (LOGD_HW, "couldn't open control socket."); return FALSE; } @@ -1937,7 +1966,7 @@ supports_mii_carrier_detect (NMDeviceEthernet *self) fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - nm_warning ("couldn't open control socket."); + nm_log_err (LOGD_HW, "couldn't open control socket."); return 0; } From f354bd3d9fc4653445f565eea4e43d8e4f0ffaf4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:33:49 -0700 Subject: [PATCH 198/392] logging: allow OLPC mesh logging to be used --- src/logging/nm-logging.c | 1 + src/main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 3d8e99b3df..980742bedb 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -78,6 +78,7 @@ static const LogDesc domain_descs[] = { { LOGD_SUSPEND, "SUSPEND" }, { LOGD_CORE, "CORE" }, { LOGD_DEVICE, "DEVICE" }, + { LOGD_OLPC_MESH, "OLPC" }, { 0, NULL } }; diff --git a/src/main.c b/src/main.c index 1974ec19b7..da317b13c6 100644 --- a/src/main.c +++ b/src/main.c @@ -462,7 +462,7 @@ main (int argc, char *argv[]) { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, - "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE,DEVICE]", + "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE,DEVICE,OLPC]", "HW,RFKILL,WIFI" }, {NULL} }; From e7877a0036bd5ce1a4cbe1ab00ed9d85755e585d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:36:47 -0700 Subject: [PATCH 199/392] logging: adjust default domains to match previous log verbosity --- src/logging/nm-logging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 980742bedb..267fa0a287 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -39,7 +39,10 @@ static guint32 log_level = LOGL_INFO; static guint32 log_domains = \ - LOGD_CORE | LOGD_HW | LOGD_RFKILL | LOGD_SUSPEND | LOGD_MB | LOGD_BT; + LOGD_HW | LOGD_RFKILL | LOGD_ETHER | LOGD_WIFI | LOGD_BT | LOGD_MB | \ + LOGD_DHCP4 | LOGD_DHCP6 | LOGD_PPP | LOGD_IP4 | LOGD_IP6 | LOGD_AUTOIP4 | \ + LOGD_DNS | LOGD_VPN | LOGD_SHARING | LOGD_SUPPLICANT | LOGD_USER_SET | \ + LOGD_SYS_SET | LOGD_SUSPEND | LOGD_CORE | LOGD_DEVICE | LOGD_OLPC_MESH; typedef struct { guint32 num; From 0d0503f21a6fa7d3b448035be487f8b1d5742652 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 13:40:27 -0700 Subject: [PATCH 200/392] logging: fix loc/func confusion --- src/logging/nm-logging.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 1b34614c7e..ba15268c34 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -63,21 +63,21 @@ enum { }; #define nm_log_err(domain, fmt, args...) \ - { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_ERR, fmt, ##args); } + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_ERR, fmt, ##args); } #define nm_log_warn(domain, fmt, args...) \ - { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_WARN, fmt, ##args); } + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_WARN, fmt, ##args); } #define nm_log_info(domain, fmt, args...) \ - { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_INFO, fmt, ##args); } + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_INFO, fmt, ##args); } #define nm_log_dbg(domain, fmt, args...) \ - { _nm_log (G_STRFUNC, G_STRLOC, domain, LOGL_DEBUG, fmt, ##args); } + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_DEBUG, fmt, ##args); } #define nm_log(domain, level, fmt, args...) \ - { _nm_log (G_STRFUNC, G_STRLOC, domain, level, fmt, ##args); } + { _nm_log (G_STRLOC, G_STRFUNC, domain, level, fmt, ##args); } -void _nm_log (const char *func, const char *loc, +void _nm_log (const char *loc, const char *func, guint32 domain, guint32 level, const char *fmt, ...); From 637a912545ff600c31a09cfd27ba308bd3da02be Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:08:34 -0700 Subject: [PATCH 201/392] logging: fix log domain parsing --- src/logging/nm-logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 267fa0a287..61dffedc05 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -122,7 +122,7 @@ nm_logging_setup (const char *level, const char *domains, GError **error) for (diter = &domain_descs[0]; diter->name; diter++) { if (!strcasecmp (diter->name, *iter)) { - new_domains &= diter->num; + new_domains |= diter->num; found = TRUE; break; } From ee58ac80bfcf923152c8eace005705740593daad Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:17:43 -0700 Subject: [PATCH 202/392] wifi: better debug log formatting --- src/nm-wifi-ap.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index ba865cfbff..80b69a3980 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -697,25 +697,25 @@ nm_ap_print_self (NMAccessPoint *ap, { NMAccessPointPrivate *priv; + g_return_if_fail (ap != NULL); g_return_if_fail (NM_IS_AP (ap)); priv = NM_AP_GET_PRIVATE (ap); - nm_log_dbg (LOGD_WIFI_SCAN, "%s'%s' (%p) stamp=%ld flags=0x%X wpa-flags=0x%X rsn-flags=0x%x " - "bssid=" MAC_FMT " strength=%d freq=%d rate=%d mode=%d seen=%ld", + nm_log_dbg (LOGD_WIFI_SCAN, "%s'%s' (%p)", prefix, priv->ssid ? nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len) : "(none)", - ap, - priv->timestamp.tv_sec, - priv->flags, - priv->wpa_flags, - priv->rsn_flags, - MAC_ARG (priv->address.ether_addr_octet), - priv->strength, - priv->freq, - priv->max_bitrate, - priv->mode, - priv->last_seen); + ap); + nm_log_dbg (LOGD_WIFI_SCAN, " BSSID " MAC_FMT, MAC_ARG (priv->address.ether_addr_octet)); + nm_log_dbg (LOGD_WIFI_SCAN, " mode %d", priv->mode); + nm_log_dbg (LOGD_WIFI_SCAN, " timestamp %ld", priv->timestamp.tv_sec); + nm_log_dbg (LOGD_WIFI_SCAN, " flags 0x%X", priv->flags); + nm_log_dbg (LOGD_WIFI_SCAN, " wpa flags 0x%X", priv->wpa_flags); + nm_log_dbg (LOGD_WIFI_SCAN, " rsn flags 0x%X", priv->rsn_flags); + nm_log_dbg (LOGD_WIFI_SCAN, " quality %d", priv->strength); + nm_log_dbg (LOGD_WIFI_SCAN, " frequency %d", priv->freq); + nm_log_dbg (LOGD_WIFI_SCAN, " max rate %d", priv->max_bitrate); + nm_log_dbg (LOGD_WIFI_SCAN, " last-seen %ld", priv->last_seen); } const char * From 6602813ffb7cee53f7afc2f3591bec736afd87ad Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:31:35 -0700 Subject: [PATCH 203/392] wifi: better scan debug logging --- src/nm-device-wifi.c | 111 ++++++++++++++++++++++++++++++++----------- 1 file changed, 82 insertions(+), 29 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index edab55d02c..858f2e546c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -181,10 +181,6 @@ struct _NMDeviceWifiPrivate { static guint32 nm_device_wifi_get_frequency (NMDeviceWifi *self); -#if DEBUG -static void nm_device_wifi_ap_list_print (NMDeviceWifi *self); -#endif - static gboolean request_wireless_scan (gpointer user_data); static void schedule_scan (NMDeviceWifi *self, gboolean backoff); @@ -759,6 +755,8 @@ supplicant_interface_release (NMDeviceWifi *self) /* Reset the scan interval to be pretty frequent when disconnected */ priv->scan_interval = SCAN_INTERVAL_MIN + SCAN_INTERVAL_STEP; + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): reset scanning interval to %d seconds", + nm_device_get_iface (NM_DEVICE (self))); remove_supplicant_interface_error_handler (self); @@ -1298,12 +1296,12 @@ nm_device_wifi_ap_list_print (NMDeviceWifi *self) g_return_if_fail (NM_IS_DEVICE_WIFI (self)); - nm_log_dbg (LOGD_WIFI_SCAN, "AP_LIST_PRINT:"); + nm_log_dbg (LOGD_WIFI_SCAN, "Current AP list:"); for (elt = priv->ap_list; elt; elt = g_slist_next (elt), i++) { NMAccessPoint * ap = NM_AP (elt->data); - nm_ap_print_self (ap, "::\t"); + nm_ap_print_self (ap, "AP: "); } - nm_log_dbg (LOGD_WIFI_SCAN, "AP_LIST_PRINT: done"); + nm_log_dbg (LOGD_WIFI_SCAN, "Current AP list: done"); } static gboolean @@ -1778,10 +1776,16 @@ request_wireless_scan (gpointer user_data) gboolean backoff = FALSE; if (check_scanning_allowed (self)) { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scanning requested", + nm_device_get_iface (NM_DEVICE (self))); + if (nm_supplicant_interface_request_scan (priv->supplicant.iface)) { /* success */ backoff = TRUE; } + } else { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan requested but not allowed at this time", + nm_device_get_iface (NM_DEVICE (self))); } priv->pending_scan_id = 0; @@ -1811,13 +1815,13 @@ schedule_scan (NMDeviceWifi *self, gboolean backoff) } if (!priv->pending_scan_id) { - guint factor = 2; + guint factor = 2, next_scan = priv->scan_interval; if ( nm_device_is_activating (NM_DEVICE (self)) || (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_ACTIVATED)) factor = 1; - priv->pending_scan_id = g_timeout_add_seconds (priv->scan_interval, + priv->pending_scan_id = g_timeout_add_seconds (next_scan, request_wireless_scan, self); @@ -1834,6 +1838,12 @@ schedule_scan (NMDeviceWifi *self, gboolean backoff) */ priv->scan_interval = 5; } + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scheduled scan in %d seconds (interval now %d seconds)", + nm_device_get_iface (NM_DEVICE (self)), + next_scan, + priv->scan_interval); + } } @@ -1855,6 +1865,10 @@ supplicant_iface_scan_request_result_cb (NMSupplicantInterface *iface, gboolean success, NMDeviceWifi *self) { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan request %s", + nm_device_get_iface (NM_DEVICE (self)), + success ? "successful" : "failed"); + if (check_scanning_allowed (self)) schedule_scan (self, TRUE); } @@ -1864,11 +1878,15 @@ supplicant_iface_scan_results_cb (NMSupplicantInterface *iface, guint32 num_results, NMDeviceWifi *self) { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan results available (%d APs found)", + nm_device_get_iface (NM_DEVICE (self)), + num_results); if (num_results == 0) { /* ensure that old APs get culled, which otherwise only * happens when there are actual scan results to process. */ cull_scan_list (self); + nm_device_wifi_ap_list_print (self); } } @@ -2022,11 +2040,12 @@ static void cull_scan_list (NMDeviceWifi *self) { NMDeviceWifiPrivate *priv; - GTimeVal cur_time; - GSList * outdated_list = NULL; - GSList * elt; - NMActRequest * req; - const char * cur_ap_path = NULL; + GTimeVal cur_time; + GSList *outdated_list = NULL; + GSList *elt; + NMActRequest *req; + const char *cur_ap_path = NULL; + guint32 removed = 0, total = 0; g_return_if_fail (self != NULL); priv = NM_DEVICE_WIFI_GET_PRIVATE (self); @@ -2037,10 +2056,13 @@ cull_scan_list (NMDeviceWifi *self) if (req) cur_ap_path = nm_act_request_get_specific_object (req); + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): checking scan list for outdated APs", + nm_device_get_iface (NM_DEVICE (self))); + /* Walk the access point list and remove any access points older than * three times the inactive scan interval. */ - for (elt = priv->ap_list; elt; elt = g_slist_next (elt)) { + for (elt = priv->ap_list; elt; elt = g_slist_next (elt), total++) { NMAccessPoint * ap = NM_AP (elt->data); const glong ap_time = nm_ap_get_last_seen (ap); gboolean keep = FALSE; @@ -2058,13 +2080,31 @@ cull_scan_list (NMDeviceWifi *self) /* Remove outdated APs */ for (elt = outdated_list; elt; elt = g_slist_next (elt)) { - NMAccessPoint * outdated_ap = NM_AP (elt->data); + NMAccessPoint *outdated_ap = NM_AP (elt->data); + const struct ether_addr *bssid; + const GByteArray *ssid; + + bssid = nm_ap_get_address (outdated_ap); + ssid = nm_ap_get_ssid (outdated_ap); + nm_log_dbg (LOGD_WIFI_SCAN, + " removing %02x:%02x:%02x:%02x:%02x:%02x (%s%s%s)", + bssid->ether_addr_octet[0], bssid->ether_addr_octet[1], + bssid->ether_addr_octet[2], bssid->ether_addr_octet[3], + bssid->ether_addr_octet[4], bssid->ether_addr_octet[5], + ssid ? "'" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", + ssid ? "'" : ""); access_point_removed (self, outdated_ap); priv->ap_list = g_slist_remove (priv->ap_list, outdated_ap); g_object_unref (outdated_ap); + removed++; } g_slist_free (outdated_list); + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): removed %d APs (of %d)", + nm_device_get_iface (NM_DEVICE (self)), + removed, total); } #define SET_QUALITY_MEMBER(qual_item, lc_member, uc_member) \ @@ -2123,20 +2163,23 @@ supplicant_iface_scanned_ap_cb (NMSupplicantInterface *iface, return; ap = nm_ap_new_from_properties (properties); - if (!ap) - return; + if (ap) { + set_ap_strength_from_properties (self, ap, properties); - set_ap_strength_from_properties (self, ap, properties); + nm_ap_print_self (ap, "AP: "); - /* Add the AP to the device's AP list */ - merge_scanned_ap (self, ap); + /* Add the AP to the device's AP list */ + merge_scanned_ap (self, ap); + g_object_unref (ap); - /* Remove outdated access points */ - cull_scan_list (self); + /* Remove outdated access points */ + cull_scan_list (self); - nm_device_wifi_ap_list_print (self); - - g_object_unref (ap); + nm_device_wifi_ap_list_print (self); + } else { + nm_log_warn (LOGD_WIFI_SCAN, "(%s): invalid AP properties received", + nm_device_get_iface (NM_DEVICE (self))); + } } @@ -2327,6 +2370,9 @@ supplicant_iface_state_cb_handler (gpointer user_data) NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE); } + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): supplicant ready, requesting initial scan", + nm_device_get_iface (NM_DEVICE (self))); + /* Request a scan to get latest results */ cancel_pending_scan (self); request_wireless_scan (self); @@ -2571,10 +2617,17 @@ supplicant_iface_connection_error_cb (NMSupplicantInterface * iface, } static void -supplicant_iface_notify_scanning_cb (NMSupplicantInterface * iface, - GParamSpec * pspec, - NMDeviceWifi * self) +supplicant_iface_notify_scanning_cb (NMSupplicantInterface *iface, + GParamSpec *pspec, + NMDeviceWifi *self) { + gboolean scanning; + + scanning = nm_supplicant_interface_get_scanning (iface); + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): now %s", + nm_device_get_iface (NM_DEVICE (self)), + scanning ? "scanning" : "not scanning"); + g_object_notify (G_OBJECT (self), "scanning"); } From 4e5cfab478cdca049779d7366b9eefd25e3bcabc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:43:32 -0700 Subject: [PATCH 204/392] logging: fix multiple log level handling Ensure messages are only printed in the format their log level wants. --- src/logging/nm-logging.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 61dffedc05..446c7a4179 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -158,14 +158,14 @@ void _nm_log (const char *loc, msg = g_strdup_vprintf (fmt, args); va_end (args); - if (log_level & LOGL_DEBUG) { + if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) { g_get_current_time (&tv); syslog (LOG_DEBUG, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); - } else if (log_level & LOGL_INFO) + } else if ((log_level & LOGL_INFO) && (level == LOGL_INFO)) syslog (LOG_INFO, " %s\n", msg); - else if (log_level & LOGL_WARN) + else if ((log_level & LOGL_WARN) && (level == LOGL_WARN)) syslog (LOG_WARNING, " %s\n", msg); - else if (log_level & LOGL_ERR) { + else if ((log_level & LOGL_ERR) && (level == LOGL_ERR)) { g_get_current_time (&tv); syslog (LOG_ERR, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); } From df04e3f66c3fea440aac7bb93b6350bfaf60f075 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:46:03 -0700 Subject: [PATCH 205/392] udev: more debug logging of rfkill and udev --- src/nm-udev-manager.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c index b1b49f510f..0ced962c27 100644 --- a/src/nm-udev-manager.c +++ b/src/nm-udev-manager.c @@ -82,6 +82,30 @@ nm_udev_manager_get_rfkill_state (NMUdevManager *self, RfKillType rtype) return NM_UDEV_MANAGER_GET_PRIVATE (self)->rfkill_states[rtype]; } +static const char * +rfkill_type_to_desc (RfKillType rtype) +{ + if (rtype == 0) + return "WiFi"; + else if (rtype == 1) + return "WWan"; + else if (rtype == 2) + return "WiMAX"; + return "unknown"; +} + +static const char * +rfkill_state_to_desc (RfKillState rstate) +{ + if (rstate == 0) + return "unblocked"; + else if (rstate == 1) + return "soft-blocked"; + else if (rstate == 2) + return "hard-blocked"; + return "unknown"; +} + static Killswitch * killswitch_new (GUdevDevice *device, RfKillType rtype) { @@ -175,6 +199,10 @@ recheck_killswitches (NMUdevManager *self) for (i = 0; i < RFKILL_TYPE_MAX; i++) { if (poll_states[i] != priv->rfkill_states[i]) { + nm_log_dbg (LOGD_RFKILL, "%s rfkill state now '%s'", + rfkill_type_to_desc (i), + rfkill_state_to_desc (poll_states[i])); + priv->rfkill_states[i] = poll_states[i]; g_signal_emit (self, signals[RFKILL_CHANGED], 0, i, priv->rfkill_states[i]); } @@ -230,7 +258,7 @@ add_one_killswitch (NMUdevManager *self, GUdevDevice *device) priv->killswitches = g_slist_prepend (priv->killswitches, ks); nm_log_info (LOGD_RFKILL, "found %s radio killswitch %s (at %s) (driver %s)", - str_type, + rfkill_type_to_desc (rtype), ks->name, ks->path, ks->driver ? ks->driver : ""); @@ -427,6 +455,9 @@ handle_uevent (GUdevClient *client, subsys = g_udev_device_get_subsystem (device); g_return_if_fail (subsys != NULL); + nm_log_dbg (LOGD_HW, "UDEV event: action '%s' subsys '%s' device '%s'", + action, subsys, g_udev_device_get_name (device)); + g_return_if_fail (!strcmp (subsys, "rfkill") || !strcmp (subsys, "net")); if (!strcmp (action, "add")) { From 71bdbf9c251004b103e381f75f363c72d805fd7a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:55:29 -0700 Subject: [PATCH 206/392] wifi: log ipw killswitch changes --- src/nm-device-wifi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 858f2e546c..a6c6282419 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -269,6 +269,7 @@ nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self) NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); char *contents = NULL; RfKillState state = RFKILL_UNBLOCKED; + const char *str_state = NULL; if ( priv->ipw_rfkill_path && g_file_get_contents (priv->ipw_rfkill_path, &contents, NULL, NULL)) { @@ -282,16 +283,23 @@ nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self) switch (contents[0]) { case '1': state = RFKILL_SOFT_BLOCKED; + str_state = "soft-blocked"; break; case '2': case '3': state = RFKILL_HARD_BLOCKED; + str_state = "hard-blocked"; break; case '0': + str_state = "unblocked"; default: break; } g_free (contents); + + nm_log_dbg (LOGD_RFKILL, "(%s): ipw rfkill state '%s'", + nm_device_get_iface (NM_DEVICE (self)), + str_state ? str_state : "(unknown)"); } return state; From 26efaaf1683643402fcf955e521d6954f90198e4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 14:55:43 -0700 Subject: [PATCH 207/392] core: more manager debug logging --- src/nm-manager.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index bb243e0c64..ed90dfa8e9 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1242,8 +1242,12 @@ manager_set_radio_enabled (NMManager *manager, RfKillType devtype = RFKILL_TYPE_UNKNOWN; g_object_get (G_OBJECT (iter->data), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); - if (devtype == rstate->rtype) + if (devtype == rstate->rtype) { + nm_log_dbg (LOGD_RFKILL, "(%s): setting radio %s", + nm_device_get_iface (NM_DEVICE (iter->data)), + enabled ? "enabled" : "disabled"); nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (iter->data), enabled); + } } } @@ -1530,6 +1534,15 @@ add_device (NMManager *self, NMDevice *device) existing = nm_device_interface_connection_match_config (NM_DEVICE_INTERFACE (device), (const GSList *) connections); g_slist_free (connections); + + if (existing) { + NMSettingConnection *s_con; + + s_con = (NMSettingConnection *) nm_connection_get_setting (existing, NM_TYPE_SETTING_CONNECTION); + nm_log_dbg (LOGD_DEVICE, "(%s): found existing device connection '%s'", + nm_device_get_iface (device), + nm_setting_connection_get_id (s_con)); + } } /* Start the device if it's supposed to be managed */ @@ -1551,11 +1564,14 @@ add_device (NMManager *self, NMDevice *device) const char *ac_path; GError *error = NULL; + nm_log_dbg (LOGD_DEVICE, "(%s): will attempt to assume existing connection", + nm_device_get_iface (device)); + ac_path = internal_activate_device (self, device, existing, NULL, FALSE, TRUE, &error); if (ac_path) g_object_notify (G_OBJECT (self), NM_MANAGER_ACTIVE_CONNECTIONS); else { - nm_log_warn (LOGD_CORE, "assumed connection (%d) %s failed to activate: (%d) %s", + nm_log_warn (LOGD_DEVICE, "assumed connection (%d) %s failed to activate: (%d) %s", nm_connection_get_scope (existing), nm_connection_get_path (existing), error ? error->code : -1, From e92e321c4d99fe8e758210afbb0db12c08a4caff Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 15:10:12 -0700 Subject: [PATCH 208/392] po: update translatables --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 4369c5b994..2cf4d231c8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -15,6 +15,7 @@ src/main.c src/dhcp-manager/nm-dhcp-dhclient.c src/dhcp-manager/nm-dhcp-manager.c src/ip6-manager/nm-netlink-listener.c +src/logging/nm-logging.c src/named-manager/nm-named-manager.c src/system-settings/nm-default-wired-connection.c system-settings/plugins/ifcfg-rh/reader.c From b0f056d787192b0db3c1869ccdcb309774ca5c21 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 16:41:44 -0700 Subject: [PATCH 209/392] core: log device delayed state transitions --- src/nm-device.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index 716401a583..e10c9049ed 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2345,10 +2345,14 @@ delayed_transitions_clear (NMDevice *self) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); if (priv->failed_to_disconnected_id) { + nm_log_dbg (LOGD_DEVICE, "(%s): clearing failed->disconnected transition", + nm_device_get_iface (self)); g_source_remove (priv->failed_to_disconnected_id); priv->failed_to_disconnected_id = 0; } if (priv->unavailable_to_disconnected_id) { + nm_log_dbg (LOGD_DEVICE, "(%s): clearing unavailable->disconnected transition", + nm_device_get_iface (self)); g_source_remove (priv->unavailable_to_disconnected_id); priv->unavailable_to_disconnected_id = 0; } @@ -3294,6 +3298,8 @@ failed_to_disconnected (gpointer user_data) NMDevice *self = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + nm_log_dbg (LOGD_DEVICE, "(%s): running failed->disconnected transition", + nm_device_get_iface (self)); priv->failed_to_disconnected_id = 0; nm_device_state_changed (self, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); return FALSE; @@ -3305,6 +3311,8 @@ unavailable_to_disconnected (gpointer user_data) NMDevice *self = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + nm_log_dbg (LOGD_DEVICE, "(%s): running unavailable->disconnected transition", + nm_device_get_iface (self)); priv->unavailable_to_disconnected_id = 0; nm_device_state_changed (self, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); return FALSE; @@ -3381,8 +3389,11 @@ nm_device_state_changed (NMDevice *device, * we can't change states again from the state handler for a variety of * reasons. */ - if (nm_device_is_available (device)) + if (nm_device_is_available (device)) { + nm_log_dbg (LOGD_WIFI, "(%s): device is available, will transition to DISCONNECTED", + nm_device_get_iface (device)); priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device); + } break; case NM_DEVICE_STATE_ACTIVATED: nm_log_info (LOGD_DEVICE, "Activation (%s) successful, device activated.", From 7fa8f29aaf8767631fb546e4fa3731e4a1a71586 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 16:42:29 -0700 Subject: [PATCH 210/392] wifi: more supplicant/wifi debug logging To help debug wifi device availablility. --- src/nm-device-wifi.c | 29 ++++++++++++++++--- .../nm-supplicant-interface.c | 9 ++++-- .../nm-supplicant-manager.c | 3 ++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index a6c6282419..6062c3c72e 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1208,16 +1208,25 @@ real_is_available (NMDevice *dev) NMSupplicantInterface *sup_iface; guint32 state; - if (!priv->enabled) + if (!priv->enabled) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because not enabled", + nm_device_get_iface (dev)); return FALSE; + } sup_iface = priv->supplicant.iface; - if (!sup_iface) + if (!sup_iface) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant not running", + nm_device_get_iface (dev)); return FALSE; + } state = nm_supplicant_interface_get_state (sup_iface); - if (state != NM_SUPPLICANT_INTERFACE_STATE_READY) + if (state != NM_SUPPLICANT_INTERFACE_STATE_READY) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant interface not ready", + nm_device_get_iface (dev)); return FALSE; + } return TRUE; } @@ -3499,9 +3508,16 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) priv->enabled = enabled; + nm_log_dbg (LOGD_WIFI, "(%s): device now %s", + nm_device_get_iface (NM_DEVICE (device)), + enabled ? "enabled" : "disabled"); + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); - if (state < NM_DEVICE_STATE_UNAVAILABLE) + if (state < NM_DEVICE_STATE_UNAVAILABLE) { + nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by UNMANAGED state", + nm_device_get_iface (NM_DEVICE (device))); return; + } if (enabled) { gboolean no_firmware = FALSE, success; @@ -3511,6 +3527,9 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) nm_log_warn (LOGD_CORE, "not in expected unavailable state!"); if (!nm_device_hw_bring_up (NM_DEVICE (self), TRUE, &no_firmware)) { + nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by failure to bring device up", + nm_device_get_iface (NM_DEVICE (device))); + /* The device sucks, or HAL was lying to us about the killswitch state */ priv->enabled = FALSE; return; @@ -3525,6 +3544,8 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) supplicant_interface_release (self); supplicant_interface_acquire (self); + nm_log_dbg (LOGD_WIFI, "(%s): enable waiting on supplicant state", + nm_device_get_iface (NM_DEVICE (device))); } else { nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_UNAVAILABLE, diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 4307a9ebc2..da1a856d1b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -768,6 +768,7 @@ static void nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; char *path = NULL; @@ -782,13 +783,13 @@ nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpoi /* Interface already added, just try to get the interface */ nm_supplicant_interface_add_to_supplicant (info->interface, TRUE); } else { - nm_log_warn (LOGD_SUPPLICANT, "Unexpected supplicant error getting interface: %s", - err->message); + nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", + priv->dev, err->message); } g_error_free (err); } else { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev); priv->object_path = path; @@ -887,6 +888,8 @@ nm_supplicant_interface_start (NMSupplicantInterface * self) /* Can only start the interface from INIT state */ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); + nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev); + state = nm_supplicant_manager_get_state (priv->smgr); if (state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING); diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index f8390437dc..a2cf58eb8f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -288,9 +288,12 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } if (!iface) { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); iface = nm_supplicant_interface_new (self, ifname, is_wireless); if (iface) priv->ifaces = g_slist_append (priv->ifaces, iface); + } else { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); } return iface; From 02002ef9d15ead885eccc46c278e6aa11a778f87 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 08:56:17 -0700 Subject: [PATCH 211/392] logging: add D-Bus method to change logging --- introspection/nm-manager.xml | 22 ++++++++++++++++++ src/logging/nm-logging.c | 45 +++++++++++++++++++++++++++++++++--- src/logging/nm-logging.h | 7 ++++++ src/nm-manager.c | 18 +++++++++++++++ 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 8303f4d469..406b5cfd1e 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -96,6 +96,28 @@ + + + + Set logging verbosity and which operations are logged. + + + + One of [ERR, WARN, INFO, DEBUG]. + + + + + A combination of logging domains separated by commas (','), or "NONE" + to disable logging. Each domain enables logging for operations + related to that domain. Available domains are: [NONE, HW, RKILL, + ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, + DNS, VPN, SHARING, SUPPLICANT, USER_SET, SYS_SET, SUSPEND, CORE, + DEVICE, OLPC] + + + + Indicates if wireless is currently enabled or not. diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 446c7a4179..3e3efa4760 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -85,6 +85,40 @@ static const LogDesc domain_descs[] = { { 0, NULL } }; +/************************************************************************/ + +enum { + NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0, + NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1, +}; + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GQuark +nm_logging_error_quark (void) +{ + static GQuark ret = 0; + + if (ret == 0) + ret = g_quark_from_static_string ("nm_logging_error"); + return ret; +} + +GType +nm_logging_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_LEVEL, "UnknownLevel"), + ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_DOMAIN, "UnknownDomain"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMLoggingError", values); + } + return etype; +} /************************************************************************/ @@ -108,18 +142,22 @@ nm_logging_setup (const char *level, const char *domains, GError **error) } if (!found) { - g_set_error (error, 0, 0, _("Unknown log level '%s'"), level); + g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_LEVEL, + _("Unknown log level '%s'"), level); return FALSE; } } /* domains */ if (domains && strlen (domains)) { - tmp = g_strsplit (domains, ",", 0); + tmp = g_strsplit_set (domains, ", ", 0); for (iter = tmp; iter && *iter; iter++) { const LogDesc *diter; gboolean found = FALSE; + if (!strlen (*iter)) + continue; + for (diter = &domain_descs[0]; diter->name; diter++) { if (!strcasecmp (diter->name, *iter)) { new_domains |= diter->num; @@ -129,7 +167,8 @@ nm_logging_setup (const char *level, const char *domains, GError **error) } if (!found) { - g_set_error (error, 0, 0, _("Unknown log domain '%s'"), *iter); + g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_DOMAIN, + _("Unknown log domain '%s'"), *iter); return FALSE; } } diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index ba15268c34..4c381a24a3 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -23,6 +23,7 @@ #define NM_LOGGING_H #include +#include /* Log domains */ enum { @@ -62,6 +63,12 @@ enum { LOGL_DEBUG = 0x00000004 }; +#define NM_LOGGING_ERROR (nm_logging_error_quark ()) +#define NM_TYPE_LOGGING_ERROR (nm_logging_error_get_type ()) +GQuark nm_logging_error_quark (void); +GType nm_logging_error_get_type (void); + + #define nm_log_err(domain, fmt, args...) \ { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_ERR, fmt, ##args); } diff --git a/src/nm-manager.c b/src/nm-manager.c index ed90dfa8e9..3189e3f76f 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -79,6 +79,11 @@ static gboolean impl_manager_deactivate_connection (NMManager *manager, static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); +static gboolean impl_manager_set_logging (NMManager *manager, + const char *level, + const char *domains, + GError **error); + /* Legacy 0.6 compatibility interface */ static gboolean impl_manager_legacy_sleep (NMManager *manager, GError **err); @@ -2756,6 +2761,18 @@ impl_manager_legacy_state (NMManager *manager, guint32 *state, GError **err) return TRUE; } +static gboolean +impl_manager_set_logging (NMManager *manager, + const char *level, + const char *domains, + GError **error) +{ + if (nm_logging_setup (level, domains, error)) { + nm_log_info (LOGD_CORE, "logging: level '%s' domains '%s'", level, domains); + return TRUE; + } + return FALSE; +} /* Connections */ @@ -3353,5 +3370,6 @@ nm_manager_class_init (NMManagerClass *manager_class) &dbus_glib_nm_manager_object_info); dbus_g_error_domain_register (NM_MANAGER_ERROR, NULL, NM_TYPE_MANAGER_ERROR); + dbus_g_error_domain_register (NM_LOGGING_ERROR, "org.freedesktop.NetworkManager.Logging", NM_TYPE_LOGGING_ERROR); } From 7e5d6a42b05c856eb53fd4084629b9f7ca121be2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 09:11:00 -0700 Subject: [PATCH 212/392] logging: use --log-domains for consistency --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index da317b13c6..cce2939e39 100644 --- a/src/main.c +++ b/src/main.c @@ -461,7 +461,7 @@ main (int argc, char *argv[]) { "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" }, { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, - { "log-domain", 0, 0, G_OPTION_ARG_STRING, &log_domains, + { "log-domains", 0, 0, G_OPTION_ARG_STRING, &log_domains, "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE,DEVICE,OLPC]", "HW,RFKILL,WIFI" }, {NULL} From f72c00b984c6015a9ef63b1b9e28579f82f30848 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 09:16:27 -0700 Subject: [PATCH 213/392] man: add logging control options --- man/Makefile.am | 3 +++ man/NetworkManager.8.in | 16 ++++++++++++++-- man/NetworkManager.conf.5.in | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 670d9a741a..7cbc5a15fd 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -10,3 +10,6 @@ EXTRA_DIST = \ NetworkManager.conf.5.in \ nm-system-settings.conf.5.in \ nm-tool.1.in + +CLEANFILES = $(man_MANS) + diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in index 2de7c262ab..4cd64c753a 100644 --- a/man/NetworkManager.8.in +++ b/man/NetworkManager.8.in @@ -8,7 +8,7 @@ .SH NAME NetworkManager \- network management daemon .SH SYNOPSIS -.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] +.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] [\-\-log-level=] [\-\-log-domain=,,...] .SH DESCRIPTION The \fINetworkManager\fP daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network @@ -81,11 +81,23 @@ List plugins used to manage system-wide connection settings. This list has preference over plugins specified in the configuration file. Currently supported plugins are: keyfile, ifcfg\-rh, ifcfg\-suse, ifupdown. See \fBNetworkManager.conf\fP(5) for more information on the plugins. +.TP +.I "\-\-log-level= +Sets how much information NetworkManager sends to the log destination (usually +syslog's "daemon" facility). By default, only informational, warning, and error +messages are logged. See \fBNetworkManager.conf\fP(5) for more information on +log levels and domains. +.TP +.I "\-\-log-domains=,, ... +Sets which operations are logged to the log destination (usually syslog). By +default, most domains are logging-enabled. See \fBNetworkManager.conf\fP(5) for +more information on log levels and domains. .SH DEBUGGING The following environment variables are supported to help debugging. When used in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helper output to stdout) these can quickly help pinpoint the source of connection -issues. +issues. Also see the \-\-log- and \-\-log-domains to enable debug logging inside +NetworkManager itself. .TP .I "NM_PPP_DEBUG" When set to anything, causes NetworkManager to turn on PPP debugging in pppd, diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index 3de273846e..783bafbda6 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -97,6 +97,26 @@ ignored by NetworkManager. Remember that NetworkManager controls the default rou so because the interface is ignored, NetworkManager may assign the default route to some other interface. When the option is missing, \fIfalse\fP value is taken as default. +.SS [logging] +This section controls NetworkManager's logging. Any settings here are +overridden by the --log-level and --log-domain command-line options. +.TP +.B level=\fI\fP +One of [ERR, WARN, INFO, DEBUG]. The ERR level logs only critical errors. WARN +logs warnings that may reflect operation. INFO logs various informational +messages that are useful for tracking state and operations. DEBUG enables +verbose logging for debugging purposes. Subsequent levels also log all messages +from earlier levels; thus setting the log level to INFO also logs error and +warning messages. +.TP +.B domains=\fI,, ...\fP +The following log domains are available: [NONE, HW, RKILL, ETHER, WIFI, BT, MB, +DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, +USER_SET, SYS_SET, SUSPEND, CORE, DEVICE, OLPC]. When "NONE" is given by itself, +logging is disabled. MB = Mobile Broadband, USER_SET = user settings operations +and communication, SYS_SET = system settings service operations, OLPC = OLPC +Mesh device operations, CORE = core daemon operations, DEVICE = activation and +general interface operations. .SH "SEE ALSO" .BR http://live.gnome.org/NetworkManager/SystemSettings .sp From 8364ce7bac41591b7815e96fda9e32167163213b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 09:22:52 -0700 Subject: [PATCH 214/392] wired: debug logging for carrier detect support detection --- src/nm-device-ethernet.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 4515ceffb1..c64ebb8ed6 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1919,13 +1919,18 @@ supports_ethtool_carrier_detect (NMDeviceEthernet *self) edata.cmd = ETHTOOL_GLINK; ifr.ifr_data = (char *) &edata; - if (ioctl (fd, SIOCETHTOOL, &ifr) < 0) + errno = 0; + if (ioctl (fd, SIOCETHTOOL, &ifr) < 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d", errno); goto out; + } supports_ethtool = TRUE; out: close (fd); + nm_log_dbg (LOGD_HW | LOGD_ETHER, "ethtool %s supported", + supports_ethtool ? "is" : "not"); return supports_ethtool; } @@ -1949,8 +1954,13 @@ mdio_read (NMDeviceEthernet *self, int fd, struct ifreq *ifr, int location) mii = (struct mii_ioctl_data *) &ifr->ifr_ifru; mii->reg_num = location; - if (ioctl (fd, SIOCGMIIREG, ifr) == 0) + errno = 0; + if (ioctl (fd, SIOCGMIIREG, ifr) == 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIREG result 0x%X", mii->val_out); val = mii->val_out; + } else { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIREG failed: %d", errno); + } return val; } @@ -1973,12 +1983,17 @@ supports_mii_carrier_detect (NMDeviceEthernet *self) memset (&ifr, 0, sizeof (struct ifreq)); strncpy (ifr.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); - if (ioctl (fd, SIOCGMIIPHY, &ifr) < 0) + errno = 0; + if (ioctl (fd, SIOCGMIIPHY, &ifr) < 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIPHY failed: %d", errno); goto out; + } /* If we can read the BMSR register, we assume that the card supports MII link detection */ bmsr = mdio_read (self, fd, &ifr, MII_BMSR); supports_mii = (bmsr != -1) ? TRUE : FALSE; + nm_log_dbg (LOGD_HW | LOGD_ETHER, "MII %s supported", + supports_mii ? "is" : "not"); out: close (fd); From d0f2a50680e0de563c0ceae215d3c6921097a85b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 09:30:05 -0700 Subject: [PATCH 215/392] core: log kernel interface indexes --- src/nm-device-ethernet.c | 3 +++ src/nm-device-olpc-mesh.c | 3 +++ src/nm-device-wifi.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index c64ebb8ed6..69d0539dc5 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -311,6 +311,9 @@ constructor (GType type, self = NM_DEVICE (object); priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + nm_log_dbg (LOGD_HW | LOGD_ETHER, "(%s): kernel interface #%d", + nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + caps = nm_device_get_capabilities (self); if (caps & NM_DEVICE_CAP_CARRIER_DETECT) { GError *error = NULL; diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 41fc83acd7..2093a8e887 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -262,6 +262,9 @@ constructor (GType type, self = NM_DEVICE_OLPC_MESH (object); priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", + nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + iface = nm_device_get_iface (NM_DEVICE (self)); fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 6062c3c72e..3e7a820476 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -578,6 +578,9 @@ constructor (GType type, self = NM_DEVICE_WIFI (object); priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + nm_log_dbg (LOGD_HW | LOGD_WIFI, "(%s): kernel ifindex %d", + nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + memset (&range, 0, sizeof (struct iw_range)); success = wireless_get_range (NM_DEVICE_WIFI (object), &range, &response_len); if (!success) From 157e9f791dcd01a53188ccec2ab8d552b5a03686 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 09:30:18 -0700 Subject: [PATCH 216/392] core: log netlink link messages --- src/nm-netlink-monitor.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 36cd99e2d0..918d637d72 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -186,6 +186,7 @@ netlink_object_message_handler (struct nl_object *obj, void *arg) struct rtnl_link *filter; struct rtnl_link *link_obj; guint flags; + guint ifidx; filter = rtnl_link_alloc (); if (!filter) { @@ -206,19 +207,17 @@ netlink_object_message_handler (struct nl_object *obj, void *arg) link_obj = (struct rtnl_link *) obj; flags = rtnl_link_get_flags (link_obj); + ifidx = rtnl_link_get_ifindex (link_obj); + + nm_log_dbg (LOGD_HW, "netlink link message: iface idx %d flags 0x%X", ifidx, flags); /* IFF_LOWER_UP is the indicator of carrier status since kernel commit * b00055aacdb172c05067612278ba27265fcd05ce in 2.6.17. */ - if (flags & IFF_LOWER_UP) { - g_signal_emit (G_OBJECT (monitor), - signals[CARRIER_ON], - 0, rtnl_link_get_ifindex (link_obj)); - } else { - g_signal_emit (G_OBJECT (monitor), - signals[CARRIER_OFF], - 0, rtnl_link_get_ifindex (link_obj)); - } + if (flags & IFF_LOWER_UP) + g_signal_emit (G_OBJECT (monitor), signals[CARRIER_ON], 0, ifidx); + else + g_signal_emit (G_OBJECT (monitor), signals[CARRIER_OFF], 0, ifidx); out: rtnl_link_put (filter); From b932dea21b32db2f5c415e759eb3355beb622c54 Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Thu, 8 Apr 2010 10:52:52 -0700 Subject: [PATCH 217/392] po: update Telugu translation (bgo #615042) --- po/te.po | 949 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 896 insertions(+), 53 deletions(-) diff --git a/po/te.po b/po/te.po index 7b3ace2288..811c8ede72 100644 --- a/po/te.po +++ b/po/te.po @@ -1,4 +1,4 @@ -# translation of NetworkManager.master.te.po to Telugu +# translation of te.po to Telugu # Telugu translation of NetworkManager. # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. @@ -6,10 +6,10 @@ # Krishna Babu K , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master.te\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2010-01-29 15:20+0530\n" +"Project-Id-Version: te\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-29 15:19+0530\n" +"PO-Revision-Date: 2010-04-07 14:59+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" @@ -18,6 +18,851 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n\n" "\n" +"\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c: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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "నామము" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "సిస్టమ్ అనుసంధానములు:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "వినియోగదారి అనుసంధానములు:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "దోషము: %s ఆర్గుమెంట్ తప్పిపోయినది." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "దోషము: %s - అటువంటి అనుసంధానము లేదు." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "సిస్టమ్-వ్యాప్త అనుసంధానములు" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "వినియోగదారి అనుసంధానములు" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "తెలియని పారామితి: %s\n" + +#: ../cli/src/connections.c:221 +#, 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 "కాదు" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "క్రియాశీల అనుసంధానములు" + +#: ../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:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "సేవ" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "పరికరములు" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "పరికరము '%s' పైన యెటువంటి క్రియాశీల అనుసంధానము లేదు" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ఎటువంటి క్రియాశీల అనుసంధానము లేదా పరికరము లేదు" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "క్రియాశీలపరచుచున్నది" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "క్రియాశీలపరచబడింది" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "తెలియని" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN అనుసంధానమౌచున్నది (సిద్దపరచు)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN అనుసంధానమౌచున్నది" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN అనుసంధానమైంది" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN అనుసంధానము విఫలమైంది" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN అననుసంధానమైంది" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "తెలియని కారణము" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "ఏదీకాదు" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "వినియోగదారి అననుసంధానింప బడినారు" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "ఆధార నెట్వర్కు అనుసంధానము ఆటంకపరచబడింది" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN సేవ అనుకోకుండా ఆపివేయబడింది" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN సేవ చెల్లని ఆకృతీకరణను తిప్పియిచ్చినది" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "అనుసంధానపు ప్రయత్నం సమయం మించిపోయినది" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN సేవ సమయం లోపల ప్రారంభించబడలేదు" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN సేవ ప్రారంభమగుటకు విఫలమైంది" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "ఏ విలువైన VPN రహస్యాలు లేవు" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "చెల్లని VPN రహస్యాలు" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "అనుసంధానము తీసివేయబడింది" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "స్థితి: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "అనుసంధానము క్రియాశీలపరచబడింది\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "స్థితి: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "దోషము: కాలపరిమితి %d సె మించినది." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "దోషము: '%s' కొరకు క్రియాశీల అనుసంధానమును పొందుటలో విఫలమైంది." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "క్రియాశీల అనుసంధానము స్థితి: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "క్రియాశీల అనుసంధానము పాత్: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "దోషము: తెలియని దోషము: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "దోషము: కాలముగింపు విలువ '%s' చెల్లనిది." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "దోషము: id లేదా uuid తెలుపవలసి వుంది." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "దోషము: ఎటువంటి సూటయ్యే పరికరము కనబడలేదు: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "దోషము: ఏ సూటగు పరికరము కనబడలేదు." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "హెచ్చరిక: అనుసంధానము క్రియాశీలంగా లేదు\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "దోషము: 'con' ఆదేశము '%s' చెల్లునది కాదు." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "దోషము: D-Busకు అనుసంధానము కాలేకపోయినది." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "దోషము: సిస్టమ్ అమరికలను పొందలేక పోయింది." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "దోషము: వినియోగదారి అమరికలను పొందలేక పోయింది." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "దోషము: అనుసంధానములను పొందలేదు: అమరికల సేవలు నడుచుటలేదు." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "నిర్వహించని" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "అందుబాటులోలేని" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "అననుసంధానమైన" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "అనుసంధానమౌచున్నది (సిద్దపడుతోంది)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "అనుసంధానమౌచున్నది (ఆకృతీకరించబడుతోంది)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "అనుసంధానమైంది" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "అనుసంధానము విఫలమైంది" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "తెలియని" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(ఏదీకాదు)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 చిరునామా 0x%X మార్చుటలో దోషము" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, పౌనఃపున్యం(ఫ్రీక్వెన్సీ) %d MHz, రేటు %d Mb/s, బలం(స్ట్రెన్త్) %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", ఎన్క్రిప్టెడ్: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr "ఎంటర్‌ప్రైజ్" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "పరికరము" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "డ్రైవర్" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(తెలియని)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "స్థితి" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW చిరునామా" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" సామర్ధ్యములు:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "కారియర్ గుర్తించబడింది" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "వేగము" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" వైర్‌లెస్ లక్షణములు\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP ఎన్క్రిప్షన్" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA ఎన్క్రిప్షన్" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 ఎన్క్రిప్షన్" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP సైఫర్" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP సైఫర్" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" వైర్‌లెస్ యాక్సిస్ పాయింట్స్ %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = current AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" వైర్డు లక్షణములు\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "కారియర్" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "ఆన్" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "ఆఫ్" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 అమరికలు:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "పరికరముల యొక్క స్థితి" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "దోషము: '%s' ఆర్గుమెంట్ తప్పిపోయినది." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "దోషము: పరికరము '%s' కనబడలేదు." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "సఫలమైంది: పరికరము '%s' సఫలవంతంగా అననుసంధానించబడింది." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "దోషము: పరికరము '%s' (%s) అననుసంధానము విఫలమైంది: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "పరికరము స్థితి: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "దోషము: iface తెలుపవలసి వుంది." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi స్కాన్ జాబితా" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "దోషము: పరికరము '%s' అనునది WiFi పరికరము కాదు." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "పరికరము:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "దోషము: hwaddr తెలుపవలసి వుంది." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "దోషము: హార్డువేర్‌చిరునామా '%s'తో యాక్సెస్ పాయింట్ కనబడలేదు." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP పారామితులు" + +#: ../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 "పౌనఃపున్యము:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "రీతి:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../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 "బలం:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "ఫ్లాగ్స్:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "గోప్యత" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA ఫ్లాగ్స్:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN ఫ్లాగ్స్:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "దోషము: 'dev wifi' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "దోషము: 'dev' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "స్థబ్దుగా(asleep)" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "అనుసంధానమౌచున్నది" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "నెట్వర్కునిర్వాహిక స్థితి" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "నెని నడుచుచున్నది:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "నడుచుచున్నది" + +#: ../cli/src/network-manager.c:104 +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 "నెని వైర్‌లెస్:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "నెని WWAN హార్డువేర్:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "దోషము: చెల్లని 'wifi' పారామితి: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "దోషము: చెల్లని 'wwan' పారామితి: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "దోషము: 'nm' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "ఆబ్జక్టు '%s' తెలియనిది, 'nmcli help' ప్రయత్నించండి." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli సాధనము, వర్షన్ %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "ఐచ్చికము '%s' తెలియనిది, 'nmcli -help' ప్రయత్నించండి." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "సిగ్నల్ %d వచ్చింది, మూసివేయుచున్నది..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "దోషము: నెట్వర్కునిర్వాహికకు అనుసంధానము కాలేకపోయింది." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "సఫలంమైంది" #: ../libnm-util/crypto.c:120 #, c-format @@ -106,7 +951,7 @@ msgstr "IV నాన్-హెక్సాడెసిమల్ సంఖ్య #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "వ్యక్తిగత కీ సైఫర్ '%s' అనునది తెలియనిది." @@ -165,43 +1010,38 @@ msgstr "వివరణ కొరకు IV అమర్చుటలో విఫ msgid "Failed to decrypt the private key: %s / %s." msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: %s / %s." -#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#: ../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 "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: అనుకోని పాడింగ్ పొడవు." -#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "ఎన్క్రిప్టింగ్ కొరకు మెమొరీ కేటాయించలేక పోయింది." #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "ఎన్క్రిప్షన్ సైఫర్ కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "ఎన్క్రిప్షన్ కొరకు సిమెట్రిక్ కీను అమర్చుటలో విఫలమైంది: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది: %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 "డాటాను ఎన్క్రిప్టు చేయుటలో విఫలమైంది: %s / %s." @@ -230,7 +1070,7 @@ msgstr "PKCS#12 ఫైలును డీకోడ్ పరచలేక పో msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ఫైలును నిర్ధారించలేక పోయింది: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "క్రిప్టో యింజన్ సిద్దము చేయుటలో విఫలమైంది: %d." @@ -272,7 +1112,6 @@ msgstr "వ్యక్తిగత కీను డిక్రిప్టు #: ../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 "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: డిక్రిప్టు చేసిన డాటా మరీ పెద్దది." @@ -281,100 +1120,91 @@ msgstr "వ్యక్తిగత కీను డిక్రిప్టు msgid "Failed to finalize decryption of the private key: %d." msgstr "వ్యక్తిగత కీ యొక్క డిక్రిప్షన్ ఖరారు చేయుటలో విఫలమైంది: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../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 "ఎన్క్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దముచేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:371 +#: ../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 "ఎన్క్రిప్షన్ కొరకు సిమ్మెట్రిక్ కీను అమర్చుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "ఎన్క్రిప్షన్ సందర్భమును సిద్దముచేయుటలో విఫలమైంది." -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "ఎన్క్రిప్టు చేయుటకు విఫలమైంది: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "ఎన్క్రిప్టు చేసిన తర్వాత అనుకోని డాటా మొత్తము." -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "సంకేతపదమును UCS2కు మార్చలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 డీకోడర్‌ను సిద్దము చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ఫైలు డీకోడ్ చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ఫైలు నిర్దారించలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:556 -#| msgid "Could not decode private key." +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1802 #, c-format -#| msgid "Not enough memory to decrypt private key." msgid "Not enough memory to make encryption key." msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." -#: ../libnm-util/nm-utils.c:1633 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:1912 msgid "Could not allocate memory for PEM file creation." msgstr "మెమొరీను PEM ఫైలు సృష్టీకరణ కొరకు కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:1936 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:1955 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." #: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 +#: ../src/nm-netlink-monitor.c:582 #: ../src/ip6-manager/nm-netlink-listener.c:352 #, c-format msgid "error processing netlink message: %s" @@ -405,21 +1235,21 @@ msgstr "లింకు స్థితిని పర్యవేక్షి msgid "error occurred while waiting for data on socket" msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 #, c-format msgid "error updating link cache: %s" msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:494 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# నెట్వర్కునిర్వాహిక ద్వారా సృష్టించబడింది\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -428,21 +1258,35 @@ msgstr "" "# %sనుండి కలుపబడింది\n" "\n" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ఎటువంటి వుపయోగకర DHCP క్లైంట్ కనుగొనబడలేదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' కనుగొనబడ గలదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' కనుగొనబడ గలదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "మద్దతీయని DHCP క్లైంట్ '%s'" + #: ../src/ip6-manager/nm-netlink-listener.c:200 #, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" msgid "unable to allocate netlink handle: %s" msgstr "నెట్‌లింక్ సంభాలికను కేటాయించలేక పోయింది: %s" #: ../src/ip6-manager/nm-netlink-listener.c:210 #, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" msgid "unable to connect to netlink: %s" msgstr "నెట్‌లింక్‌కు అనుసంధానము కాలేకపోయింది: %s" #: ../src/ip6-manager/nm-netlink-listener.c:307 #, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" msgid "unable to join netlink group: %s" msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" @@ -454,12 +1298,12 @@ msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు స msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 msgid "System" msgstr "సిస్టమ్" @@ -484,7 +1328,6 @@ msgid "System policy prevents modification of system settings" msgstr "సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents modification of the persistent system hostname" msgstr "నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది" From 0d8174dfa69f295b1f930fd4e9f8ce4791a0b335 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 13:29:07 -0700 Subject: [PATCH 218/392] logging: fix build on 32-bit platforms --- src/logging/nm-logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 3e3efa4760..b1d1b058b8 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -199,14 +199,14 @@ void _nm_log (const char *loc, if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) { g_get_current_time (&tv); - syslog (LOG_DEBUG, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + syslog (LOG_DEBUG, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); } else if ((log_level & LOGL_INFO) && (level == LOGL_INFO)) syslog (LOG_INFO, " %s\n", msg); else if ((log_level & LOGL_WARN) && (level == LOGL_WARN)) syslog (LOG_WARNING, " %s\n", msg); else if ((log_level & LOGL_ERR) && (level == LOGL_ERR)) { g_get_current_time (&tv); - syslog (LOG_ERR, " [%zu.%zu] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + syslog (LOG_ERR, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); } g_free (msg); } From 8247ecc524267a06bf5ec3e3d3b7f4237e035416 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 13:56:37 -0700 Subject: [PATCH 219/392] doc: fix libnm-glib doc generation --- docs/libnm-glib/Makefile.am | 17 ++++++++------ docs/libnm-glib/libnm-glib-docs.sgml | 35 ++++++++++++++++------------ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am index 297722a46e..96ff66eee3 100644 --- a/docs/libnm-glib/Makefile.am +++ b/docs/libnm-glib/Makefile.am @@ -34,23 +34,26 @@ IGNORE_HFILES= \ nm-device-private.h \ nm-object-cache.h \ nm-object-private.h \ + nm-remote-connection-private.h \ nm-types-private.h \ nm-access-point-bindings.h \ + nm-active-connection-bindings.h \ nm-client-bindings.h \ nm-device-bindings.h \ + nm-device-bt-bindings.h \ nm-device-ethernet-bindings.h \ nm-device-wifi-bindings.h \ - nm-exported-connection-glue.h \ + nm-dhcp4-config-bindings.h \ + nm-dhcp6-config-bindings.h \ nm-exported-connection-bindings.h \ - nm-settings-glue.h \ + nm-exported-connection-glue.h \ + nm-ip4-config-bindings.h \ + nm-ip6-config-bindings.h \ nm-settings-bindings.h \ + nm-settings-glue.h \ nm-settings-system-bindings.h \ nm-vpn-connection-bindings.h \ - nm-vpn-plugin-glue.h \ - nm-active-connection-bindings.h \ - nm-ip4-config-bindings.h \ - nm-dhcp4-config-bindings.h \ - nm-ip4-config-bindings.h + nm-vpn-plugin-glue.h # Images to copy into HTML directory. HTML_IMAGES = diff --git a/docs/libnm-glib/libnm-glib-docs.sgml b/docs/libnm-glib/libnm-glib-docs.sgml index 8fe5a1d43a..0ea21102ee 100644 --- a/docs/libnm-glib/libnm-glib-docs.sgml +++ b/docs/libnm-glib/libnm-glib-docs.sgml @@ -5,35 +5,40 @@ libnm-glib Reference Manual - for libnm-glib [VERSION] + for libnm-glib 0.8 The latest version of this documentation can be found on-line at - http://[SERVER]/libnm-glib/. + http://projects.gnome.org/NetworkManager/developers/libnm-glib/08/. - [Insert title here] + libnm-glib Objects + - + + + + + + + - + + + + + + + + + - - - - - - - - - - From f5adc0f62b92af9acda29bc197e863c8d9a50772 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 14:00:08 -0700 Subject: [PATCH 220/392] doc: rearrange libnm-glib doc sections --- docs/libnm-glib/libnm-glib-docs.sgml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/libnm-glib/libnm-glib-docs.sgml b/docs/libnm-glib/libnm-glib-docs.sgml index 0ea21102ee..b4e5dac25a 100644 --- a/docs/libnm-glib/libnm-glib-docs.sgml +++ b/docs/libnm-glib/libnm-glib-docs.sgml @@ -13,25 +13,25 @@ libnm-glib Objects - - - - + + + + + + + + - - - - From dcda7e7ab2f345fd2b819268321b15dd0eaf8282 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 14:03:04 -0700 Subject: [PATCH 221/392] doc: update libnm-util doc locations --- docs/libnm-util/libnm-util-docs.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/libnm-util/libnm-util-docs.sgml b/docs/libnm-util/libnm-util-docs.sgml index 3758b6eb59..78b931d8a2 100644 --- a/docs/libnm-util/libnm-util-docs.sgml +++ b/docs/libnm-util/libnm-util-docs.sgml @@ -8,9 +8,9 @@ libnm-util Reference Manual - for libnm-util [VERSION] + for libnm-util 0.8 The latest version of this documentation can be found on-line at - http://[SERVER]/libnm-util/. + http://projects.gnome.org/NetworkManager/developers/libnm-util/08/. From 78f7ef11151f548fa39a3b4ed0732a335c777094 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 14:49:56 -0700 Subject: [PATCH 222/392] logging: use INFO level for debug messages By default most distros won't log debug messages to syslog; but we want them logged when the user explicitly requests them via the logging API and config options in NM. Half the point of doing more logging was to make it easier for users to get logs out of NM, and having to edit syslog configuration makes it all pointless. --- src/logging/nm-logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index b1d1b058b8..acfca1b46f 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -199,7 +199,7 @@ void _nm_log (const char *loc, if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) { g_get_current_time (&tv); - syslog (LOG_DEBUG, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + syslog (LOG_INFO, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); } else if ((log_level & LOGL_INFO) && (level == LOGL_INFO)) syslog (LOG_INFO, " %s\n", msg); else if ((log_level & LOGL_WARN) && (level == LOGL_WARN)) From ea05e9001627452a6bef5a168d1897360af48ed9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 15:00:32 -0700 Subject: [PATCH 223/392] ethernet: fix debug log message --- src/nm-device-ethernet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 69d0539dc5..f4581e9ac6 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -311,7 +311,7 @@ constructor (GType type, self = NM_DEVICE (object); priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - nm_log_dbg (LOGD_HW | LOGD_ETHER, "(%s): kernel interface #%d", + nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); caps = nm_device_get_capabilities (self); From 3592e59cabbb8363b699cf4886a71502b7548d74 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 15:51:32 -0700 Subject: [PATCH 224/392] wifi: fix log message --- src/nm-device-wifi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 3e7a820476..cccaf1194e 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -3517,7 +3517,8 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); if (state < NM_DEVICE_STATE_UNAVAILABLE) { - nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by UNMANAGED state", + nm_log_dbg (LOGD_WIFI, "(%s): %s blocked by UNMANAGED state", + enabled ? "enable" : "disable", nm_device_get_iface (NM_DEVICE (device))); return; } From c57c40a621003265a46ed07a558c27baf6e258a1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 15:51:54 -0700 Subject: [PATCH 225/392] core: fix device log message in UNAVAILABLE state --- src/nm-device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index e10c9049ed..280d4e4105 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3390,9 +3390,12 @@ nm_device_state_changed (NMDevice *device, * reasons. */ if (nm_device_is_available (device)) { - nm_log_dbg (LOGD_WIFI, "(%s): device is available, will transition to DISCONNECTED", + nm_log_dbg (LOGD_DEVICE, "(%s): device is available, will transition to DISCONNECTED", nm_device_get_iface (device)); priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device); + } else { + nm_log_dbg (LOGD_DEVICE, "(%s): device not yet available for transition to DISCONNECTED", + nm_device_get_iface (device)); } break; case NM_DEVICE_STATE_ACTIVATED: From 38ef723df33d2776345116b6cb78a29493dafbd9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Apr 2010 18:23:43 -0700 Subject: [PATCH 226/392] wifi: fix disabled wifi devices on resume (rh #578141) RFKILL_TYPE_WLAN is 0, and we while we had allocated the structure for WIMAX rfkill in the manager's priv->radio_states, we hadn't filled it in. That meant that priv->radio_states[RFKILL_TYPE_WIMAX].rtype was 0, and thus various operations thought that wifi devices were wimax devices, and since WiMAX rfkill is never updated because it's not yet used, wifi would never be enabled after resume. --- src/nm-manager.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 3189e3f76f..a24606ad99 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1407,13 +1407,19 @@ manager_rfkill_update_one_type (NMManager *self, break; } + if (rstate->desc) { + nm_log_dbg (LOGD_RFKILL, "%s hw-enabled %d enabled %d", + rstate->desc, new_he, new_e); + } + if (new_he != rstate->hw_enabled) { nm_log_info (LOGD_RFKILL, "%s now %s by radio killswitch", rstate->desc, (new_e && new_he) ? "enabled" : "disabled"); rstate->hw_enabled = new_he; - g_object_notify (G_OBJECT (self), rstate->hw_prop); + if (rstate->hw_prop) + g_object_notify (G_OBJECT (self), rstate->hw_prop); } manager_set_radio_enabled (self, rstate, new_e); } @@ -2715,6 +2721,12 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) gboolean enabled = (rstate->hw_enabled && rstate->enabled); RfKillType devtype = RFKILL_TYPE_UNKNOWN; + if (rstate->desc) { + nm_log_dbg (LOGD_RFKILL, "%s %s devices (hw_enabled %d, enabled %d)", + enabled ? "enabling" : "disabling", + rstate->desc, rstate->hw_enabled, rstate->enabled); + } + g_object_get (G_OBJECT (device), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); if (devtype == rstate->rtype) nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), enabled); @@ -2899,6 +2911,10 @@ nm_manager_start (NMManager *self) manager_set_radio_enabled (self, rstate, rstate->enabled && enabled); } + /* Log overall networking status - asleep/running */ + nm_log_info (LOGD_CORE, "Networking is %s by state file", + priv->sleeping ? "disabled" : "enabled"); + system_unmanaged_devices_changed_cb (priv->sys_settings, NULL, self); system_hostname_changed_cb (priv->sys_settings, NULL, self); system_query_connections (self); @@ -3154,6 +3170,14 @@ nm_manager_init (NMManager *manager) priv->radio_states[RFKILL_TYPE_WWAN].other_enabled_func = nm_manager_get_modem_enabled_state; priv->radio_states[RFKILL_TYPE_WWAN].rtype = RFKILL_TYPE_WWAN; + priv->radio_states[RFKILL_TYPE_WIMAX].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WIMAX].key = "WiMAXEnabled"; + priv->radio_states[RFKILL_TYPE_WIMAX].prop = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].hw_prop = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].desc = "WiMAX"; + priv->radio_states[RFKILL_TYPE_WIMAX].other_enabled_func = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].rtype = RFKILL_TYPE_WIMAX; + for (i = 0; i < RFKILL_TYPE_MAX; i++) priv->radio_states[i].hw_enabled = TRUE; From 618c5f1b086c3b4f18a13dd2c0dd1e2604da1c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Sun, 11 Apr 2010 21:24:59 -0700 Subject: [PATCH 227/392] po: update Spanish translation (bgo #615374) --- po/es.po | 66 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/po/es.po b/po/es.po index 9e0a29ca44..6919c06759 100644 --- a/po/es.po +++ b/po/es.po @@ -11,8 +11,8 @@ msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-02-26 03:24+0000\n" -"PO-Revision-Date: 2010-03-28 18:46+0200\n" +"POT-Creation-Date: 2010-04-09 03:24+0000\n" +"PO-Revision-Date: 2010-04-10 19:52+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -1186,85 +1186,91 @@ 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:1802 +#: ../libnm-util/nm-utils.c:1818 #, 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:1912 +#: ../libnm-util/nm-utils.c:1928 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:1924 +#: ../libnm-util/nm-utils.c:1940 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "No se pudo asignar memoria para escribir IV en el archivo PEM." -#: ../libnm-util/nm-utils.c:1936 +#: ../libnm-util/nm-utils.c:1952 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "No se pudo asignar memoria para escribir la clave cifrada en el archivo PEM." -#: ../libnm-util/nm-utils.c:1955 +#: ../libnm-util/nm-utils.c:1971 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 #, c-format msgid "error processing netlink message: %s" msgstr "error al procesar el mensaje de netlink: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:259 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "no se puede asignar el manejador netlink para monitorizar el estado del " "enlace: %s" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:269 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "no se puede conectar con netlink para monitorizar el estado del enlace: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:277 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" "no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:285 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "no se puede asignar el enlace a la caché de netlink para monitorizar el " "estado del enlace: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 msgid "error occurred while waiting for data on socket" msgstr "ha ocurrido un error mientras esperaban datos en un socket" -#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 #, c-format msgid "error updating link cache: %s" msgstr "error al actualizar el enlace caché: %s" -#: ../src/main.c:494 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +#: ../src/main.c:558 +#, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Use --help para ver una lista de las opciones válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -1290,28 +1296,38 @@ msgstr "no se pudo encontrar «dhcpd»." msgid "unsupported DHCP client '%s'" msgstr "no se soporta el cliente de DHCP «%s»" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/ip6-manager/nm-netlink-listener.c:199 #, c-format msgid "unable to allocate netlink handle: %s" msgstr "no se puede asignar el manejador netlink: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/ip6-manager/nm-netlink-listener.c:209 #, c-format msgid "unable to connect to netlink: %s" msgstr "no se puede conectar con netlink: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/ip6-manager/nm-netlink-listener.c:306 #, c-format msgid "unable to join netlink group: %s" msgstr "no pudo unirse al grupo netlink: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nivel de registro «%s» desconocido" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Dominio de registro «%s» desconocido" + +#: ../src/named-manager/nm-named-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " "servidores de nombres." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:316 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." From ab529302a7bb1dbf819a64c4a7a80fc0706c02c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 12 Apr 2010 17:15:28 +0200 Subject: [PATCH 228/392] ifcfg-rh: fix setting MTU to "automatic" for wired connections (rh #569319) ifcfg-rh plugin was not able to reset MTU to "automatic" if it had been set to a value, for wired connection. This fix removes "MTU" variable from the ifcfg-* file when mtu is 0. --- system-settings/plugins/ifcfg-rh/writer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 330bbf044e..74f3a59a56 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -807,6 +807,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (tmp); } + svSetValue (ifcfg, "MTU", NULL, FALSE); mtu = nm_setting_wired_get_mtu (s_wired); if (mtu) { tmp = g_strdup_printf ("%u", mtu); From 9b9331f53d562af20c73489635dbdd03d25f534d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 12 Apr 2010 17:48:37 +0200 Subject: [PATCH 229/392] logging: fix log level flag values (LOGL_*) 0x00000000 caused that ERR level (nm_log_err()) gets never logged. --- src/logging/nm-logging.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 4c381a24a3..2dc52d1e53 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -57,10 +57,10 @@ enum { /* Log levels */ enum { - LOGL_ERR = 0x00000000, - LOGL_WARN = 0x00000001, - LOGL_INFO = 0x00000002, - LOGL_DEBUG = 0x00000004 + LOGL_ERR = 0x00000001, + LOGL_WARN = 0x00000002, + LOGL_INFO = 0x00000004, + LOGL_DEBUG = 0x00000008 }; #define NM_LOGGING_ERROR (nm_logging_error_quark ()) From 9000c688393af8f797a1a788ac8b4fc1686bf130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 12 Apr 2010 17:55:44 +0200 Subject: [PATCH 230/392] logging: change default level to be true INFO level Using LOGL_INFO | LOGL_WARN | LOGL_ERR as default to log the same values as though "--log-level=INFO" were specified. --- src/logging/nm-logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index acfca1b46f..ac30eb42c6 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -37,7 +37,7 @@ #include "nm-logging.h" -static guint32 log_level = LOGL_INFO; +static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR; static guint32 log_domains = \ LOGD_HW | LOGD_RFKILL | LOGD_ETHER | LOGD_WIFI | LOGD_BT | LOGD_MB | \ LOGD_DHCP4 | LOGD_DHCP6 | LOGD_PPP | LOGD_IP4 | LOGD_IP6 | LOGD_AUTOIP4 | \ From dc7fe96e3f34bcf7ebd2f7c3cbbb1930bf099e83 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 12 Apr 2010 16:24:07 -0700 Subject: [PATCH 231/392] ifcfg-rh: fix IPv6-only configurations (rh #538499) --- system-settings/plugins/ifcfg-rh/reader.c | 58 ++-- .../tests/network-scripts/Makefile.am | 3 +- .../ifcfg-test-wired-ipv6-only | 14 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 287 +++++++++++++++++- system-settings/plugins/ifcfg-rh/writer.c | 29 +- 5 files changed, 364 insertions(+), 27 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a445d5b177..32575f3953 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.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) 2008 - 2009 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -1115,6 +1115,7 @@ static NMSetting * make_ip4_setting (shvarFile *ifcfg, const char *network_file, const char *iscsiadm_path, + gboolean valid_ip6_config, GError **error) { NMSettingIP4Config *s_ip4 = NULL; @@ -1192,14 +1193,17 @@ make_ip4_setting (shvarFile *ifcfg, g_set_error (error, ifcfg_plugin_error_quark (), 0, "Unknown BOOTPROTO '%s'", value); g_free (value); - goto error; + goto done; } g_free (value); } else { char *tmp_ip4, *tmp_prefix, *tmp_netmask; - /* If there is no BOOTPROTO, no IPADDR, no PREFIX, and no NETMASK, - * assume DHCP is to be used. Happens with minimal ifcfg files like: + /* If there is no BOOTPROTO, no IPADDR, no PREFIX, no NETMASK, but + * valid IPv6 configuration, assume that IPv4 is disabled. Otherwise, + * if there is no IPv6 configuration, assume DHCP is to be used. + * Happens with minimal ifcfg files like the following that anaconda + * sometimes used to write out: * * DEVICE=eth0 * HWADDR=11:22:33:44:55:66 @@ -1208,8 +1212,14 @@ make_ip4_setting (shvarFile *ifcfg, tmp_ip4 = svGetValue (ifcfg, "IPADDR", FALSE); tmp_prefix = svGetValue (ifcfg, "PREFIX", FALSE); tmp_netmask = svGetValue (ifcfg, "NETMASK", FALSE); - if (!tmp_ip4 && !tmp_prefix && !tmp_netmask) + if (!tmp_ip4 && !tmp_prefix && !tmp_netmask) { + if (valid_ip6_config) { + /* Nope, no IPv4 */ + goto done; + } + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + } g_free (tmp_ip4); g_free (tmp_prefix); g_free (tmp_netmask); @@ -1229,7 +1239,7 @@ make_ip4_setting (shvarFile *ifcfg, for (i = 1; i < 256; i++) { addr = read_full_ip4_address (ifcfg, network_file, i, error); if (error && *error) - goto error; + goto done; if (!addr) break; @@ -1271,7 +1281,7 @@ make_ip4_setting (shvarFile *ifcfg, } if (!tmp_success) { g_free (tag); - goto error; + goto done; } g_clear_error (error); } @@ -1305,7 +1315,7 @@ make_ip4_setting (shvarFile *ifcfg, if (!route_path) { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Could not get route file path for '%s'", ifcfg->fileName); - goto error; + goto done; } /* First test new/legacy syntax */ @@ -1319,7 +1329,7 @@ make_ip4_setting (shvarFile *ifcfg, route = read_one_ip4_route (route_ifcfg, network_file, i, error); if (error && *error) { svCloseFile (route_ifcfg); - goto error; + goto done; } if (!route) break; @@ -1334,7 +1344,7 @@ make_ip4_setting (shvarFile *ifcfg, read_route_file_legacy (route_path, s_ip4, error); g_free (route_path); if (error && *error) - goto error; + goto done; } /* Legacy value NM used for a while but is incorrect (rh #459370) */ @@ -1360,7 +1370,7 @@ make_ip4_setting (shvarFile *ifcfg, return NM_SETTING (s_ip4); -error: +done: g_object_unref (s_ip4); return NULL; } @@ -3058,6 +3068,7 @@ connection_from_file (const char *filename, NMSetting *s_ip4, *s_ip6; const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; + gboolean ip6_used = FALSE; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (unmanaged != NULL, NULL); @@ -3161,22 +3172,27 @@ connection_from_file (const char *filename, if (!connection || *unmanaged) goto done; - s_ip4 = make_ip4_setting (parsed, network_file, iscsiadm_path, error); - if (*error) { - g_object_unref (connection); - connection = NULL; - goto done; - } else if (s_ip4) { - nm_connection_add_setting (connection, s_ip4); - } - s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, error); if (*error) { g_object_unref (connection); connection = NULL; goto done; - } else if (s_ip6) + } else if (s_ip6) { + const char *method; + nm_connection_add_setting (connection, s_ip6); + method = nm_setting_ip6_config_get_method (NM_SETTING_IP6_CONFIG (s_ip6)); + if (method && strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + ip6_used = TRUE; + } + + s_ip4 = make_ip4_setting (parsed, network_file, iscsiadm_path, ip6_used, error); + if (*error) { + g_object_unref (connection); + connection = NULL; + goto done; + } else if (s_ip4) + nm_connection_add_setting (connection, s_ip4); /* iSCSI / ibft connections are read-only since their settings are * stored in NVRAM and can only be changed in BIOS. 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 b5c94dd3b5..f6879633df 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -57,7 +57,8 @@ EXTRA_DIST = \ route6-test-wired-ipv6-manual \ ifcfg-test-wired-static-no-prefix-8 \ ifcfg-test-wired-static-no-prefix-16 \ - ifcfg-test-wired-static-no-prefix-24 + ifcfg-test-wired-static-no-prefix-24 \ + ifcfg-test-wired-ipv6-only check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only new file mode 100644 index 0000000000..59ec32e5b6 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only @@ -0,0 +1,14 @@ +# Intel Corporation 82567LM Gigabit Network Connection +TYPE=Ethernet +DEVICE=eth2 +HWADDR=00:11:22:33:44:ee +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DNS1=1:2:3:4::a +DOMAIN="lorem.com ipsum.org dolor.edu" +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR="1001:abba::1234/56" + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 8855a32191..cfe93d6ec0 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.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) 2008 - 2009 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -2142,6 +2142,155 @@ test_read_wired_ipv6_manual (void) g_object_unref (connection); } +#define TEST_IFCFG_WIRED_IPV6_ONLY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-ipv6-only" + +static void +test_read_wired_ipv6_only (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_id = "System test-wired-ipv6-only"; + const char *expected_address1 = "1001:abba::1234"; + guint32 expected_prefix1 = 56; + const char *expected_dns1 = "1:2:3:4::a"; + NMIP6Address *ip6_addr; + struct in6_addr addr; + + connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_ONLY, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-ipv6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); + + ASSERT (unmanaged == FALSE, + "wired-ipv6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-ipv6-only-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-ipv6-only-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-ipv6-only-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-ipv6-only-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 == NULL, + "wired-ipv6-only-verify-ip4", "failed to verify %s: unexpected %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-ipv6-only-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + /* IP addresses */ + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1, + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "wired-ipv6-only-verify-ip6", "failed to verify %s: missing IP6 address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == expected_prefix1, + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_address1, &addr) > 0, + "wired-ipv6-only-verify-ip6", "failed to verify %s: couldn't convert IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr), + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected IP6 address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 1, + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected_dns1, &addr) > 0, + "wired-ipv6-only-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr), + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + /* DNS domains - none as domains are stuffed to 'ipv4' setting */ + ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 0, + "wired-ipv6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + #define TEST_IFCFG_ONBOOT_NO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-onboot-no" static void @@ -5108,6 +5257,140 @@ test_write_wired_dhcp (void) g_object_unref (reread); } +static void +test_write_wired_static_ip6_only (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP6Config *s_ip6; + static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; + GByteArray *mac; + char *uuid; + guint64 timestamp = 0x12344433L; + struct in6_addr ip6; + struct in6_addr dns6; + NMIP6Address *addr6; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + + inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6); + inet_pton (AF_INET6, "fade:0102:0103::face", &dns6); + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wired-static-ip6-only-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired Static IP6 Only", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + mac = g_byte_array_sized_new (sizeof (tmpmac)); + g_byte_array_append (mac, &tmpmac[0], sizeof (tmpmac)); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); + g_byte_array_free (mac, TRUE); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + + /* Add addresses */ + addr6 = nm_ip6_address_new (); + nm_ip6_address_set_address (addr6, &ip6); + nm_ip6_address_set_prefix (addr6, 11); + nm_setting_ip6_config_add_address (s_ip6, addr6); + nm_ip6_address_unref (addr6); + + /* DNS server */ + nm_setting_ip6_config_add_dns (s_ip6, &dns6); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-static-ip6-only-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-static-ip6-only-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-static-ip6-only-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wired-static-ip6-only-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wired-static-ip6-only-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP4_CONFIG) == NULL, + "wired-static-ip6-only-write-reread-verify", "unexpected IPv4 setting"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wired-static-ip6-only-write", "written and re-read connection weren't the same."); + + if (route6file) + unlink (route6file); + + g_free (testfile); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); + g_object_unref (reread); +} + + #define TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-static-routes-legacy" static void @@ -7813,6 +8096,7 @@ int main (int argc, char **argv) test_read_wired_static_routes (); test_read_wired_static_routes_legacy (); test_read_wired_ipv6_manual (); + test_read_wired_ipv6_only (); test_read_onboot_no (); test_read_wired_8021x_peap_mschapv2 (); test_read_wifi_open (); @@ -7835,6 +8119,7 @@ int main (int argc, char **argv) test_read_wifi_wep_eap_ttls_chap (); test_write_wired_static (); + test_write_wired_static_ip6_only (); test_write_wired_static_routes (); test_read_write_static_routes_legacy (); test_write_wired_dhcp (); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 74f3a59a56..cc24a96f58 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -911,9 +911,30 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); if (!s_ip4) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Missing '%s' setting", NM_SETTING_IP4_CONFIG_SETTING_NAME); - return FALSE; + int result; + + /* IPv4 disabled, clear IPv4 related parameters */ + svSetValue (ifcfg, "BOOTPROTO", NULL, FALSE); + for (i = 0; i < 254; i++) { + if (i == 0) { + addr_key = g_strdup ("IPADDR"); + prefix_key = g_strdup ("PREFIX"); + gw_key = g_strdup ("GATEWAY"); + } else { + addr_key = g_strdup_printf ("IPADDR%d", i + 1); + prefix_key = g_strdup_printf ("PREFIX%d", i + 1); + gw_key = g_strdup_printf ("GATEWAY%d", i + 1); + } + + svSetValue (ifcfg, addr_key, NULL, FALSE); + svSetValue (ifcfg, prefix_key, NULL, FALSE); + svSetValue (ifcfg, gw_key, NULL, FALSE); + } + + route_path = utils_get_route_path (ifcfg->fileName); + result = unlink (route_path); + g_free (route_path); + return TRUE; } value = nm_setting_ip4_config_get_method (s_ip4); From 963ae366360bdbddca69c5a87e3ca2949fb59032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 13 Apr 2010 15:57:11 +0200 Subject: [PATCH 232/392] man: manpage updates and cleanups --- man/NetworkManager.8.in | 10 +++++----- man/NetworkManager.conf.5.in | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in index 4cd64c753a..a6be073170 100644 --- a/man/NetworkManager.8.in +++ b/man/NetworkManager.8.in @@ -8,7 +8,7 @@ .SH NAME NetworkManager \- network management daemon .SH SYNOPSIS -.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] [\-\-log-level=] [\-\-log-domain=,,...] +.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] [\-\-log\-level=] [\-\-log\-domains=,,...] .SH DESCRIPTION The \fINetworkManager\fP daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network @@ -55,7 +55,7 @@ The system hostname has been updated. Use gethostname(2) to retrieve it. .SH OPTIONS The following options are supported: .TP -.I "\-\-no-daemon" +.I "\-\-no\-daemon" Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog. .TP @@ -82,13 +82,13 @@ preference over plugins specified in the configuration file. Currently supporte plugins are: keyfile, ifcfg\-rh, ifcfg\-suse, ifupdown. See \fBNetworkManager.conf\fP(5) for more information on the plugins. .TP -.I "\-\-log-level= +.I "\-\-log\-level= Sets how much information NetworkManager sends to the log destination (usually syslog's "daemon" facility). By default, only informational, warning, and error messages are logged. See \fBNetworkManager.conf\fP(5) for more information on log levels and domains. .TP -.I "\-\-log-domains=,, ... +.I "\-\-log\-domains=,, ... Sets which operations are logged to the log destination (usually syslog). By default, most domains are logging-enabled. See \fBNetworkManager.conf\fP(5) for more information on log levels and domains. @@ -96,7 +96,7 @@ more information on log levels and domains. The following environment variables are supported to help debugging. When used in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helper output to stdout) these can quickly help pinpoint the source of connection -issues. Also see the \-\-log- and \-\-log-domains to enable debug logging inside +issues. Also see the \-\-log\-level and \-\-log\-domains to enable debug logging inside NetworkManager itself. .TP .I "NM_PPP_DEBUG" diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index 783bafbda6..c3af611675 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -16,8 +16,8 @@ where depends on your distribution or build. .SH DESCRIPTION .P .I NetworkManager.conf -is a configuration file for NetworkManager. As the name suggests, it configures -how NetworkManager handles system-wide connection settings. The location of +is a configuration file for NetworkManager. It is used to set up various +aspects of NetworkManager's behavior. The location of the file may be changed through use of the "\-\-config=" argument for \fBNetworkManager\fP (8). @@ -81,11 +81,26 @@ plugin is only provided for simple backward compatibility with SUSE and OpenSUSE Most setups should be using the \fIkeyfile\fP plugin instead. The \fIifcfg\-suse\fP plugin supports reading wired and WiFi connections, but does not support saving any connection types. .RE +.TP +.B dhcp=\fIdhclient\fP | \fIdhcpcd\fP +This key sets up what DHCP client NetworkManager will use. Presently +\fIdhclient\fP and \fIdhcpcd\fP are supported. The client configured here should +be available on your system too. If this key is missing, available DHCP clients +are looked for in this order: dhclient, dhcpcd. .SS [keyfile] This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. .TP .B hostname=\fI\fP Set a persistent hostname when using the \fIkeyfile\fP plugin. +.TP +.B unmanaged-devices=\fImac:\fP;\fImac:\fP;... +Set devices that should be ignored by NetworkManager when using the \fIkeyfile\fP +plugin. Devices are specified in the following format: "mac:", where + is MAC address of the device to be ignored, in lowercase. Multiple +entries are separated by a semicolon. Example: +.nf +unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1e:65:30:d1:c4 +.fi .SS [ifupdown] This section contains ifupdown-specific options and thus only has effect when using \fIifupdown\fP plugin. .TP @@ -99,7 +114,7 @@ some other interface. When the option is missing, \fIfalse\fP value is taken as default. .SS [logging] This section controls NetworkManager's logging. Any settings here are -overridden by the --log-level and --log-domain command-line options. +overridden by the \-\-log\-level and \-\-log\-domains command-line options. .TP .B level=\fI\fP One of [ERR, WARN, INFO, DEBUG]. The ERR level logs only critical errors. WARN From 6234c66bc98e8232e2ab838429297e8c61307695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 14 Apr 2010 23:40:52 +0200 Subject: [PATCH 233/392] man: add man page for nmcli --- configure.ac | 1 + man/Makefile.am | 6 +- man/nmcli.1.in | 321 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 man/nmcli.1.in diff --git a/configure.ac b/configure.ac index f5872c1b0c..e6b36460f7 100644 --- a/configure.ac +++ b/configure.ac @@ -498,6 +498,7 @@ man/NetworkManager.8 man/NetworkManager.conf.5 man/nm-system-settings.conf.5 man/nm-tool.1 +man/nmcli.1 po/Makefile.in policy/Makefile docs/Makefile diff --git a/man/Makefile.am b/man/Makefile.am index 670d9a741a..aa6bfdda1f 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -2,11 +2,13 @@ man_MANS = \ NetworkManager.8 \ NetworkManager.conf.5 \ nm-system-settings.conf.5 \ - nm-tool.1 + nm-tool.1 \ + nmcli.1 EXTRA_DIST = \ $(man_MANS) \ NetworkManager.8.in \ NetworkManager.conf.5.in \ nm-system-settings.conf.5.in \ - nm-tool.1.in + nm-tool.1.in \ + nmcli.1.in diff --git a/man/nmcli.1.in b/man/nmcli.1.in new file mode 100644 index 0000000000..056b5bdd40 --- /dev/null +++ b/man/nmcli.1.in @@ -0,0 +1,321 @@ +.\" nmcli (1) manual page +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH NMCLI "1" "14 April 2010" + +.SH NAME +nmcli \- command-line tool for controlling NetworkManager +.SH SYNOPSIS +.ad l +.B nmcli +.RI " [ " OPTIONS " ] " OBJECT " { " COMMAND " | " +.BR help " } " +.sp + +.IR OBJECT " := { " +.BR nm " | " con " | " dev " } " +.sp + +.IR OPTIONS " := { " +.br +\fB\-t\fR[\fIerse\fR] +.br +\fB\-p\fR[\fIretty\fR] +.br +\fB\-m\fR[\fImode\fR] tabular | multiline +.br +\fB\-f\fR[\fIields\fR] | all | common +.br +\fB\-e\fR[\fIscape\fR] yes | no +.br +\fB\-v\fR[\fIersion\fR] +.br +\fB\-h\fR[\fIelp\fR] +.br +.RI "}" + +.SH DESCRIPTION +.B nmcli +is a command-line tool for controlling NetworkManager and getting its status. +It is not meant as a replacement of \fInm-applet\fP or other similar clients. +Rather it's a complementary utility to these programs. +The main \fInmcli\fP's usage is on servers, headless machines or just for +power users who prefer the command line. +.P +The use cases comprise: +.IP \(em 4 +Initscripts: ifup/ifdown can utilize NetworkManager via \fInmcli\fP instead of +having to manage connections itself and possible interfere with NetworkManager. +.IP \(em 4 +Servers, headless machines: No GUI is available; then \fInmcli\fP is used to +talk directly to NetworkManager and control only system-wide connections. +.IP \(em 4 +User sessions: For this case, \fInmcli\fP can talk to \fInm-applet\fP to find +user connections. It can still talk directly to NetworkManager for manipulating +these connections. As \fInmcli\fP doesn't have direct access to user +configuration data in GConf, \fInm-applet\fP handles that itself. That may, +for example, cause the applet to pop up keyring dialogs when secrets are needed. +.SS \fIOPTIONS\fP +.TP +.B \-t, \-\-terse +Output is terse. This mode is designed and suitable for computer (script) +processing. +.TP +.B \-p, \-\-pretty +Output is pretty. This causes \fInmcli\fP to produce easy readable outputs +for humans, i.e. values are aligned, headers are printed, etc. +.TP +.B \-m, \-\-mode tabular | multiline +Switch between \fItabular\fP and \fImultiline\fP output. +If omitted, default is \fItabular\fP for most commands. For the commands +producing more structured information, that cannot be displayed on a single +line, default is \fImultiline\fP. Currenly, they are: +.br +.nf + 'nmcli con list id|uuid ' + 'nmcli dev list' +.fi +\fItabular\fP - Output is a table where each line describes a single entry. +Columns define particular properties of the entry. +.br +\fImultiline\fP - Each entry comprises more lines, each property on its own line. +The values are prefixed with the property name. +.TP +.B \-f, \-\-fields | all | common +This option is used to specify what fields (column names) should be printed. +Valid field names differ for specific commands. List available fields by +providing an invalid value to the \fI--fields\fP option. +.br +\fIall\fP is used to print all valid field values of the command. +\fIcommon\fP is used to print common field values of the command. +If omitted, default is \fIcommon\fP. +The option is mandatory when \fI--terse\fP is used. In this case, generic +values \fIall\fP and \fIcommon\fP cannot be used. (This is to maintain +compatibility when new fields are added in the future). +.TP +.B \-e, \-\-escape yes | no +Whether to escape ':' and '\\' characters in terse tabular mode. The escape +character is '\\'. +If omitted, default is \fIyes\fP. +.TP +.B \-v, \-\-version +Show \fInmcli\fP version. +.TP +.B \-h, \-\-help +Print help information. +.SS \fIOBJECT\fP +.TP +.B nm +NetworkManager +.br +Use this object to inquire and change state of NetworkManager. +.TP +.SS \fICOMMAND\fP := { status | sleep | wakeup | wifi | wwan } +.sp +.RS +.TP +.B status +.br +Show overall status of NetworkManager. This is the default action, when no +command is provided to \fInm\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B sleep +.br +Put NetworkManager to sleeping mode. Thus all interfaces that NetworkManager +manages are deactivated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: TRUE +.fi +.TP +.B wakeup +.br +Awake NetworkManager from sleep. When NetworkManager is awaken, devices are +available to be activated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: FALSE +.fi +.TP +.B wifi [on|off] +.br +Inquire or set status of WiFi in NetworkManager. Without any further argument, +WiFi status is printed; \fIon\fP enables WiFi; \fIoff\fP disables WiFi. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B wwan [on|off] +.br +Inquire or set status of WWAN in NetworkManager. Without any further argument, +WWAN status is printed; \fIon\fP enables WWAN; \fIoff\fP disables WWAN. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.TP +.B con +Connections +.br +Get information about NetworkManager's connections. +.TP +.SS \fICOMMAND\fP := { list | status | up | down } +.sp +.RS +.TP +.B list [id | uuid | system | user] +.br +List configured connections. Without a parameter, configured connection from +both system and user settings services are listed. \fIsystem\fP argument filters +only system-wide connections, \fIuser\fP prints user connections only. +In order to get connection details, \fIid\fP with connection's name or \fIuuid\fP +with connection's UUID shall be specified. +When no command is given to \fIcon\fP object, the default action is 'nmcli con list'. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B status +.br +Print status of active connections. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B up id | uuid [iface ] [ap ] [\-\-nowait] [\-\-timeout ] +.br +Activate a connection. The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. For requiring particular device to activate +the connection on, \fIiface\fP option with interface name should be given. +\fIap\fP option can further concretize what AP should be used in case of WiFi +connection. \fI\-\-nowait\fP option causes \fInmcli\fP to exit immediately and +not to wait for command completion. \fI\-\-timeout\fP option provides a means +to specify how long to wait for operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: ActivateConnection +arguments: according to arguments +.fi +.TP +.B down id | uuid +.br +Deactivate a connection. +The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: DeactivateConnection +arguments: according to arguments +.fi +.RE + +.TP +.B dev +Devices +.br +Get information about devices. +.TP +.SS \fICOMMAND\fP := { status | list | disconnect | wifi } +.sp +.RS +.TP +.B status +.br +Print status of devices. This is the default action, when no command +is specified to \fIdev\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B list [iface ] +.br +Get detailed information about devices. Without an argument, all devices are +examined. To get information for a specific device, \fIiface\fP argument +with the interface name should be provided. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B disconnect iface [\-\-nowait] [\-\-timeout ] +.br +Disconnect a device and prevent the device from automatically activating further +connections without user/manual intervention. \fI\-\-nowait\fP option causes +\fInmcli\fP to exit immediately and not to wait for command completion. +\fI\-\-timeout\fP option provides a means to specify how long to wait for +operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager.Device +method: Disconnect +arguments: none +.fi +.TP +.B wifi [list [iface ] [hwaddr ]] +.br +List available WiFi access points. \fIiface\fP and \fIhwaddr\fP options +can be used to get just APs for particular interface or specific AP, +respectively. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.SH BUGS +There are probably some. If you find a bug, please report to +https://bugzilla.gnome.org/ \- product \fINetworkManager\fP. + +.SH SEE ALSO +.BR nm\-tool (1), +.BR NetworkManager(8). From 5a01a0b39e634e2cf3c378deb73f15b16645b76e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Apr 2010 15:16:48 -0700 Subject: [PATCH 234/392] wifi: prevent infinite loop when disposing of supplicant proxy (rh #538717) This has been around a long time, but is very hard to trigger. It appears to happen mostly if the supplicant segfaults on resume but has been seen in other cases as well. For whatever reason, the DBusGProxy's refcount reaches 0 and the proxy gets disposed of. That in turn disposes of all the pending calls that are in-progress on the proxy. Since we give the pending calls a closure, that closure (nm_supplicant_info_destroy) gets called when the pending calls are destroyed. That closure unrefs the proxy again. Since DBusGProxy doesn't have any protection in its dispose() handler against re-entrant disposes (which is arguably a bug of the client) we end up infinite looping in nm_supplicant_info_destroy(). Fix that by ensuring we return early if we detect that we are already freeing the NMSupplicantInfo object, and thus don't try to dispose of the proxy yet again. --- .../nm-supplicant-interface.c | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index da1a856d1b..b91a509c68 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -144,6 +144,7 @@ typedef struct { DBusGProxy *proxy; NMCallStore *store; DBusGProxyCall *call; + gboolean disposing; } NMSupplicantInfo; static NMSupplicantInfo * @@ -164,10 +165,11 @@ nm_supplicant_info_new (NMSupplicantInterface *interface, static void nm_supplicant_info_set_call (NMSupplicantInfo *info, DBusGProxyCall *call) { - if (call) { - nm_call_store_add (info->store, G_OBJECT (info->proxy), (gpointer) call); - info->call = call; - } + g_return_if_fail (info != NULL); + g_return_if_fail (call != NULL); + + nm_call_store_add (info->store, G_OBJECT (info->proxy), (gpointer) call); + info->call = call; } static void @@ -175,13 +177,25 @@ nm_supplicant_info_destroy (gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - if (info->call) - nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call); + /* Guard against double-disposal; since DBusGProxy doesn't guard against + * double-disposal, we could infinite loop here if we're in the middle of + * some wpa_supplicant D-Bus calls. When the supplicant dies we'll dispose + * of the proxy, which kills all its pending calls, which brings us here. + * Then when we unref the proxy here, its dispose() function will get called + * again, and we get right back here until we segfault because our callstack + * is too long. + */ + if (!info->disposing) { + info->disposing = TRUE; - g_object_unref (info->proxy); - g_object_unref (info->interface); + if (info->call) + nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call); - g_slice_free (NMSupplicantInfo, info); + g_object_unref (info->proxy); + g_object_unref (info->interface); + + g_slice_free (NMSupplicantInfo, info); + } } From 009336a54c821c4248455f9b10e7ae7d3f895614 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Apr 2010 15:22:48 -0700 Subject: [PATCH 235/392] wifi: robustify supplicant info destruction Zero out the struct so we crash if we ever try to use it after its been freed. --- src/supplicant-manager/nm-supplicant-interface.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index b91a509c68..a65a458f5b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -188,12 +188,17 @@ nm_supplicant_info_destroy (gpointer user_data) if (!info->disposing) { info->disposing = TRUE; - if (info->call) + if (info->call) { nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call); + info->call = NULL; + } g_object_unref (info->proxy); + info->proxy = NULL; g_object_unref (info->interface); + info->interface = NULL; + memset (info, 0, sizeof (NMSupplicantInfo)); g_slice_free (NMSupplicantInfo, info); } } From fb6c929d887f652967d4fb978d50e9104788ad24 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 14:51:47 -0700 Subject: [PATCH 236/392] libnm-util: add IPv4 'disabled' method Allowing IPv4 configuration to be completely disabled for a connection. --- libnm-util/nm-setting-ip4-config.c | 57 ++++++++++++++++-------------- libnm-util/nm-setting-ip4-config.h | 3 +- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index 46ebbd377f..c1d7f01c76 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -462,7 +462,8 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } } else if ( !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL) - || !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { + || !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) + || !strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) { if (priv->dns && priv->dns->len) { g_set_error (error, NM_SETTING_IP4_CONFIG_ERROR, @@ -721,7 +722,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * network access to other computers) then the interface is assigned an * address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server * are started, and the interface is NAT-ed to the current default network - * connection. This property must be set. + * connection. 'disabled' means IPv4 will not be used on this connection. + * This property must be set. **/ g_object_class_install_property (object_class, PROP_METHOD, @@ -742,7 +744,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "address in the 10.42.x.1/24 range and a DHCP and " "forwarding DNS server are started, and the " "interface is NAT-ed to the current default network " - "connection. This property must be set.", + "connection. 'disabled' means IPv4 will not be " + "used on this connection. This property must be set.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -751,8 +754,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * * List of DNS servers (network byte order). For the 'auto' method, these * DNS servers are appended to those (if any) returned by automatic - * configuration. DNS servers cannot be used with the 'shared' or - * 'link-local' methods as there is no usptream network. In all other + * configuration. DNS servers cannot be used with the 'shared', 'link-local', + * or 'disabled' methods as there is no usptream network. In all other * methods, these DNS servers are used as the only DNS servers for this * connection. **/ @@ -764,10 +767,10 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "the 'auto' method, these DNS servers are " "appended to those (if any) returned by automatic " "configuration. DNS servers cannot be used with " - "the 'shared' or 'link-local' methods as there is " - "no usptream network. In all other methods, " - "these DNS servers are used as the only DNS " - "servers for this connection.", + "the 'shared', 'link-local', or 'disabled' " + "methods as there is no usptream network. In all " + "other methods, these DNS servers are used as the " + "only DNS servers for this connection.", DBUS_TYPE_G_UINT_ARRAY, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -776,9 +779,9 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * * List of DNS search domains. For the 'auto' method, these search domains * are appended to those returned by automatic configuration. Search domains - * cannot be used with the 'shared' or 'link-local' methods as there is no - * upstream network. In all other methods, these search domains are used - * as the only search domains for this connection. + * cannot be used with the 'shared', 'link-local', or 'disabled' methods as + * there is no upstream network. In all other methods, these search domains + * are used as the only search domains for this connection. **/ g_object_class_install_property (object_class, PROP_DNS_SEARCH, @@ -787,11 +790,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "List of DNS search domains. For the 'auto' " "method, these search domains are appended to " "those returned by automatic configuration. " - "Search domains cannot be used with the 'shared' " - "or 'link-local' methods as there is no upstream " - "network. In all other methods, these search " - "domains are used as the only search domains for " - "this connection.", + "Search domains cannot be used with the 'shared', " + "'link-local', or 'disabled' methods as there is " + "no upstream network. In all other methods, these " + "search domains are used as the only search domains " + "for this connection.", DBUS_TYPE_G_LIST_OF_STRING, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -804,8 +807,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * (network byte order). The gateway may be left as 0 if no gateway exists * for that subnet. For the 'auto' method, given IP addresses are appended * to those returned by automatic configuration. Addresses cannot be used - * with the 'shared' or 'link-local' methods as the interface is - * automatically assigned an address with these methods. + * with the 'shared', 'link-local', or 'disabled' methods as addressing is + * either automatic or disabled with these methods. **/ g_object_class_install_property (object_class, PROP_ADDRESSES, @@ -820,9 +823,9 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "for that subnet. For the 'auto' method, given " "IP addresses are appended to those returned by " "automatic configuration. Addresses cannot be " - "used with the 'shared' or 'link-local' methods " - "as the interface is automatically assigned an " - "address with these methods.", + "used with the 'shared', 'link-local', or " + "'disabled' methods as addressing is either " + "automatic or disabled with these methods.", DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -835,8 +838,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * address prefix (1 - 32), the third being the next-hop (network byte * order) if any, and the fourth being the route metric. For the 'auto' * method, given IP routes are appended to those returned by automatic - * configuration. Routes cannot be used with the 'shared' or 'link-local' - * methods because there is no upstream network. + * configuration. Routes cannot be used with the 'shared', 'link-local', + * or 'disabled' methods because there is no upstream network. **/ g_object_class_install_property (object_class, PROP_ROUTES, @@ -852,8 +855,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "For the 'auto' method, given IP routes are " "appended to those returned by automatic " "configuration. Routes cannot be used with the " - "'shared' or 'link-local' methods as there is no " - "upstream network.", + "'shared', 'link-local', or 'disabled', methods " + "as there is no upstream network.", DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h index 2362982f51..777f53f126 100644 --- a/libnm-util/nm-setting-ip4-config.h +++ b/libnm-util/nm-setting-ip4-config.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -69,6 +69,7 @@ GQuark nm_setting_ip4_config_error_quark (void); #define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local" #define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual" #define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared" +#define NM_SETTING_IP4_CONFIG_METHOD_DISABLED "disabled" typedef struct NMIP4Address NMIP4Address; From fe25e20f6ad541915d8f3a9079f802008020c3b2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 14:52:43 -0700 Subject: [PATCH 237/392] ifcfg-rh: handle disabled IPv4 correctly Instead of not including the IP4 setting, set its method to disabled. In reality either one is legal, but including the IP4 setting wtih the method set to 'disabled' is more explicit. --- system-settings/plugins/ifcfg-rh/reader.c | 5 +++- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 27 +++++++++++++++---- system-settings/plugins/ifcfg-rh/writer.c | 6 ++++- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 32575f3953..378aff4e00 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1215,7 +1215,10 @@ make_ip4_setting (shvarFile *ifcfg, if (!tmp_ip4 && !tmp_prefix && !tmp_netmask) { if (valid_ip6_config) { /* Nope, no IPv4 */ - goto done; + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + return NM_SETTING (s_ip4); } method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; 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 cfe93d6ec0..2f77be2ca9 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -2165,6 +2165,7 @@ test_read_wired_ipv6_only (void) const char *expected_dns1 = "1:2:3:4::a"; NMIP6Address *ip6_addr; struct in6_addr addr; + const char *method; connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_ONLY, NULL, @@ -2217,11 +2218,18 @@ test_read_wired_ipv6_only (void) /* ===== IPv4 SETTING ===== */ s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); - ASSERT (s_ip4 == NULL, - "wired-ipv6-only-verify-ip4", "failed to verify %s: unexpected %s setting", + ASSERT (s_ip4 != NULL, + "wired-ipv6-only-verify-ip4", "failed to verify %s: missing %s setting", TEST_IFCFG_WIRED_IPV6_MANUAL, NM_SETTING_IP4_CONFIG_SETTING_NAME); + method = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0, + "wired-ipv6-only-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + /* ===== IPv6 SETTING ===== */ s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); @@ -5264,6 +5272,7 @@ test_write_wired_static_ip6_only (void) NMConnection *reread; NMSettingConnection *s_con; NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; NMSettingIP6Config *s_ip6; static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; GByteArray *mac; @@ -5317,6 +5326,17 @@ test_write_wired_static_ip6_only (void) g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); g_byte_array_free (mac, TRUE); + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + /* IP6 setting */ s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); ASSERT (s_ip6 != NULL, @@ -5373,9 +5393,6 @@ test_write_wired_static_ip6_only (void) ASSERT (nm_connection_verify (reread, &error), "wired-static-ip6-only-write-reread-verify", "failed to verify %s: %s", testfile, error->message); - ASSERT (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP4_CONFIG) == NULL, - "wired-static-ip6-only-write-reread-verify", "unexpected IPv4 setting"); - ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "wired-static-ip6-only-write", "written and re-read connection weren't the same."); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index cc24a96f58..8085584cca 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -908,9 +908,13 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) guint32 i, num; GString *searches; gboolean success = FALSE; + const char *method = NULL; s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - if (!s_ip4) { + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (!s_ip4 || (method && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED))) { int result; /* IPv4 disabled, clear IPv4 related parameters */ From c049680515a7c1a6719287940498fa6ed127dbdd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 14:54:22 -0700 Subject: [PATCH 238/392] core: use constant instead of hardcoding a string --- src/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index 280d4e4105..c5051dc99b 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2248,7 +2248,7 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) if (s_ip4) method = nm_setting_ip4_config_get_method (s_ip4); - if (s_ip4 && !strcmp (method, "shared")) { + if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { if (!start_sharing (self)) { nm_log_warn (LOGD_SHARING, "Activation (%s) Stage 5 of 5 (IP Configure Commit) start sharing failed.", iface); nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SHARED_START_FAILED); From c35bec214c42f60bb53a355237d4d471d8133486 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 14:54:42 -0700 Subject: [PATCH 239/392] dhcp: ensure the IP4 method is compatible with DHCP --- src/dhcp-manager/nm-dhcp-manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 94109adcf6..635fe320b0 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -482,6 +482,13 @@ nm_dhcp_manager_start_ip4 (NMDHCPManager *self, priv = NM_DHCP_MANAGER_GET_PRIVATE (self); if (s_ip4) { + const char *method = nm_setting_ip4_config_get_method (s_ip4); + + if (method) { + /* Method must be 'auto' */ + g_return_val_if_fail (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, NULL); + } + if ( nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) && priv->hostname_provider != NULL) { From 5e6ae3b226ecf6b05924b8d4113501fa2c4a82ea Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 14:59:29 -0700 Subject: [PATCH 240/392] core: don't require IPv4 configuration during activation --- src/nm-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index c5051dc99b..1ee7510321 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1674,7 +1674,8 @@ real_act_stage4_get_ip4_config (NMDevice *self, *config = nm_device_new_ip4_shared_config (self, reason); if (*config) priv->dnsmasq_manager = nm_dnsmasq_manager_new (ip_iface); - } + } else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) + ret = NM_ACT_STAGE_RETURN_SUCCESS; } if (!*config) { From e2ad8c2a5410c734a58ab22ee4e14579dfc6542b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 15:18:08 -0700 Subject: [PATCH 241/392] core: add 'default6' property for ActiveConnection objects Since IPv4 and IPv6 have different routing one device can have the active IPv4 connection and a completely different one can have the active IPv6 one. --- introspection/nm-active-connection.xml | 5 ++- libnm-glib/Makefile.am | 2 +- libnm-glib/libnm-glib.ver | 1 + libnm-glib/nm-active-connection.c | 62 ++++++++++++++++++++++---- libnm-glib/nm-active-connection.h | 4 +- 5 files changed, 63 insertions(+), 11 deletions(-) diff --git a/introspection/nm-active-connection.xml b/introspection/nm-active-connection.xml index ff55f63885..765830a1dc 100644 --- a/introspection/nm-active-connection.xml +++ b/introspection/nm-active-connection.xml @@ -18,7 +18,10 @@ The state of this active connection. - Whether this active connection is the default connection, i.e. whether it currently owns the default route. + Whether this active connection is the default IPv4 connection, i.e. whether it currently owns the default IPv4 route. + + + Whether this active connection is the default IPv6 connection, i.e. whether it currently owns the default IPv6 route. Whether this active connection is also a VPN connection. diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 58b5bc559e..8f03b0abda 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "4:1:2" + -version-info "4:2:2" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 1caa2d42ba..46051e8784 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -18,6 +18,7 @@ global: nm_access_point_new; nm_active_connection_get_connection; nm_active_connection_get_default; + nm_active_connection_get_default6; nm_active_connection_get_devices; nm_active_connection_get_scope; nm_active_connection_get_service_name; diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c index df8bb98271..2468da099f 100644 --- a/libnm-glib/nm-active-connection.c +++ b/libnm-glib/nm-active-connection.c @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -50,6 +50,7 @@ typedef struct { GPtrArray *devices; NMActiveConnectionState state; gboolean is_default; + gboolean is_default6; } NMActiveConnectionPrivate; enum { @@ -60,6 +61,7 @@ enum { PROP_DEVICES, PROP_STATE, PROP_DEFAULT, + PROP_DEFAULT6, LAST_PROP }; @@ -70,6 +72,7 @@ enum { #define DBUS_PROP_DEVICES "Devices" #define DBUS_PROP_STATE "State" #define DBUS_PROP_DEFAULT "Default" +#define DBUS_PROP_DEFAULT6 "Default6" /** * nm_active_connection_new: @@ -263,10 +266,10 @@ nm_active_connection_get_state (NMActiveConnection *connection) * nm_active_connection_get_default: * @connection: a #NMActiveConnection * - * Whether the active connection is the default one (that is, is used for the default route - * and DNS information). + * Whether the active connection is the default IPv4 one (that is, is used for + * the default IPv4 route and DNS information). * - * Returns: %TRUE if the active connection is the default one + * Returns: %TRUE if the active connection is the default IPv4 connection **/ gboolean nm_active_connection_get_default (NMActiveConnection *connection) @@ -278,13 +281,39 @@ nm_active_connection_get_default (NMActiveConnection *connection) priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); if (!priv->is_default) { priv->is_default = _nm_object_get_boolean_property (NM_OBJECT (connection), - NM_DBUS_INTERFACE_ACTIVE_CONNECTION, - DBUS_PROP_DEFAULT); + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_DEFAULT); } return priv->is_default; } +/** + * nm_active_connection_get_default6: + * @connection: a #NMActiveConnection + * + * Whether the active connection is the default IPv6 one (that is, is used for + * the default IPv6 route and DNS information). + * + * Returns: %TRUE if the active connection is the default IPv6 connection + **/ +gboolean +nm_active_connection_get_default6 (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->is_default6) { + priv->is_default6 = _nm_object_get_boolean_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_DEFAULT6); + } + + return priv->is_default6; +} + static void nm_active_connection_init (NMActiveConnection *ap) { @@ -350,6 +379,9 @@ get_property (GObject *object, case PROP_DEFAULT: g_value_set_boolean (value, nm_active_connection_get_default (self)); break; + case PROP_DEFAULT6: + g_value_set_boolean (value, nm_active_connection_get_default6 (self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -392,6 +424,7 @@ register_for_property_changed (NMActiveConnection *connection) { NM_ACTIVE_CONNECTION_DEVICES, demarshal_devices, &priv->devices }, { NM_ACTIVE_CONNECTION_STATE, _nm_object_demarshal_generic, &priv->state }, { NM_ACTIVE_CONNECTION_DEFAULT, _nm_object_demarshal_generic, &priv->is_default }, + { NM_ACTIVE_CONNECTION_DEFAULT6, _nm_object_demarshal_generic, &priv->is_default6 }, { NULL }, }; @@ -512,13 +545,26 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) /** * NMActiveConnection:default: * - * Whether the active connection is the default one. + * Whether the active connection is the default IPv4 one. **/ g_object_class_install_property (object_class, PROP_DEFAULT, g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "Default", - "Is the default active connection", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:default6: + * + * Whether the active connection is the default IPv6 one. + **/ + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", FALSE, G_PARAM_READABLE)); } diff --git a/libnm-glib/nm-active-connection.h b/libnm-glib/nm-active-connection.h index f717c055ef..30edf047a0 100644 --- a/libnm-glib/nm-active-connection.h +++ b/libnm-glib/nm-active-connection.h @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -45,6 +45,7 @@ G_BEGIN_DECLS #define NM_ACTIVE_CONNECTION_DEVICES "devices" #define NM_ACTIVE_CONNECTION_STATE "state" #define NM_ACTIVE_CONNECTION_DEFAULT "default" +#define NM_ACTIVE_CONNECTION_DEFAULT6 "default6" typedef struct { NMObject parent; @@ -73,6 +74,7 @@ const char * nm_active_connection_get_specific_object (NMActiveConnection *c const GPtrArray *nm_active_connection_get_devices (NMActiveConnection *connection); NMActiveConnectionState nm_active_connection_get_state (NMActiveConnection *connection); gboolean nm_active_connection_get_default (NMActiveConnection *connection); +gboolean nm_active_connection_get_default6 (NMActiveConnection *connection); G_END_DECLS From 37c411abc91714e8a14c7811fe8ef6c133a280f5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 15:26:11 -0700 Subject: [PATCH 242/392] core: add 'default6' property to ActiveConnection implementations --- src/nm-activation-request.c | 45 +++++++++++++++++++++++++++-- src/nm-activation-request.h | 6 +++- src/nm-active-connection.h | 3 +- src/vpn-manager/nm-vpn-connection.c | 14 ++++++++- 4 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c index 1335c35e46..2529e77f65 100644 --- a/src/nm-activation-request.c +++ b/src/nm-activation-request.c @@ -72,6 +72,7 @@ typedef struct { NMActiveConnectionState state; gboolean is_default; + gboolean is_default6; gboolean shared; GSList *share_rules; @@ -88,6 +89,7 @@ enum { PROP_DEVICES, PROP_STATE, PROP_DEFAULT, + PROP_DEFAULT6, PROP_VPN, LAST_PROP @@ -104,7 +106,7 @@ device_state_changed (NMDevice *device, NMActRequest *self = NM_ACT_REQUEST (user_data); NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (self); NMActiveConnectionState new_ac_state; - gboolean new_default = FALSE; + gboolean new_default = FALSE, new_default6 = FALSE; /* Set NMActiveConnection state based on the device's state */ switch (new_state) { @@ -117,6 +119,7 @@ device_state_changed (NMDevice *device, case NM_DEVICE_STATE_ACTIVATED: new_ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATED; new_default = priv->is_default; + new_default6 = priv->is_default6; break; default: new_ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; @@ -132,6 +135,11 @@ device_state_changed (NMDevice *device, priv->is_default = new_default; g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEFAULT); } + + if (new_default6 != priv->is_default6) { + priv->is_default6 = new_default6; + g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEFAULT6); + } } NMActRequest * @@ -271,6 +279,9 @@ get_property (GObject *object, guint prop_id, case PROP_DEFAULT: g_value_set_boolean (value, priv->is_default); break; + case PROP_DEFAULT6: + g_value_set_boolean (value, priv->is_default6); + break; case PROP_VPN: g_value_set_boolean (value, FALSE); break; @@ -334,7 +345,14 @@ nm_act_request_class_init (NMActRequestClass *req_class) (object_class, PROP_DEFAULT, g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "Default", - "Is the default active connection", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", FALSE, G_PARAM_READABLE)); g_object_class_install_property @@ -548,6 +566,29 @@ nm_act_request_get_default (NMActRequest *req) return NM_ACT_REQUEST_GET_PRIVATE (req)->is_default; } +void +nm_act_request_set_default6 (NMActRequest *req, gboolean is_default6) +{ + NMActRequestPrivate *priv; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + + priv = NM_ACT_REQUEST_GET_PRIVATE (req); + if (priv->is_default6 == is_default6) + return; + + priv->is_default6 = is_default6; + g_object_notify (G_OBJECT (req), NM_ACTIVE_CONNECTION_DEFAULT6); +} + +gboolean +nm_act_request_get_default6 (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->is_default6; +} + static void share_child_setup (gpointer user_data G_GNUC_UNUSED) { diff --git a/src/nm-activation-request.h b/src/nm-activation-request.h index a3c0d97446..a243694521 100644 --- a/src/nm-activation-request.h +++ b/src/nm-activation-request.h @@ -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. * - * (C) Copyright 2005 - 2008 Red Hat, Inc. + * (C) Copyright 2005 - 2010 Red Hat, Inc. */ #ifndef NM_ACTIVATION_REQUEST_H @@ -76,6 +76,10 @@ void nm_act_request_set_default (NMActRequest *req, gboolean is_default gboolean nm_act_request_get_default (NMActRequest *req); +void nm_act_request_set_default6 (NMActRequest *req, gboolean is_default6); + +gboolean nm_act_request_get_default6 (NMActRequest *req); + gboolean nm_act_request_get_shared (NMActRequest *req); void nm_act_request_set_shared (NMActRequest *req, gboolean shared); diff --git a/src/nm-active-connection.h b/src/nm-active-connection.h index 4a1f2e1477..6a463cb257 100644 --- a/src/nm-active-connection.h +++ b/src/nm-active-connection.h @@ -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) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #ifndef NM_ACTIVE_CONNECTION_H @@ -30,6 +30,7 @@ #define NM_ACTIVE_CONNECTION_DEVICES "devices" #define NM_ACTIVE_CONNECTION_STATE "state" #define NM_ACTIVE_CONNECTION_DEFAULT "default" +#define NM_ACTIVE_CONNECTION_DEFAULT6 "default6" #define NM_ACTIVE_CONNECTION_VPN "vpn" char *nm_active_connection_get_next_object_path (void); diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 01f639acc5..a594df59b5 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -69,6 +69,7 @@ typedef struct { gulong device_ip4; gboolean is_default; + gboolean is_default6; NMActiveConnectionState state; NMVPNConnectionState vpn_state; @@ -102,6 +103,7 @@ enum { PROP_DEVICES, PROP_STATE, PROP_DEFAULT, + PROP_DEFAULT6, PROP_VPN, PROP_VPN_STATE, PROP_BANNER, @@ -1052,6 +1054,9 @@ get_property (GObject *object, guint prop_id, case PROP_DEFAULT: g_value_set_boolean (value, priv->is_default); break; + case PROP_DEFAULT6: + g_value_set_boolean (value, priv->is_default6); + break; case PROP_VPN: g_value_set_boolean (value, TRUE); break; @@ -1122,7 +1127,14 @@ nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) (object_class, PROP_DEFAULT, g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "Default", - "Is the default active connection", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", FALSE, G_PARAM_READABLE)); g_object_class_install_property From d8f0ba554c645e8af3036e96dc034642c1675280 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Apr 2010 15:28:42 -0700 Subject: [PATCH 243/392] policy: reconfigure routing and DNS when either IPv4 or IPv6 changes --- src/nm-policy.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 7159eafb57..5cbf0cdbcd 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -828,9 +828,9 @@ device_state_changed (NMDevice *device, } static void -device_ip4_config_changed (NMDevice *device, - GParamSpec *pspec, - gpointer user_data) +device_ip_config_changed (NMDevice *device, + GParamSpec *pspec, + gpointer user_data) { update_routing_and_dns ((NMPolicy *) user_data, TRUE); } @@ -872,7 +872,12 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data) policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); id = g_signal_connect (device, "notify::" NM_DEVICE_INTERFACE_IP4_CONFIG, - G_CALLBACK (device_ip4_config_changed), + G_CALLBACK (device_ip_config_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + + id = g_signal_connect (device, "notify::" NM_DEVICE_INTERFACE_IP6_CONFIG, + G_CALLBACK (device_ip_config_changed), policy); policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); From 44ea07a5d77fb42e4f7cc97126836270319cf981 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 17 Apr 2010 10:26:53 -0700 Subject: [PATCH 244/392] libnm-util: add gateway member to IPv6 addresses --- include/nm-dbus-glib-types.h | 2 +- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 2 ++ libnm-util/nm-setting-ip6-config.c | 24 ++++++++++++++ libnm-util/nm-setting-ip6-config.h | 4 +++ libnm-util/nm-utils.c | 53 +++++++++++++++++++++++++----- 6 files changed, 76 insertions(+), 11 deletions(-) diff --git a/include/nm-dbus-glib-types.h b/include/nm-dbus-glib-types.h index cfb08274c6..0f8c542e82 100644 --- a/include/nm-dbus-glib-types.h +++ b/include/nm-dbus-glib-types.h @@ -34,7 +34,7 @@ #define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) #define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) -#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID)) #define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS)) #define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) #define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 8f6a0cc95d..bb4736f45b 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "4:2:3" + -version-info "4:3:3" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 44d9ac5aec..1c8446ba2e 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -177,6 +177,8 @@ global: nm_ip6_address_compare; nm_ip6_address_get_address; nm_ip6_address_set_address; + nm_ip6_address_get_gateway; + nm_ip6_address_set_gateway; nm_ip6_address_get_prefix; nm_ip6_address_set_prefix; nm_ip6_route_new; diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index 3fbf1a2bc4..c383b2d270 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -797,10 +797,13 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) } +/********************************************************************/ + struct NMIP6Address { guint32 refcount; struct in6_addr address; guint32 prefix; + struct in6_addr gateway; }; NMIP6Address * @@ -902,6 +905,27 @@ nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix) address->prefix = prefix; } +const struct in6_addr * +nm_ip6_address_get_gateway (NMIP6Address *address) +{ + g_return_val_if_fail (address != NULL, 0); + g_return_val_if_fail (address->refcount > 0, 0); + + return &address->gateway; +} + +void +nm_ip6_address_set_gateway (NMIP6Address *address, const struct in6_addr *gw) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + g_return_if_fail (gw != NULL); + + memcpy (&address->gateway, gw, sizeof (struct in6_addr)); +} + +/********************************************************************/ + struct NMIP6Route { guint32 refcount; diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index b089679e4e..78617c4547 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -88,6 +88,10 @@ guint32 nm_ip6_address_get_prefix (NMIP6Address *address); void nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix); +const struct in6_addr *nm_ip6_address_get_gateway (NMIP6Address *address); +void nm_ip6_address_set_gateway (NMIP6Address *address, + const struct in6_addr *gw); + typedef struct NMIP6Route NMIP6Route; NMIP6Route * nm_ip6_route_new (void); diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 5ca3014d79..405288d361 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -1459,8 +1459,8 @@ nm_utils_ip4_get_default_prefix (guint32 ip) * @value: gvalue containing a GPtrArray of GValueArrays of (GArray of guchars) and guint32 * * Utility function to convert a #GPtrArray of #GValueArrays of (#GArray of guchars) and guint32 - * representing a list of NetworkManager IPv6 addresses (which is a pair of address - * and prefix), into a GSList of #NMIP6Address objects. The specific format of + * representing a list of NetworkManager IPv6 addresses (which is a tuple of address, + * prefix, and gateway), into a GSList of #NMIP6Address objects. The specific format of * this serialization is not guaranteed to be stable and the #GValueArray may be * extended in the future. * @@ -1479,16 +1479,28 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value) GValueArray *elements = (GValueArray *) g_ptr_array_index (addresses, i); GValue *tmp; GByteArray *ba_addr; + GByteArray *ba_gw = NULL; NMIP6Address *addr; guint32 prefix; - if ( (elements->n_values != 2) - || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + if (elements->n_values < 2 || elements->n_values > 3) { + nm_warning ("%s: ignoring invalid IP6 address structure", __func__); + continue; + } + + if ( (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT)) { nm_warning ("%s: ignoring invalid IP6 address structure", __func__); continue; } + /* Check optional 3rd element (gateway) */ + if ( elements->n_values == 3 + && (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY)) { + nm_warning ("%s: ignoring invalid IP6 address structure", __func__); + continue; + } + tmp = g_value_array_get_nth (elements, 0); ba_addr = g_value_get_boxed (tmp); if (ba_addr->len != 16) { @@ -1505,9 +1517,22 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value) continue; } + if (elements->n_values == 3) { + tmp = g_value_array_get_nth (elements, 2); + ba_gw = g_value_get_boxed (tmp); + if (ba_gw->len != 16) { + nm_warning ("%s: ignoring invalid IP6 gateway address of length %d", + __func__, ba_gw->len); + continue; + } + } + addr = nm_ip6_address_new (); nm_ip6_address_set_prefix (addr, prefix); nm_ip6_address_set_address (addr, (const struct in6_addr *) ba_addr->data); + if (ba_gw) + nm_ip6_address_set_gateway (addr, (const struct in6_addr *) ba_gw->data); + list = g_slist_prepend (list, addr); } @@ -1522,10 +1547,10 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value) * g_value_unset(). * * Utility function to convert a #GSList of #NMIP6Address objects into a - * GPtrArray of GValueArrays of (GArray or guchars) and guint32 representing a list - * of NetworkManager IPv6 addresses (which is a pair of address and prefix). - * The specific format of this serialization is not guaranteed to be stable and may be - * extended in the future. + * GPtrArray of GValueArrays representing a list of NetworkManager IPv6 addresses + * (which is a tuple of address, prefix, and gateway). The specific format of + * this serialization is not guaranteed to be stable and may be extended in the + * future. **/ void nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) @@ -1541,8 +1566,9 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) GValue element = {0, }; GByteArray *ba; - array = g_value_array_new (2); + array = g_value_array_new (3); + /* IP address */ g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); ba = g_byte_array_new (); g_byte_array_append (ba, (guint8 *) nm_ip6_address_get_address (addr), 16); @@ -1550,11 +1576,20 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) g_value_array_append (array, &element); g_value_unset (&element); + /* Prefix */ g_value_init (&element, G_TYPE_UINT); g_value_set_uint (&element, nm_ip6_address_get_prefix (addr)); g_value_array_append (array, &element); g_value_unset (&element); + /* Gateway */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guint8 *) nm_ip6_address_get_gateway (addr), 16); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + g_ptr_array_add (addresses, array); } From 1d409aeb532e9927d6d15033f2365709c342464a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 17 Apr 2010 17:19:30 -0700 Subject: [PATCH 245/392] core: fix Address property type of IP6Config objects We can change the property's D-Bus signature (and thus API) here because querying the IP6Config object's properties caused NM to crash. Apparently we forgot to change the type of the Address property when we C&P-ed the IP4Config into the IP6Config, and DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT is certainly the wrong type to use since the backing object that dbus-glib would marshal into the ARRAY_OF_ARRAY_OF_UINT wasn't that type, causing a crash in dbus-glib when a client got the IP6Config. --- introspection/nm-ip6-config.xml | 4 ++-- src/nm-ip6-config.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/introspection/nm-ip6-config.xml b/introspection/nm-ip6-config.xml index d1349b0c21..604781857e 100644 --- a/introspection/nm-ip6-config.xml +++ b/introspection/nm-ip6-config.xml @@ -2,8 +2,8 @@ - - Tuples of IPv6 address/prefix. + + Tuples of IPv6 address/prefix/gateway. The nameservers in use. diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 66c328eef9..d2a17a0e5c 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.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) 2006 - 2008 Novell, Inc. */ @@ -697,7 +697,7 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, "Addresses", "IP6 addresses", - DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, G_PARAM_READABLE)); g_object_class_install_property (object_class, PROP_NAMESERVERS, From 73a7e6b8e06b1f6db13fa671a2e7a7fc89bfd4f3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 18 Apr 2010 11:43:43 -0700 Subject: [PATCH 246/392] core: fix IP6Config property types to match introspection spec --- src/nm-ip6-config.c | 55 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index d2a17a0e5c..e3fe92dbd3 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -692,34 +692,33 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) object_class->finalize = finalize; /* properties */ - g_object_class_install_property - (object_class, PROP_ADDRESSES, - g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, - "Addresses", - "IP6 addresses", - DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, - G_PARAM_READABLE)); - g_object_class_install_property - (object_class, PROP_NAMESERVERS, - g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, - "Nameservers", - "DNS list", - DBUS_TYPE_G_UINT_ARRAY, - G_PARAM_READABLE)); - g_object_class_install_property - (object_class, PROP_DOMAINS, - g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, - "Domains", - "Domains", - DBUS_TYPE_G_ARRAY_OF_STRING, - G_PARAM_READABLE)); - g_object_class_install_property - (object_class, PROP_ROUTES, - g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, - "Routes", - "Routes", - DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, - G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_ADDRESSES, + g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, + "Addresses", + "IP6 addresses", + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_NAMESERVERS, + g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, + "Nameservers", + "DNS list", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_DOMAINS, + g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, + "Domains", + "Domains", + DBUS_TYPE_G_ARRAY_OF_STRING, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_ROUTES, + g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, + "Routes", + "Routes", + DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, + G_PARAM_READABLE)); dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), &dbus_glib_nm_ip6_config_object_info); From 83652e6b8e79c12def7e4f42af8b01fbf61d9097 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 10:14:44 -0700 Subject: [PATCH 247/392] libnm-util: convert from old IP6 address format to new Ensure it still works correctly if something tries to set the 'addresses' property using the old GType. Also make sure that the various IP6 address comparison operations and string conversion functions handle the gateway. --- libnm-util/nm-param-spec-specialized.c | 18 ++++- libnm-util/nm-utils.c | 70 ++++++++++++++++++ libnm-util/tests/test-general.c | 99 +++++++++++++++++++++++++- 3 files changed, 182 insertions(+), 5 deletions(-) diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index ad0febfcf6..f5a362ce41 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -377,6 +377,7 @@ nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) GValue *tmp_val; GByteArray *addr1, *addr2; guint32 prefix1, prefix2; + GByteArray *gw1, *gw2; gint ret = 0; int i; @@ -387,8 +388,8 @@ nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) /* Since they are NM IPv6 address structures, we expect both * to contain two elements as specified in nm-dbus-glib-types.h. */ - g_return_val_if_fail (values1->n_values == 2, 0); - g_return_val_if_fail (values2->n_values == 2, 0); + g_return_val_if_fail (values1->n_values == 3, 0); + g_return_val_if_fail (values2->n_values == 3, 0); /* First struct IPv6 address */ tmp_val = g_value_array_get_nth (values1, 0); @@ -396,6 +397,9 @@ nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) /* First struct IPv6 prefix */ tmp_val = g_value_array_get_nth (values1, 1); prefix1 = g_value_get_uint (tmp_val); + /* First struct IPv6 gateway */ + tmp_val = g_value_array_get_nth (values1, 2); + gw1 = g_value_get_boxed (tmp_val); /* Second struct IPv6 address */ tmp_val = g_value_array_get_nth (values2, 0); @@ -403,6 +407,9 @@ nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) /* Second struct IPv6 prefix */ tmp_val = g_value_array_get_nth (values2, 1); prefix2 = g_value_get_uint (tmp_val); + /* Second struct IPv6 gateway */ + tmp_val = g_value_array_get_nth (values2, 2); + gw2 = g_value_get_boxed (tmp_val); /* Compare IPv6 addresses */ if (prefix1 != prefix2) @@ -413,6 +420,11 @@ nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) ret = addr1->data[i] < addr2->data[i] ? -1 : addr1->data[i] > addr2->data[i]; } + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *) gw1->data, (struct in6_addr *) gw2->data)) { + for (i = 0; ret == 0 && i < gw1->len; i++) + ret = gw1->data[i] < gw2->data[i] ? -1 : gw1->data[i] > gw2->data[i]; + } + return ret; } diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 405288d361..808169471f 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -275,6 +275,8 @@ nm_utils_init (GError **error) if (!crypto_init (error)) return FALSE; + _nm_utils_register_value_transformations (); + atexit (nm_utils_deinit); initialized = TRUE; } @@ -886,6 +888,19 @@ nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValu continue; } g_string_append_printf (printable, "px = %u", prefix); + g_string_append (printable, ", "); + + /* IPv6 Gateway */ + tmp = g_value_array_get_nth (elements, 2); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "gw = %s", buf); g_string_append (printable, " }"); } g_string_append_c (printable, ']'); @@ -977,6 +992,58 @@ nm_utils_convert_ip6_route_struct_array_to_string (const GValue *src_value, GVal g_string_free (printable, FALSE); } +#define OLD_DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", OLD_DBUS_TYPE_G_IP6_ADDRESS)) + +static void +nm_utils_convert_old_ip6_addr_array (const GValue *src_value, GValue *dst_value) +{ + GPtrArray *src_outer_array; + GPtrArray *dst_outer_array; + guint i; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + src_outer_array = (GPtrArray *) g_value_get_boxed (src_value); + dst_outer_array = g_ptr_array_new (); + + for (i = 0; src_outer_array && (i < src_outer_array->len); i++) { + GValueArray *src_addr_array; + GValueArray *dst_addr_array; + GValue element = {0, }; + GValue *src_addr, *src_prefix; + GByteArray *ba; + + src_addr_array = (GValueArray *) g_ptr_array_index (src_outer_array, i); + + if ( (src_addr_array->n_values != 2) + || (G_VALUE_TYPE (g_value_array_get_nth (src_addr_array, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (src_addr_array, 1)) != G_TYPE_UINT)) { + g_warning ("%s: invalid old IPv6 address type", __func__); + return; + } + + dst_addr_array = g_value_array_new (3); + + src_addr = g_value_array_get_nth (src_addr_array, 0); + g_value_array_append (dst_addr_array, src_addr); + src_prefix = g_value_array_get_nth (src_addr_array, 1); + g_value_array_append (dst_addr_array, src_prefix); + + /* Blank Gateway */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guint8 *) "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16); + g_value_take_boxed (&element, ba); + g_value_array_append (dst_addr_array, &element); + g_value_unset (&element); + + g_ptr_array_add (dst_outer_array, dst_addr_array); + } + + g_value_take_boxed (dst_value, dst_outer_array); +} + void _nm_utils_register_value_transformations (void) { @@ -1013,6 +1080,9 @@ _nm_utils_register_value_transformations (void) g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, G_TYPE_STRING, nm_utils_convert_ip6_route_struct_array_to_string); + g_value_register_transform_func (OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + nm_utils_convert_old_ip6_addr_array); registered = TRUE; } } diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index d00ec994e1..9530445959 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.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) 2008 - 2009 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. * */ @@ -28,7 +28,8 @@ #include "nm-setting-connection.h" #include "nm-setting-vpn.h" - +#include "nm-setting-ip6-config.h" +#include "nm-dbus-glib-types.h" static void vpn_check_func (const char *key, const char *value, gpointer user_data) @@ -128,6 +129,99 @@ test_setting_vpn_items (void) g_object_unref (s_vpn); } +#define OLD_DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", OLD_DBUS_TYPE_G_IP6_ADDRESS)) + +/* Test that setting the IPv6 setting's 'addresses' property using the old + * IPv6 address format still works, i.e. that the GValue transformation function + * from old->new is working correctly. + */ +static void +test_setting_ip6_config_old_address_array (void) +{ + NMSettingIP6Config *s_ip6; + GPtrArray *addresses, *read_addresses; + GValueArray *array, *read_array; + GValue element = {0, }, written_value = {0, }, read_value = {0, }; + GByteArray *ba; + const guint8 addr[16] = { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x11, 0x22, 0x33, 0x44, 0x66, 0x77, 0x88, 0x99 }; + const guint8 gw[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + guint32 prefix = 56; + GValue *read_addr, *read_prefix, *read_gw; + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "ip6-old-addr", "error creating IP6 setting"); + + g_value_init (&written_value, OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS); + + addresses = g_ptr_array_new (); + array = g_value_array_new (3); + + /* IP address */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, &addr[0], sizeof (addr)); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + /* Prefix */ + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_ptr_array_add (addresses, array); + g_value_set_boxed (&written_value, addresses); + + /* Set the address array on the object */ + g_object_set_property (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_ADDRESSES, &written_value); + + /* Get it back so we can compare it */ + g_value_init (&read_value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS); + g_object_get_property (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_ADDRESSES, &read_value); + + ASSERT (G_VALUE_HOLDS (&read_value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS), + "ip6-old-addr", "wrong addresses property value type '%s'", + G_VALUE_TYPE_NAME (&read_value)); + + read_addresses = (GPtrArray *) g_value_get_boxed (&read_value); + ASSERT (read_addresses != NULL, + "ip6-old-addr", "missing addresses on readback"); + ASSERT (read_addresses->len == 1, + "ip6-old-addr", "expected one address on readback"); + + read_array = (GValueArray *) g_ptr_array_index (read_addresses, 0); + + read_addr = g_value_array_get_nth (read_array, 0); + ba = g_value_get_boxed (read_addr); + ASSERT (ba->len == sizeof (addr), + "ip6-old-addr", "unexpected address item length %d", ba->len); + ASSERT (memcmp (ba->data, &addr[0], sizeof (addr)) == 0, + "ip6-old-addr", "unexpected failure comparing addresses"); + + read_prefix = g_value_array_get_nth (read_array, 1); + ASSERT (g_value_get_uint (read_prefix) == prefix, + "ip6-old-addr", "unexpected failure comparing prefix"); + + /* Ensure the gateway is all zeros, which is how the 2-item to 3-item + * conversion happens. + */ + read_gw = g_value_array_get_nth (read_array, 2); + ba = g_value_get_boxed (read_gw); + ASSERT (ba->len == sizeof (gw), + "ip6-old-addr", "unexpected gateway item length %d", ba->len); + ASSERT (memcmp (ba->data, &gw[0], sizeof (gw)) == 0, + "ip6-old-addr", "unexpected failure comparing gateways"); + + g_value_unset (&written_value); + g_value_unset (&read_value); + g_object_unref (s_ip6); +} + int main (int argc, char **argv) { GError *error = NULL; @@ -142,6 +236,7 @@ int main (int argc, char **argv) /* The tests */ test_setting_vpn_items (); + test_setting_ip6_config_old_address_array (); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); From c5ff30fa71f2f80046f043b680384cf76c445f3c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 15:07:18 -0700 Subject: [PATCH 248/392] doc: update settings spec generator for IPv6 address changes --- docs/generate-settings-spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generate-settings-spec.c b/docs/generate-settings-spec.c index d7a391f9b0..6ec8f7c5e0 100644 --- a/docs/generate-settings-spec.c +++ b/docs/generate-settings-spec.c @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2009 Red Hat, Inc. + * (C) Copyright 2009 - 2010 Red Hat, Inc. */ #include @@ -86,7 +86,7 @@ static TypeNameElement name_map[] = { { "GPtrArray_GArray_guint__", "array of array of uint32" }, { "GPtrArray_GArray_guchar__", "array of byte array" }, { "GHashTable_gchararray+gchararray_", "dict of (string::string)" }, - { "GPtrArray_GValueArray_GArray_guchar_+guint__", "array of (byte array, uint32)" }, + { "GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar___", "array of (byte array, uint32, byte array)" }, { "GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar_+guint__", "array of (byte array, uint32, byte array, uint32)" }, { NULL, NULL } }; From 151a2b4c5a0587e72e6c757a0a5fc75dfa493a62 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 15:10:03 -0700 Subject: [PATCH 249/392] libnm-util: quiet harmless message in type conversion --- libnm-util/nm-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 808169471f..c9c34f1ba6 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -747,7 +747,8 @@ nm_utils_convert_string_hash_to_string (const GValue *src_value, GValue *dest_va hash = (GHashTable *) g_value_get_boxed (src_value); printable = g_string_new ("["); - g_hash_table_foreach (hash, convert_one_string_hash_entry, printable); + if (hash) + g_hash_table_foreach (hash, convert_one_string_hash_entry, printable); g_string_append (printable, " ]"); g_value_take_string (dest_value, printable->str); From 31590021ab007c426c6acacfef8db8064f04f4bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 15:10:17 -0700 Subject: [PATCH 250/392] libnm-util: update IPv6 address property description --- libnm-util/nm-setting-ip6-config.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index c383b2d270..3e42216cbd 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -684,25 +684,32 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * NMSettingIP6Config:addresses: * * Array of IPv6 address structures. Each IPv6 address structure is - * composed of 2 members, the first being a byte array containing the IPv6 - * address (network byte order) and the second a 32-bit integer containing - * the IPv6 address prefix. For the 'auto' method, given IP addresses are - * appended to those returned by automatic configuration. Addresses cannot - * be used with the 'shared' or 'link-local' methods as the interface is - * automatically assigned an address with these methods. + * composed of 3 members, the first being a byte array containing the IPv6 + * address (network byte order), the second a 32-bit integer containing the + * IPv6 address prefix, and the third a byte array containing the IPv6 + * address (network byte order) of the gateway associated with this address, + * if any. If no gateway is given, the third element should be given as + * all zeros. For the 'auto' method, given IP addresses are appended to + * those returned by automatic configuration. Addresses cannot be used with + * the 'shared' or 'link-local' methods as the interface is automatically + * assigned an address with these methods. **/ g_object_class_install_property (object_class, PROP_ADDRESSES, _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ADDRESSES, "Addresses", "Array of IPv6 address structures. Each IPv6 " - "address structure is composed of 2 members, the " + "address structure is composed of 3 members, the " "first being a byte array containing the IPv6 " - "address (network byte order) and the second a " + "address (network byte order), the second a " "32-bit integer containing the IPv6 address " - "prefix. For the 'auto' method, given IP " - "addresses are appended to those returned by " - "automatic configuration. Addresses cannot be " + "prefix, and the third a byte array containing " + "the IPv6 address (network byte order) of the " + "gateway associated with this address, if any. " + "If no gateway is given, the third element should " + "be given as all zeros. For the 'auto' method, " + "given IP addresses are appended to those returned " + "by automatic configuration. Addresses cannot be " "used with the 'shared' or 'link-local' methods " "as the interface is automatically assigned an " "address with these methods.", From b04ebe5cc3d11984332e86d48c5a8975b8d758cd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 16:55:40 -0700 Subject: [PATCH 251/392] keyfile: fix writing IPv6 addresses with new format --- system-settings/plugins/keyfile/io/writer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index d9f36af7a6..2e194072e3 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -298,9 +298,9 @@ ip6_addr_writer (GKeyFile *file, GValueArray *values = g_ptr_array_index (array, i); char *key_name, *ip6_addr; - if (values->n_values % 2) { - nm_warning ("%s: error writing IP6 address %d; address array length" - " %d is not a multiple of 2.", + if (values->n_values != 3) { + nm_warning ("%s: error writing IP6 address %d (address array length " + "%d is not 3)", __func__, i, values->n_values); continue; } From fbcdc95a21173c3ede100b4710d6cda30d554971 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 16:56:50 -0700 Subject: [PATCH 252/392] logging: logger needs -ldl for dladdr() --- src/logging/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/logging/Makefile.am b/src/logging/Makefile.am index d2e3e25112..51a6b25dc0 100644 --- a/src/logging/Makefile.am +++ b/src/logging/Makefile.am @@ -10,5 +10,6 @@ libnm_logging_la_CPPFLAGS = \ -DG_DISABLE_DEPRECATED libnm_logging_la_LIBADD = \ + -ldl \ $(GLIB_LIBS) From f9113079961887b93a2bbf4a0a5dd2212e53743a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 16:59:34 -0700 Subject: [PATCH 253/392] policy: move hostname/lookup thread operations into separate file --- src/Makefile.am | 4 + src/nm-policy-hostname.c | 196 ++++++++++++++++++++++++++++ src/nm-policy-hostname.h | 47 +++++++ src/nm-policy-hosts.c | 62 +++++++++ src/nm-policy-hosts.h | 10 +- src/nm-policy.c | 271 +++++---------------------------------- 6 files changed, 346 insertions(+), 244 deletions(-) create mode 100644 src/nm-policy-hostname.c create mode 100644 src/nm-policy-hostname.h diff --git a/src/Makefile.am b/src/Makefile.am index 214f7545c3..ca1ce6bbd2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -68,9 +68,11 @@ libtest_policy_hosts_la_SOURCES = \ nm-policy-hosts.h libtest_policy_hosts_la_CPPFLAGS = \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ $(GLIB_CFLAGS) libtest_policy_hosts_la_LIBADD = \ + ${top_builddir}/src/logging/libnm-logging.la \ $(GLIB_LIBS) @@ -123,6 +125,8 @@ NetworkManager_SOURCES = \ nm-policy.h \ nm-policy-hosts.c \ nm-policy-hosts.h \ + nm-policy-hostname.c \ + nm-policy-hostname.h \ NetworkManagerUtils.c \ NetworkManagerUtils.h \ nm-system.c \ diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c new file mode 100644 index 0000000000..02eb560263 --- /dev/null +++ b/src/nm-policy-hostname.c @@ -0,0 +1,196 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include + +#include + +#include "nm-logging.h" +#include "nm-policy-hostname.h" +#include "nm-policy-hosts.h" + +/************************************************************************/ + +struct HostnameThread { + GThread *thread; + + GMutex *lock; + gboolean dead; + int ret; + + guint32 ip4_addr; + char hostname[NI_MAXHOST + 1]; + + HostnameThreadCallback callback; + gpointer user_data; +}; + +static gboolean +hostname_thread_run_cb (gpointer user_data) +{ + HostnameThread *ht = (HostnameThread *) user_data; + + (*ht->callback) (ht, ht->ret, ht->hostname, ht->user_data); + return FALSE; +} + +static gpointer +hostname_thread_worker (gpointer data) +{ + HostnameThread *ht = (HostnameThread *) data; + struct sockaddr_in addr; + int i; + + g_mutex_lock (ht->lock); + if (ht->dead) { + g_mutex_unlock (ht->lock); + return (gpointer) NULL; + } + g_mutex_unlock (ht->lock); + + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = ht->ip4_addr; + + ht->ret = getnameinfo ((struct sockaddr *) &addr, sizeof (struct sockaddr_in), + ht->hostname, NI_MAXHOST, NULL, 0, + NI_NAMEREQD); + if (ht->ret == 0) { + for (i = 0; i < strlen (ht->hostname); i++) + ht->hostname[i] = tolower (ht->hostname[i]); + } + + /* Don't track the idle handler ID because by the time the g_idle_add() + * returns the ID, the handler may already have run and freed the + * HostnameThread. + */ + g_idle_add (hostname_thread_run_cb, ht); + return (gpointer) TRUE; +} + +void +hostname_thread_free (HostnameThread *ht) +{ + g_return_if_fail (ht != NULL); + + g_mutex_free (ht->lock); + memset (ht, 0, sizeof (HostnameThread)); + g_free (ht); +} + +HostnameThread * +hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer user_data) +{ + HostnameThread *ht; + + ht = g_malloc0 (sizeof (HostnameThread)); + g_assert (ht); + + ht->lock = g_mutex_new (); + ht->callback = callback; + ht->user_data = user_data; + ht->ip4_addr = ip4_addr; + + ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL); + if (!ht->thread) { + hostname_thread_free (ht); + ht = NULL; + } + + return ht; +} + +void +hostname_thread_kill (HostnameThread *ht) +{ + g_return_if_fail (ht != NULL); + + g_mutex_lock (ht->lock); + ht->dead = TRUE; + g_mutex_unlock (ht->lock); +} + +gboolean +hostname_thread_is_dead (HostnameThread *ht) +{ + g_return_val_if_fail (ht != NULL, TRUE); + + return ht->dead; +} + +/************************************************************************/ + +#define FALLBACK_HOSTNAME "localhost.localdomain" + +gboolean +nm_policy_set_system_hostname (const char *new_hostname, const char *msg) +{ + char old_hostname[HOST_NAME_MAX + 1]; + int ret = 0; + const char *name = new_hostname ? new_hostname : FALLBACK_HOSTNAME; + gboolean set_hostname = TRUE, changed = FALSE; + + old_hostname[HOST_NAME_MAX] = '\0'; + errno = 0; + ret = gethostname (old_hostname, HOST_NAME_MAX); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", + errno, strerror (errno)); + } else { + /* Don't set the hostname if it isn't actually changing */ + if ( (new_hostname && !strcmp (old_hostname, new_hostname)) + || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME))) + set_hostname = FALSE; + } + + if (set_hostname) { + nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); + ret = sethostname (name, strlen (name)); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", + name, errno, strerror (errno)); + return FALSE; + } + } + + /* But even if the hostname isn't changing, always try updating /etc/hosts + * just in case the hostname changed while NM wasn't running; we need to + * make sure that /etc/hosts has valid mappings for '127.0.0.1' and the + * current system hostname. If those exist, + * nm_policy_hosts_update_etc_hosts() will just return and won't touch + * /etc/hosts at all. + */ + if (!nm_policy_hosts_update_etc_hosts (name, FALLBACK_HOSTNAME, &changed)) { + /* error updating /etc/hosts; fallback to localhost.localdomain */ + nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); + ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", + FALLBACK_HOSTNAME, errno, strerror (errno)); + } + } + + return changed; +} + diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h new file mode 100644 index 0000000000..c59ca41078 --- /dev/null +++ b/src/nm-policy-hostname.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_POLICY_HOSTNAME_H +#define NM_POLICY_HOSTNAME_H + +#include + +gboolean nm_policy_set_system_hostname (const char *new_hostname, const char *msg); + + +typedef struct HostnameThread HostnameThread; + +typedef void (*HostnameThreadCallback) (HostnameThread *ht, + int error, + const char *hostname, + gpointer user_data); + +HostnameThread * hostname_thread_new (guint32 ip4_addr, + HostnameThreadCallback callback, + gpointer user_data); + +void hostname_thread_free (HostnameThread *ht); + +gboolean hostname_thread_is_dead (HostnameThread *ht); + +void hostname_thread_kill (HostnameThread *ht); + +#endif /* NM_POLICY_HOSTNAME_H */ diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 35a0b9d60c..7723c99759 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -25,6 +25,7 @@ #include #include "nm-policy-hosts.h" +#include "nm-logging.h" gboolean nm_policy_hosts_find_token (const char *line, const char *token) @@ -171,3 +172,64 @@ nm_policy_get_etc_hosts (const char **lines, return contents; } +gboolean +nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *fallback_hostname, + gboolean *out_changed) +{ + char *contents = NULL; + char **lines = NULL; + GError *error = NULL; + GString *new_contents = NULL; + gsize contents_len = 0; + gboolean success = FALSE; + + g_return_val_if_fail (hostname != NULL, FALSE); + g_return_val_if_fail (out_changed != NULL, FALSE); + + if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + return FALSE; + } + + /* Get the new /etc/hosts contents */ + lines = g_strsplit_set (contents, "\n\r", 0); + new_contents = nm_policy_get_etc_hosts ((const char **) lines, + contents_len, + hostname, + fallback_hostname, + &error); + g_strfreev (lines); + g_free (contents); + + if (new_contents) { + nm_log_info (LOGD_DNS, "Updating /etc/hosts with new system hostname"); + + g_clear_error (&error); + /* And actually update /etc/hosts */ + if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { + nm_log_warn (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + success = TRUE; + *out_changed = TRUE; + } + + g_string_free (new_contents, TRUE); + } else if (!error) { + /* No change required */ + success = TRUE; + } else { + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error->code, error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } + + return success; +} + diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h index 4130ad0037..0a77e6678a 100644 --- a/src/nm-policy-hosts.h +++ b/src/nm-policy-hosts.h @@ -23,14 +23,18 @@ #include +gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *fallback_hostname, + gboolean *out_changed); + +/* Only for testcases; don't use outside of nm-policy-hosts.c */ +gboolean nm_policy_hosts_find_token (const char *line, const char *token); + GString *nm_policy_get_etc_hosts (const char **lines, gsize existing_len, const char *hostname, const char *fallback_hostname, GError **error); -/* Only for testcases; don't use outside of nm-policy-hosts.c */ -gboolean nm_policy_hosts_find_token (const char *line, const char *token); - #endif /* NM_POLICY_HOSTS_H */ diff --git a/src/nm-policy.c b/src/nm-policy.c index 5cbf0cdbcd..4fccaf4d11 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -42,24 +42,7 @@ #include "nm-named-manager.h" #include "nm-vpn-manager.h" #include "nm-policy-hosts.h" - -typedef struct LookupThread LookupThread; - -typedef void (*LookupCallback) (LookupThread *thread, gpointer user_data); - -struct LookupThread { - GThread *thread; - - GMutex *lock; - gboolean die; - int ret; - - guint32 ip4_addr; - char hostname[NI_MAXHOST + 1]; - - LookupCallback callback; - gpointer user_data; -}; +#include "nm-policy-hostname.h" struct NMPolicy { NMManager *manager; @@ -74,97 +57,11 @@ struct NMPolicy { NMDevice *default_device; - LookupThread *lookup; + HostnameThread *lookup; char *orig_hostname; /* hostname at NM start time */ }; -static gboolean -lookup_thread_run_cb (gpointer user_data) -{ - LookupThread *thread = (LookupThread *) user_data; - - (*thread->callback) (thread, thread->user_data); - return FALSE; -} - -static gpointer -lookup_thread_worker (gpointer data) -{ - LookupThread *thread = (LookupThread *) data; - struct sockaddr_in addr; - - g_mutex_lock (thread->lock); - if (thread->die) { - g_mutex_unlock (thread->lock); - return (gpointer) NULL; - } - g_mutex_unlock (thread->lock); - - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = thread->ip4_addr; - - thread->ret = getnameinfo ((struct sockaddr *) &addr, sizeof (struct sockaddr_in), - thread->hostname, NI_MAXHOST, NULL, 0, - NI_NAMEREQD); - if (thread->ret == 0) { - int i; - - for (i = 0; i < strlen (thread->hostname); i++) - thread->hostname[i] = tolower (thread->hostname[i]); - } - - /* Don't track the idle handler ID because by the time the g_idle_add() - * returns the ID, the handler may already have run and freed the - * LookupThread. - */ - g_idle_add (lookup_thread_run_cb, thread); - return (gpointer) TRUE; -} - -static void -lookup_thread_free (LookupThread *thread) -{ - g_return_if_fail (thread != NULL); - - g_mutex_free (thread->lock); - memset (thread, 0, sizeof (LookupThread)); - g_free (thread); -} - -static LookupThread * -lookup_thread_new (guint32 ip4_addr, LookupCallback callback, gpointer user_data) -{ - LookupThread *thread; - - thread = g_malloc0 (sizeof (LookupThread)); - if (!thread) - return NULL; - - thread->lock = g_mutex_new (); - thread->callback = callback; - thread->user_data = user_data; - thread->ip4_addr = ip4_addr; - - thread->thread = g_thread_create (lookup_thread_worker, thread, FALSE, NULL); - if (!thread->thread) { - lookup_thread_free (thread); - return NULL; - } - - return thread; -} - -static void -lookup_thread_die (LookupThread *thread) -{ - g_return_if_fail (thread != NULL); - - g_mutex_lock (thread->lock); - thread->die = TRUE; - g_mutex_unlock (thread->lock); -} - #define INVALID_TAG "invalid" static const char * @@ -253,142 +150,34 @@ get_best_device (NMManager *manager, NMActRequest **out_req) return best; } -#define FALLBACK_HOSTNAME "localhost.localdomain" - -static gboolean -update_etc_hosts (const char *hostname, gboolean *out_changed) -{ - char *contents = NULL; - char **lines = NULL; - GError *error = NULL; - GString *new_contents = NULL; - gsize contents_len = 0; - gboolean success = FALSE; - - g_return_val_if_fail (hostname != NULL, FALSE); - g_return_val_if_fail (out_changed != NULL, FALSE); - - if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { - nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", - error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); - g_clear_error (&error); - return FALSE; - } - - /* Get the new /etc/hosts contents */ - lines = g_strsplit_set (contents, "\n\r", 0); - new_contents = nm_policy_get_etc_hosts ((const char **) lines, - contents_len, - hostname, - FALLBACK_HOSTNAME, - &error); - g_strfreev (lines); - g_free (contents); - - if (new_contents) { - nm_log_info (LOGD_DNS, "Updating /etc/hosts with new system hostname"); - - g_clear_error (&error); - /* And actually update /etc/hosts */ - if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { - nm_log_warn (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", - error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); - g_clear_error (&error); - } else { - success = TRUE; - *out_changed = TRUE; - } - - g_string_free (new_contents, TRUE); - } else if (!error) { - /* No change required */ - success = TRUE; - } else { - nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", - error->code, error->message ? error->message : "(unknown)"); - g_clear_error (&error); - } - - return success; -} - static void -set_system_hostname (const char *new_hostname, const char *msg) +_set_hostname (const char *new_hostname, const char *msg) { - char old_hostname[HOST_NAME_MAX + 1]; - int ret = 0; - const char *name = new_hostname ? new_hostname : FALLBACK_HOSTNAME; - gboolean set_hostname = TRUE, changed = FALSE; - - old_hostname[HOST_NAME_MAX] = '\0'; - errno = 0; - ret = gethostname (old_hostname, HOST_NAME_MAX); - if (ret != 0) { - nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", - errno, strerror (errno)); - } else { - /* Don't set the hostname if it isn't actually changing */ - if ( (new_hostname && !strcmp (old_hostname, new_hostname)) - || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME))) - set_hostname = FALSE; - } - - if (set_hostname) { - nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); - ret = sethostname (name, strlen (name)); - if (ret != 0) { - nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", - name, errno, strerror (errno)); - return; - } - } - - /* But still always try updating /etc/hosts just in case the hostname - * changed while NM wasn't running; we need to make sure that /etc/hosts - * has valid mappings for '127.0.0.1' and the current system hostname. If - * those exist, update_etc_hosts() will just return and won't touch - * /etc/hosts at all. - */ - if (!update_etc_hosts (name, &changed)) { - /* error updating /etc/hosts; fallback to localhost.localdomain */ - nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); - ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); - if (ret != 0) { - nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", - FALLBACK_HOSTNAME, errno, strerror (errno)); - } - } - - if (changed) + if (nm_policy_set_system_hostname (new_hostname, msg)) nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); } static void -lookup_callback (LookupThread *thread, gpointer user_data) +lookup_callback (HostnameThread *thread, + int result, + const char *hostname, + gpointer user_data) { NMPolicy *policy = (NMPolicy *) user_data; + char *msg; - /* If the thread was told to die or it's not the current in-progress - * hostname lookup, nothing to do. - */ - if (thread->die || (thread != policy->lookup)) - goto done; - - policy->lookup = NULL; - if (!strlen (thread->hostname)) { - char *msg; - - /* No valid IP4 config (!!); fall back to localhost.localdomain */ - msg = g_strdup_printf ("address lookup failed: %d", thread->ret); - set_system_hostname (NULL, msg); - g_free (msg); - } else - set_system_hostname (thread->hostname, "from address lookup"); - -done: - lookup_thread_free (thread); + /* Update the hostname if the calling lookup thread is the in-progress one */ + if (!hostname_thread_is_dead (thread) && (thread == policy->lookup)) { + policy->lookup = NULL; + if (!hostname) { + /* No valid IP4 config (!!); fall back to localhost.localdomain */ + msg = g_strdup_printf ("address lookup failed: %d", result); + _set_hostname (NULL, msg); + g_free (msg); + } else + _set_hostname (hostname, "from address lookup"); + } + hostname_thread_free (thread); } static void @@ -403,7 +192,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) g_return_if_fail (policy != NULL); if (policy->lookup) { - lookup_thread_die (policy->lookup); + hostname_thread_kill (policy->lookup); policy->lookup = NULL; } @@ -419,7 +208,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) /* Try a persistent hostname first */ g_object_get (G_OBJECT (policy->manager), NM_MANAGER_HOSTNAME, &configured_hostname, NULL); if (configured_hostname) { - set_system_hostname (configured_hostname, "from system configuration"); + _set_hostname (configured_hostname, "from system configuration"); g_free (configured_hostname); return; } @@ -432,7 +221,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) /* No best device; fall back to original hostname or if there wasn't * one, 'localhost.localdomain' */ - set_system_hostname (policy->orig_hostname, "no default device"); + _set_hostname (policy->orig_hostname, "no default device"); return; } @@ -446,7 +235,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) /* Sanity check */ while (*p) { if (!isblank (*p++)) { - set_system_hostname (dhcp4_hostname, "from DHCP"); + _set_hostname (dhcp4_hostname, "from DHCP"); return; } } @@ -459,7 +248,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) * when NM started up. */ if (policy->orig_hostname) { - set_system_hostname (policy->orig_hostname, "from system startup"); + _set_hostname (policy->orig_hostname, "from system startup"); return; } @@ -471,7 +260,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { /* No valid IP4 config (!!); fall back to localhost.localdomain */ - set_system_hostname (NULL, "no IPv4 config"); + _set_hostname (NULL, "no IPv4 config"); return; } @@ -479,10 +268,10 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) g_assert (addr); /* checked for > 1 address above */ /* Start the hostname lookup thread */ - policy->lookup = lookup_thread_new (nm_ip4_address_get_address (addr), lookup_callback, policy); + policy->lookup = hostname_thread_new (nm_ip4_address_get_address (addr), lookup_callback, policy); if (!policy->lookup) { /* Fall back to 'localhost.localdomain' */ - set_system_hostname (NULL, "error starting hostname thread"); + _set_hostname (NULL, "error starting hostname thread"); } } @@ -1088,7 +877,7 @@ nm_policy_destroy (NMPolicy *policy) * by the lookup thread callback. */ if (policy->lookup) { - lookup_thread_die (policy->lookup); + hostname_thread_kill (policy->lookup); policy->lookup = NULL; } From e2d28adeb058bab0d1615db136a1180d39628d57 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 10:45:01 -0700 Subject: [PATCH 254/392] core: simplify netlink monitor code a bit --- src/nm-netlink-monitor.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 918d637d72..913a5887bb 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -47,14 +47,9 @@ #include "nm-marshal.h" #include "nm-netlink.h" -#define NM_NETLINK_MONITOR_EVENT_CONDITIONS \ - ((GIOCondition) (G_IO_IN | G_IO_PRI)) - -#define NM_NETLINK_MONITOR_ERROR_CONDITIONS \ - ((GIOCondition) (G_IO_ERR | G_IO_NVAL)) - -#define NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS \ - ((GIOCondition) (G_IO_HUP)) +#define EVENT_CONDITIONS ((GIOCondition) (G_IO_IN | G_IO_PRI)) +#define ERROR_CONDITIONS ((GIOCondition) (G_IO_ERR | G_IO_NVAL)) +#define DISCONNECT_CONDITIONS ((GIOCondition) (G_IO_HUP)) #define NM_NETLINK_MONITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ NM_TYPE_NETLINK_MONITOR, \ @@ -374,9 +369,7 @@ nm_netlink_monitor_attach (NMNetlinkMonitor *monitor) g_return_if_fail (priv->event_id == 0); priv->event_id = g_io_add_watch (priv->io_channel, - (NM_NETLINK_MONITOR_EVENT_CONDITIONS | - NM_NETLINK_MONITOR_ERROR_CONDITIONS | - NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS), + (EVENT_CONDITIONS | ERROR_CONDITIONS | DISCONNECT_CONDITIONS), nm_netlink_monitor_event_handler, monitor); } @@ -450,12 +443,12 @@ nm_netlink_monitor_event_handler (GIOChannel *channel, priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); g_return_val_if_fail (priv->event_id > 0, TRUE); - if (io_condition & NM_NETLINK_MONITOR_ERROR_CONDITIONS) + if (io_condition & ERROR_CONDITIONS) return nm_netlink_monitor_error_handler (channel, io_condition, monitor); - else if (io_condition & NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS) + else if (io_condition & DISCONNECT_CONDITIONS) return nm_netlink_monitor_disconnect_handler (channel, io_condition, monitor); - g_return_val_if_fail (!(io_condition & ~(NM_NETLINK_MONITOR_EVENT_CONDITIONS)), FALSE); + g_return_val_if_fail (!(io_condition & ~EVENT_CONDITIONS), FALSE); if (nl_recvmsgs_default (priv->nlh) < 0) { error = g_error_new (NM_NETLINK_MONITOR_ERROR, @@ -482,7 +475,7 @@ nm_netlink_monitor_error_handler (GIOChannel *channel, int err_code; socklen_t err_len; - g_return_val_if_fail (io_condition & NM_NETLINK_MONITOR_ERROR_CONDITIONS, FALSE); + g_return_val_if_fail (io_condition & ERROR_CONDITIONS, FALSE); err_code = 0; err_len = sizeof (err_code); @@ -512,7 +505,7 @@ nm_netlink_monitor_disconnect_handler (GIOChannel *channel, NMNetlinkMonitor *monitor) { - g_return_val_if_fail (!(io_condition & ~(NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)), FALSE); + g_return_val_if_fail (!(io_condition & ~DISCONNECT_CONDITIONS), FALSE); return FALSE; } From 3da6854f1f0be5599ce3ecd0c9b749b08fac5909 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 10:55:40 -0700 Subject: [PATCH 255/392] core: more netlink monitor cleanup and reorg --- src/nm-netlink-monitor.c | 145 ++++++++++++++------------------------- 1 file changed, 51 insertions(+), 94 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 913a5887bb..a984ebe236 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -66,18 +66,6 @@ typedef struct { guint request_status_id; } NMNetlinkMonitorPrivate; -static gboolean nm_netlink_monitor_event_handler (GIOChannel *channel, - GIOCondition io_condition, - gpointer user_data); - -static gboolean nm_netlink_monitor_error_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkMonitor *monitor); - -static gboolean nm_netlink_monitor_disconnect_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkMonitor *monitor); - enum { CARRIER_ON = 0, CARRIER_OFF, @@ -232,6 +220,56 @@ netlink_event_input (struct nl_msg *msg, void *arg) return NL_STOP; } +static gboolean +event_handler (GIOChannel *channel, + GIOCondition io_condition, + gpointer user_data) +{ + NMNetlinkMonitor *monitor = (NMNetlinkMonitor *) user_data; + NMNetlinkMonitorPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (monitor), TRUE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + g_return_val_if_fail (priv->event_id > 0, TRUE); + + if (io_condition & ERROR_CONDITIONS) { + const char *err_msg; + int err_code = 0; + socklen_t err_len = sizeof (err_code); + + /* Grab error information */ + if (getsockopt (g_io_channel_unix_get_fd (channel), + SOL_SOCKET, SO_ERROR, (void *) &err_code, &err_len)) + err_msg = strerror (err_code); + else + err_msg = _("error occurred while waiting for data on socket"); + + error = g_error_new (NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA, + "%s", err_msg); + g_signal_emit (monitor, signals[ERROR], 0, error); + g_error_free (error); + return TRUE; + } else if (io_condition & DISCONNECT_CONDITIONS) + return FALSE; + + g_return_val_if_fail (!(io_condition & ~EVENT_CONDITIONS), FALSE); + + /* Process the netlink messages */ + if (nl_recvmsgs_default (priv->nlh) < 0) { + error = g_error_new (NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, + _("error processing netlink message: %s"), + nl_geterror ()); + g_signal_emit (G_OBJECT (monitor), signals[ERROR], 0, error); + g_error_free (error); + } + + return TRUE; +} + gboolean nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, GError **error) @@ -370,8 +408,7 @@ nm_netlink_monitor_attach (NMNetlinkMonitor *monitor) priv->event_id = g_io_add_watch (priv->io_channel, (EVENT_CONDITIONS | ERROR_CONDITIONS | DISCONNECT_CONDITIONS), - nm_netlink_monitor_event_handler, - monitor); + event_handler, monitor); } void @@ -429,86 +466,6 @@ nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, return TRUE; } -static gboolean -nm_netlink_monitor_event_handler (GIOChannel *channel, - GIOCondition io_condition, - gpointer user_data) -{ - NMNetlinkMonitor *monitor = (NMNetlinkMonitor *) user_data; - NMNetlinkMonitorPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (NM_IS_NETLINK_MONITOR (monitor), TRUE); - - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); - g_return_val_if_fail (priv->event_id > 0, TRUE); - - if (io_condition & ERROR_CONDITIONS) - return nm_netlink_monitor_error_handler (channel, io_condition, monitor); - else if (io_condition & DISCONNECT_CONDITIONS) - return nm_netlink_monitor_disconnect_handler (channel, io_condition, monitor); - - g_return_val_if_fail (!(io_condition & ~EVENT_CONDITIONS), FALSE); - - if (nl_recvmsgs_default (priv->nlh) < 0) { - error = g_error_new (NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, - _("error processing netlink message: %s"), - nl_geterror ()); - - g_signal_emit (G_OBJECT (monitor), - signals[ERROR], - 0, error); - g_error_free (error); - } - - return TRUE; -} - -static gboolean -nm_netlink_monitor_error_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkMonitor *monitor) -{ - GError *socket_error; - const char *err_msg; - int err_code; - socklen_t err_len; - - g_return_val_if_fail (io_condition & ERROR_CONDITIONS, FALSE); - - err_code = 0; - err_len = sizeof (err_code); - if (getsockopt (g_io_channel_unix_get_fd (channel), - SOL_SOCKET, SO_ERROR, (void *) &err_code, &err_len)) - err_msg = strerror (err_code); - else - err_msg = _("error occurred while waiting for data on socket"); - - socket_error = g_error_new (NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA, - "%s", - err_msg); - - g_signal_emit (G_OBJECT (monitor), - signals[ERROR], - 0, socket_error); - - g_error_free (socket_error); - - return TRUE; -} - -static gboolean -nm_netlink_monitor_disconnect_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkMonitor *monitor) -{ - - g_return_val_if_fail (!(io_condition & ~DISCONNECT_CONDITIONS), FALSE); - return FALSE; -} - typedef struct { NMNetlinkMonitor *self; struct rtnl_link *filter; From cadc56abc80b62b328ff345f22a3642e124c4740 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 15:22:36 -0700 Subject: [PATCH 256/392] netlink: loosen sender checks to allow other multicast messages We need the IFLA_PROTINFO messages, and these are apparently sent (still by the kernel) but with our own PID. So the current checks that limit the netlink PID to zero block these messages out. Instead (like udev) we should be checking the actual sender of the message usign unix socket credentials. Second, at least at this point only privileged processes can send netlink multicast messages, so as long as the: * the other end of the socket is UID 0 AND * the netlink PID is 0 OR * the message is multicast and sent to our netlink PID the we accept the message and process it as normal. For another example of this, see 'netlink.c' from the dhcp6s program; do a Google search for "IFLA_PROTINFO" to find it. --- src/nm-netlink-monitor.c | 45 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index a984ebe236..2f11ff154e 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -25,6 +25,9 @@ * Copyright (C) 2004 Novell, Inc. */ +/* for struct ucred */ +#include + #include #include #include @@ -209,15 +212,41 @@ out: static int netlink_event_input (struct nl_msg *msg, void *arg) { + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); struct nlmsghdr *hdr = nlmsg_hdr (msg); + struct ucred *creds = nlmsg_get_creds (msg); + guint32 local_port; + gboolean accept_msg = FALSE; - if (hdr->nlmsg_pid != 0) + /* Only messages sent from the kernel */ + if (!creds || creds->uid != 0) { + nm_log_dbg (LOGD_HW, "ignoring netlink message from UID %d", + creds ? creds->uid : -1); return NL_STOP; + } + + /* Accept any messages from the kernel */ + if (hdr->nlmsg_pid == 0) + accept_msg = TRUE; + + /* And any multicast message directed to our netlink PID, since multicast + * currently requires CAP_ADMIN to use. + */ + local_port = nl_socket_get_local_port (priv->nlh); + if ((hdr->nlmsg_pid == local_port) && (hdr->nlmsg_flags & NLM_F_MULTI)) + accept_msg = TRUE; + + if (accept_msg == FALSE) { + nm_log_dbg (LOGD_HW, "ignoring netlink message from PID %d (local PID %d, multicast %d)", + hdr->nlmsg_pid, + local_port, + (hdr->nlmsg_flags & NLM_F_MULTI)); + return NL_STOP; + } nl_msg_parse (msg, &netlink_object_message_handler, arg); - - /* Stop processing messages */ - return NL_STOP; + return NL_SKIP; } static gboolean @@ -304,6 +333,14 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, goto error; } + if (nl_set_passcred (priv->nlh, 1) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to enable netlink handle credential passing: %s"), + nl_geterror ()); + goto error; + } + if (nl_socket_add_membership (priv->nlh, RTNLGRP_LINK) < 0) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, From dd3848ea458f3c88f0d347336a97d4d8095fe06f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 15:31:54 -0700 Subject: [PATCH 257/392] netlink: move generic GObject stuff to the bottom --- src/nm-netlink-monitor.c | 189 ++++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 2f11ff154e..df56cd7d53 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -81,89 +81,6 @@ static guint signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (NMNetlinkMonitor, nm_netlink_monitor, G_TYPE_OBJECT); -NMNetlinkMonitor * -nm_netlink_monitor_get (void) -{ - static NMNetlinkMonitor *singleton = NULL; - - if (!singleton) - singleton = NM_NETLINK_MONITOR (g_object_new (NM_TYPE_NETLINK_MONITOR, NULL)); - else - g_object_ref (singleton); - - return singleton; -} - -static void -nm_netlink_monitor_init (NMNetlinkMonitor *monitor) -{ -} - -static void -finalize (GObject *object) -{ - NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (object); - - if (priv->request_status_id) - g_source_remove (priv->request_status_id); - - if (priv->io_channel) - nm_netlink_monitor_close_connection (NM_NETLINK_MONITOR (object)); - - if (priv->nlh_link_cache) { - nl_cache_free (priv->nlh_link_cache); - priv->nlh_link_cache = NULL; - } - - if (priv->nlh) { - nl_handle_destroy (priv->nlh); - priv->nlh = NULL; - } - - if (priv->nlh_cb) { - nl_cb_put (priv->nlh_cb); - priv->nlh_cb = NULL; - } - - G_OBJECT_CLASS (nm_netlink_monitor_parent_class)->finalize (object); -} - -static void -nm_netlink_monitor_class_init (NMNetlinkMonitorClass *monitor_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (monitor_class); - - g_type_class_add_private (monitor_class, sizeof (NMNetlinkMonitorPrivate)); - - /* Virtual methods */ - object_class->finalize = finalize; - - /* Signals */ - signals[CARRIER_ON] = - g_signal_new ("carrier-on", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_on), - NULL, NULL, g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - signals[CARRIER_OFF] = - g_signal_new ("carrier-off", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_off), - NULL, NULL, g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - signals[ERROR] = - g_signal_new ("error", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMNetlinkMonitorClass, error), - NULL, NULL, _nm_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); -} - static void netlink_object_message_handler (struct nl_object *obj, void *arg) { @@ -421,17 +338,6 @@ nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor) priv->io_channel = NULL; } -GQuark -nm_netlink_monitor_error_quark (void) -{ - static GQuark error_quark = 0; - - if (error_quark == 0) - error_quark = g_quark_from_static_string ("nm-netlink-monitor-error-quark"); - - return error_quark; -} - void nm_netlink_monitor_attach (NMNetlinkMonitor *monitor) { @@ -591,3 +497,98 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, return TRUE; /* success */ } +/***************************************************************/ + +NMNetlinkMonitor * +nm_netlink_monitor_get (void) +{ + static NMNetlinkMonitor *singleton = NULL; + + if (!singleton) + singleton = NM_NETLINK_MONITOR (g_object_new (NM_TYPE_NETLINK_MONITOR, NULL)); + else + g_object_ref (singleton); + + return singleton; +} + +static void +nm_netlink_monitor_init (NMNetlinkMonitor *monitor) +{ +} + +static void +finalize (GObject *object) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (object); + + if (priv->request_status_id) + g_source_remove (priv->request_status_id); + + if (priv->io_channel) + nm_netlink_monitor_close_connection (NM_NETLINK_MONITOR (object)); + + if (priv->nlh_link_cache) { + nl_cache_free (priv->nlh_link_cache); + priv->nlh_link_cache = NULL; + } + + if (priv->nlh) { + nl_handle_destroy (priv->nlh); + priv->nlh = NULL; + } + + if (priv->nlh_cb) { + nl_cb_put (priv->nlh_cb); + priv->nlh_cb = NULL; + } + + G_OBJECT_CLASS (nm_netlink_monitor_parent_class)->finalize (object); +} + +static void +nm_netlink_monitor_class_init (NMNetlinkMonitorClass *monitor_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (monitor_class); + + g_type_class_add_private (monitor_class, sizeof (NMNetlinkMonitorPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + + /* Signals */ + signals[CARRIER_ON] = + g_signal_new ("carrier-on", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_on), + NULL, NULL, g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); + + signals[CARRIER_OFF] = + g_signal_new ("carrier-off", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_off), + NULL, NULL, g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); + + signals[ERROR] = + g_signal_new ("error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, error), + NULL, NULL, _nm_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} + +GQuark +nm_netlink_monitor_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = g_quark_from_static_string ("nm-netlink-monitor-error-quark"); + return error_quark; +} + From 6695eb7423cb1393c36740b8ce6a73d9ff6a7ebe Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 15:54:55 -0700 Subject: [PATCH 258/392] netlink: let clients get netlink message for generic parsing First step on the way to killing the IPv6-specific netlink listener. --- src/nm-netlink-monitor.c | 49 ++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index df56cd7d53..21ea5ab3dd 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -47,7 +47,6 @@ #include "nm-system.h" #include "nm-netlink-monitor.h" #include "nm-logging.h" -#include "nm-marshal.h" #include "nm-netlink.h" #define EVENT_CONDITIONS ((GIOCondition) (G_IO_IN | G_IO_PRI)) @@ -70,19 +69,19 @@ typedef struct { } NMNetlinkMonitorPrivate; enum { - CARRIER_ON = 0, - CARRIER_OFF, - ERROR, - - LAST_SIGNAL + NOTIFICATION = 0, + CARRIER_ON, + CARRIER_OFF, + ERROR, + LAST_SIGNAL }; - static guint signals[LAST_SIGNAL] = { 0 }; + G_DEFINE_TYPE (NMNetlinkMonitor, nm_netlink_monitor, G_TYPE_OBJECT); static void -netlink_object_message_handler (struct nl_object *obj, void *arg) +link_msg_handler (struct nl_object *obj, void *arg) { NMNetlinkMonitor *monitor = NM_NETLINK_MONITOR (arg); GError *error; @@ -97,9 +96,7 @@ netlink_object_message_handler (struct nl_object *obj, void *arg) NM_NETLINK_MONITOR_ERROR_BAD_ALLOC, _("error processing netlink message: %s"), nl_geterror ()); - g_signal_emit (G_OBJECT (monitor), - signals[ERROR], - 0, error); + g_signal_emit (G_OBJECT (monitor), signals[ERROR], 0, error); g_error_free (error); return; } @@ -162,8 +159,13 @@ netlink_event_input (struct nl_msg *msg, void *arg) return NL_STOP; } - nl_msg_parse (msg, &netlink_object_message_handler, arg); - return NL_SKIP; + /* Let clients handle generic messages */ + g_signal_emit (self, signals[NOTIFICATION], 0, msg); + + /* Parse carrier messages */ + nl_msg_parse (msg, &link_msg_handler, self); + + return NL_OK; } static gboolean @@ -250,6 +252,9 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, goto error; } + /* Enable unix socket peer credentials which we use for verifying that the + * sender of the message is actually the kernel. + */ if (nl_set_passcred (priv->nlh, 1) < 0) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, @@ -381,12 +386,8 @@ deferred_emit_carrier_state (gpointer user_data) */ if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); - } else { - nl_cache_foreach_filter (priv->nlh_link_cache, - NULL, - netlink_object_message_handler, - monitor); - } + } else + nl_cache_foreach_filter (priv->nlh_link_cache, NULL, link_msg_handler, monitor); return FALSE; } @@ -557,6 +558,14 @@ nm_netlink_monitor_class_init (NMNetlinkMonitorClass *monitor_class) object_class->finalize = finalize; /* Signals */ + signals[NOTIFICATION] = + g_signal_new ("notification", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, notification), + NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + signals[CARRIER_ON] = g_signal_new ("carrier-on", G_OBJECT_CLASS_TYPE (object_class), @@ -578,7 +587,7 @@ nm_netlink_monitor_class_init (NMNetlinkMonitorClass *monitor_class) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMNetlinkMonitorClass, error), - NULL, NULL, _nm_marshal_VOID__POINTER, + NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); } From 952745d4d341e2a83f850db89563ad94975b63a8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 15:59:18 -0700 Subject: [PATCH 259/392] netlink: add header part of 6695eb7423cb1393c36740b8ce6a73d9ff6a7ebe --- src/nm-netlink-monitor.h | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h index 115eccaaa3..06bbe572db 100644 --- a/src/nm-netlink-monitor.h +++ b/src/nm-netlink-monitor.h @@ -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. * Copyright (C) 2005 Ray Strode */ @@ -25,16 +25,14 @@ #include #include +#include -G_BEGIN_DECLS - -#define NM_TYPE_NETLINK_MONITOR (nm_netlink_monitor_get_type ()) -#define NM_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitor)) +#define NM_TYPE_NETLINK_MONITOR (nm_netlink_monitor_get_type ()) +#define NM_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitor)) #define NM_NETLINK_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitorClass)) -#define NM_IS_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_NETLINK_MONITOR)) +#define NM_IS_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_NETLINK_MONITOR)) #define NM_IS_NETLINK_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_NETLINK_MONITOR)) #define NM_NETLINK_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitorClass)) -#define NM_NETLINK_MONITOR_ERROR (nm_netlink_monitor_error_quark ()) typedef enum { NM_NETLINK_MONITOR_ERROR_GENERIC = 0, @@ -56,29 +54,29 @@ typedef struct { GObjectClass parent_class; /* Signals */ - void (*carrier_on) (NMNetlinkMonitor *monitor, int index); - void (*carrier_off) (NMNetlinkMonitor *monitor, int index); - void (*error) (NMNetlinkMonitor *monitor, GError *error); + void (*notification) (NMNetlinkMonitor *monitor, struct nl_msg *msg); + void (*carrier_on) (NMNetlinkMonitor *monitor, int index); + void (*carrier_off) (NMNetlinkMonitor *monitor, int index); + void (*error) (NMNetlinkMonitor *monitor, GError *error); } NMNetlinkMonitorClass; -GType nm_netlink_monitor_get_type (void) G_GNUC_CONST; -GQuark nm_netlink_monitor_error_quark (void) G_GNUC_CONST; +#define NM_NETLINK_MONITOR_ERROR (nm_netlink_monitor_error_quark ()) +GType nm_netlink_monitor_get_type (void) G_GNUC_CONST; +GQuark nm_netlink_monitor_error_quark (void) G_GNUC_CONST; NMNetlinkMonitor *nm_netlink_monitor_get (void); gboolean nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, - GError **error); + GError **error); void nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor); -void nm_netlink_monitor_attach (NMNetlinkMonitor *monitor); -void nm_netlink_monitor_detach (NMNetlinkMonitor *monitor); +void nm_netlink_monitor_attach (NMNetlinkMonitor *monitor); +void nm_netlink_monitor_detach (NMNetlinkMonitor *monitor); gboolean nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, - GError **error); + GError **error); gboolean nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *monitor, guint32 ifindex, guint32 *ifflags, GError **error); -G_END_DECLS - #endif /* NM_NETLINK_MONITOR_H */ From b3d833746514050696826c6ff5a0b80bd80bd85f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 15:59:50 -0700 Subject: [PATCH 260/392] netlink: s/monitor/self --- src/nm-netlink-monitor.c | 71 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 21ea5ab3dd..4a6818dc13 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -83,7 +83,7 @@ G_DEFINE_TYPE (NMNetlinkMonitor, nm_netlink_monitor, G_TYPE_OBJECT); static void link_msg_handler (struct nl_object *obj, void *arg) { - NMNetlinkMonitor *monitor = NM_NETLINK_MONITOR (arg); + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); GError *error; struct rtnl_link *filter; struct rtnl_link *link_obj; @@ -96,7 +96,7 @@ link_msg_handler (struct nl_object *obj, void *arg) NM_NETLINK_MONITOR_ERROR_BAD_ALLOC, _("error processing netlink message: %s"), nl_geterror ()); - g_signal_emit (G_OBJECT (monitor), signals[ERROR], 0, error); + g_signal_emit (self, signals[ERROR], 0, error); g_error_free (error); return; } @@ -115,9 +115,9 @@ link_msg_handler (struct nl_object *obj, void *arg) * b00055aacdb172c05067612278ba27265fcd05ce in 2.6.17. */ if (flags & IFF_LOWER_UP) - g_signal_emit (G_OBJECT (monitor), signals[CARRIER_ON], 0, ifidx); + g_signal_emit (self, signals[CARRIER_ON], 0, ifidx); else - g_signal_emit (G_OBJECT (monitor), signals[CARRIER_OFF], 0, ifidx); + g_signal_emit (self, signals[CARRIER_OFF], 0, ifidx); out: rtnl_link_put (filter); @@ -173,13 +173,13 @@ event_handler (GIOChannel *channel, GIOCondition io_condition, gpointer user_data) { - NMNetlinkMonitor *monitor = (NMNetlinkMonitor *) user_data; + NMNetlinkMonitor *self = (NMNetlinkMonitor *) user_data; NMNetlinkMonitorPrivate *priv; GError *error = NULL; - g_return_val_if_fail (NM_IS_NETLINK_MONITOR (monitor), TRUE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), TRUE); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_val_if_fail (priv->event_id > 0, TRUE); if (io_condition & ERROR_CONDITIONS) { @@ -197,7 +197,7 @@ event_handler (GIOChannel *channel, error = g_error_new (NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA, "%s", err_msg); - g_signal_emit (monitor, signals[ERROR], 0, error); + g_signal_emit (self, signals[ERROR], 0, error); g_error_free (error); return TRUE; } else if (io_condition & DISCONNECT_CONDITIONS) @@ -211,7 +211,7 @@ event_handler (GIOChannel *channel, NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, _("error processing netlink message: %s"), nl_geterror ()); - g_signal_emit (G_OBJECT (monitor), signals[ERROR], 0, error); + g_signal_emit (self, signals[ERROR], 0, error); g_error_free (error); } @@ -219,17 +219,17 @@ event_handler (GIOChannel *channel, } gboolean -nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, - GError **error) +nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) { NMNetlinkMonitorPrivate *priv; - int fd; GError *channel_error = NULL; GIOFlags channel_flags; + int fd; - g_return_val_if_fail (NM_IS_NETLINK_MONITOR (monitor), FALSE); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_val_if_fail (priv->io_channel == NULL, FALSE); priv->nlh_cb = nl_cb_alloc (NL_CB_VERBOSE); @@ -243,7 +243,7 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, } nl_disable_sequence_check (priv->nlh); - nl_socket_modify_cb (priv->nlh, NL_CB_VALID, NL_CB_CUSTOM, netlink_event_input, monitor); + nl_socket_modify_cb (priv->nlh, NL_CB_VALID, NL_CB_CUSTOM, netlink_event_input, self); if (nl_connect (priv->nlh, NETLINK_ROUTE) < 0) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, @@ -303,7 +303,7 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, error: if (priv->io_channel) - nm_netlink_monitor_close_connection (monitor); + nm_netlink_monitor_close_connection (self); if (priv->nlh_link_cache) { nl_cache_free (priv->nlh_link_cache); @@ -323,17 +323,17 @@ error: } void -nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor) +nm_netlink_monitor_close_connection (NMNetlinkMonitor *self) { NMNetlinkMonitorPrivate *priv; - g_return_if_fail (NM_IS_NETLINK_MONITOR (monitor)); + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_if_fail (priv->io_channel != NULL); if (priv->event_id) - nm_netlink_monitor_detach (monitor); + nm_netlink_monitor_detach (self); g_io_channel_shutdown (priv->io_channel, TRUE /* flush pending data */, @@ -344,29 +344,29 @@ nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor) } void -nm_netlink_monitor_attach (NMNetlinkMonitor *monitor) +nm_netlink_monitor_attach (NMNetlinkMonitor *self) { NMNetlinkMonitorPrivate *priv; - g_return_if_fail (NM_IS_NETLINK_MONITOR (monitor)); + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_if_fail (priv->nlh != NULL); g_return_if_fail (priv->event_id == 0); priv->event_id = g_io_add_watch (priv->io_channel, (EVENT_CONDITIONS | ERROR_CONDITIONS | DISCONNECT_CONDITIONS), - event_handler, monitor); + event_handler, self); } void -nm_netlink_monitor_detach (NMNetlinkMonitor *monitor) +nm_netlink_monitor_detach (NMNetlinkMonitor *self) { NMNetlinkMonitorPrivate *priv; - g_return_if_fail (NM_IS_NETLINK_MONITOR (monitor)); + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_if_fail (priv->event_id > 0); g_source_remove (priv->event_id); @@ -376,8 +376,8 @@ nm_netlink_monitor_detach (NMNetlinkMonitor *monitor) static gboolean deferred_emit_carrier_state (gpointer user_data) { - NMNetlinkMonitor *monitor = NM_NETLINK_MONITOR (user_data); - NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (user_data); + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); priv->request_status_id = 0; @@ -387,25 +387,24 @@ deferred_emit_carrier_state (gpointer user_data) if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); } else - nl_cache_foreach_filter (priv->nlh_link_cache, NULL, link_msg_handler, monitor); + nl_cache_foreach_filter (priv->nlh_link_cache, NULL, link_msg_handler, self); return FALSE; } gboolean -nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, - GError **error) +nm_netlink_monitor_request_status (NMNetlinkMonitor *self, GError **error) { NMNetlinkMonitorPrivate *priv; - g_return_val_if_fail (NM_IS_NETLINK_MONITOR (monitor), FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); - priv = NM_NETLINK_MONITOR_GET_PRIVATE (monitor); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_val_if_fail (priv->event_id > 0, FALSE); /* Schedule the carrier state emission */ if (!priv->request_status_id) - priv->request_status_id = g_idle_add (deferred_emit_carrier_state, monitor); + priv->request_status_id = g_idle_add (deferred_emit_carrier_state, self); return TRUE; } @@ -514,7 +513,7 @@ nm_netlink_monitor_get (void) } static void -nm_netlink_monitor_init (NMNetlinkMonitor *monitor) +nm_netlink_monitor_init (NMNetlinkMonitor *self) { } From d1c7c37863711f34b62f637e842ea3c24cab86e7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 16:32:03 -0700 Subject: [PATCH 261/392] netlink: implement generic group subscription Needed by the IPv6 manager. --- src/nm-netlink-monitor.c | 86 +++++++++++++++++++++++++++++++++++++--- src/nm-netlink-monitor.h | 12 +++++- 2 files changed, 90 insertions(+), 8 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 4a6818dc13..b807d5c37c 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -66,6 +66,8 @@ typedef struct { guint event_id; guint request_status_id; + + GHashTable *subscriptions; } NMNetlinkMonitorPrivate; enum { @@ -263,13 +265,9 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } - if (nl_socket_add_membership (priv->nlh, RTNLGRP_LINK) < 0) { - g_set_error (error, NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, - _("unable to join netlink group for monitoring link status: %s"), - nl_geterror ()); + /* Subscribe to the LINK group for internal carrier signals */ + if (!nm_netlink_monitor_subscribe (self, RTNLGRP_LINK, error)) goto error; - } if ((priv->nlh_link_cache = rtnl_link_alloc_cache (priv->nlh)) == NULL) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, @@ -373,6 +371,77 @@ nm_netlink_monitor_detach (NMNetlinkMonitor *self) priv->event_id = 0; } +static int +get_subs (NMNetlinkMonitor *self, int group) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + return GPOINTER_TO_INT (g_hash_table_lookup (priv->subscriptions, + GINT_TO_POINTER (group))); +} + +static void +set_subs (NMNetlinkMonitor *self, int group, int new_subs) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + g_hash_table_insert (priv->subscriptions, + GINT_TO_POINTER (group), + GINT_TO_POINTER (new_subs)); +} + +gboolean +nm_netlink_monitor_subscribe (NMNetlinkMonitor *self, int group, GError **error) +{ + NMNetlinkMonitorPrivate *priv; + int subs; + + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + if (!priv->nlh) { + if (!nm_netlink_monitor_open_connection (self, error)) + return FALSE; + } + + subs = get_subs (self, group) + 1; + if (subs == 1) { + if (nl_socket_add_membership (priv->nlh, group) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, + _("unable to join netlink group: %s"), + nl_geterror ()); + return FALSE; + } + } + + /* Update # of subscriptions for this group */ + set_subs (self, group, subs); + + return TRUE; +} + +void +nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *self, int group) +{ + NMNetlinkMonitorPrivate *priv; + int subs; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_if_fail (priv->nlh != NULL); + + subs = get_subs (self, group) - 1; + if (subs == 0) + nl_socket_drop_membership (priv->nlh, group); + + /* Update # of subscriptions for this group */ + set_subs (self, group, subs); +} + static gboolean deferred_emit_carrier_state (gpointer user_data) { @@ -515,6 +584,9 @@ nm_netlink_monitor_get (void) static void nm_netlink_monitor_init (NMNetlinkMonitor *self) { + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + priv->subscriptions = g_hash_table_new (g_int_hash, g_int_equal); } static void @@ -543,6 +615,8 @@ finalize (GObject *object) priv->nlh_cb = NULL; } + g_hash_table_destroy (priv->subscriptions); + G_OBJECT_CLASS (nm_netlink_monitor_parent_class)->finalize (object); } diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h index 06bbe572db..1920704a79 100644 --- a/src/nm-netlink-monitor.h +++ b/src/nm-netlink-monitor.h @@ -67,11 +67,19 @@ GQuark nm_netlink_monitor_error_quark (void) G_GNUC_CONST; NMNetlinkMonitor *nm_netlink_monitor_get (void); -gboolean nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, - GError **error); +gboolean nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, + GError **error); void nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor); void nm_netlink_monitor_attach (NMNetlinkMonitor *monitor); void nm_netlink_monitor_detach (NMNetlinkMonitor *monitor); + +gboolean nm_netlink_monitor_subscribe (NMNetlinkMonitor *monitor, + int group, + GError **error); +void nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *monitor, + int group); + + gboolean nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, GError **error); gboolean nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *monitor, From 9476355be2cd2e5c7554f3a403403da82fe02696 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 16:33:55 -0700 Subject: [PATCH 262/392] trivial: remove dead CFLAGS --- src/Makefile.am | 2 -- src/ip6-manager/Makefile.am | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ca1ce6bbd2..80336ab060 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -210,9 +210,7 @@ BUILT_SOURCES = \ NetworkManager_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ - $(HAL_CFLAGS) \ $(GUDEV_CFLAGS) \ - $(OPENSSL_CFLAGS) \ $(LIBNL_CFLAGS) \ $(GMODULE_CFLAGS) \ -DG_DISABLE_DEPRECATED \ diff --git a/src/ip6-manager/Makefile.am b/src/ip6-manager/Makefile.am index 9f5229f77b..39d77155f7 100644 --- a/src/ip6-manager/Makefile.am +++ b/src/ip6-manager/Makefile.am @@ -18,7 +18,6 @@ libip6_manager_la_SOURCES = \ libip6_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ - $(HAL_CFLAGS) \ -DG_DISABLE_DEPRECATED libip6_manager_la_LIBADD = \ From 5b8b9fc608f28d22ceb91d9a8b6cd8a5bd2c805a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 16:46:08 -0700 Subject: [PATCH 263/392] netlink: fix IPv6 RA flag retrieval The RA flags aren't in the link flags, they are in the special PROTINFO flags that the IPv6 stack sends. To get these, because libnl doesn't have native support for them, we get to parse the netlink messages directly. Furthermore, the PROTINFO message isn't sent unless it's explicitly requested with a RTM_GETLINK/AF_INET6 message, meaning we get to poll for it periodically. So switch over to the netlink monitor object (killing a lot of duplicate code) and start requesting the PROTINFO bits from netlink. --- src/ip6-manager/Makefile.am | 4 +- src/ip6-manager/nm-ip6-manager.c | 106 +++++-- src/ip6-manager/nm-netlink-listener.c | 406 -------------------------- src/ip6-manager/nm-netlink-listener.h | 78 ----- src/nm-netlink-monitor.c | 22 ++ src/nm-netlink-monitor.h | 2 + 6 files changed, 103 insertions(+), 515 deletions(-) delete mode 100644 src/ip6-manager/nm-netlink-listener.c delete mode 100644 src/ip6-manager/nm-netlink-listener.h diff --git a/src/ip6-manager/Makefile.am b/src/ip6-manager/Makefile.am index 39d77155f7..c2f5591429 100644 --- a/src/ip6-manager/Makefile.am +++ b/src/ip6-manager/Makefile.am @@ -11,9 +11,7 @@ noinst_LTLIBRARIES = libip6-manager.la libip6_manager_la_SOURCES = \ nm-ip6-manager.c \ - nm-ip6-manager.h \ - nm-netlink-listener.c \ - nm-netlink-listener.h + nm-ip6-manager.h libip6_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index be85ab0dc0..04a3049464 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -25,7 +25,8 @@ #include #include "nm-ip6-manager.h" -#include "nm-netlink-listener.h" +#include "nm-netlink-monitor.h" +#include "nm-netlink.h" #include "NetworkManagerUtils.h" #include "nm-marshal.h" #include "nm-logging.h" @@ -40,7 +41,7 @@ #define IF_RS_SENT 0x10 typedef struct { - NMNetlinkListener *netlink; + NMNetlinkMonitor *monitor; GHashTable *devices_by_iface, *devices_by_index; struct nl_handle *nlh; @@ -82,6 +83,8 @@ typedef struct { GArray *rdnss_servers; guint rdnss_timeout_id; + + guint32 ra_flags; } NMIP6Device; G_DEFINE_TYPE (NMIP6Manager, nm_ip6_manager, G_TYPE_OBJECT) @@ -96,7 +99,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; static NMIP6Manager *nm_ip6_manager_new (void); -static void netlink_notification (NMNetlinkListener *listener, struct nl_msg *msg, gpointer user_data); +static void netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer user_data); static void nm_ip6_device_destroy (NMIP6Device *device); @@ -122,12 +125,14 @@ nm_ip6_manager_init (NMIP6Manager *manager) (GDestroyNotify) nm_ip6_device_destroy); priv->devices_by_index = g_hash_table_new (NULL, NULL); - priv->netlink = nm_netlink_listener_get (); - g_signal_connect (priv->netlink, "notification", - G_CALLBACK (netlink_notification), manager); - nm_netlink_listener_subscribe (priv->netlink, RTNLGRP_IPV6_IFADDR, NULL); - nm_netlink_listener_subscribe (priv->netlink, RTNLGRP_IPV6_PREFIX, NULL); - nm_netlink_listener_subscribe (priv->netlink, RTNLGRP_ND_USEROPT, NULL); + priv->monitor = nm_netlink_monitor_get (); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_IFADDR, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_PREFIX, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_ND_USEROPT, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_LINK, NULL); + + g_signal_connect (priv->monitor, "notification", + G_CALLBACK (netlink_notification), manager); priv->nlh = nm_netlink_get_default_handle (); priv->addr_cache = rtnl_addr_alloc_cache (priv->nlh); @@ -141,7 +146,7 @@ finalize (GObject *object) g_hash_table_destroy (priv->devices_by_iface); g_hash_table_destroy (priv->devices_by_index); - g_object_unref (priv->netlink); + g_object_unref (priv->monitor); nl_cache_free (priv->addr_cache); nl_cache_free (priv->route_cache); @@ -348,8 +353,6 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) struct rtnl_addr *rtnladdr; struct nl_addr *nladdr; struct in6_addr *addr; - struct rtnl_link *link; - guint flags; CallbackInfo *info; guint dhcp_opts = IP6_DHCP_OPT_NONE; @@ -373,21 +376,16 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) } } - /* Note: we don't want to keep a cache of links, because the - * kernel doesn't send notifications when the flags change, so the - * cached rtnl_links would have out-of-date flags. - */ - link = nm_netlink_index_to_rtnl_link (device->index); - flags = rtnl_link_get_flags (link); - rtnl_link_put (link); - - if ((flags & IF_RA_RCVD) && device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) + if ((device->ra_flags & IF_RA_RCVD) && device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; - if (flags & IF_RA_MANAGED) + if (device->ra_flags & IF_RA_MANAGED) { dhcp_opts = IP6_DHCP_OPT_MANAGED; - else if (flags & IF_RA_OTHERCONF) + nm_log_dbg (LOGD_IP6, "router advertisement deferred to DHCPv6"); + } else if (device->ra_flags & IF_RA_OTHERCONF) { dhcp_opts = IP6_DHCP_OPT_OTHERCONF; + nm_log_dbg (LOGD_IP6, "router advertisement requests parallel DHCPv6"); + } if (!device->addrconf_complete) { if (device->state >= device->target_state || @@ -598,8 +596,58 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) return NULL; } +static struct nla_policy link_policy[IFLA_MAX + 1] = { + [IFLA_PROTINFO] = { .type = NLA_NESTED }, +}; + +static struct nla_policy link_prot_policy[IFLA_INET6_MAX + 1] = { + [IFLA_INET6_FLAGS] = { .type = NLA_U32 }, +}; + +static NMIP6Device * +process_newlink (NMIP6Manager *manager, struct nl_msg *msg) +{ + struct nlmsghdr *hdr = nlmsg_hdr (msg); + struct ifinfomsg *ifi; + NMIP6Device *device; + struct nlattr *tb[IFLA_MAX + 1]; + struct nlattr *pi[IFLA_INET6_MAX + 1]; + int err; + + ifi = nlmsg_data (hdr); + if (ifi->ifi_family != AF_INET6) + return NULL; + + device = nm_ip6_manager_get_device (manager, ifi->ifi_index); + if (!device || device->addrconf_complete) + return NULL; + + /* FIXME: we have to do this manually for now since libnl doesn't yet + * support the IFLA_PROTINFO attribute of NEWLINK messages. When it does, + * we can get rid of this function and just grab IFLA_PROTINFO from + * nm_ip6_device_sync_from_netlink(), then get the IFLA_INET6_FLAGS out of + * the PROTINFO. + */ + + err = nlmsg_parse (hdr, sizeof (*ifi), tb, IFLA_MAX, link_policy); + if (err < 0) + return NULL; + if (!tb[IFLA_PROTINFO]) + return NULL; + + err = nla_parse_nested (pi, IFLA_INET6_MAX, tb[IFLA_PROTINFO], link_prot_policy); + if (err < 0) + return NULL; + if (!pi[IFLA_INET6_FLAGS]) + return NULL; + + device->ra_flags = nla_get_u32 (pi[IFLA_INET6_FLAGS]); + + return device; +} + static void -netlink_notification (NMNetlinkListener *listener, struct nl_msg *msg, gpointer user_data) +netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer user_data) { NMIP6Manager *manager = (NMIP6Manager *) user_data; NMIP6Device *device; @@ -613,22 +661,22 @@ netlink_notification (NMNetlinkListener *listener, struct nl_msg *msg, gpointer device = process_addr (manager, msg); config_changed = TRUE; break; - case RTM_NEWROUTE: case RTM_DELROUTE: device = process_route (manager, msg); config_changed = TRUE; break; - case RTM_NEWPREFIX: device = process_prefix (manager, msg); break; - case RTM_NEWNDUSEROPT: device = process_nduseropt (manager, msg); config_changed = TRUE; break; - + case RTM_NEWLINK: + device = process_newlink (manager, msg); + config_changed = TRUE; + break; default: return; } @@ -758,6 +806,7 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, nm_log_info (LOGD_IP6, "Activation (%s) Beginning IP6 addrconf.", iface); device->addrconf_complete = FALSE; + device->ra_flags = 0; /* Set up a timeout on the transaction to kill it after the timeout */ info = callback_info_new (device, 0); @@ -771,6 +820,7 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, * device is already fully configured and schedule the * ADDRCONF_COMPLETE signal in that case. */ + nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); nm_ip6_device_sync_from_netlink (device, FALSE); } diff --git a/src/ip6-manager/nm-netlink-listener.c b/src/ip6-manager/nm-netlink-listener.c deleted file mode 100644 index 55c4d76ad4..0000000000 --- a/src/ip6-manager/nm-netlink-listener.c +++ /dev/null @@ -1,406 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2005 - 2009 Red Hat, Inc. - * Copyright (C) 2005 - 2008 Novell, Inc. - * Copyright (C) 2005 Ray Strode - * - * Some code borrowed from HAL: - * - * Copyright (C) 2003 David Zeuthen, - * Copyright (C) 2004 Novell, Inc. - */ - -/* FIXME: this should be merged with src/nm-netlink-monitor.c */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "NetworkManager.h" -#include "nm-system.h" -#include "nm-netlink-listener.h" -#include "nm-marshal.h" -#include "nm-netlink.h" - -#define NM_NETLINK_LISTENER_EVENT_CONDITIONS \ - ((GIOCondition) (G_IO_IN | G_IO_PRI)) - -#define NM_NETLINK_LISTENER_ERROR_CONDITIONS \ - ((GIOCondition) (G_IO_ERR | G_IO_NVAL)) - -#define NM_NETLINK_LISTENER_DISCONNECT_CONDITIONS \ - ((GIOCondition) (G_IO_HUP)) - -#define NM_NETLINK_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - NM_TYPE_NETLINK_LISTENER, \ - NMNetlinkListenerPrivate)) - -typedef struct { - struct nl_handle *nlh; - struct nl_cb * nlh_cb; - struct nl_cache * nlh_link_cache; - - GIOChannel * io_channel; - guint event_id; - - guint request_status_id; -} NMNetlinkListenerPrivate; - -static gboolean nm_netlink_listener_event_handler (GIOChannel *channel, - GIOCondition io_condition, - gpointer user_data); - -static gboolean nm_netlink_listener_error_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkListener *listener); - -static gboolean nm_netlink_listener_disconnect_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkListener *listener); - -static void close_connection (NMNetlinkListener *listener); - -enum { - NOTIFICATION = 0, - ERROR, - - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -G_DEFINE_TYPE (NMNetlinkListener, nm_netlink_listener, G_TYPE_OBJECT); - -NMNetlinkListener * -nm_netlink_listener_get (void) -{ - static NMNetlinkListener *singleton = NULL; - - if (!singleton) - singleton = NM_NETLINK_LISTENER (g_object_new (NM_TYPE_NETLINK_LISTENER, NULL)); - else - g_object_ref (singleton); - - return singleton; -} - -static void -nm_netlink_listener_init (NMNetlinkListener *listener) -{ -} - -static void -finalize (GObject *object) -{ - NMNetlinkListenerPrivate *priv = NM_NETLINK_LISTENER_GET_PRIVATE (object); - - if (priv->request_status_id) - g_source_remove (priv->request_status_id); - - if (priv->io_channel) - close_connection (NM_NETLINK_LISTENER (object)); - - if (priv->nlh) { - nl_handle_destroy (priv->nlh); - priv->nlh = NULL; - } - - if (priv->nlh_cb) { - nl_cb_put (priv->nlh_cb); - priv->nlh_cb = NULL; - } - - G_OBJECT_CLASS (nm_netlink_listener_parent_class)->finalize (object); -} - -static void -nm_netlink_listener_class_init (NMNetlinkListenerClass *listener_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (listener_class); - - g_type_class_add_private (listener_class, sizeof (NMNetlinkListenerPrivate)); - - /* Virtual methods */ - object_class->finalize = finalize; - - /* Signals */ - signals[NOTIFICATION] = - g_signal_new ("notification", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMNetlinkListenerClass, notification), - NULL, NULL, g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[ERROR] = - g_signal_new ("error", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMNetlinkListenerClass, error), - NULL, NULL, _nm_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); -} - -static int -netlink_event_input (struct nl_msg *msg, void *listener) -{ - struct nlmsghdr *hdr = nlmsg_hdr (msg); - - if (hdr->nlmsg_pid != 0) - return NL_STOP; - - g_signal_emit (listener, signals[NOTIFICATION], 0, msg); - - /* Stop processing messages */ - return NL_STOP; -} - -static gboolean -open_connection (NMNetlinkListener *listener, GError **error) -{ - NMNetlinkListenerPrivate *priv = NM_NETLINK_LISTENER_GET_PRIVATE (listener); - int fd; - GError *channel_error = NULL; - GIOFlags channel_flags; - - g_return_val_if_fail (priv->io_channel == NULL, FALSE); - - priv->nlh_cb = nl_cb_alloc (NL_CB_DEFAULT); - priv->nlh = nl_handle_alloc_cb (priv->nlh_cb); - if (!priv->nlh) { - g_set_error (error, NM_NETLINK_LISTENER_ERROR, - NM_NETLINK_LISTENER_ERROR_NETLINK_ALLOC_HANDLE, - _("unable to allocate netlink handle: %s"), - nl_geterror ()); - goto error; - } - - nl_disable_sequence_check (priv->nlh); - nl_socket_modify_cb (priv->nlh, NL_CB_VALID, NL_CB_CUSTOM, netlink_event_input, listener); - if (nl_connect (priv->nlh, NETLINK_ROUTE) < 0) { - g_set_error (error, NM_NETLINK_LISTENER_ERROR, - NM_NETLINK_LISTENER_ERROR_NETLINK_CONNECT, - _("unable to connect to netlink: %s"), - nl_geterror ()); - goto error; - } - - fd = nl_socket_get_fd (priv->nlh); - priv->io_channel = g_io_channel_unix_new (fd); - - g_io_channel_set_encoding (priv->io_channel, NULL, &channel_error); - /* Encoding is NULL, so no conversion error can possibly occur */ - g_assert (channel_error == NULL); - - g_io_channel_set_close_on_unref (priv->io_channel, TRUE); - channel_flags = g_io_channel_get_flags (priv->io_channel); - channel_error = NULL; - g_io_channel_set_flags (priv->io_channel, - channel_flags | G_IO_FLAG_NONBLOCK, - &channel_error); - if (channel_error != NULL) { - g_propagate_error (error, channel_error); - goto error; - } - - priv->event_id = g_io_add_watch (priv->io_channel, - (NM_NETLINK_LISTENER_EVENT_CONDITIONS | - NM_NETLINK_LISTENER_ERROR_CONDITIONS | - NM_NETLINK_LISTENER_DISCONNECT_CONDITIONS), - nm_netlink_listener_event_handler, - listener); - return TRUE; - -error: - if (priv->io_channel) - close_connection (listener); - - if (priv->nlh) { - nl_handle_destroy (priv->nlh); - priv->nlh = NULL; - } - - if (priv->nlh_cb) { - nl_cb_put (priv->nlh_cb); - priv->nlh_cb = NULL; - } - return FALSE; -} - -static void -close_connection (NMNetlinkListener *listener) -{ - NMNetlinkListenerPrivate *priv = NM_NETLINK_LISTENER_GET_PRIVATE (listener); - - g_return_if_fail (priv->io_channel != NULL); - - if (priv->event_id) { - g_source_remove (priv->event_id); - priv->event_id = 0; - } - - g_io_channel_shutdown (priv->io_channel, - TRUE /* flush pending data */, - NULL); - - g_io_channel_unref (priv->io_channel); - priv->io_channel = NULL; -} - -GQuark -nm_netlink_listener_error_quark (void) -{ - static GQuark error_quark = 0; - - if (error_quark == 0) - error_quark = g_quark_from_static_string ("nm-netlink-listener-error-quark"); - - return error_quark; -} - -gboolean -nm_netlink_listener_subscribe (NMNetlinkListener *listener, - int group, - GError **error) -{ - NMNetlinkListenerPrivate *priv; - - g_return_val_if_fail (NM_IS_NETLINK_LISTENER (listener), FALSE); - - priv = NM_NETLINK_LISTENER_GET_PRIVATE (listener); - - if (!priv->nlh) { - if (!open_connection (listener, error)) - return FALSE; - } - - if (nl_socket_add_membership (priv->nlh, group) < 0) { - g_set_error (error, NM_NETLINK_LISTENER_ERROR, - NM_NETLINK_LISTENER_ERROR_NETLINK_JOIN_GROUP, - _("unable to join netlink group: %s"), - nl_geterror ()); - return FALSE; - } - - return TRUE; -} - -void -nm_netlink_listener_unsubscribe (NMNetlinkListener *listener, int group) -{ - NMNetlinkListenerPrivate *priv; - - g_return_if_fail (NM_IS_NETLINK_LISTENER (listener)); - - priv = NM_NETLINK_LISTENER_GET_PRIVATE (listener); - g_return_if_fail (priv->nlh != NULL); - - nl_socket_drop_membership (priv->nlh, group); -} - -static gboolean -nm_netlink_listener_event_handler (GIOChannel *channel, - GIOCondition io_condition, - gpointer user_data) -{ - NMNetlinkListener *listener = (NMNetlinkListener *) user_data; - NMNetlinkListenerPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (NM_IS_NETLINK_LISTENER (listener), TRUE); - - priv = NM_NETLINK_LISTENER_GET_PRIVATE (listener); - g_return_val_if_fail (priv->event_id > 0, TRUE); - - if (io_condition & NM_NETLINK_LISTENER_ERROR_CONDITIONS) - return nm_netlink_listener_error_handler (channel, io_condition, listener); - else if (io_condition & NM_NETLINK_LISTENER_DISCONNECT_CONDITIONS) - return nm_netlink_listener_disconnect_handler (channel, io_condition, listener); - - g_return_val_if_fail (!(io_condition & ~(NM_NETLINK_LISTENER_EVENT_CONDITIONS)), FALSE); - - if (nl_recvmsgs_default (priv->nlh) < 0) { - error = g_error_new (NM_NETLINK_LISTENER_ERROR, - NM_NETLINK_LISTENER_ERROR_PROCESSING_MESSAGE, - _("error processing netlink message: %s"), - nl_geterror ()); - - g_signal_emit (G_OBJECT (listener), - signals[ERROR], - 0, error); - g_error_free (error); - } - - return TRUE; -} - -static gboolean -nm_netlink_listener_error_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkListener *listener) -{ - GError *socket_error; - const char *err_msg; - int err_code; - socklen_t err_len; - - g_return_val_if_fail (io_condition & NM_NETLINK_LISTENER_ERROR_CONDITIONS, FALSE); - - err_code = 0; - err_len = sizeof (err_code); - if (getsockopt (g_io_channel_unix_get_fd (channel), - SOL_SOCKET, SO_ERROR, (void *) &err_code, &err_len)) - err_msg = strerror (err_code); - else - err_msg = _("error occurred while waiting for data on socket"); - - socket_error = g_error_new (NM_NETLINK_LISTENER_ERROR, - NM_NETLINK_LISTENER_ERROR_WAITING_FOR_SOCKET_DATA, - "%s", - err_msg); - - g_signal_emit (G_OBJECT (listener), - signals[ERROR], - 0, socket_error); - - g_error_free (socket_error); - - return TRUE; -} - -static gboolean -nm_netlink_listener_disconnect_handler (GIOChannel *channel, - GIOCondition io_condition, - NMNetlinkListener *listener) -{ - - g_return_val_if_fail (!(io_condition & ~(NM_NETLINK_LISTENER_DISCONNECT_CONDITIONS)), FALSE); - return FALSE; -} - diff --git a/src/ip6-manager/nm-netlink-listener.h b/src/ip6-manager/nm-netlink-listener.h deleted file mode 100644 index 0baabac004..0000000000 --- a/src/ip6-manager/nm-netlink-listener.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Netlink socket listener - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2005 - 2009 Red Hat, Inc. - * Copyright (C) 2005 - 2008 Novell, Inc. - * Copyright (C) 2005 Ray Strode - */ - -#ifndef NM_NETLINK_LISTENER_H -#define NM_NETLINK_LISTENER_H - -#include -#include - -#include "nm-netlink.h" - -G_BEGIN_DECLS - -#define NM_TYPE_NETLINK_LISTENER (nm_netlink_listener_get_type ()) -#define NM_NETLINK_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_NETLINK_LISTENER, NMNetlinkListener)) -#define NM_NETLINK_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_NETLINK_LISTENER, NMNetlinkListenerClass)) -#define NM_IS_NETLINK_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_NETLINK_LISTENER)) -#define NM_IS_NETLINK_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_NETLINK_LISTENER)) -#define NM_NETLINK_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_NETLINK_LISTENER, NMNetlinkListenerClass)) -#define NM_NETLINK_LISTENER_ERROR (nm_netlink_listener_error_quark ()) - -typedef enum { - NM_NETLINK_LISTENER_ERROR_GENERIC = 0, - NM_NETLINK_LISTENER_ERROR_NETLINK_ALLOC_HANDLE, - NM_NETLINK_LISTENER_ERROR_NETLINK_CONNECT, - NM_NETLINK_LISTENER_ERROR_NETLINK_JOIN_GROUP, - NM_NETLINK_LISTENER_ERROR_NETLINK_ALLOC_LINK_CACHE, - NM_NETLINK_LISTENER_ERROR_PROCESSING_MESSAGE, - NM_NETLINK_LISTENER_ERROR_BAD_ALLOC, - NM_NETLINK_LISTENER_ERROR_WAITING_FOR_SOCKET_DATA, - NM_NETLINK_LISTENER_ERROR_LINK_CACHE_UPDATE -} NMNetlinkListenerError; - -typedef struct { - GObject parent; -} NMNetlinkListener; - -typedef struct { - GObjectClass parent_class; - - /* Signals */ - void (*notification) (NMNetlinkListener *listener, struct nl_msg *msg); - void (*error) (NMNetlinkListener *listener, GError *error); -} NMNetlinkListenerClass; - -GType nm_netlink_listener_get_type (void) G_GNUC_CONST; -GQuark nm_netlink_listener_error_quark (void) G_GNUC_CONST; - -NMNetlinkListener *nm_netlink_listener_get (void); - -gboolean nm_netlink_listener_subscribe (NMNetlinkListener *listener, - int group, - GError **error); -void nm_netlink_listener_unsubscribe (NMNetlinkListener *listener, - int group); - -G_END_DECLS - -#endif /* NM_NETLINK_LISTENER_H */ diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index b807d5c37c..24b463ce33 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -442,6 +442,28 @@ nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *self, int group) set_subs (self, group, subs); } +/***************************************************************/ + +gboolean +nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + /* FIXME: nl_rtgen_request() gets the return value screwed up with + * libnl-1.1; revisit this and return a proper error when we port to + * a later libnl. + */ + nl_rtgen_request (priv->nlh, RTM_GETLINK, AF_INET6, NLM_F_DUMP); + + return TRUE; +} + + static gboolean deferred_emit_carrier_state (gpointer user_data) { diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h index 1920704a79..a2b26e6b3b 100644 --- a/src/nm-netlink-monitor.h +++ b/src/nm-netlink-monitor.h @@ -79,6 +79,8 @@ gboolean nm_netlink_monitor_subscribe (NMNetlinkMonitor *monitor void nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *monitor, int group); +gboolean nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *monitor, + GError **error); gboolean nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, GError **error); From d85583b928a64dbd16a23af819ffff3f201b26a0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 16:53:05 -0700 Subject: [PATCH 264/392] po: remove dead translatable --- po/POTFILES.in | 1 - 1 file changed, 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 2cf4d231c8..6cf236ad37 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -14,7 +14,6 @@ src/nm-netlink-monitor.c src/main.c src/dhcp-manager/nm-dhcp-dhclient.c src/dhcp-manager/nm-dhcp-manager.c -src/ip6-manager/nm-netlink-listener.c src/logging/nm-logging.c src/named-manager/nm-named-manager.c src/system-settings/nm-default-wired-connection.c From f722b180e2fa36709bcb6ec5eda31aae5db8c4dc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 16:55:13 -0700 Subject: [PATCH 265/392] trivial: netlink header cleanup --- src/ip6-manager/nm-ip6-manager.c | 1 + src/nm-device-ethernet.c | 2 ++ src/nm-netlink.c | 1 + src/nm-netlink.h | 3 --- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 04a3049464..0ce694dcf6 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index f4581e9ac6..00942a3d34 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -34,6 +34,8 @@ #include #include +#include + #include "nm-glib-compat.h" #include "nm-device-ethernet.h" #include "nm-device-interface.h" diff --git a/src/nm-netlink.c b/src/nm-netlink.c index c55c093ae8..15eb6c1c34 100644 --- a/src/nm-netlink.c +++ b/src/nm-netlink.c @@ -28,6 +28,7 @@ #include #include #include +#include static struct nl_cache * link_cache = NULL; static struct nl_handle * def_nl_handle = NULL; diff --git a/src/nm-netlink.h b/src/nm-netlink.h index 7b5e1ba573..b77cbf566f 100644 --- a/src/nm-netlink.h +++ b/src/nm-netlink.h @@ -21,10 +21,7 @@ #ifndef NM_NETLINK_H #define NM_NETLINK_H -#include -#include #include -#include #include int nm_netlink_iface_to_index (const char *iface); From 87c6e5db76d8b56656ea26d91bf63f8781c530f2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 17:22:58 -0700 Subject: [PATCH 266/392] netlink: merge nm-netlink.c into nm-netlink-monitor.c --- src/Makefile.am | 2 - src/backends/NetworkManagerGeneric.c | 9 +- src/ip6-manager/nm-ip6-manager.c | 1 - src/nm-device-ethernet.c | 1 - src/nm-device.c | 2 +- src/nm-netlink-monitor.c | 138 ++++++++++++++++++++---- src/nm-netlink-monitor.h | 7 ++ src/nm-netlink.c | 150 --------------------------- src/nm-netlink.h | 33 ------ src/nm-system.c | 2 +- src/vpn-manager/nm-vpn-connection.c | 2 +- 11 files changed, 129 insertions(+), 218 deletions(-) delete mode 100644 src/nm-netlink.c delete mode 100644 src/nm-netlink.h diff --git a/src/Makefile.am b/src/Makefile.am index 80336ab060..5d2db6e36d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -141,8 +141,6 @@ NetworkManager_SOURCES = \ nm-properties-changed-signal.h \ wpa.c \ wpa.h \ - nm-netlink.c \ - nm-netlink.h \ nm-dhcp4-config.c \ nm-dhcp4-config.h \ nm-dhcp6-config.c \ diff --git a/src/backends/NetworkManagerGeneric.c b/src/backends/NetworkManagerGeneric.c index 4f8336d9bb..8f16066fa3 100644 --- a/src/backends/NetworkManagerGeneric.c +++ b/src/backends/NetworkManagerGeneric.c @@ -1,9 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager - * - * Timothee Lecomte - * - * Heavily based on NetworkManagerRedhat.c by Dan Williams * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +15,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2004 Red Hat, Inc. + * (C) Copyright 2004 - 2010 Red Hat, Inc. + * (C) Copyright 2006 Timothee Lecomte */ #ifdef HAVE_CONFIG_H @@ -36,8 +33,8 @@ #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" -#include "nm-netlink.h" #include "nm-logging.h" +#include "nm-netlink-monitor.h" /* Because of a bug in libnl, rtnl.h should be included before route.h */ #include diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 0ce694dcf6..50905c3af5 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -27,7 +27,6 @@ #include "nm-ip6-manager.h" #include "nm-netlink-monitor.h" -#include "nm-netlink.h" #include "NetworkManagerUtils.h" #include "nm-marshal.h" #include "nm-logging.h" diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 00942a3d34..202584b24b 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -45,7 +45,6 @@ #include "nm-supplicant-manager.h" #include "nm-supplicant-interface.h" #include "nm-supplicant-config.h" -#include "nm-netlink.h" #include "nm-netlink-monitor.h" #include "nm-system.h" #include "nm-setting-connection.h" diff --git a/src/nm-device.c b/src/nm-device.c index 1ee7510321..db0ad914a9 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -45,7 +45,7 @@ #include "nm-named-manager.h" #include "nm-utils.h" #include "nm-logging.h" -#include "nm-netlink.h" +#include "nm-netlink-monitor.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" #include "nm-setting-connection.h" diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 24b463ce33..bfcbab7e7f 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -25,7 +25,7 @@ * Copyright (C) 2004 Novell, Inc. */ -/* for struct ucred */ +/* for struct ucred and LIBNL_NEEDS_ADDR_CACHING_WORKAROUND */ #include #include @@ -38,16 +38,15 @@ #include #include #include -#include +#include +#include +#include #include #include -#include "NetworkManager.h" -#include "nm-system.h" #include "nm-netlink-monitor.h" #include "nm-logging.h" -#include "nm-netlink.h" #define EVENT_CONDITIONS ((GIOCondition) (G_IO_IN | G_IO_PRI)) #define ERROR_CONDITIONS ((GIOCondition) (G_IO_ERR | G_IO_NVAL)) @@ -60,7 +59,7 @@ typedef struct { struct nl_handle *nlh; struct nl_cb * nlh_cb; - struct nl_cache * nlh_link_cache; + struct nl_cache * link_cache; GIOChannel * io_channel; guint event_id; @@ -104,8 +103,10 @@ link_msg_handler (struct nl_object *obj, void *arg) } /* Ensure it's a link object */ - if (nl_object_match_filter(obj, OBJ_CAST (filter)) == 0) - goto out; + if (nl_object_match_filter(obj, OBJ_CAST (filter)) == 0) { + rtnl_link_put (filter); + return; + } link_obj = (struct rtnl_link *) obj; flags = rtnl_link_get_flags (link_obj); @@ -121,7 +122,6 @@ link_msg_handler (struct nl_object *obj, void *arg) else g_signal_emit (self, signals[CARRIER_OFF], 0, ifidx); -out: rtnl_link_put (filter); } @@ -227,6 +227,9 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) GError *channel_error = NULL; GIOFlags channel_flags; int fd; +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + struct nl_cache *addr_cache; +#endif g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); @@ -265,11 +268,23 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + /* Work around apparent libnl bug; rtnl_addr requires that all + * addresses have the "peer" attribute set in order to be compared + * for equality, but this attribute is not normally set. As a + * result, most addresses will not compare as equal even to + * themselves, busting caching. + */ + addr_cache = rtnl_addr_alloc_cache (priv->nlh); + nl_cache_get_ops (addr_cache)->co_obj_ops->oo_id_attrs &= ~0x80; + nl_cache_free (addr_cache); +#endif + /* Subscribe to the LINK group for internal carrier signals */ if (!nm_netlink_monitor_subscribe (self, RTNLGRP_LINK, error)) goto error; - if ((priv->nlh_link_cache = rtnl_link_alloc_cache (priv->nlh)) == NULL) { + if ((priv->link_cache = rtnl_link_alloc_cache (priv->nlh)) == NULL) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_LINK_CACHE, _("unable to allocate netlink link cache for monitoring link status: %s"), @@ -277,7 +292,7 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } - nl_cache_mngt_provide (priv->nlh_link_cache); + nl_cache_mngt_provide (priv->link_cache); fd = nl_socket_get_fd (priv->nlh); priv->io_channel = g_io_channel_unix_new (fd); @@ -303,9 +318,9 @@ error: if (priv->io_channel) nm_netlink_monitor_close_connection (self); - if (priv->nlh_link_cache) { - nl_cache_free (priv->nlh_link_cache); - priv->nlh_link_cache = NULL; + if (priv->link_cache) { + nl_cache_free (priv->link_cache); + priv->link_cache = NULL; } if (priv->nlh) { @@ -475,10 +490,10 @@ deferred_emit_carrier_state (gpointer user_data) /* Update the link cache with latest state, and if there are no errors * emit the link states for all the interfaces in the cache. */ - if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + if (nl_cache_refill (priv->nlh, priv->link_cache)) { nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); } else - nl_cache_foreach_filter (priv->nlh_link_cache, NULL, link_msg_handler, self); + nl_cache_foreach_filter (priv->link_cache, NULL, link_msg_handler, self); return FALSE; } @@ -534,7 +549,7 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); /* Update the link cache with the latest information */ - if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + if (nl_cache_refill (priv->nlh, priv->link_cache)) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, @@ -547,7 +562,7 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, * otherwise some kernels (or maybe libnl?) only send a few of the * interfaces in the refill request. */ - if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + if (nl_cache_refill (priv->nlh, priv->link_cache)) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, @@ -572,7 +587,7 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, info.self = self; info.filter = filter; info.error = NULL; - nl_cache_foreach_filter (priv->nlh_link_cache, NULL, get_flags_sync_cb, &info); + nl_cache_foreach_filter (priv->link_cache, NULL, get_flags_sync_cb, &info); rtnl_link_put (filter); @@ -590,6 +605,85 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, /***************************************************************/ +struct nl_handle * +nm_netlink_get_default_handle (void) +{ + NMNetlinkMonitor *self; + struct nl_handle *nlh; + + self = nm_netlink_monitor_get (); + nlh = NM_NETLINK_MONITOR_GET_PRIVATE (self)->nlh; + g_object_unref (self); + + return nlh; +} + +int +nm_netlink_iface_to_index (const char *iface) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + int idx; + + g_return_val_if_fail (iface != NULL, -1); + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + nl_cache_update (priv->nlh, priv->link_cache); + idx = rtnl_link_name2i (priv->link_cache, iface); + g_object_unref (self); + + return idx; +} + +#define MAX_IFACE_LEN 33 +char * +nm_netlink_index_to_iface (int idx) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + char *buf = NULL; + + g_return_val_if_fail (idx >= 0, NULL); + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + buf = g_malloc0 (MAX_IFACE_LEN); + g_assert (buf); + + nl_cache_update (priv->nlh, priv->link_cache); + if (!rtnl_link_i2name (priv->link_cache, idx, buf, MAX_IFACE_LEN - 1)) { + g_free (buf); + buf = NULL; + } + + g_object_unref (self); + return buf; +} + +struct rtnl_link * +nm_netlink_index_to_rtnl_link (int idx) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + struct rtnl_link *ret = NULL; + + g_return_val_if_fail (idx >= 0, NULL); + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + nl_cache_update (priv->nlh, priv->link_cache); + ret = rtnl_link_get (priv->link_cache, idx); + g_object_unref (self); + + return ret; +} + +/***************************************************************/ + NMNetlinkMonitor * nm_netlink_monitor_get (void) { @@ -622,9 +716,9 @@ finalize (GObject *object) if (priv->io_channel) nm_netlink_monitor_close_connection (NM_NETLINK_MONITOR (object)); - if (priv->nlh_link_cache) { - nl_cache_free (priv->nlh_link_cache); - priv->nlh_link_cache = NULL; + if (priv->link_cache) { + nl_cache_free (priv->link_cache); + priv->link_cache = NULL; } if (priv->nlh) { diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h index a2b26e6b3b..8b57a312d7 100644 --- a/src/nm-netlink-monitor.h +++ b/src/nm-netlink-monitor.h @@ -26,6 +26,7 @@ #include #include #include +#include #define NM_TYPE_NETLINK_MONITOR (nm_netlink_monitor_get_type ()) #define NM_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitor)) @@ -89,4 +90,10 @@ gboolean nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *monitor guint32 *ifflags, GError **error); +/* Generic utility functions */ +int nm_netlink_iface_to_index (const char *iface); +char * nm_netlink_index_to_iface (int idx); +struct rtnl_link *nm_netlink_index_to_rtnl_link (int idx); +struct nl_handle *nm_netlink_get_default_handle (void); + #endif /* NM_NETLINK_MONITOR_H */ diff --git a/src/nm-netlink.c b/src/nm-netlink.c deleted file mode 100644 index 15eb6c1c34..0000000000 --- a/src/nm-netlink.c +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2007 - 2008 Red Hat, Inc. - */ - -#include "config.h" - -#include "nm-netlink.h" -#include "nm-logging.h" - -#include -#include -#include -#include -#include -#include - -static struct nl_cache * link_cache = NULL; -static struct nl_handle * def_nl_handle = NULL; - - -static struct nl_cache * -get_link_cache (void) -{ - struct nl_handle * nlh; - - nlh = nm_netlink_get_default_handle (); - if (G_UNLIKELY (!nlh)) { - nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); - return NULL; - } - - if (G_UNLIKELY (!link_cache)) - link_cache = rtnl_link_alloc_cache (nlh); - - if (G_UNLIKELY (!link_cache)) { - nm_log_err (LOGD_HW, "couldn't allocate netlink link cache: %s", nl_geterror ()); - return NULL; - } - - nl_cache_update (nlh, link_cache); - return link_cache; -} - - -struct nl_handle * -nm_netlink_get_default_handle (void) -{ - struct nl_cb *cb; -#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND - struct nl_cache *addr_cache; -#endif - - if (def_nl_handle) - return def_nl_handle; - - cb = nl_cb_alloc(NL_CB_VERBOSE); - def_nl_handle = nl_handle_alloc_cb (cb); - if (!def_nl_handle) { - nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); - return NULL; - } - - if (nl_connect (def_nl_handle, NETLINK_ROUTE) < 0) { - nm_log_err (LOGD_HW, "couldn't connect to netlink: %s", nl_geterror ()); - return NULL; - } - -#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND - /* Work around apparent libnl bug; rtnl_addr requires that all - * addresses have the "peer" attribute set in order to be compared - * for equality, but this attribute is not normally set. As a - * result, most addresses will not compare as equal even to - * themselves, busting caching. - */ - addr_cache = rtnl_addr_alloc_cache (def_nl_handle); - nl_cache_get_ops (addr_cache)->co_obj_ops->oo_id_attrs &= ~0x80; - nl_cache_free (addr_cache); -#endif - - return def_nl_handle; -} - -int -nm_netlink_iface_to_index (const char *iface) -{ - struct nl_cache * cache; - - g_return_val_if_fail (iface != NULL, -1); - - cache = get_link_cache (); - if (!cache) - return RTNL_LINK_NOT_FOUND; - - return rtnl_link_name2i (cache, iface); -} - - -#define MAX_IFACE_LEN 33 -char * -nm_netlink_index_to_iface (int idx) -{ - struct nl_cache * cache; - char * buf = NULL; - - cache = get_link_cache (); - if (!cache) - return NULL; - - buf = g_malloc0 (MAX_IFACE_LEN); - if (buf == NULL) { - nm_log_warn (LOGD_HW, "Not enough memory to allocate interface name buffer."); - return NULL; - } - - if (rtnl_link_i2name (cache, idx, buf, MAX_IFACE_LEN - 1) == NULL) { - g_free (buf); - buf = NULL; - } - - return buf; -} - -struct rtnl_link * -nm_netlink_index_to_rtnl_link (int idx) -{ - struct nl_cache *cache; - - cache = get_link_cache (); - if (!cache) - return NULL; - - return rtnl_link_get (cache, idx); -} - diff --git a/src/nm-netlink.h b/src/nm-netlink.h deleted file mode 100644 index b77cbf566f..0000000000 --- a/src/nm-netlink.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2007 - 2008 Red Hat, Inc. - */ - -#ifndef NM_NETLINK_H -#define NM_NETLINK_H - -#include -#include - -int nm_netlink_iface_to_index (const char *iface); -char * nm_netlink_index_to_iface (int idx); -struct rtnl_link * nm_netlink_index_to_rtnl_link (int idx); - -struct nl_handle * nm_netlink_get_default_handle (void); - -#endif /* NM_NETLINK_H */ diff --git a/src/nm-system.c b/src/nm-system.c index bd5f57f51d..0d38ea6cf4 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -48,7 +48,7 @@ #include "NetworkManagerUtils.h" #include "nm-utils.h" #include "nm-logging.h" -#include "nm-netlink.h" +#include "nm-netlink-monitor.h" /* Because of a bug in libnl, rtnl.h should be included before route.h */ #include diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index a594df59b5..a714e991e8 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -45,7 +45,7 @@ #include "nm-dbus-glib-types.h" #include "NetworkManagerUtils.h" #include "nm-named-manager.h" -#include "nm-netlink.h" +#include "nm-netlink-monitor.h" #include "nm-glib-compat.h" #include "nm-vpn-connection-glue.h" From df3f09b63386fa526950e384737fc2dbabc8980d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Apr 2010 17:24:49 -0700 Subject: [PATCH 267/392] netlink: fix group subscription --- src/nm-netlink-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index bfcbab7e7f..09e7d7c21e 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -702,7 +702,7 @@ nm_netlink_monitor_init (NMNetlinkMonitor *self) { NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - priv->subscriptions = g_hash_table_new (g_int_hash, g_int_equal); + priv->subscriptions = g_hash_table_new (g_direct_hash, g_direct_equal); } static void From 7cec17fcce299acb1bfebef296bf3f9a7d2de101 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Apr 2010 01:05:08 -0700 Subject: [PATCH 268/392] netlink: fix checking multicast groups Got the flags wrong in the previous commit; MULTI isn't about multicast/unicast, but about multi-part packets. Instead we need to check the netlink sockaddr structure for the group mask. --- src/nm-netlink-monitor.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 09e7d7c21e..e1bbfb86e3 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -132,6 +132,7 @@ netlink_event_input (struct nl_msg *msg, void *arg) NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); struct nlmsghdr *hdr = nlmsg_hdr (msg); struct ucred *creds = nlmsg_get_creds (msg); + const struct sockaddr_nl *snl; guint32 local_port; gboolean accept_msg = FALSE; @@ -142,15 +143,18 @@ netlink_event_input (struct nl_msg *msg, void *arg) return NL_STOP; } + snl = nlmsg_get_src (msg); + g_assert (snl); + /* Accept any messages from the kernel */ - if (hdr->nlmsg_pid == 0) + if (hdr->nlmsg_pid == 0 || snl->nl_pid == 0) accept_msg = TRUE; /* And any multicast message directed to our netlink PID, since multicast * currently requires CAP_ADMIN to use. */ local_port = nl_socket_get_local_port (priv->nlh); - if ((hdr->nlmsg_pid == local_port) && (hdr->nlmsg_flags & NLM_F_MULTI)) + if ((hdr->nlmsg_pid == local_port) && snl->nl_groups) accept_msg = TRUE; if (accept_msg == FALSE) { @@ -268,6 +272,14 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } + if (nl_socket_recv_pktinfo (priv->nlh, 1) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to enable netlink handle packet info: %s"), + nl_geterror ()); + goto error; + } + #ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND /* Work around apparent libnl bug; rtnl_addr requires that all * addresses have the "peer" attribute set in order to be compared @@ -292,8 +304,6 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } - nl_cache_mngt_provide (priv->link_cache); - fd = nl_socket_get_fd (priv->nlh); priv->io_channel = g_io_channel_unix_new (fd); From 9fee99e1230580067efb33f3aaea0fddad5cfe66 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Apr 2010 14:16:07 -0700 Subject: [PATCH 269/392] netlink: provide both blocking and nonblocking netlink connections The non-blocking connection is really only good for listening for events. It doesn't work for request/response operations (like refilling link and address caches) because the message receive loop in libnl will break out from the EAGAIN before it gets the response it needs to update the cache with. This is most evident with link cache refills when requesting the interface index from the name, or vice-versa; the refill request exits early with EAGAIN (due to the non-blocking nature of the connection's socket) and the cache isn't refilled, and the index lookup fails. We need to use blocking netlink operations in quite a few places besides index lookups, from address/route operations to getting the initial device carrier state. So, split the montior's netlink connection into a non-blocking event listener connection, and a synchronous connection which gets used for immediate operations. This also has the effect of validation the synchronous operations for security, which wasn't done before in nm-netlink.c (though it wasn't really a problem). --- src/nm-netlink-monitor.c | 267 ++++++++++++++++++++++++--------------- 1 file changed, 165 insertions(+), 102 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index e1bbfb86e3..6fb13ef3d1 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -57,13 +57,15 @@ NMNetlinkMonitorPrivate)) typedef struct { - struct nl_handle *nlh; - struct nl_cb * nlh_cb; - struct nl_cache * link_cache; - + /* Async event listener connection */ + struct nl_handle *nlh_event; GIOChannel * io_channel; guint event_id; + /* Sync/blocking request/response connection */ + struct nl_handle *nlh_sync; + struct nl_cache * link_cache; + guint request_status_id; GHashTable *subscriptions; @@ -103,7 +105,7 @@ link_msg_handler (struct nl_object *obj, void *arg) } /* Ensure it's a link object */ - if (nl_object_match_filter(obj, OBJ_CAST (filter)) == 0) { + if (nl_object_match_filter (obj, OBJ_CAST (filter)) == 0) { rtnl_link_put (filter); return; } @@ -126,10 +128,9 @@ link_msg_handler (struct nl_object *obj, void *arg) } static int -netlink_event_input (struct nl_msg *msg, void *arg) +event_msg_recv (struct nl_msg *msg, void *arg) { - NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); - NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + struct nl_handle *nlh = arg; struct nlmsghdr *hdr = nlmsg_hdr (msg); struct ucred *creds = nlmsg_get_creds (msg); const struct sockaddr_nl *snl; @@ -140,7 +141,7 @@ netlink_event_input (struct nl_msg *msg, void *arg) if (!creds || creds->uid != 0) { nm_log_dbg (LOGD_HW, "ignoring netlink message from UID %d", creds ? creds->uid : -1); - return NL_STOP; + return NL_SKIP; } snl = nlmsg_get_src (msg); @@ -153,7 +154,7 @@ netlink_event_input (struct nl_msg *msg, void *arg) /* And any multicast message directed to our netlink PID, since multicast * currently requires CAP_ADMIN to use. */ - local_port = nl_socket_get_local_port (priv->nlh); + local_port = nl_socket_get_local_port (nlh); if ((hdr->nlmsg_pid == local_port) && snl->nl_groups) accept_msg = TRUE; @@ -162,9 +163,21 @@ netlink_event_input (struct nl_msg *msg, void *arg) hdr->nlmsg_pid, local_port, (hdr->nlmsg_flags & NLM_F_MULTI)); - return NL_STOP; + return NL_SKIP; } + return NL_OK; +} + +static int +event_msg_ready (struct nl_msg *msg, void *arg) +{ + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); + + /* By the time the message gets here we've already checked the sender + * and we're sure it's safe to parse this message. + */ + /* Let clients handle generic messages */ g_signal_emit (self, signals[NOTIFICATION], 0, msg); @@ -212,7 +225,7 @@ event_handler (GIOChannel *channel, g_return_val_if_fail (!(io_condition & ~EVENT_CONDITIONS), FALSE); /* Process the netlink messages */ - if (nl_recvmsgs_default (priv->nlh) < 0) { + if (nl_recvmsgs_default (priv->nlh_event) < 0) { error = g_error_new (NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, _("error processing netlink message: %s"), @@ -224,26 +237,55 @@ event_handler (GIOChannel *channel, return TRUE; } -gboolean -nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) +static gboolean +nlh_setup (struct nl_handle *nlh, + nl_recvmsg_msg_cb_t valid_func, + gpointer cb_data, + GError **error) { - NMNetlinkMonitorPrivate *priv; + nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, cb_data); + + if (valid_func) + nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data); + + if (nl_connect (nlh, NETLINK_ROUTE) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to connect to netlink for monitoring link status: %s"), + nl_geterror ()); + return FALSE; + } + + /* Enable unix socket peer credentials which we use for verifying that the + * sender of the message is actually the kernel. + */ + if (nl_set_passcred (nlh, 1) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to enable netlink handle credential passing: %s"), + nl_geterror ()); + return FALSE; + } + + return TRUE; +} + +static gboolean +event_connection_setup (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); GError *channel_error = NULL; GIOFlags channel_flags; + struct nl_cb *cb; int fd; -#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND - struct nl_cache *addr_cache; -#endif - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); - - priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); g_return_val_if_fail (priv->io_channel == NULL, FALSE); - priv->nlh_cb = nl_cb_alloc (NL_CB_VERBOSE); - priv->nlh = nl_handle_alloc_cb (priv->nlh_cb); - if (!priv->nlh) { + /* Set up the event listener connection */ + cb = nl_cb_alloc (NL_CB_VERBOSE); + priv->nlh_event = nl_handle_alloc_cb (cb); + nl_cb_put (cb); + if (!priv->nlh_event) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE, _("unable to allocate netlink handle for monitoring link status: %s"), @@ -251,60 +293,16 @@ nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) goto error; } - nl_disable_sequence_check (priv->nlh); - nl_socket_modify_cb (priv->nlh, NL_CB_VALID, NL_CB_CUSTOM, netlink_event_input, self); - if (nl_connect (priv->nlh, NETLINK_ROUTE) < 0) { - g_set_error (error, NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, - _("unable to connect to netlink for monitoring link status: %s"), - nl_geterror ()); + if (!nlh_setup (priv->nlh_event, event_msg_ready, self, error)) goto error; - } - /* Enable unix socket peer credentials which we use for verifying that the - * sender of the message is actually the kernel. - */ - if (nl_set_passcred (priv->nlh, 1) < 0) { - g_set_error (error, NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, - _("unable to enable netlink handle credential passing: %s"), - nl_geterror ()); - goto error; - } - - if (nl_socket_recv_pktinfo (priv->nlh, 1) < 0) { - g_set_error (error, NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, - _("unable to enable netlink handle packet info: %s"), - nl_geterror ()); - goto error; - } - -#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND - /* Work around apparent libnl bug; rtnl_addr requires that all - * addresses have the "peer" attribute set in order to be compared - * for equality, but this attribute is not normally set. As a - * result, most addresses will not compare as equal even to - * themselves, busting caching. - */ - addr_cache = rtnl_addr_alloc_cache (priv->nlh); - nl_cache_get_ops (addr_cache)->co_obj_ops->oo_id_attrs &= ~0x80; - nl_cache_free (addr_cache); -#endif + nl_disable_sequence_check (priv->nlh_event); /* Subscribe to the LINK group for internal carrier signals */ if (!nm_netlink_monitor_subscribe (self, RTNLGRP_LINK, error)) goto error; - if ((priv->link_cache = rtnl_link_alloc_cache (priv->nlh)) == NULL) { - g_set_error (error, NM_NETLINK_MONITOR_ERROR, - NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_LINK_CACHE, - _("unable to allocate netlink link cache for monitoring link status: %s"), - nl_geterror ()); - goto error; - } - - fd = nl_socket_get_fd (priv->nlh); + fd = nl_socket_get_fd (priv->nlh_event); priv->io_channel = g_io_channel_unix_new (fd); g_io_channel_set_encoding (priv->io_channel, NULL, &channel_error); @@ -328,23 +326,90 @@ error: if (priv->io_channel) nm_netlink_monitor_close_connection (self); + if (priv->nlh_event) { + nl_handle_destroy (priv->nlh_event); + priv->nlh_event = NULL; + } + + return FALSE; +} + +static gboolean +sync_connection_setup (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + struct nl_cb *cb; +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + struct nl_cache *addr_cache; +#endif + + /* Set up the event listener connection */ + cb = nl_cb_alloc (NL_CB_VERBOSE); + priv->nlh_sync = nl_handle_alloc_cb (cb); + nl_cb_put (cb); + if (!priv->nlh_sync) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE, + _("unable to allocate netlink handle for monitoring link status: %s"), + nl_geterror ()); + goto error; + } + + if (!nlh_setup (priv->nlh_sync, NULL, self, error)) + goto error; + +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + /* Work around apparent libnl bug; rtnl_addr requires that all + * addresses have the "peer" attribute set in order to be compared + * for equality, but this attribute is not normally set. As a + * result, most addresses will not compare as equal even to + * themselves, busting caching. + */ + addr_cache = rtnl_addr_alloc_cache (priv->nlh_sync); + nl_cache_get_ops (addr_cache)->co_obj_ops->oo_id_attrs &= ~0x80; + nl_cache_free (addr_cache); +#endif + + if ((priv->link_cache = rtnl_link_alloc_cache (priv->nlh_sync)) == NULL) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_LINK_CACHE, + _("unable to allocate netlink link cache for monitoring link status: %s"), + nl_geterror ()); + goto error; + } + nl_cache_mngt_provide (priv->link_cache); + + return TRUE; + +error: if (priv->link_cache) { nl_cache_free (priv->link_cache); priv->link_cache = NULL; } - if (priv->nlh) { - nl_handle_destroy (priv->nlh); - priv->nlh = NULL; + if (priv->nlh_sync) { + nl_handle_destroy (priv->nlh_sync); + priv->nlh_sync = NULL; } - if (priv->nlh_cb) { - nl_cb_put (priv->nlh_cb); - priv->nlh_cb = NULL; - } return FALSE; } +gboolean +nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) +{ + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + if (!event_connection_setup (self, error)) + return FALSE; + + if (!sync_connection_setup (self, error)) + return FALSE; + + return TRUE; +} + void nm_netlink_monitor_close_connection (NMNetlinkMonitor *self) { @@ -359,9 +424,8 @@ nm_netlink_monitor_close_connection (NMNetlinkMonitor *self) nm_netlink_monitor_detach (self); g_io_channel_shutdown (priv->io_channel, - TRUE /* flush pending data */, - NULL); - + TRUE /* flush pending data */, + NULL); g_io_channel_unref (priv->io_channel); priv->io_channel = NULL; } @@ -374,7 +438,7 @@ nm_netlink_monitor_attach (NMNetlinkMonitor *self) g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - g_return_if_fail (priv->nlh != NULL); + g_return_if_fail (priv->nlh_event != NULL); g_return_if_fail (priv->event_id == 0); priv->event_id = g_io_add_watch (priv->io_channel, @@ -425,14 +489,14 @@ nm_netlink_monitor_subscribe (NMNetlinkMonitor *self, int group, GError **error) priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - if (!priv->nlh) { + if (!priv->nlh_event) { if (!nm_netlink_monitor_open_connection (self, error)) return FALSE; } subs = get_subs (self, group) + 1; if (subs == 1) { - if (nl_socket_add_membership (priv->nlh, group) < 0) { + if (nl_socket_add_membership (priv->nlh_event, group) < 0) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, _("unable to join netlink group: %s"), @@ -457,11 +521,11 @@ nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *self, int group) g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - g_return_if_fail (priv->nlh != NULL); + g_return_if_fail (priv->nlh_event != NULL); subs = get_subs (self, group) - 1; if (subs == 0) - nl_socket_drop_membership (priv->nlh, group); + nl_socket_drop_membership (priv->nlh_event, group); /* Update # of subscriptions for this group */ set_subs (self, group, subs); @@ -483,7 +547,7 @@ nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *self, GError **error) * libnl-1.1; revisit this and return a proper error when we port to * a later libnl. */ - nl_rtgen_request (priv->nlh, RTM_GETLINK, AF_INET6, NLM_F_DUMP); + nl_rtgen_request (priv->nlh_event, RTM_GETLINK, AF_INET6, NLM_F_DUMP); return TRUE; } @@ -500,7 +564,7 @@ deferred_emit_carrier_state (gpointer user_data) /* Update the link cache with latest state, and if there are no errors * emit the link states for all the interfaces in the cache. */ - if (nl_cache_refill (priv->nlh, priv->link_cache)) { + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); } else nl_cache_foreach_filter (priv->link_cache, NULL, link_msg_handler, self); @@ -516,7 +580,6 @@ nm_netlink_monitor_request_status (NMNetlinkMonitor *self, GError **error) g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - g_return_val_if_fail (priv->event_id > 0, FALSE); /* Schedule the carrier state emission */ if (!priv->request_status_id) @@ -559,7 +622,7 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); /* Update the link cache with the latest information */ - if (nl_cache_refill (priv->nlh, priv->link_cache)) { + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, @@ -572,7 +635,7 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, * otherwise some kernels (or maybe libnl?) only send a few of the * interfaces in the refill request. */ - if (nl_cache_refill (priv->nlh, priv->link_cache)) { + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { g_set_error (error, NM_NETLINK_MONITOR_ERROR, NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, @@ -622,7 +685,7 @@ nm_netlink_get_default_handle (void) struct nl_handle *nlh; self = nm_netlink_monitor_get (); - nlh = NM_NETLINK_MONITOR_GET_PRIVATE (self)->nlh; + nlh = NM_NETLINK_MONITOR_GET_PRIVATE (self)->nlh_sync; g_object_unref (self); return nlh; @@ -640,7 +703,7 @@ nm_netlink_iface_to_index (const char *iface) self = nm_netlink_monitor_get (); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - nl_cache_update (priv->nlh, priv->link_cache); + nl_cache_refill (priv->nlh_sync, priv->link_cache); idx = rtnl_link_name2i (priv->link_cache, iface); g_object_unref (self); @@ -663,7 +726,7 @@ nm_netlink_index_to_iface (int idx) buf = g_malloc0 (MAX_IFACE_LEN); g_assert (buf); - nl_cache_update (priv->nlh, priv->link_cache); + nl_cache_refill (priv->nlh_sync, priv->link_cache); if (!rtnl_link_i2name (priv->link_cache, idx, buf, MAX_IFACE_LEN - 1)) { g_free (buf); buf = NULL; @@ -685,7 +748,7 @@ nm_netlink_index_to_rtnl_link (int idx) self = nm_netlink_monitor_get (); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); - nl_cache_update (priv->nlh, priv->link_cache); + nl_cache_refill (priv->nlh_sync, priv->link_cache); ret = rtnl_link_get (priv->link_cache, idx); g_object_unref (self); @@ -731,14 +794,14 @@ finalize (GObject *object) priv->link_cache = NULL; } - if (priv->nlh) { - nl_handle_destroy (priv->nlh); - priv->nlh = NULL; + if (priv->nlh_event) { + nl_handle_destroy (priv->nlh_event); + priv->nlh_event = NULL; } - if (priv->nlh_cb) { - nl_cb_put (priv->nlh_cb); - priv->nlh_cb = NULL; + if (priv->nlh_sync) { + nl_handle_destroy (priv->nlh_sync); + priv->nlh_sync = NULL; } g_hash_table_destroy (priv->subscriptions); From 34793c1fb1f92e8acf31382792800a0f47c26002 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Apr 2010 14:58:25 -0700 Subject: [PATCH 270/392] core: use ifindex instead of interface name in a lot of places Where we can do so, let's use ifindex since that's actually unique and doesn't change when the interface name changes. We already use ifindex in a bunch of places, and netlink *only* uses ifindex, so this will make it easier later when we move over to ifindexes fully. --- marshallers/nm-marshal.list | 4 +- src/ip6-manager/nm-ip6-manager.c | 124 ++++++++++++++----------------- src/ip6-manager/nm-ip6-manager.h | 26 +++---- src/nm-device-ethernet.c | 44 ++--------- src/nm-device-ethernet.h | 6 +- src/nm-device-interface.c | 10 ++- src/nm-device-interface.h | 4 +- src/nm-device-olpc-mesh.c | 34 +-------- src/nm-device-olpc-mesh.h | 6 +- src/nm-device-wifi.c | 31 +------- src/nm-device-wifi.h | 6 +- src/nm-device.c | 66 +++++++++++++--- src/nm-device.h | 2 + src/nm-manager.c | 18 ++--- src/nm-netlink-monitor.c | 3 +- src/nm-system.c | 2 +- src/nm-udev-manager.c | 6 +- 17 files changed, 168 insertions(+), 224 deletions(-) diff --git a/marshallers/nm-marshal.list b/marshallers/nm-marshal.list index e19f8befcf..359fbed2d5 100644 --- a/marshallers/nm-marshal.list +++ b/marshallers/nm-marshal.list @@ -15,8 +15,8 @@ VOID:POINTER,POINTER VOID:STRING,STRING,STRING,UINT VOID:OBJECT,UINT,UINT VOID:STRING,INT -VOID:STRING,UINT -VOID:STRING,UINT,BOOLEAN +VOID:INT,UINT +VOID:INT,UINT,BOOLEAN VOID:OBJECT,OBJECT,ENUM VOID:POINTER,STRING VOID:STRING,BOXED diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 50905c3af5..ddecf07cdc 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -42,7 +42,7 @@ typedef struct { NMNetlinkMonitor *monitor; - GHashTable *devices_by_iface, *devices_by_index; + GHashTable *devices; struct nl_handle *nlh; struct nl_cache *addr_cache, *route_cache; @@ -68,7 +68,7 @@ typedef struct { typedef struct { NMIP6Manager *manager; char *iface; - int index; + int ifindex; char *accept_ra_path; gboolean accept_ra_save_valid; @@ -120,10 +120,9 @@ nm_ip6_manager_init (NMIP6Manager *manager) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - priv->devices_by_iface = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, - (GDestroyNotify) nm_ip6_device_destroy); - priv->devices_by_index = g_hash_table_new (NULL, NULL); + priv->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, + (GDestroyNotify) nm_ip6_device_destroy); priv->monitor = nm_netlink_monitor_get (); nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_IFADDR, NULL); @@ -144,8 +143,7 @@ finalize (GObject *object) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); - g_hash_table_destroy (priv->devices_by_iface); - g_hash_table_destroy (priv->devices_by_index); + g_hash_table_destroy (priv->devices); g_object_unref (priv->monitor); nl_cache_free (priv->addr_cache); nl_cache_free (priv->route_cache); @@ -170,8 +168,8 @@ nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMIP6ManagerClass, addrconf_complete), NULL, NULL, - _nm_marshal_VOID__STRING_UINT_BOOLEAN, - G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_BOOLEAN); + _nm_marshal_VOID__INT_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); signals[CONFIG_CHANGED] = g_signal_new ("config-changed", @@ -179,8 +177,8 @@ nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), NULL, NULL, - _nm_marshal_VOID__STRING_UINT, - G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT); + _nm_marshal_VOID__INT_UINT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); } static void @@ -217,7 +215,7 @@ nm_ip6_manager_new (void) manager = g_object_new (NM_TYPE_IP6_MANAGER, NULL); priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - if (!priv->devices_by_iface || !priv->devices_by_index) { + if (!priv->devices) { nm_log_err (LOGD_IP6, "not enough memory to initialize IP6 manager tables"); g_object_unref (manager); manager = NULL; @@ -231,8 +229,7 @@ nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - return g_hash_table_lookup (priv->devices_by_index, - GINT_TO_POINTER (ifindex)); + return g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); } typedef struct { @@ -246,25 +243,22 @@ finish_addrconf (gpointer user_data) CallbackInfo *info = user_data; NMIP6Device *device = info->device; NMIP6Manager *manager = device->manager; - char *iface_copy; + int ifindex; device->finish_addrconf_id = 0; device->addrconf_complete = TRUE; + ifindex = device->ifindex; if (device->state >= device->target_state) { g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - device->iface, info->dhcp_opts, TRUE); + ifindex, info->dhcp_opts, TRUE); } else { nm_log_info (LOGD_IP6, "(%s): IP6 addrconf timed out or failed.", device->iface); - iface_copy = g_strdup (device->iface); - - nm_ip6_manager_cancel_addrconf (manager, device->iface); + nm_ip6_manager_cancel_addrconf (manager, ifindex); g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - iface_copy, info->dhcp_opts, FALSE); - - g_free (iface_copy); + ifindex, info->dhcp_opts, FALSE); } return FALSE; @@ -278,7 +272,7 @@ emit_config_changed (gpointer user_data) NMIP6Manager *manager = device->manager; device->config_changed_id = 0; - g_signal_emit (manager, signals[CONFIG_CHANGED], 0, device->iface, info->dhcp_opts); + g_signal_emit (manager, signals[CONFIG_CHANGED], 0, device->ifindex, info->dhcp_opts); return FALSE; } @@ -359,7 +353,7 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) for (rtnladdr = (struct rtnl_addr *)nl_cache_get_first (priv->addr_cache); rtnladdr; rtnladdr = (struct rtnl_addr *)nl_cache_get_next ((struct nl_object *)rtnladdr)) { - if (rtnl_addr_get_ifindex (rtnladdr) != device->index) + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) continue; nladdr = rtnl_addr_get_local (rtnladdr); @@ -686,33 +680,36 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us } static NMIP6Device * -nm_ip6_device_new (NMIP6Manager *manager, const char *iface) +nm_ip6_device_new (NMIP6Manager *manager, int ifindex) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); NMIP6Device *device; GError *error = NULL; char *contents = NULL; + g_return_val_if_fail (ifindex > 0, NULL); + device = g_slice_new0 (NMIP6Device); if (!device) { - nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object.", iface); + nm_log_err (LOGD_IP6, "(%d): out of memory creating IP6 addrconf object.", + ifindex); return NULL; } - device->iface = g_strdup (iface); + device->ifindex = ifindex; + device->iface = g_strdup (nm_netlink_index_to_iface (ifindex)); if (!device->iface) { - nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object " - "property 'iface'.", - iface); + nm_log_err (LOGD_IP6, "(%d): could not find interface name from index.", + ifindex); goto error; } - device->index = nm_netlink_iface_to_index (iface); - device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", iface); + device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", + device->iface); if (!device->accept_ra_path) { nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object " "property 'accept_ra_path'.", - iface); + device->iface); goto error; } @@ -720,15 +717,14 @@ nm_ip6_device_new (NMIP6Manager *manager, const char *iface) device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); - g_hash_table_replace (priv->devices_by_iface, device->iface, device); - g_hash_table_replace (priv->devices_by_index, GINT_TO_POINTER (device->index), device); + g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); /* Grab the original value of "accept_ra" so we can restore it when the * device is taken down. */ if (!g_file_get_contents (device->accept_ra_path, &contents, NULL, &error)) { nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", - iface, device->accept_ra_path, + device->iface, device->accept_ra_path, error ? error->code : -1, error && error->message ? error->message : "(unknown)"); g_clear_error (&error); @@ -753,7 +749,7 @@ error: void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, - const char *iface, + int ifindex, NMSettingIP6Config *s_ip6) { NMIP6ManagerPrivate *priv; @@ -761,11 +757,11 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, const char *method = NULL; g_return_if_fail (NM_IS_IP6_MANAGER (manager)); - g_return_if_fail (iface != NULL); + g_return_if_fail (ifindex > 0); priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - device = nm_ip6_device_new (manager, iface); + device = nm_ip6_device_new (manager, ifindex); if (s_ip6) method = nm_setting_ip6_config_get_method (s_ip6); @@ -778,9 +774,9 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, else device->target_state = NM_IP6_DEVICE_GOT_ADDRESS; - g_return_if_fail (strchr (iface, '/') == NULL && - strcmp (iface, "all") != 0 && - strcmp (iface, "default") != 0); + g_return_if_fail ( strchr (device->iface, '/') == NULL + && strcmp (device->iface, "all") != 0 + && strcmp (device->iface, "default") != 0); /* Turn router advertisement acceptance on or off... */ nm_utils_do_sysctl (device->accept_ra_path, @@ -788,22 +784,21 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, } void -nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, - const char *iface) +nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex) { NMIP6ManagerPrivate *priv; NMIP6Device *device; CallbackInfo *info; g_return_if_fail (NM_IS_IP6_MANAGER (manager)); - g_return_if_fail (iface != NULL); + g_return_if_fail (ifindex > 0); priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - device = (NMIP6Device *) g_hash_table_lookup (priv->devices_by_iface, iface); + device = (NMIP6Device *) g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); g_return_if_fail (device != NULL); - nm_log_info (LOGD_IP6, "Activation (%s) Beginning IP6 addrconf.", iface); + nm_log_info (LOGD_IP6, "Activation (%s) Beginning IP6 addrconf.", device->iface); device->addrconf_complete = FALSE; device->ra_flags = 0; @@ -825,27 +820,17 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, } void -nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, - const char *iface) +nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, int ifindex) { - NMIP6ManagerPrivate *priv; - NMIP6Device *device; - g_return_if_fail (NM_IS_IP6_MANAGER (manager)); - g_return_if_fail (iface != NULL); + g_return_if_fail (ifindex > 0); - priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - - device = g_hash_table_lookup (priv->devices_by_iface, iface); - if (device) { - g_hash_table_remove (priv->devices_by_index, GINT_TO_POINTER (device->index)); - g_hash_table_remove (priv->devices_by_iface, iface); - } + g_hash_table_remove (NM_IP6_MANAGER_GET_PRIVATE (manager)->devices, + GINT_TO_POINTER (ifindex)); } NMIP6Config * -nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, - const char *iface) +nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) { NMIP6ManagerPrivate *priv; NMIP6Device *device; @@ -862,20 +847,21 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int i; g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL); - g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (ifindex > 0, NULL); priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - device = (NMIP6Device *) g_hash_table_lookup (priv->devices_by_iface, iface); + device = (NMIP6Device *) g_hash_table_lookup (priv->devices, + GINT_TO_POINTER (ifindex)); if (!device) { - nm_log_warn (LOGD_IP6, "(%s): addrconf not started.", iface); + nm_log_warn (LOGD_IP6, "(%d): addrconf not started.", ifindex); return NULL; } config = nm_ip6_config_new (); if (!config) { nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 config object.", - iface); + device->iface); return NULL; } @@ -883,7 +869,7 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, for (rtnladdr = (struct rtnl_addr *)nl_cache_get_first (priv->addr_cache); rtnladdr; rtnladdr = (struct rtnl_addr *)nl_cache_get_next ((struct nl_object *)rtnladdr)) { - if (rtnl_addr_get_ifindex (rtnladdr) != device->index) + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) continue; nladdr = rtnl_addr_get_local (rtnladdr); @@ -901,7 +887,7 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, for (rtnlroute = (struct rtnl_route *)nl_cache_get_first (priv->route_cache); rtnlroute; rtnlroute = (struct rtnl_route *)nl_cache_get_next ((struct nl_object *)rtnlroute)) { - if (rtnl_route_get_oif (rtnlroute) != device->index) + if (rtnl_route_get_oif (rtnlroute) != device->ifindex) continue; nldest = rtnl_route_get_dst (rtnlroute); diff --git a/src/ip6-manager/nm-ip6-manager.h b/src/ip6-manager/nm-ip6-manager.h index d0cf4b08a9..db920662b9 100644 --- a/src/ip6-manager/nm-ip6-manager.h +++ b/src/ip6-manager/nm-ip6-manager.h @@ -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) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #ifndef NM_IP6_MANAGER_H @@ -54,7 +54,7 @@ typedef struct { * that the initial configuration is complete. */ void (*addrconf_complete) (NMIP6Manager *manager, - char *iface, + guint32 ifindex, guint dhcp_opts, gboolean success); @@ -63,22 +63,22 @@ typedef struct { * of the interface has changed. */ void (*config_changed) (NMIP6Manager *manager, - char *iface, + guint32 ifindex, guint dhcp_opts); } NMIP6ManagerClass; GType nm_ip6_manager_get_type (void); -NMIP6Manager *nm_ip6_manager_get (void); -void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, - const char *iface, - NMSettingIP6Config *s_ip6); -void nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, - const char *iface); -void nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, - const char *iface); +NMIP6Manager *nm_ip6_manager_get (void); +void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, + int ifindex, + NMSettingIP6Config *s_ip6); +void nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, + int ifindex); +void nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, + int ifindex); -NMIP6Config * nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, - const char *iface); +NMIP6Config * nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, + int ifindex); #endif /* NM_IP6_MANAGER_H */ diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 202584b24b..be6d4e2f3c 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -106,7 +106,6 @@ typedef struct { struct ether_addr hw_addr; gboolean carrier; - guint32 ifindex; NMNetlinkMonitor * monitor; gulong link_connected_id; @@ -134,7 +133,6 @@ enum { PROP_HW_ADDRESS, PROP_SPEED, PROP_CARRIER, - PROP_IFINDEX, LAST_PROP }; @@ -247,11 +245,10 @@ carrier_on (NMNetlinkMonitor *monitor, { NMDevice *device = NM_DEVICE (user_data); NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); guint32 caps; /* Make sure signal is for us */ - if (idx == priv->ifindex) { + if (idx == nm_device_get_ifindex (device)) { /* Ignore spurious netlink messages */ caps = nm_device_get_capabilities (device); if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) @@ -268,11 +265,10 @@ carrier_off (NMNetlinkMonitor *monitor, { NMDevice *device = NM_DEVICE (user_data); NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); guint32 caps; /* Make sure signal is for us */ - if (idx == priv->ifindex) { + if (idx == nm_device_get_ifindex (device)) { NMDeviceState state; gboolean defer = FALSE; @@ -313,7 +309,8 @@ constructor (GType type, priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", - nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); caps = nm_device_get_capabilities (self); if (caps & NM_DEVICE_CAP_CARRIER_DETECT) { @@ -332,7 +329,7 @@ constructor (GType type, /* Get initial link state */ if (!nm_netlink_monitor_get_flags_sync (priv->monitor, - priv->ifindex, + nm_device_get_ifindex (NM_DEVICE (self)), &ifflags, &error)) { nm_log_warn (LOGD_HW | LOGD_ETHER, @@ -427,8 +424,7 @@ real_hw_take_down (NMDevice *dev) NMDevice * nm_device_ethernet_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex) + const char *driver) { g_return_val_if_fail (udi != NULL, NULL); g_return_val_if_fail (iface != NULL, NULL); @@ -438,7 +434,6 @@ nm_device_ethernet_new (const char *udi, NM_DEVICE_INTERFACE_UDI, udi, NM_DEVICE_INTERFACE_IFACE, iface, NM_DEVICE_INTERFACE_DRIVER, driver, - NM_DEVICE_ETHERNET_IFINDEX, ifindex, NM_DEVICE_INTERFACE_TYPE_DESC, "Ethernet", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_ETHERNET, NULL); @@ -460,14 +455,6 @@ nm_device_ethernet_get_address (NMDeviceEthernet *self, struct ether_addr *addr) memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->hw_addr), sizeof (struct ether_addr)); } -guint32 -nm_device_ethernet_get_ifindex (NMDeviceEthernet *self) -{ - g_return_val_if_fail (self != NULL, FALSE); - - return NM_DEVICE_ETHERNET_GET_PRIVATE (self)->ifindex; -} - /* Returns speed in Mb/s */ static guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *self) @@ -1619,7 +1606,7 @@ ip4_match_config (NMDevice *self, NMConnection *connection) int ifindex; AddrData check_data; - ifindex = nm_device_ethernet_get_ifindex (NM_DEVICE_ETHERNET (self)); + ifindex = nm_device_get_ifindex (self); s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); g_assert (s_con); @@ -1791,9 +1778,6 @@ get_property (GObject *object, guint prop_id, case PROP_CARRIER: g_value_set_boolean (value, priv->carrier); break; - case PROP_IFINDEX: - g_value_set_uint (value, priv->ifindex); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1804,13 +1788,7 @@ static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object); - switch (prop_id) { - case PROP_IFINDEX: - /* construct-only */ - priv->ifindex = g_value_get_uint (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1877,14 +1855,6 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) FALSE, G_PARAM_READABLE)); - g_object_class_install_property - (object_class, PROP_IFINDEX, - g_param_spec_uint (NM_DEVICE_ETHERNET_IFINDEX, - "Ifindex", - "Interface index", - 0, G_MAXUINT32, 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); - /* Signals */ signals[PROPERTIES_CHANGED] = nm_properties_changed_signal_new (object_class, diff --git a/src/nm-device-ethernet.h b/src/nm-device-ethernet.h index 643572f700..7bb3db0086 100644 --- a/src/nm-device-ethernet.h +++ b/src/nm-device-ethernet.h @@ -39,7 +39,6 @@ G_BEGIN_DECLS #define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address" #define NM_DEVICE_ETHERNET_SPEED "speed" #define NM_DEVICE_ETHERNET_CARRIER "carrier" -#define NM_DEVICE_ETHERNET_IFINDEX "ifindex" typedef struct { NMDevice parent; @@ -58,14 +57,11 @@ GType nm_device_ethernet_get_type (void); NMDevice *nm_device_ethernet_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex); + const char *driver); void nm_device_ethernet_get_address (NMDeviceEthernet *dev, struct ether_addr *addr); -guint32 nm_device_ethernet_get_ifindex (NMDeviceEthernet *dev); - G_END_DECLS #endif /* NM_DEVICE_ETHERNET_H */ diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index 4040626c2b..85f58d5563 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include "nm-marshal.h" @@ -186,6 +186,14 @@ nm_device_interface_init (gpointer g_iface) RFKILL_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + g_object_interface_install_property + (g_iface, + g_param_spec_int (NM_DEVICE_INTERFACE_IFINDEX, + "Ifindex", + "Ifindex", + 0, G_MAXINT, 0, + G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + /* Signals */ g_signal_new ("state-changed", iface_type, diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index adbafcaa25..ec27f6e820 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -57,8 +57,9 @@ typedef enum #define NM_DEVICE_INTERFACE_STATE "state" #define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ #define NM_DEVICE_INTERFACE_MANAGED "managed" -#define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ +#define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ #define NM_DEVICE_INTERFACE_RFKILL_TYPE "rfkill-type" /* Internal only */ +#define NM_DEVICE_INTERFACE_IFINDEX "ifindex" /* Internal only */ typedef enum { NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000, @@ -77,6 +78,7 @@ typedef enum { NM_DEVICE_INTERFACE_PROP_MANAGED, NM_DEVICE_INTERFACE_PROP_TYPE_DESC, NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, + NM_DEVICE_INTERFACE_PROP_IFINDEX, } NMDeviceInterfaceProp; diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index 2093a8e887..f73108a793 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -69,7 +69,6 @@ enum { PROP_HW_ADDRESS, PROP_COMPANION, PROP_ACTIVE_CHANNEL, - PROP_IFINDEX, LAST_PROP }; @@ -98,7 +97,6 @@ struct _NMDeviceOlpcMeshPrivate gboolean dispose_has_run; struct ether_addr hw_addr; - guint32 ifindex; GByteArray * ssid; @@ -263,7 +261,8 @@ constructor (GType type, priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", - nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); iface = nm_device_get_iface (NM_DEVICE (self)); fd = socket (PF_INET, SOCK_DGRAM, 0); @@ -539,15 +538,6 @@ nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid) close (sk); } - -guint32 -nm_device_olpc_mesh_get_ifindex (NMDeviceOlpcMesh *self) -{ - g_return_val_if_fail (self != NULL, FALSE); - - return NM_DEVICE_OLPC_MESH_GET_PRIVATE (self)->ifindex; -} - /****************************************************************************/ static void @@ -701,9 +691,6 @@ get_property (GObject *object, guint prop_id, case PROP_ACTIVE_CHANNEL: g_value_set_uint (value, nm_device_olpc_mesh_get_channel (device)); break; - case PROP_IFINDEX: - g_value_set_uint (value, nm_device_olpc_mesh_get_ifindex (device)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -714,13 +701,7 @@ static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object); - switch (prop_id) { - case PROP_IFINDEX: - /* construct-only */ - priv->ifindex = g_value_get_uint (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -780,13 +761,6 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass) 0, G_MAXUINT32, 0, G_PARAM_READABLE)); - g_object_class_install_property (object_class, PROP_IFINDEX, - g_param_spec_uint (NM_DEVICE_OLPC_MESH_IFINDEX, - "Ifindex", - "Interface index", - 0, G_MAXUINT32, 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - signals[PROPERTIES_CHANGED] = nm_properties_changed_signal_new (object_class, G_STRUCT_OFFSET (NMDeviceOlpcMeshClass, properties_changed)); @@ -986,8 +960,7 @@ state_changed_cb (NMDevice *device, NMDeviceState state, gpointer user_data) NMDevice * nm_device_olpc_mesh_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex) + const char *driver) { GObject *obj; @@ -999,7 +972,6 @@ nm_device_olpc_mesh_new (const char *udi, NM_DEVICE_INTERFACE_UDI, udi, NM_DEVICE_INTERFACE_IFACE, iface, NM_DEVICE_INTERFACE_DRIVER, driver, - NM_DEVICE_OLPC_MESH_IFINDEX, ifindex, NM_DEVICE_INTERFACE_TYPE_DESC, "802.11 OLPC Mesh", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_OLPC_MESH, NULL); diff --git a/src/nm-device-olpc-mesh.h b/src/nm-device-olpc-mesh.h index adf3d2d956..bcc03e57ab 100644 --- a/src/nm-device-olpc-mesh.h +++ b/src/nm-device-olpc-mesh.h @@ -46,7 +46,6 @@ G_BEGIN_DECLS #define NM_DEVICE_OLPC_MESH_COMPANION "companion" #define NM_DEVICE_OLPC_MESH_BITRATE "bitrate" #define NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL "active-channel" -#define NM_DEVICE_OLPC_MESH_IFINDEX "ifindex" #ifndef NM_DEVICE_OLPC_MESH_DEFINED #define NM_DEVICE_OLPC_MESH_DEFINED @@ -75,10 +74,7 @@ GType nm_device_olpc_mesh_get_type (void); NMDevice *nm_device_olpc_mesh_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex); - -guint32 nm_device_olpc_mesh_get_ifindex (NMDeviceOlpcMesh *self); + const char *driver); G_END_DECLS diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index cccaf1194e..b598f2b675 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -82,7 +82,6 @@ enum { PROP_BITRATE, PROP_ACTIVE_ACCESS_POINT, PROP_CAPABILITIES, - PROP_IFINDEX, PROP_SCANNING, PROP_IPW_RFKILL_STATE, @@ -144,7 +143,6 @@ struct _NMDeviceWifiPrivate { gboolean disposed; struct ether_addr hw_addr; - guint32 ifindex; /* Legacy rfkill for ipw2x00; will be fixed with 2.6.33 kernel */ char * ipw_rfkill_path; @@ -579,7 +577,8 @@ constructor (GType type, priv = NM_DEVICE_WIFI_GET_PRIVATE (self); nm_log_dbg (LOGD_HW | LOGD_WIFI, "(%s): kernel ifindex %d", - nm_device_get_iface (NM_DEVICE (self)), priv->ifindex); + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); memset (&range, 0, sizeof (struct iw_range)); success = wireless_get_range (NM_DEVICE_WIFI (object), &range, &response_len); @@ -3462,14 +3461,6 @@ device_state_changed (NMDevice *device, remove_all_aps (self); } -guint32 -nm_device_wifi_get_ifindex (NMDeviceWifi *self) -{ - g_return_val_if_fail (self != NULL, FALSE); - - return NM_DEVICE_WIFI_GET_PRIVATE (self)->ifindex; -} - NMAccessPoint * nm_device_wifi_get_activation_ap (NMDeviceWifi *self) { @@ -3563,8 +3554,7 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) NMDevice * nm_device_wifi_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex) + const char *driver) { g_return_val_if_fail (udi != NULL, NULL); g_return_val_if_fail (iface != NULL, NULL); @@ -3574,7 +3564,6 @@ nm_device_wifi_new (const char *udi, NM_DEVICE_INTERFACE_UDI, udi, NM_DEVICE_INTERFACE_IFACE, iface, NM_DEVICE_INTERFACE_DRIVER, driver, - NM_DEVICE_WIFI_IFINDEX, ifindex, NM_DEVICE_INTERFACE_TYPE_DESC, "802.11 WiFi", NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_WIFI, NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WLAN, @@ -3675,9 +3664,6 @@ get_property (GObject *object, guint prop_id, else g_value_set_boxed (value, "/"); break; - case PROP_IFINDEX: - g_value_set_uint (value, nm_device_wifi_get_ifindex (device)); - break; case PROP_SCANNING: g_value_set_boolean (value, nm_supplicant_interface_get_scanning (priv->supplicant.iface)); break; @@ -3697,10 +3683,6 @@ set_property (GObject *object, guint prop_id, NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); switch (prop_id) { - case PROP_IFINDEX: - /* construct-only */ - priv->ifindex = g_value_get_uint (value); - break; case PROP_IPW_RFKILL_STATE: /* construct only */ priv->ipw_rfkill_state = g_value_get_uint (value); @@ -3788,13 +3770,6 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) 0, G_MAXUINT32, NM_WIFI_DEVICE_CAP_NONE, G_PARAM_READABLE)); - g_object_class_install_property (object_class, PROP_IFINDEX, - g_param_spec_uint (NM_DEVICE_WIFI_IFINDEX, - "Ifindex", - "Interface index", - 0, G_MAXUINT32, 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); - g_object_class_install_property (object_class, PROP_SCANNING, g_param_spec_boolean (NM_DEVICE_WIFI_SCANNING, "Scanning", diff --git a/src/nm-device-wifi.h b/src/nm-device-wifi.h index 45b573a03c..11ac885735 100644 --- a/src/nm-device-wifi.h +++ b/src/nm-device-wifi.h @@ -47,7 +47,6 @@ G_BEGIN_DECLS #define NM_DEVICE_WIFI_BITRATE "bitrate" #define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point" #define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities" -#define NM_DEVICE_WIFI_IFINDEX "ifindex" #define NM_DEVICE_WIFI_SCANNING "scanning" #define NM_DEVICE_WIFI_IPW_RFKILL_STATE "ipw-rfkill-state" @@ -84,8 +83,7 @@ GType nm_device_wifi_get_type (void); NMDevice *nm_device_wifi_new (const char *udi, const char *iface, - const char *driver, - guint32 ifindex); + const char *driver); void nm_device_wifi_get_address (NMDeviceWifi *dev, struct ether_addr *addr); @@ -102,8 +100,6 @@ NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *self); NMAccessPoint * nm_device_wifi_get_activation_ap (NMDeviceWifi *self); -guint32 nm_device_wifi_get_ifindex (NMDeviceWifi *self); - RfKillState nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self); G_END_DECLS diff --git a/src/nm-device.c b/src/nm-device.c index db0ad914a9..b285baaf86 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -83,7 +83,9 @@ typedef struct { char * udi; char * path; char * iface; /* may change, could be renamed by user */ + int ifindex; char * ip_iface; + int ip_ifindex; NMDeviceType type; char * type_desc; guint32 capabilities; @@ -304,6 +306,13 @@ nm_device_get_iface (NMDevice *self) return NM_DEVICE_GET_PRIVATE (self)->iface; } +int +nm_device_get_ifindex (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, 0); + + return NM_DEVICE_GET_PRIVATE (self)->ifindex; +} const char * nm_device_get_ip_iface (NMDevice *self) @@ -317,14 +326,36 @@ nm_device_get_ip_iface (NMDevice *self) return priv->ip_iface ? priv->ip_iface : priv->iface; } +int +nm_device_get_ip_ifindex (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (self != NULL, 0); + + priv = NM_DEVICE_GET_PRIVATE (self); + /* If it's not set, default to iface */ + return priv->ip_iface ? priv->ip_ifindex : priv->ifindex; +} void nm_device_set_ip_iface (NMDevice *self, const char *iface) { + NMDevicePrivate *priv; + g_return_if_fail (NM_IS_DEVICE (self)); - g_free (NM_DEVICE_GET_PRIVATE (self)->ip_iface); - NM_DEVICE_GET_PRIVATE (self)->ip_iface = iface ? g_strdup (iface) : NULL; + priv = NM_DEVICE_GET_PRIVATE (self); + g_free (priv->ip_iface); + priv->ip_ifindex = 0; + + priv->ip_iface = g_strdup (iface); + if (priv->ip_iface) { + priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface); + if (!priv->ip_ifindex) { + nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface); + } + } } @@ -545,7 +576,7 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family) static void ip6_addrconf_complete (NMIP6Manager *ip6_manager, - const char *iface, + int ifindex, guint dhcp_opts, gboolean success, gpointer user_data) @@ -558,7 +589,7 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; NMDeviceState state; - if (strcmp (nm_device_get_ip_iface (self), iface) != 0) + if (ifindex != nm_device_get_ip_ifindex (self)) return; req = nm_device_get_act_request (self); if (!req) @@ -614,13 +645,13 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, static void ip6_config_changed (NMIP6Manager *ip6_manager, - const char *iface, + int ifindex, guint dhcp_opts, gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); - if (strcmp (nm_device_get_ip_iface (self), iface) != 0) + if (ifindex != nm_device_get_ip_ifindex (self)) return; if (!nm_device_get_act_request (self)) return; @@ -675,7 +706,9 @@ addrconf6_setup (NMDevice *self) ip_iface = nm_device_get_ip_iface (self); s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - nm_ip6_manager_prepare_interface (priv->ip6_manager, ip_iface, s_ip6); + nm_ip6_manager_prepare_interface (priv->ip6_manager, + nm_device_get_ip_ifindex (self), + s_ip6); } static void @@ -1481,7 +1514,7 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { priv->ip6_waiting_for_config = TRUE; - nm_ip6_manager_begin_addrconf (priv->ip6_manager, ip_iface); + nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) ret = dhcp6_start (self, connection, IP6_DHCP_OPT_MANAGED, reason); @@ -1867,7 +1900,8 @@ real_act_stage4_get_ip6_config (NMDevice *self, s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { - *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, ip_iface); + *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, + nm_device_get_ip_ifindex (self)); if (*config) { /* Merge user-defined overrides into the IP6Config to be applied */ nm_utils_merge_ip6_config (*config, s_ip6); @@ -3089,7 +3123,14 @@ set_property (GObject *object, guint prop_id, break; case NM_DEVICE_INTERFACE_PROP_IFACE: g_free (priv->iface); + priv->ifindex = 0; priv->iface = g_value_dup_string (value); + if (priv->iface) { + priv->ifindex = nm_netlink_iface_to_index (priv->iface); + if (priv->ifindex < 0) { + nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", priv->iface); + } + } break; case NM_DEVICE_INTERFACE_PROP_DRIVER: priv->driver = g_strdup (g_value_get_string (value)); @@ -3137,6 +3178,9 @@ get_property (GObject *object, guint prop_id, case NM_DEVICE_INTERFACE_PROP_IFACE: g_value_set_string (value, priv->iface); break; + case NM_DEVICE_INTERFACE_PROP_IFINDEX: + g_value_set_int (value, priv->ifindex); + break; case NM_DEVICE_INTERFACE_PROP_DRIVER: g_value_set_string (value, priv->driver); break; @@ -3235,6 +3279,10 @@ nm_device_class_init (NMDeviceClass *klass) NM_DEVICE_INTERFACE_PROP_IFACE, NM_DEVICE_INTERFACE_IFACE); + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IFINDEX, + NM_DEVICE_INTERFACE_IFINDEX); + g_object_class_override_property (object_class, NM_DEVICE_INTERFACE_PROP_DRIVER, NM_DEVICE_INTERFACE_DRIVER); diff --git a/src/nm-device.h b/src/nm-device.h index 5fcde5c338..ffeca42142 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -128,7 +128,9 @@ void nm_device_set_path (NMDevice *dev, const char *path); const char * nm_device_get_udi (NMDevice *dev); const char * nm_device_get_iface (NMDevice *dev); +int nm_device_get_ifindex (NMDevice *dev); const char * nm_device_get_ip_iface (NMDevice *dev); +int nm_device_get_ip_ifindex(NMDevice *dev); const char * nm_device_get_driver (NMDevice *dev); const char * nm_device_get_type_desc (NMDevice *dev); diff --git a/src/nm-manager.c b/src/nm-manager.c index a24606ad99..e42452c9bf 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1523,7 +1523,8 @@ add_device (NMManager *self, NMDevice *device) driver = nm_device_get_driver (device); if (!driver) driver = "unknown"; - nm_log_info (LOGD_HW, "(%s): new %s device (driver: '%s')", iface, type_desc, driver); + nm_log_info (LOGD_HW, "(%s): new %s device (driver: '%s' ifindex: %d)", + iface, type_desc, driver, nm_device_get_ifindex (device)); path = g_strdup_printf ("/org/freedesktop/NetworkManager/Devices/%d", devcount++); nm_device_set_path (device, path); @@ -1794,20 +1795,11 @@ find_device_by_ifindex (NMManager *self, guint32 ifindex) GSList *iter; for (iter = priv->devices; iter; iter = g_slist_next (iter)) { - NMDevice *device = NM_DEVICE (iter->data); - gint candidate_idx = 0; + NMDevice *candidate = NM_DEVICE (iter->data); - if (NM_IS_DEVICE_ETHERNET (device)) - candidate_idx = nm_device_ethernet_get_ifindex (NM_DEVICE_ETHERNET (device)); - else if (NM_IS_DEVICE_WIFI (device)) - candidate_idx = nm_device_wifi_get_ifindex (NM_DEVICE_WIFI (device)); - else if (NM_IS_DEVICE_OLPC_MESH (device)) - candidate_idx = nm_device_olpc_mesh_get_ifindex (NM_DEVICE_OLPC_MESH (device)); - - if (candidate_idx == ifindex) - return device; + if (ifindex == nm_device_get_ifindex (candidate)) + return candidate; } - return NULL; } diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 6fb13ef3d1..10bf239d5d 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -743,7 +743,8 @@ nm_netlink_index_to_rtnl_link (int idx) NMNetlinkMonitorPrivate *priv; struct rtnl_link *ret = NULL; - g_return_val_if_fail (idx >= 0, NULL); + if (idx <= 0) + return NULL; self = nm_netlink_monitor_get (); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); diff --git a/src/nm-system.c b/src/nm-system.c index 0d38ea6cf4..2e03c41a8e 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -986,7 +986,7 @@ foreach_route (void (*callback)(struct nl_object *, gpointer), nlh = nm_netlink_get_default_handle (); route_cache = rtnl_route_alloc_cache (nlh); - nl_cache_mngt_provide (route_cache); + g_assert (route_cache); nl_cache_foreach (route_cache, callback, user_data); nl_cache_free (route_cache); } diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c index 0ced962c27..3481d88b40 100644 --- a/src/nm-udev-manager.c +++ b/src/nm-udev-manager.c @@ -384,11 +384,11 @@ device_creator (NMUdevManager *manager, } if (is_olpc_mesh (udev_device)) /* must be before is_wireless */ - device = (GObject *) nm_device_olpc_mesh_new (path, ifname, driver, ifindex); + device = (GObject *) nm_device_olpc_mesh_new (path, ifname, driver); else if (is_wireless (udev_device)) - device = (GObject *) nm_device_wifi_new (path, ifname, driver, ifindex); + device = (GObject *) nm_device_wifi_new (path, ifname, driver); else - device = (GObject *) nm_device_ethernet_new (path, ifname, driver, ifindex); + device = (GObject *) nm_device_ethernet_new (path, ifname, driver); out: if (grandparent) From 5750529ff58147c6acccaa759ccdf19130273fe0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Apr 2010 15:20:16 -0700 Subject: [PATCH 271/392] ip6: make sure IPv6 addrconf is cleaned up correctly --- src/nm-device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nm-device.c b/src/nm-device.c index b285baaf86..c76c9f50ad 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -730,6 +730,7 @@ addrconf6_cleanup (NMDevice *self) priv->ip6_config_changed_sigid = 0; } + nm_ip6_manager_cancel_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); g_object_unref (priv->ip6_manager); priv->ip6_manager = NULL; } From 2ce8028e10ab2780dcd7970674ba18dc0772595a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Apr 2010 15:43:34 -0700 Subject: [PATCH 272/392] ip6: fix IPv6 addrconf detection and completion Poll the device's IPv6 flags so we're notified when the RA has been parsed and what the flags are. Only when that's complete and the device's target state has been reached (or Managed mode was indicated by the RA) should we continue with IP configuration. --- src/ip6-manager/nm-ip6-manager.c | 79 ++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index ddecf07cdc..7767870186 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -55,8 +55,6 @@ typedef enum { NM_IP6_DEVICE_GOT_LINK_LOCAL, NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT, NM_IP6_DEVICE_GOT_ADDRESS, - NM_IP6_DEVICE_WAITING_FOR_DHCP, - NM_IP6_DEVICE_GOT_DHCP, NM_IP6_DEVICE_TIMED_OUT } NMIP6DeviceState; @@ -84,6 +82,8 @@ typedef struct { GArray *rdnss_servers; guint rdnss_timeout_id; + guint ip6flags_poll_id; + guint32 ra_flags; } NMIP6Device; @@ -201,6 +201,8 @@ nm_ip6_device_destroy (NMIP6Device *device) g_array_free (device->rdnss_servers, TRUE); if (device->rdnss_timeout_id) g_source_remove (device->rdnss_timeout_id); + if (device->ip6flags_poll_id) + g_source_remove (device->ip6flags_poll_id); g_free (device->accept_ra_path); g_slice_free (NMIP6Device, device); @@ -235,6 +237,7 @@ nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) typedef struct { NMIP6Device *device; guint dhcp_opts; + gboolean success; } CallbackInfo; static gboolean @@ -249,16 +252,23 @@ finish_addrconf (gpointer user_data) device->addrconf_complete = TRUE; ifindex = device->ifindex; - if (device->state >= device->target_state) { + /* We're done, stop polling IPv6 flags */ + if (device->ip6flags_poll_id) { + g_source_remove (device->ip6flags_poll_id); + device->ip6flags_poll_id = 0; + } + + /* And tell listeners that addrconf is complete */ + if (info->success) { g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - ifindex, info->dhcp_opts, TRUE); + ifindex, info->dhcp_opts, TRUE); } else { nm_log_info (LOGD_IP6, "(%s): IP6 addrconf timed out or failed.", - device->iface); + device->iface); nm_ip6_manager_cancel_addrconf (manager, ifindex); g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, - ifindex, info->dhcp_opts, FALSE); + ifindex, info->dhcp_opts, FALSE); } return FALSE; @@ -328,14 +338,14 @@ set_rdnss_timeout (NMIP6Device *device) } static CallbackInfo * -callback_info_new (NMIP6Device *device, guint dhcp_opts) +callback_info_new (NMIP6Device *device, guint dhcp_opts, gboolean success) { CallbackInfo *info; info = g_malloc0 (sizeof (CallbackInfo)); info->device = device; info->dhcp_opts = dhcp_opts; - + info->success = success; return info; } @@ -350,9 +360,10 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) CallbackInfo *info; guint dhcp_opts = IP6_DHCP_OPT_NONE; - for (rtnladdr = (struct rtnl_addr *)nl_cache_get_first (priv->addr_cache); + /* Look for any IPv6 addresses the kernel may have set for the device */ + for (rtnladdr = (struct rtnl_addr *) nl_cache_get_first (priv->addr_cache); rtnladdr; - rtnladdr = (struct rtnl_addr *)nl_cache_get_next ((struct nl_object *)rtnladdr)) { + rtnladdr = (struct rtnl_addr *) nl_cache_get_next ((struct nl_object *) rtnladdr)) { if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) continue; @@ -370,27 +381,35 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) } } - if ((device->ra_flags & IF_RA_RCVD) && device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) - device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; + /* We only care about router advertisements if we want for a real IPv6 address */ + if (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) { + if ( (device->ra_flags & IF_RA_RCVD) + && (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT)) + device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; - if (device->ra_flags & IF_RA_MANAGED) { - dhcp_opts = IP6_DHCP_OPT_MANAGED; - nm_log_dbg (LOGD_IP6, "router advertisement deferred to DHCPv6"); - } else if (device->ra_flags & IF_RA_OTHERCONF) { - dhcp_opts = IP6_DHCP_OPT_OTHERCONF; - nm_log_dbg (LOGD_IP6, "router advertisement requests parallel DHCPv6"); + if (device->ra_flags & IF_RA_MANAGED) { + dhcp_opts = IP6_DHCP_OPT_MANAGED; + nm_log_dbg (LOGD_IP6, "router advertisement deferred to DHCPv6"); + } else if (device->ra_flags & IF_RA_OTHERCONF) { + dhcp_opts = IP6_DHCP_OPT_OTHERCONF; + nm_log_dbg (LOGD_IP6, "router advertisement requests parallel DHCPv6"); + } } if (!device->addrconf_complete) { - if (device->state >= device->target_state || - device->state == NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) { + /* Managed mode (ie DHCP only) short-circuits automatic addrconf, so + * we don't bother waiting for the device's target state to be reached + * when the RA requests managed mode. + */ + if ( (device->state >= device->target_state) + || (dhcp_opts == IP6_DHCP_OPT_MANAGED)) { /* device->finish_addrconf_id may currently be a timeout * rather than an idle, so we remove the existing source. */ if (device->finish_addrconf_id) g_source_remove (device->finish_addrconf_id); - info = callback_info_new (device, dhcp_opts); + info = callback_info_new (device, dhcp_opts, TRUE); device->finish_addrconf_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, finish_addrconf, info, @@ -398,7 +417,7 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) } } else if (config_changed) { if (!device->config_changed_id) { - info = callback_info_new (device, dhcp_opts); + info = callback_info_new (device, dhcp_opts, TRUE); device->config_changed_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, emit_config_changed, info, @@ -636,6 +655,7 @@ process_newlink (NMIP6Manager *manager, struct nl_msg *msg) return NULL; device->ra_flags = nla_get_u32 (pi[IFLA_INET6_FLAGS]); + nm_log_dbg (LOGD_IP6, "(%s): got IPv6 flags 0x%X", device->iface, device->ra_flags); return device; } @@ -783,6 +803,13 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, device->target_state >= NM_IP6_DEVICE_GOT_ADDRESS ? "1\n" : "0\n"); } +static gboolean +poll_ip6_flags (gpointer user_data) +{ + nm_netlink_monitor_request_ip6_info (NM_NETLINK_MONITOR (user_data), NULL); + return TRUE; +} + void nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex) { @@ -804,18 +831,22 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex) device->ra_flags = 0; /* Set up a timeout on the transaction to kill it after the timeout */ - info = callback_info_new (device, 0); + info = callback_info_new (device, 0, FALSE); device->finish_addrconf_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, NM_IP6_TIMEOUT, finish_addrconf, info, (GDestroyNotify) g_free); + device->ip6flags_poll_id = g_timeout_add_seconds (1, poll_ip6_flags, priv->monitor); + + /* Kick off the initial IPv6 flags request */ + nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); + /* Sync flags, etc, from netlink; this will also notice if the * device is already fully configured and schedule the * ADDRCONF_COMPLETE signal in that case. */ - nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); nm_ip6_device_sync_from_netlink (device, FALSE); } From 6d6f7d3d909a69999c33e9caa3abac3eca725498 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Apr 2010 12:27:31 -0700 Subject: [PATCH 273/392] core: ensure errors are dbus-glib accessible (rh #581794) Errors that can possibly be returned from D-Bus method calls need to be registered with dbus-glib. --- libnm-glib/libnm-glib.ver | 1 + src/system-settings/nm-sysconfig-settings.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 1caa2d42ba..dfe4fe5023 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -129,6 +129,7 @@ global: nm_settings_connection_interface_get_type; nm_settings_connection_interface_update; nm_settings_interface_add_connection; + nm_settings_interface_error_get_type; nm_settings_interface_error_quark; nm_settings_interface_get_connection_by_path; nm_settings_interface_get_type; diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index b120953a3e..0054a9990f 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -1475,7 +1475,12 @@ nm_sysconfig_settings_class_init (NMSysconfigSettingsClass *class) NM_DBUS_IFACE_SETTINGS_SYSTEM, NM_TYPE_SYSCONFIG_SETTINGS_ERROR); + dbus_g_error_domain_register (NM_SETTINGS_INTERFACE_ERROR, + NM_DBUS_IFACE_SETTINGS, + NM_TYPE_SETTINGS_INTERFACE_ERROR); + /* And register all the settings errors with D-Bus */ + dbus_g_error_domain_register (NM_CONNECTION_ERROR, NULL, NM_TYPE_CONNECTION_ERROR); dbus_g_error_domain_register (NM_SETTING_802_1X_ERROR, NULL, NM_TYPE_SETTING_802_1X_ERROR); dbus_g_error_domain_register (NM_SETTING_BLUETOOTH_ERROR, NULL, NM_TYPE_SETTING_BLUETOOTH_ERROR); dbus_g_error_domain_register (NM_SETTING_CDMA_ERROR, NULL, NM_TYPE_SETTING_CDMA_ERROR); From eeca251a27530f7e9cae020df57a47ef10c8e673 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Apr 2010 12:39:48 -0700 Subject: [PATCH 274/392] core: return valid error to dbus-glib (rh #581794) --- libnm-glib/nm-exported-connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnm-glib/nm-exported-connection.c b/libnm-glib/nm-exported-connection.c index 8ca64e797c..3a8e51ce79 100644 --- a/libnm-glib/nm-exported-connection.c +++ b/libnm-glib/nm-exported-connection.c @@ -228,7 +228,9 @@ impl_exported_connection_get_secrets (NMExportedConnection *self, if (NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_secrets) NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_secrets (self, setting_name, hints, request_new, context); else { - error = g_error_new (0, 0, "%s: %s:%d get_secrets() unimplemented", __func__, __FILE__, __LINE__); + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d get_secrets() unimplemented", __func__, __FILE__, __LINE__); dbus_g_method_return_error (context, error); g_error_free (error); } From 5a9b7b42d176c2340e146a3e76adfb7d142e02c4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Apr 2010 14:19:50 -0700 Subject: [PATCH 275/392] ifcfg-rh: return valid errors to dbus-glib (rh #581794) --- system-settings/plugins/ifcfg-rh/plugin.c | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index a272728621..47ce0075f8 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -38,6 +38,7 @@ #include #include +#include #include "common.h" #include "nm-dbus-glib-types.h" @@ -535,31 +536,46 @@ impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, const char *path; if (!g_path_is_absolute (in_ifcfg)) { - g_set_error (error, 0, 0, "ifcfg path '%s' is not absolute", in_ifcfg); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "ifcfg path '%s' is not absolute", in_ifcfg); return FALSE; } connection = g_hash_table_lookup (priv->connections, in_ifcfg); if (!connection) { - g_set_error (error, 0, 0, "ifcfg file '%s' unknown", in_ifcfg); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "ifcfg file '%s' unknown", in_ifcfg); return FALSE; } s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); if (!s_con) { - g_set_error_literal (error, 0, 0, "unable to retrieve the connection setting"); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to retrieve the connection setting"); return FALSE; } uuid = nm_setting_connection_get_uuid (s_con); if (!uuid) { - g_set_error_literal (error, 0, 0, "unable to get the UUID"); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to get the UUID"); return FALSE; } path = nm_connection_get_path (NM_CONNECTION (connection)); if (!path) { - g_set_error_literal (error, 0, 0, "unable to get the connection D-Bus path"); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to get the connection D-Bus path"); return FALSE; } From c309a2bc8a27a63b49552c3ecec20bdd6463b555 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 22 Apr 2010 17:14:33 -0700 Subject: [PATCH 276/392] wifi: fix B/G band adhoc wifi auto channel selection --- src/nm-wifi-ap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index 80b69a3980..c7b5d8a51a 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -1469,7 +1469,7 @@ channel_to_freq (guint32 channel, const char *band) } else if (!strcmp (band, "bg")) { while (bg_table[i].chan && (bg_table[i].chan != channel)) i++; - return a_table[i].freq; + return bg_table[i].freq; } return 0; From a4cc8873c9981176575c0939c63473b4206db72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 23 Apr 2010 12:13:04 +0200 Subject: [PATCH 277/392] system-settings: fix loading connection by plugins The error case was as follows. When using 'ifupdown,keyfile' plugins and 'eth0' present in /etc/network/interfaces on a Debian-based system, 'ifupdown' plugin, in unmanaged mode, load_connections() prematurely and thus effectively blocked reading connections from 'keyfile' plugin. Patch by Dan and tested by me. --- src/system-settings/nm-sysconfig-settings.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 0054a9990f..4bcfb04bc7 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -357,8 +357,6 @@ add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, G_CALLBACK (plugin_connection_added), self); - g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, - G_CALLBACK (unmanaged_specs_changed), self); g_signal_connect (plugin, "notify::hostname", G_CALLBACK (hostname_changed), self); nm_system_config_interface_init (plugin, NULL); @@ -368,6 +366,9 @@ add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) NM_SYSTEM_CONFIG_INTERFACE_INFO, &pinfo, NULL); + g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, + G_CALLBACK (unmanaged_specs_changed), self); + nm_log_info (LOGD_SYS_SET, "Loaded plugin %s: %s", pname, pinfo); g_free (pname); g_free (pinfo); @@ -1328,6 +1329,7 @@ nm_sysconfig_settings_new (const char *config_file, g_object_unref (self); return NULL; } + unmanaged_specs_changed (NULL, self); } return self; From 8315a03632f8b3eeb85ce63518fa3aa2e6917b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 23 Apr 2010 13:12:41 +0200 Subject: [PATCH 278/392] core: return valid error to dbus-glib (rh #581794) --- src/nm-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index a24606ad99..6eaf6a51ef 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2099,7 +2099,9 @@ system_get_secrets_idle_cb (gpointer user_data) connection = nm_settings_interface_get_connection_by_path (NM_SETTINGS_INTERFACE (priv->sys_settings), info->connection_path); if (!connection) { - error = g_error_new_literal (0, 0, "unknown connection (not exported by system settings)"); + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "unknown connection (not exported by system settings)"); nm_secrets_provider_interface_get_secrets_result (info->provider, info->setting_name, info->caller, From b0548425d7920e1c3d9cd65754b663380e9051cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 23 Apr 2010 15:25:32 +0200 Subject: [PATCH 279/392] logging: log NetworkManager version; use distribution version when configured --- configure.ac | 8 ++++++++ src/main.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index aedc8ec903..adfe67fe9b 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,14 @@ if test x"$with_distro" = xpardus; then AC_DEFINE(TARGET_PARDUS, 1, [Define if you have Pardus]) fi +dnl +dnl Distribution version string +dnl +AC_ARG_WITH(dist-version, AS_HELP_STRING([--with-dist-version=], [Define the NM's distribution version string]), ac_distver=$withval, ac_distver="") +if ! test x"$ac_distver" = x""; then + AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string]) +fi + AC_MSG_CHECKING([Linux Wireless Extensions >= 18]) AC_TRY_COMPILE([#ifndef __user #define __user diff --git a/src/main.c b/src/main.c index cce2939e39..6bb1121716 100644 --- a/src/main.c +++ b/src/main.c @@ -616,7 +616,10 @@ main (int argc, char *argv[]) nm_logging_start (become_daemon); - nm_log_info (LOGD_CORE, "starting..."); +#if !defined(NM_DIST_VERSION) +# define NM_DIST_VERSION VERSION +#endif + nm_log_info (LOGD_CORE, "NetworkManager-" NM_DIST_VERSION " is starting..."); success = FALSE; main_loop = g_main_loop_new (NULL, FALSE); From e46577ffe5b805e857d3de85530a4c6b8a10e83e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 12:12:47 -0700 Subject: [PATCH 280/392] core: rearrange version macros a bit --- src/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 6bb1121716..1d0ab5328c 100644 --- a/src/main.c +++ b/src/main.c @@ -53,6 +53,10 @@ #include "nm-vpn-manager.h" #include "nm-logging.h" +#if !defined(NM_DIST_VERSION) +# define NM_DIST_VERSION VERSION +#endif + #define NM_DEFAULT_PID_FILE LOCALSTATEDIR"/run/NetworkManager.pid" #define NM_DEFAULT_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/NetworkManager.conf" #define NM_OLD_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/nm-system-settings.conf" @@ -616,10 +620,7 @@ main (int argc, char *argv[]) nm_logging_start (become_daemon); -#if !defined(NM_DIST_VERSION) -# define NM_DIST_VERSION VERSION -#endif - nm_log_info (LOGD_CORE, "NetworkManager-" NM_DIST_VERSION " is starting..."); + nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting..."); success = FALSE; main_loop = g_main_loop_new (NULL, FALSE); From 24bd77dc9272bb1f3090d3dc4968a042765d5b76 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 12:55:05 -0700 Subject: [PATCH 281/392] ifcfg-rh: missing IP4 setting means DHCP --- system-settings/plugins/ifcfg-rh/writer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 8085584cca..c4d829fa25 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -914,7 +914,11 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) if (s_ip4) method = nm_setting_ip4_config_get_method (s_ip4); - if (!s_ip4 || (method && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED))) { + /* Missing IP4 setting is assumed to be DHCP */ + if (!method) + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) { int result; /* IPv4 disabled, clear IPv4 related parameters */ From 4a2bb8b6477e6ff7c693a352592cc7f004c37345 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 12:56:33 -0700 Subject: [PATCH 282/392] core: don't even bother running IPv4 or IPv6 when they are disabled --- src/nm-device.c | 14 +++++++++++++- src/nm-device.h | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index c76c9f50ad..ba88c6b0e3 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1338,6 +1338,7 @@ dhcp_timeout (NMDHCPClient *client, gpointer user_data) static NMActStageReturn real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) { + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMConnection *connection; NMSettingConnection *s_con; NMSettingIP4Config *s_ip4; @@ -1367,7 +1368,6 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) method = nm_setting_ip4_config_get_method (s_ip4); if (!s_ip4 || !method || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); guint8 *anycast = NULL; /* Begin a DHCP transaction on the interface */ @@ -1423,6 +1423,10 @@ real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) *reason = NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED; ret = NM_ACT_STAGE_RETURN_FAILURE; } + } else if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) { + /* Nothing to do... */ + priv->ip4_ready = TRUE; + ret = NM_ACT_STAGE_RETURN_STOP; } return ret; @@ -1519,6 +1523,10 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) ret = NM_ACT_STAGE_RETURN_POSTPONE; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) ret = dhcp6_start (self, connection, IP6_DHCP_OPT_MANAGED, reason); + else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + priv->ip6_ready = TRUE; + ret = NM_ACT_STAGE_RETURN_STOP; + } return ret; } @@ -1551,6 +1559,8 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data) else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; + } else if (ret == NM_ACT_STAGE_RETURN_STOP) { + /* Nothing to do */ } else g_assert (ret == NM_ACT_STAGE_RETURN_POSTPONE); @@ -1560,6 +1570,8 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data) else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; + } else if (ret == NM_ACT_STAGE_RETURN_STOP) { + /* Nothing to do */ } else g_assert (ret == NM_ACT_STAGE_RETURN_POSTPONE); diff --git a/src/nm-device.h b/src/nm-device.h index ffeca42142..202f392413 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -38,7 +38,8 @@ typedef enum NMActStageReturn { NM_ACT_STAGE_RETURN_FAILURE = 0, NM_ACT_STAGE_RETURN_SUCCESS, - NM_ACT_STAGE_RETURN_POSTPONE + NM_ACT_STAGE_RETURN_POSTPONE, + NM_ACT_STAGE_RETURN_STOP /* This activation chain is done */ } NMActStageReturn; From f20f7294f6f46847bc4c6bb8edeac6fdc810d113 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 14:20:10 -0700 Subject: [PATCH 283/392] ifcfg-rh: fix handling of WEP passphrases (rh #581718) ifcfg-rh wasn't updated for WEP passphrases after that capability got added. Can't use KEY for passphrases since there's no way to distinguish some WEP passphrases from some WEP Hex and ASCII keys, so we use KEY_PASSPHRASE instead. --- system-settings/plugins/ifcfg-rh/reader.c | 90 ++++-- .../tests/network-scripts/Makefile.am | 4 +- .../ifcfg-test-wifi-wep-passphrase | 14 + .../keys-test-wifi-wep-passphrase | 1 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 295 ++++++++++++++++++ system-settings/plugins/ifcfg-rh/writer.c | 42 ++- 6 files changed, 403 insertions(+), 43 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 32575f3953..4149e6cd76 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1578,6 +1578,7 @@ static gboolean add_one_wep_key (shvarFile *ifcfg, const char *shvar_key, guint8 key_idx, + gboolean passphrase, NMSettingWirelessSecurity *s_wsec, GError **error) { @@ -1597,42 +1598,51 @@ add_one_wep_key (shvarFile *ifcfg, } /* Validate keys */ - if (strlen (value) == 10 || strlen (value) == 26) { - /* Hexadecimal WEP key */ - char *p = value; - - while (*p) { - if (!g_ascii_isxdigit (*p)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Invalid hexadecimal WEP key."); - goto out; - } - p++; + if (passphrase) { + if (strlen (value) && strlen (value) < 64) { + key = g_strdup (value); + g_object_set (G_OBJECT (s_wsec), + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, + NM_WEP_KEY_TYPE_PASSPHRASE, + NULL); } - key = g_strdup (value); - } else if ( strncmp (value, "s:", 2) - && (strlen (value) == 7 || strlen (value) == 15)) { - /* ASCII passphrase */ - char *p = value + 2; - - while (*p) { - if (!isascii ((int) (*p))) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Invalid ASCII WEP passphrase."); - goto out; - } - p++; - } - - key = utils_bin2hexstr (value, strlen (value), strlen (value) * 2); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, "Invalid WEP key length."); + if (strlen (value) == 10 || strlen (value) == 26) { + /* Hexadecimal WEP key */ + char *p = value; + + while (*p) { + if (!g_ascii_isxdigit (*p)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid hexadecimal WEP key."); + goto out; + } + p++; + } + key = g_strdup (value); + } else if ( strncmp (value, "s:", 2) + && (strlen (value) == 7 || strlen (value) == 15)) { + /* ASCII passphrase */ + char *p = value + 2; + + while (*p) { + if (!isascii ((int) (*p))) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid ASCII WEP passphrase."); + goto out; + } + p++; + } + + key = utils_bin2hexstr (value, strlen (value), strlen (value) * 2); + } } if (key) { nm_setting_wireless_security_set_wep_key (s_wsec, key_idx, key); success = TRUE; - } + } else + g_set_error (error, ifcfg_plugin_error_quark (), 0, "Invalid WEP key length."); out: g_free (value); @@ -1645,15 +1655,26 @@ read_wep_keys (shvarFile *ifcfg, NMSettingWirelessSecurity *s_wsec, GError **error) { - if (!add_one_wep_key (ifcfg, "KEY1", 0, s_wsec, error)) + /* Try hex/ascii keys first */ + if (!add_one_wep_key (ifcfg, "KEY1", 0, FALSE, s_wsec, error)) return FALSE; - if (!add_one_wep_key (ifcfg, "KEY2", 1, s_wsec, error)) + if (!add_one_wep_key (ifcfg, "KEY2", 1, FALSE, s_wsec, error)) return FALSE; - if (!add_one_wep_key (ifcfg, "KEY3", 2, s_wsec, error)) + if (!add_one_wep_key (ifcfg, "KEY3", 2, FALSE, s_wsec, error)) return FALSE; - if (!add_one_wep_key (ifcfg, "KEY4", 3, s_wsec, error)) + if (!add_one_wep_key (ifcfg, "KEY4", 3, FALSE, s_wsec, error)) return FALSE; - if (!add_one_wep_key (ifcfg, "KEY", def_idx, s_wsec, error)) + if (!add_one_wep_key (ifcfg, "KEY", def_idx, FALSE, s_wsec, error)) + return FALSE; + + /* And then passphrases */ + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE1", 0, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE2", 1, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE3", 2, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE4", 3, TRUE, s_wsec, error)) return FALSE; return TRUE; @@ -1701,6 +1722,7 @@ make_wep_setting (shvarFile *ifcfg, goto error; } svCloseFile (keys_ifcfg); + g_assert (error == NULL || *error == NULL); } /* If there's a default key, ensure that key exists */ 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 f6879633df..66435acbcb 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -58,7 +58,9 @@ EXTRA_DIST = \ ifcfg-test-wired-static-no-prefix-8 \ ifcfg-test-wired-static-no-prefix-16 \ ifcfg-test-wired-static-no-prefix-24 \ - ifcfg-test-wired-ipv6-only + ifcfg-test-wired-ipv6-only \ + ifcfg-test-wifi-wep-passphrase \ + keys-test-wifi-wep-passphrase check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase new file mode 100644 index 0000000000..250efa134c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase new file mode 100644 index 0000000000..d45c0ea8e8 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase @@ -0,0 +1 @@ +KEY_PASSPHRASE1="foobar222blahblah" diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index cfe93d6ec0..c96d13adb7 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -3004,6 +3004,7 @@ test_read_wifi_wep (void) const char *expected_mode = "infrastructure"; const guint32 expected_channel = 1; const char *expected_wep_key0 = "0123456789abcdef0123456789"; + NMWepKeyType key_type; connection = connection_from_file (TEST_IFCFG_WIFI_WEP, NULL, @@ -3175,6 +3176,13 @@ test_read_wifi_wep (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP, + key_type); + /* WEP key index 0 */ tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); ASSERT (tmp != NULL, @@ -3508,6 +3516,142 @@ test_read_wifi_wep_adhoc (void) g_object_unref (connection); } +#define TEST_IFCFG_WIFI_WEP_PASSPHRASE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-passphrase" + +static void +test_read_wifi_wep_passphrase (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wsec; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_wep_key0 = "foobar222blahblah"; + NMWepKeyType key_type; + + connection = connection_from_file (TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-passphrase-read", "failed to read %s: %s", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-passphrase-verify", "failed to verify %s: %s", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-passphrase-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_PASSPHRASE, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + #define TEST_IFCFG_WIFI_LEAP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-leap" static void @@ -6419,6 +6563,155 @@ test_write_wifi_wep_adhoc (void) g_object_unref (reread); } +static void +test_write_wifi_wep_passphrase (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-passphrase-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP Passphrase", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 0, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, NM_WEP_KEY_TYPE_PASSPHRASE, + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "asdfdjaslfjasd;flasjdfl;aksdf"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-passphrase-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-passphrase-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-passphrase-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-passphrase-write-reread", "expected keyfile for '%s'", testfile); + + ASSERT (stat (keyfile, &statbuf) == 0, + "wifi-wep-passphrase-write-reread", "couldn't stat() '%s'", keyfile); + ASSERT (S_ISREG (statbuf.st_mode), + "wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't a normal file", keyfile); + ASSERT ((statbuf.st_mode & 0077) == 0, + "wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); + + unlink (keyfile); + + ASSERT (reread != NULL, + "wifi-wep-passphrase-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-passphrase-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-passphrase-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + static void test_write_wifi_leap (void) { @@ -8108,6 +8401,7 @@ int main (int argc, char **argv) test_read_wifi_open_ssid_quoted (); test_read_wifi_wep (); test_read_wifi_wep_adhoc (); + test_read_wifi_wep_passphrase (); test_read_wifi_leap (); test_read_wifi_wpa_psk (); test_read_wifi_wpa_psk_unquoted (); @@ -8128,6 +8422,7 @@ int main (int argc, char **argv) test_write_wifi_open_hex_ssid (); test_write_wifi_wep (); test_write_wifi_wep_adhoc (); + test_write_wifi_wep_passphrase (); test_write_wifi_leap (); test_write_wifi_wpa_psk ("Test Write Wifi WPA PSK", "wifi-wpa-psk-write", diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index cc24a96f58..d8df2d3fe9 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -579,20 +579,46 @@ write_wireless_security_setting (NMConnection *connection, } } + /* WEP keys */ + + /* Clear existing keys */ + set_secret (ifcfg, "KEY", NULL, FALSE); /* Clear any default key */ + for (i = 0; i < 4; i++) { + tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1); + set_secret (ifcfg, tmp, NULL, FALSE); + g_free (tmp); + + tmp = g_strdup_printf ("KEY%d", i + 1); + set_secret (ifcfg, tmp, NULL, FALSE); + g_free (tmp); + } + + /* And write the new ones out */ if (wep) { /* Default WEP TX key index */ tmp = g_strdup_printf ("%d", nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) + 1); svSetValue (ifcfg, "DEFAULTKEY", tmp, FALSE); g_free (tmp); - } - /* WEP keys */ - set_secret (ifcfg, "KEY", NULL, FALSE); /* Clear any default key */ - for (i = 0; i < 4; i++) { - key = nm_setting_wireless_security_get_wep_key (s_wsec, i); - tmp = g_strdup_printf ("KEY%d", i + 1); - set_secret (ifcfg, tmp, (wep && key) ? key : NULL, FALSE); - g_free (tmp); + for (i = 0; i < 4; i++) { + NMWepKeyType key_type; + + key = nm_setting_wireless_security_get_wep_key (s_wsec, i); + if (key) { + /* Passphrase needs a different ifcfg key since with WEP, there + * are some passphrases that are indistinguishable from WEP hex + * keys. + */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + if (key_type == NM_WEP_KEY_TYPE_PASSPHRASE) + tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1); + else + tmp = g_strdup_printf ("KEY%d", i + 1); + + set_secret (ifcfg, tmp, key, FALSE); + g_free (tmp); + } + } } /* WPA protos */ From eaa750dda9482bd6f6baa241ed42f95b7be7e944 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 15:30:46 -0700 Subject: [PATCH 284/392] dhcp: add missing DHCPv6 client states --- src/dhcp-manager/nm-dhcp-client.c | 3 +++ src/dhcp-manager/nm-dhcp-client.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 888e7c5402..9f9719473a 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -390,11 +390,14 @@ static DhcState state_table[] = { { DHC_REBIND4, "rebind" }, { DHC_REBIND6, "rebind6" }, { DHC_STOP, "stop" }, + { DHC_STOP6, "stop6" }, { DHC_MEDIUM, "medium" }, { DHC_TIMEOUT, "timeout" }, { DHC_FAIL, "fail" }, { DHC_EXPIRE, "expire" }, + { DHC_EXPIRE6, "expire6" }, { DHC_RELEASE, "release" }, + { DHC_RELEASE6,"release6" }, { DHC_START, "start" }, { DHC_ABEND, "abend" }, { DHC_END, "end" }, diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 2ebb5a745c..146cf57b3f 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -53,11 +53,14 @@ typedef enum { DHC_REBIND6, /* IPv6 new/different lease */ DHC_DEPREF6, /* IPv6 lease depreferred */ DHC_STOP, /* remove old lease */ + DHC_STOP6, /* remove old lease */ DHC_MEDIUM, /* media selection begun */ DHC_TIMEOUT, /* timed out contacting DHCP server */ DHC_FAIL, /* all attempts to contact server timed out, sleeping */ DHC_EXPIRE, /* lease has expired, renewing */ + DHC_EXPIRE6, /* lease has expired, renewing */ DHC_RELEASE, /* releasing lease */ + DHC_RELEASE6, /* releasing lease */ DHC_START, /* sent when dhclient started OK */ DHC_ABEND, /* dhclient exited abnormally */ DHC_END, /* dhclient exited normally */ From b172519045e5ea4825f85fca81de8395e92600c1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 15:52:09 -0700 Subject: [PATCH 285/392] core: fail connections if IP configuration expires Need to mark these connections invalid too, otherwise they'll just be retried over and over and over. Ran into a problem with DHCPv6 where lease expiration (cached lease really) was *negative*, which caused the lease to expire immediately after being bound. Previously the policy wouldn't mark connections like this as invalid because they hadn't failed during activation. NetworkManager: (eth0): carrier now ON (device state 2) NetworkManager: (eth0): device state change: 2 -> 3 (reason 40) NetworkManager: Activation (eth0) starting connection 'dhcp6 test' NetworkManager: (eth0): device state change: 3 -> 4 (reason 0) NetworkManager: Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled... NetworkManager: Activation (eth0) Stage 1 of 5 (Device Prepare) started... NetworkManager: Activation (eth0) Stage 2 of 5 (Device Configure) scheduled... NetworkManager: Activation (eth0) Stage 1 of 5 (Device Prepare) complete. NetworkManager: Activation (eth0) Stage 2 of 5 (Device Configure) starting... NetworkManager: (eth0): device state change: 4 -> 5 (reason 0) NetworkManager: Activation (eth0) Stage 2 of 5 (Device Configure) successful. NetworkManager: Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled. NetworkManager: Activation (eth0) Stage 2 of 5 (Device Configure) complete. NetworkManager: Activation (eth0) Stage 3 of 5 (IP Configure Start) started... NetworkManager: (eth0): device state change: 5 -> 7 (reason 0) NetworkManager: Activation (eth0) Beginning DHCPv6 transaction (timeout in 45 seconds) NetworkManager: dhclient started with pid 6639 NetworkManager: Activation (eth0) Stage 3 of 5 (IP Configure Start) complete. Internet Systems Consortium DHCP Client 4.1.1 Copyright 2004-2010 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ NetworkManager: (eth0): DHCPv6 state changed nbi -> preinit6 Bound to *:546 Listening on Socket/eth0 Sending on Socket/eth0 PRC: Confirming active lease (INIT-REBOOT). XMT: Forming Confirm, 0 ms elapsed. XMT: X-- IA_NA 5a:47:1f:71 XMT: | X-- Confirm Address 3ffe:501:ffff::4 XMT: V IA_NA appended. XMT: Confirm on eth0, interval 1090ms. send_packet6: Cannot assign requested address dhc6: sendpacket6() sent -1 of 80 bytes XMT: Forming Confirm, 1090 ms elapsed. XMT: X-- IA_NA 5a:47:1f:71 XMT: | X-- Confirm Address 3ffe:501:ffff::4 XMT: V IA_NA appended. XMT: Confirm on eth0, interval 2120ms. send_packet6: Cannot assign requested address dhc6: sendpacket6() sent -1 of 80 bytes XMT: Forming Confirm, 3210 ms elapsed. XMT: X-- IA_NA 5a:47:1f:71 XMT: | X-- Confirm Address 3ffe:501:ffff::4 XMT: V IA_NA appended. XMT: Confirm on eth0, interval 4320ms. XMT: Forming Confirm, 7530 ms elapsed. XMT: X-- IA_NA 5a:47:1f:71 XMT: | X-- Confirm Address 3ffe:501:ffff::4 XMT: V IA_NA appended. XMT: Confirm on eth0, interval 2470ms. Max retransmission duration exceeded. PRC: Bound to lease 00:01:00:01:12:e1:92:d9:00:14:22:fd:06:e7. PRC: Rebind event scheduled in -8604281 seconds, to run for 110 seconds. PRC: Depreference scheduled in -8604241 seconds. PRC: Expiration scheduled in -8604171 seconds. PRC: Rebinding lease on eth0. PRC: Depreference scheduled in -8604241 seconds. PRC: Expiration scheduled in -8604171 seconds. NetworkManager: (eth0): DHCPv6 state changed preinit6 -> bound6 NetworkManager: Activation (eth0) Stage 4 of 5 (IP6 Configure Get) scheduled... NetworkManager: Activation (eth0) Stage 4 of 5 (IP6 Configure Get) started... NetworkManager: address 3ffe:501:ffff::4 NetworkManager: prefix 64 NetworkManager: nameserver '2000::2' NetworkManager: domain search 'ibm.com.' NetworkManager: Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled... NetworkManager: Activation (eth0) Stage 4 of 5 (IP6 Configure Get) complete. NetworkManager: Activation (eth0) Stage 5 of 5 (IP Configure Commit) started... PRC: Address 3ffe:501:ffff::4 depreferred. PRC: Expiration scheduled in -8604171 seconds. PRC: Address 3ffe:501:ffff::4 expired. PRC: Bound lease is devoid of active addresses. Re-initializing. PRC: Soliciting for leases (INIT). XMT: Forming Solicit, 0 ms elapsed. XMT: X-- IA_NA 5a:47:1f:71 XMT: | X-- Request renew in +3600 XMT: | X-- Request rebind in +5400 XMT: Solicit on eth0, interval 1040ms. Stopping nscd: [ OK ] Starting nscd: [ OK ] NetworkManager: (eth0): device state change: 7 -> 8 (reason 0) NetworkManager: Activation (eth0) successful, device activated. NetworkManager: Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete. NetworkManager: (eth0): DHCPv6 state changed bound6 -> depref6 NetworkManager: (eth0): DHCPv6 state changed depref6 -> expire6 --- src/nm-device.c | 16 ++++++++++++++++ src/nm-policy.c | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index ba88c6b0e3..26b00474dc 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1312,6 +1312,22 @@ dhcp_state_changed (NMDHCPClient *client, else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); break; + case DHC_STOP: + case DHC_STOP6: + case DHC_EXPIRE: + case DHC_EXPIRE6: + if (dev_state == NM_DEVICE_STATE_ACTIVATED) { + if (ipv6) + nm_dhcp6_config_reset (priv->dhcp6_config); + else + nm_dhcp4_config_reset (priv->dhcp4_config); + + /* dhclient quit and can't get/renew a lease; so kill the connection */ + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + } + break; default: break; } diff --git a/src/nm-policy.c b/src/nm-policy.c index 4fccaf4d11..2591de27b6 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -585,10 +585,23 @@ device_state_changed (NMDevice *device, /* Mark the connection invalid if it failed during activation so that * it doesn't get automatically chosen over and over and over again. */ - if (connection && IS_ACTIVATING_STATE (old_state)) { - g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); - nm_connection_clear_secrets (connection); + if (connection) { + gboolean fail = FALSE; + + if (IS_ACTIVATING_STATE (old_state)) { + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); + fail = TRUE; + } else if ( (old_state == NM_DEVICE_STATE_ACTIVATED) + && (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED)) { + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid because IP configuration expired.", + get_connection_id (connection)); + fail = TRUE; + } + + if (fail) { + g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); + nm_connection_clear_secrets (connection); + } } schedule_activate_check (policy, device, 3); break; From 6b63481d4d47882d15704aa60737f3f777d90ae1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 16:37:45 -0700 Subject: [PATCH 286/392] core: prepare for IPv6 routing and DNS stuff --- src/nm-policy.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 2591de27b6..8693484b9e 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -55,7 +55,7 @@ struct NMPolicy { gulong vpn_activated_id; gulong vpn_deactivated_id; - NMDevice *default_device; + NMDevice *default_device4; HostnameThread *lookup; @@ -276,7 +276,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) } static void -update_routing_and_dns (NMPolicy *policy, gboolean force_update) +update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) { NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; NMDevice *best = NULL; @@ -293,7 +293,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) best = get_best_device (policy->manager, &best_req); if (!best) goto out; - if (!force_update && (best == policy->default_device)) + if (!force_update && (best == policy->default_device4)) goto out; /* If a VPN connection is active, it is preferred */ @@ -393,10 +393,16 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) } out: - /* Update the system hostname */ - update_system_hostname (policy, best); + policy->default_device4 = best; +} - policy->default_device = best; +static void +update_routing_and_dns (NMPolicy *policy, gboolean force_update) +{ + update_ip4_routing_and_dns (policy, force_update); + + /* Update the system hostname */ + update_system_hostname (policy, policy->default_device4); } typedef struct { From aaf10a8edbeb1403a252799a7e6da9e8032be72c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 21:48:16 -0700 Subject: [PATCH 287/392] core: don't pointlessly clear IP6 config on success --- src/nm-device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 26b00474dc..9c14f5ae30 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1960,10 +1960,8 @@ real_act_stage4_get_ip6_config (NMDevice *self, } else { *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; } - } else { - *config = NULL; + } else ret = NM_ACT_STAGE_RETURN_SUCCESS; - } out: return ret; From 8d0d80d8dfc580010c9b4257e226bce985e19727 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 21:51:09 -0700 Subject: [PATCH 288/392] core: assure a valid IPv6 config on timeout success --- src/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index 9c14f5ae30..1a96bd3d27 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2084,7 +2084,7 @@ nm_device_activate_stage4_ip6_config_timeout (gpointer user_data) goto out; } g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); - /* FIXME g_assert (ip6_config); */ + g_assert (ip6_config); g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), NM_ACT_REQUEST_IP6_CONFIG, ip6_config); From bb936cd46c33759acfdc350559667528ccc67b6f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 21:52:10 -0700 Subject: [PATCH 289/392] core: ensure IP stage failure when stuff actually fails --- src/nm-device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nm-device.c b/src/nm-device.c index 1a96bd3d27..9d6ee5f410 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2292,6 +2292,16 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) assumed = nm_act_request_get_assumed (priv->act_request); + if (!ip6_config && !ip4_config) { + nm_log_info (LOGD_DEVICE, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) failed (no IP configuration found)", + iface); + nm_device_state_changed (self, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + goto out; + } + if (ip4_config && !nm_device_set_ip4_config (self, ip4_config, assumed, &reason)) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; @@ -2301,6 +2311,8 @@ nm_device_activate_stage5_ip_config_commit (gpointer user_data) nm_log_info (LOGD_DEVICE | LOGD_IP6, "Activation (%s) Stage 5 of 5 (IP Configure Commit) IPv6 failed", iface); + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; } connection = nm_act_request_get_connection (nm_device_get_act_request (self)); From 837364726bb127027dfc0425d0f8ac29204052cb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 22:08:56 -0700 Subject: [PATCH 290/392] dns: handle IPv6 nameservers more like IPv4 ones --- src/named-manager/nm-named-manager.c | 66 +++++++++++++++++++--------- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 2963652f06..aed25e8ba3 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -38,6 +38,7 @@ #include "nm-named-manager.h" #include "nm-ip4-config.h" +#include "nm-ip6-config.h" #include "nm-logging.h" #include "nm-system.h" #include "NetworkManagerUtils.h" @@ -60,8 +61,10 @@ G_DEFINE_TYPE(NMNamedManager, nm_named_manager, G_TYPE_OBJECT) struct NMNamedManagerPrivate { - NMIP4Config *vpn_config; - NMIP4Config *device_config; + NMIP4Config *ip4_vpn_config; + NMIP4Config *ip4_device_config; + NMIP6Config *ip6_vpn_config; + NMIP6Config *ip6_device_config; GSList *configs; }; @@ -487,25 +490,33 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) rc.domain = NULL; rc.searches = g_ptr_array_new (); - if (priv->vpn_config) - merge_one_ip4_config (&rc, priv->vpn_config); + if (priv->ip4_vpn_config) + merge_one_ip4_config (&rc, priv->ip4_vpn_config); + if (priv->ip4_device_config) + merge_one_ip4_config (&rc, priv->ip4_device_config); - if (priv->device_config) - merge_one_ip4_config (&rc, priv->device_config); + if (priv->ip6_vpn_config) + merge_one_ip6_config (&rc, priv->ip6_vpn_config); + if (priv->ip6_device_config) + merge_one_ip6_config (&rc, priv->ip6_device_config); for (iter = priv->configs; iter; iter = g_slist_next (iter)) { + if ( (iter->data == priv->ip4_vpn_config) + || (iter->data == priv->ip4_device_config) + || (iter->data == priv->ip6_vpn_config) + || (iter->data == priv->ip6_device_config)) + continue; + if (NM_IS_IP4_CONFIG (iter->data)) { NMIP4Config *config = NM_IP4_CONFIG (iter->data); - if ((config == priv->vpn_config) || (config == priv->device_config)) - continue; - merge_one_ip4_config (&rc, config); - } else { + } else if (NM_IS_IP6_CONFIG (iter->data)) { NMIP6Config *config = NM_IP6_CONFIG (iter->data); merge_one_ip6_config (&rc, config); - } + } else + g_assert_not_reached (); } domain = rc.domain; @@ -572,10 +583,10 @@ nm_named_manager_add_ip4_config (NMNamedManager *mgr, switch (cfg_type) { case NM_NAMED_IP_CONFIG_TYPE_VPN: - priv->vpn_config = config; + priv->ip4_vpn_config = config; break; case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: - priv->device_config = config; + priv->ip4_device_config = config; break; default: break; @@ -613,11 +624,10 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, priv->configs = g_slist_remove (priv->configs, config); - if (config == priv->vpn_config) - priv->vpn_config = NULL; - - if (config == priv->device_config) - priv->device_config = NULL; + if (config == priv->ip4_vpn_config) + priv->ip4_vpn_config = NULL; + if (config == priv->ip4_device_config) + priv->ip4_device_config = NULL; g_object_unref (config); @@ -643,10 +653,21 @@ nm_named_manager_add_ip6_config (NMNamedManager *mgr, g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (config != NULL, FALSE); - g_return_val_if_fail (cfg_type == NM_NAMED_IP_CONFIG_TYPE_DEFAULT, FALSE); - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + switch (cfg_type) { + case NM_NAMED_IP_CONFIG_TYPE_VPN: + /* FIXME: not quite yet... */ + g_return_val_if_fail (cfg_type != NM_NAMED_IP_CONFIG_TYPE_VPN, FALSE); + priv->ip6_vpn_config = config; + break; + case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: + priv->ip6_device_config = config; + break; + default: + break; + } + /* Don't allow the same zone added twice */ if (!g_slist_find (priv->configs, config)) priv->configs = g_slist_append (priv->configs, g_object_ref (config)); @@ -679,6 +700,11 @@ nm_named_manager_remove_ip6_config (NMNamedManager *mgr, priv->configs = g_slist_remove (priv->configs, config); + if (config == priv->ip6_vpn_config) + priv->ip6_vpn_config = NULL; + if (config == priv->ip6_device_config) + priv->ip6_device_config = NULL; + g_object_unref (config); if (!rewrite_resolv_conf (mgr, iface, &error)) { From e218092d62ef5b5767ee2e79f0c3e49072a00b2f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Apr 2010 22:11:22 -0700 Subject: [PATCH 291/392] core: first pass of IPv6 routing and DNS update on IP config change Mostly the same as the IPv4 bits; dupe them for IPv6. A lot of duplicated code, but it's hard to consolidate. --- src/nm-policy.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++-- src/nm-system.c | 152 ++++++++++++++++++++++++++++++++++ src/nm-system.h | 3 + 3 files changed, 362 insertions(+), 6 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 8693484b9e..a7bd96f1bb 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -56,6 +56,7 @@ struct NMPolicy { gulong vpn_deactivated_id; NMDevice *default_device4; + NMDevice *default_device6; HostnameThread *lookup; @@ -78,7 +79,7 @@ get_connection_id (NMConnection *connection) } static NMDevice * -get_best_device (NMManager *manager, NMActRequest **out_req) +get_best_ip4_device (NMManager *manager, NMActRequest **out_req) { GSList *devices, *iter; NMDevice *best = NULL; @@ -150,6 +151,79 @@ get_best_device (NMManager *manager, NMActRequest **out_req) return best; } +static NMDevice * +get_best_ip6_device (NMManager *manager, NMActRequest **out_req) +{ + GSList *devices, *iter; + NMDevice *best = NULL; + int best_prio = G_MAXINT; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (out_req != NULL, NULL); + g_return_val_if_fail (*out_req == NULL, NULL); + + devices = nm_manager_get_devices (manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + NMConnection *connection; + NMIP6Config *ip6_config; + NMSettingIP6Config *s_ip6; + int prio; + guint i; + gboolean can_default = FALSE; + const char *method = NULL; + + if (nm_device_get_state (dev) != NM_DEVICE_STATE_ACTIVATED) + continue; + + ip6_config = nm_device_get_ip6_config (dev); + if (!ip6_config) + continue; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Never set the default route through an IPv4LL-addressed device */ + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) + method = nm_setting_ip6_config_get_method (s_ip6); + + if (method && !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) + continue; + + /* Make sure at least one of this device's IP addresses has a gateway */ + for (i = 0; i < nm_ip6_config_get_num_addresses (ip6_config); i++) { + NMIP6Address *addr; + + addr = nm_ip6_config_get_address (ip6_config, i); + if (nm_ip6_address_get_gateway (addr)) { + can_default = TRUE; + break; + } + } + + if (!can_default && !NM_IS_DEVICE_MODEM (dev)) + continue; + + /* 'never-default' devices can't ever be the default */ + if (s_ip6 && nm_setting_ip6_config_get_never_default (s_ip6)) + continue; + + prio = nm_device_get_priority (dev); + if (prio > 0 && prio < best_prio) { + best = dev; + best_prio = prio; + *out_req = req; + } + } + + return best; +} + static void _set_hostname (const char *new_hostname, const char *msg) { @@ -215,7 +289,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) /* Try automatically determined hostname from the best device's IP config */ if (!best) - best = get_best_device (policy->manager, &best_req); + best = get_best_ip4_device (policy->manager, &best_req); if (!best) { /* No best device; fall back to original hostname or if there wasn't @@ -290,7 +364,7 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) NMSettingConnection *s_con = NULL; const char *connection_id; - best = get_best_device (policy->manager, &best_req); + best = get_best_ip4_device (policy->manager, &best_req); if (!best) goto out; if (!force_update && (best == policy->default_device4)) @@ -387,19 +461,146 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) connection_id = s_con ? nm_setting_connection_get_id (s_con) : NULL; if (connection_id) { - nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for routing and DNS.", connection_id, ip_iface); + nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for IPv4 routing and DNS.", connection_id, ip_iface); } else { - nm_log_info (LOGD_CORE, "Policy set (%s) as default for routing and DNS.", ip_iface); + nm_log_info (LOGD_CORE, "Policy set (%s) as default for IPv4 routing and DNS.", ip_iface); } out: - policy->default_device4 = best; + policy->default_device4 = best; +} + +static void +update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) +{ + NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + NMDevice *best = NULL; + NMActRequest *best_req = NULL; + NMNamedManager *named_mgr; + GSList *devices = NULL, *iter; +#if NOT_YET + GSList *vpns; +#endif + NMIP6Config *ip6_config = NULL; + NMIP6Address *addr; + const char *ip_iface = NULL; + NMConnection *connection = NULL; + NMSettingConnection *s_con = NULL; + const char *connection_id; + + best = get_best_ip6_device (policy->manager, &best_req); + if (!best) + goto out; + if (!force_update && (best == policy->default_device6)) + goto out; + +#if NOT_YET + /* If a VPN connection is active, it is preferred */ + vpns = nm_vpn_manager_get_active_connections (policy->vpn_manager); + for (iter = vpns; iter; iter = g_slist_next (iter)) { + NMVPNConnection *candidate = NM_VPN_CONNECTION (iter->data); + NMConnection *vpn_connection; + NMSettingIP6Config *s_ip6; + gboolean can_default = TRUE; + NMVPNConnectionState vpn_state; + + /* If it's marked 'never-default', don't make it default */ + vpn_connection = nm_vpn_connection_get_connection (candidate); + g_assert (vpn_connection); + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (vpn_connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6 && nm_setting_ip6_config_get_never_default (s_ip6)) + can_default = FALSE; + + vpn_state = nm_vpn_connection_get_vpn_state (candidate); + if (can_default && (vpn_state == NM_VPN_CONNECTION_STATE_ACTIVATED)) { + NMIP6Config *parent_ip6; + NMDevice *parent; + + ip_iface = nm_vpn_connection_get_ip_iface (candidate); + connection = nm_vpn_connection_get_connection (candidate); + ip6_config = nm_vpn_connection_get_ip6_config (candidate); + addr = nm_ip6_config_get_address (ip6_config, 0); + + parent = nm_vpn_connection_get_parent_device (candidate); + parent_ip6 = nm_device_get_ip6_config (parent); + + nm_system_replace_default_ip6_route_vpn (ip_iface, + nm_ip6_address_get_gateway (addr), + nm_vpn_connection_get_ip4_internal_gateway (candidate), + nm_ip6_config_get_mss (ip4_config), + nm_device_get_ip_iface (parent), + nm_ip6_config_get_mss (parent_ip4)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_VPN; + } + g_object_unref (candidate); + } + g_slist_free (vpns); +#endif + + /* The best device gets the default route if a VPN connection didn't */ + if (!ip_iface || !ip6_config) { + connection = nm_act_request_get_connection (best_req); + ip_iface = nm_device_get_ip_iface (best); + ip6_config = nm_device_get_ip6_config (best); + g_assert (ip6_config); + addr = nm_ip6_config_get_address (ip6_config, 0); + + nm_system_replace_default_ip6_route (ip_iface, nm_ip6_address_get_gateway (addr)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + } + + if (!ip_iface || !ip6_config) { + nm_log_warn (LOGD_CORE, "couldn't determine IP interface (%p) or IPv6 config (%p)!", + ip_iface, ip6_config); + goto out; + } + + /* Update the default active connection. Only mark the new default + * active connection after setting default = FALSE on all other connections + * first. The order is important, we don't want two connections marked + * default at the same time ever. + */ + devices = nm_manager_get_devices (policy->manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + + req = nm_device_get_act_request (dev); + if (req && (req != best_req)) + nm_act_request_set_default6 (req, FALSE); + } + + named_mgr = nm_named_manager_get (); + nm_named_manager_add_ip6_config (named_mgr, ip_iface, ip6_config, dns_type); + g_object_unref (named_mgr); + + /* Now set new default active connection _after_ updating DNS info, so that + * if the connection is shared dnsmasq picks up the right stuff. + */ + if (best_req) + nm_act_request_set_default6 (best_req, TRUE); + + if (connection) + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + + connection_id = s_con ? nm_setting_connection_get_id (s_con) : NULL; + if (connection_id) { + nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for IPv6 routing and DNS.", connection_id, ip_iface); + } else { + nm_log_info (LOGD_CORE, "Policy set (%s) as default for IPv6 routing and DNS.", ip_iface); + } + +out: + policy->default_device6 = best; } static void update_routing_and_dns (NMPolicy *policy, gboolean force_update) { update_ip4_routing_and_dns (policy, force_update); + update_ip6_routing_and_dns (policy, force_update); /* Update the system hostname */ update_system_hostname (policy, policy->default_device4); diff --git a/src/nm-system.c b/src/nm-system.c index 2e03c41a8e..ccb0a47a19 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -940,6 +940,158 @@ nm_system_replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss) return success; } +static struct rtnl_route * +add_ip6_route_to_gateway (const char *iface, const struct in6_addr *gw) +{ + struct nl_handle *nlh; + struct rtnl_route *route = NULL; + struct nl_addr *gw_addr = NULL; + int iface_idx, err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, NULL); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return NULL; + + /* Gateway might be over a bridge; try adding a route to gateway first */ + route = rtnl_route_alloc (); + if (route == NULL) + return NULL; + + rtnl_route_set_family (route, AF_INET6); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_oif (route, iface_idx); + rtnl_route_set_scope (route, RT_SCOPE_LINK); + + gw_addr = nl_addr_build (AF_INET, (void *) gw, sizeof (*gw)); + if (!gw_addr) + goto error; + nl_addr_set_prefixlen (gw_addr, 128); + rtnl_route_set_dst (route, gw_addr); + nl_addr_put (gw_addr); + + /* Add direct route to the gateway */ + err = rtnl_route_add (nlh, route, 0); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to add IPv4 route to gateway (%d)", + iface, err); + goto error; + } + + return route; + +error: + rtnl_route_put (route); + return NULL; +} + +static int +replace_default_ip6_route (const char *iface, const struct in6_addr *gw) +{ + struct rtnl_route *route = NULL; + struct nl_handle *nlh; + struct nl_addr *dst_addr = NULL; + struct nl_addr *gw_addr = NULL; + struct in6_addr dst; + int iface_idx, err = -1; + + g_return_val_if_fail (iface != NULL, -ENODEV); + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, -ENOMEM); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return -ENODEV; + + route = rtnl_route_alloc(); + g_return_val_if_fail (route != NULL, -ENOMEM); + + rtnl_route_set_family (route, AF_INET6); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); + rtnl_route_set_oif (route, iface_idx); + + /* Build up the destination address */ + memset (&dst, 0, sizeof (dst)); + dst_addr = nl_addr_build (AF_INET6, &dst, sizeof (dst)); + if (!dst_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (dst_addr, 0); + rtnl_route_set_dst (route, dst_addr); + + /* Build up the gateway address */ + gw_addr = nl_addr_build (AF_INET6, (void *) gw, sizeof (*gw)); + if (!gw_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (gw_addr, 0); + rtnl_route_set_gateway (route, gw_addr); + + /* Add the new default route */ + err = rtnl_route_add (nlh, route, NLM_F_REPLACE); + +out: + if (dst_addr) + nl_addr_put (dst_addr); + if (gw_addr) + nl_addr_put (gw_addr); + rtnl_route_put (route); + return err; +} + +/* + * nm_system_replace_default_ip6_route + * + * Replace default IPv6 route with one via the given gateway + * + */ +gboolean +nm_system_replace_default_ip6_route (const char *iface, const struct in6_addr *gw) +{ + struct rtnl_route *gw_route = NULL; + struct nl_handle *nlh; + gboolean success = FALSE; + int err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, FALSE); + + err = replace_default_ip6_route (iface, gw); + if (err == 0) { + return TRUE; + } else if (err != -ESRCH) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 default route: %d", + iface, err); + return FALSE; + } + + /* Try adding a direct route to the gateway first */ + gw_route = add_ip6_route_to_gateway (iface, gw); + if (!gw_route) + return FALSE; + + /* Try adding the original route again */ + err = replace_default_ip6_route (iface, gw); + if (err != 0) { + rtnl_route_del (nlh, gw_route, 0); + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 default route (pass #2): %d", + iface, err); + } else + success = TRUE; + + rtnl_route_put (gw_route); + return success; +} + static void flush_addresses (const char *iface, gboolean ipv4_only) { int iface_idx; diff --git a/src/nm-system.h b/src/nm-system.h index f2c2693ac1..e48e493c61 100644 --- a/src/nm-system.h +++ b/src/nm-system.h @@ -40,6 +40,9 @@ gboolean nm_system_replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss); +gboolean nm_system_replace_default_ip6_route (const char *iface, + const struct in6_addr *gw); + gboolean nm_system_replace_default_ip4_route_vpn (const char *iface, guint32 ext_gw, guint32 int_gw, From f8d1d7e83238146a81433474645767386c015713 Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Sat, 24 Apr 2010 00:13:31 -0700 Subject: [PATCH 292/392] po: update Telugu translation (bgo #616399) --- po/te.po | 75 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/po/te.po b/po/te.po index 811c8ede72..4d9101b69d 100644 --- a/po/te.po +++ b/po/te.po @@ -7,16 +7,19 @@ msgid "" msgstr "" "Project-Id-Version: te\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-29 15:19+0530\n" -"PO-Revision-Date: 2010-04-07 14:59+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-21 03:24+0000\n" +"PO-Revision-Date: 2010-04-21 18:32+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"\n" +"\n" "\n" "\n" @@ -1179,77 +1182,82 @@ msgstr "PKCS#12 ఫైలు నిర్దారించలేక పోయ msgid "Could not generate random data." msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." -#: ../libnm-util/nm-utils.c:1802 +#: ../libnm-util/nm-utils.c:1818 #, c-format msgid "Not enough memory to make encryption key." msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." -#: ../libnm-util/nm-utils.c:1912 +#: ../libnm-util/nm-utils.c:1928 msgid "Could not allocate memory for PEM file creation." msgstr "మెమొరీను PEM ఫైలు సృష్టీకరణ కొరకు కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1940 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1936 +#: ../libnm-util/nm-utils.c:1952 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1955 +#: ../libnm-util/nm-utils.c:1971 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 #, c-format msgid "error processing netlink message: %s" msgstr "నెట్‌లింక్ సందేశమును ప్రోసెసింగ్ చేయుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:259 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:269 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకుకు అనుసంధానము కాలేకపోయింది: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:277 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు సమూహమును కలుపలేక పోయింది:%s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:285 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు క్యాచీని కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 msgid "error occurred while waiting for data on socket" msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" -#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 #, c-format msgid "error updating link cache: %s" msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" -#: ../src/main.c:494 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +#: ../src/main.c:558 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. చెల్లునటువంటి ఐచ్చికముల జాబితా చూచుటకు దయచేసి --help వుపయోగించుము.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# నెట్వర్కునిర్వాహిక ద్వారా సృష్టించబడింది\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -1275,26 +1283,36 @@ msgstr "'dhcpcd' కనుగొనబడ గలదు." msgid "unsupported DHCP client '%s'" msgstr "మద్దతీయని DHCP క్లైంట్ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/ip6-manager/nm-netlink-listener.c:199 #, c-format msgid "unable to allocate netlink handle: %s" msgstr "నెట్‌లింక్ సంభాలికను కేటాయించలేక పోయింది: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/ip6-manager/nm-netlink-listener.c:209 #, c-format msgid "unable to connect to netlink: %s" msgstr "నెట్‌లింక్‌కు అనుసంధానము కాలేకపోయింది: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/ip6-manager/nm-netlink-listener.c:306 #, c-format msgid "unable to join netlink group: %s" msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "తెలియని లాగ్ స్థాయి '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "తెలియని లాగ్ డొమైన్ '%s'" + +#: ../src/named-manager/nm-named-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:316 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." @@ -1303,7 +1321,7 @@ msgstr "క్రిందన జాబితాచేసివున్న న msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3229 msgid "System" msgstr "సిస్టమ్" @@ -1338,4 +1356,3 @@ 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 నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" - From 9f01ed9f9a25696f16cb3fcef22cecb086ffe6c0 Mon Sep 17 00:00:00 2001 From: Shankar Prasad Date: Sat, 24 Apr 2010 00:14:45 -0700 Subject: [PATCH 293/392] po: update Kannada translation (bgo #616625) --- po/kn.po | 1002 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 931 insertions(+), 71 deletions(-) diff --git a/po/kn.po b/po/kn.po index 3a433c8dfd..bd04652a29 100644 --- a/po/kn.po +++ b/po/kn.po @@ -7,10 +7,10 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.po.master.kn\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." -"cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2010-02-10 14:31+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-21 03:24+0000\n" +"PO-Revision-Date: 2010-04-20 18:07+0530\n" "Last-Translator: Shankar Prasad \n" "Language-Team: kn-IN <>\n" "MIME-Version: 1.0\n" @@ -19,6 +19,850 @@ msgstr "" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ಬಳಕೆ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c: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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "ಹೆಸರು" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳು:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ದೋಷ: %s ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ" + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ದೋಷ: %s - ಅಂತಹ ಯಾವುದೆ ಸಂಪರ್ಕಗಳಿಲ್ಲ." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "ವ್ಯವಸ್ಥೆಯಾದ್ಯಂತದ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ಗೊತ್ತಿರದ ನಿಯತಾಂಕಗಳು: %s\n" + +#: ../cli/src/connections.c:221 +#, 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 "ಇಲ್ಲ" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕಗಳು" + +#: ../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:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "ಸೇವೆ" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "ಸಾಧನಗಳು" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' ಎಂಬ ಸಾಧನದಲ್ಲಿ ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕವು ಕಂಡುಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಅಥವ ಸಾಧನವು ಕಂಡುಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "ಸಕ್ರಿಯಗೊಳ್ಳುತ್ತಿದೆ" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "ಸಕ್ರಿಯಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "ಗೊತ್ತಿಲ್ಲದ" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN ಸಂಪರ್ಕಿತಗೊಳ್ಳುತ್ತಿದೆ" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN ಸಂಪರ್ಕವು ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN ಸಂಪರ್ಕ ಕಡಿದಿದೆ" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "ಗೊತ್ತಿರದ ಕಾರಣ" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "ಯಾವುದೂ ಇಲ್ಲ" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "ಬಳಕೆದಾರರೊಂದಿಗೆ ಸಂಪರ್ಕ ಕಡಿದುಹೋಗಿದೆ" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "ಮೂಲ ಜಾಲಬಂಧ ಸಂಪರ್ಕಕ್ಕೆ ತಡೆಯುಂಟಾಗಿದೆ" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ಸೇವೆಯನ್ನು ಅನಿರೀಕ್ಷಿತವಾಗಿ ನಿಲ್ಲಿಸಲಾಗಿದೆ" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ಸೇವೆಯು ಅಮಾನ್ಯವಾದ ಸಂರಚನೆಯನ್ನು ಮರಳಿಸಿದೆ" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "ಸಂಪರ್ಕದ ಪ್ರಯತ್ನದ ಕಾಲಾವಧಿ ಮೀರಿದೆ" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN ಸೇವೆಯು ಸರಿಯಾದ ಸಮಯದಲ್ಲಿ ಆರಂಭಗೊಳ್ಳಲಿಲ್ಲ" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN ಸೇವೆಯು ಆರಂಭಗೊಳ್ಳಲು ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "ಯಾವುದೆ ಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳಿಲ್ಲ (ಸೀಕ್ರೇಟ್‌ಗಳಿಲ್ಲ)" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "ಅಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳು" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "ಸಂಪರ್ಕವನ್ನು ತೆಗೆದು ಹಾಕಲಾಗಿದೆ" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "ಸ್ಥಿತಿ: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ದೋಷ: ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ಸ್ಥಿತಿ: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ದೋಷ: ಕಾಲಾವಧಿ %d sec ತೀರಿದೆ." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ದೋಷ: '%s' ಗಾಗಿ ಸಕ್ರಿಯ ಸಂಪರ್ಕವನ್ನು ಪಡೆಯುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕದ ಸ್ಥಿತಿ: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಮಾರ್ಗ: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ದೋಷ: ಗೊತ್ತಿರದ ಸಂಪರ್ಕ: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ ಕಾಲಾವಧಿ ತೀರಿಕೆ ಮೌಲ್ಯವು ಅಮಾನ್ಯವಾಗಿದೆ." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ದೋಷ: id ಅಥವ uuid ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ಎಚ್ಚರಿಕೆ: ಸಂಪರ್ಕವು ಸಕ್ರಿಯವಾಗಿಲ್ಲ\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ದೋಷ: 'con' ಆಜ್ಷೆ '%s' ಎಂಬುದು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ದೋಷ: D-Bus ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ದೋಷ: ವ್ಯವಸ್ಥೆಯ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ದೋಷ: ಬಳಕೆದಾರ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ದೋಷ: ಸಂಪರ್ಕಗಳನ್ನು ಪಡೆಯಲಾಗಿಲ್ಲ: ಸಿದ್ಧತೆಗಳು ಚಾಲನೆಯಲ್ಲಿಲ್ಲ." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"ಬಳಕೆ: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "ನಿರ್ವಹಿಸದೆ ಇರುವ" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "ಲಭ್ಯವಿಲ್ಲ" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "ಸಂಪರ್ಕಕಡಿದು ಹೋಗಿದೆ" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಂರಚಿಸುವಿಕೆ)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "ಸಂಪರ್ಕಗೊಂಡಿದೆ" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "ಸಂಪರ್ಕ ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "ಗೊತ್ತಿರದ" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(ಯಾವುದೂ ಇಲ್ಲ)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ವಿಳಾಸ 0x%X ಅನ್ನು ಪರಿವರ್ತಿಸುವಲ್ಲಿ ದೋಷ" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, ಫ್ರೀಕ್ವೆ %d MHz, ದರ %d Mb/s, ದೃಢತೆ %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " ಎಂಟರ್ಪೈಸ್" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "ಸಾಧನ" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ಚಾಲಕ" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(ಗೊತ್ತಿರದ)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "ಸ್ಥಿತಿ" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW ವಿಳಾಸ" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" ಸಾಮಾರ್ಥ್ಯಗಳು:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "ಕ್ಯಾರಿಯರ್ ಪತ್ತೆ" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "ವೇಗ" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" ವೈರ್ಲೆಸ್‌ ಗುಣಧರ್ಮಗಳು\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP ಗೂಢಲಿಪೀಕರಣ" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA ಗೂಢಲಿಪೀಕರಣ" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 ಗೂಢಲಿಪೀಕರಣ" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP ಸಿಫರ್" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP ಸಿಫರ್" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" ವೈರ್ಲೆಸ್ ನಿಲುಕಣಾ ಬಿಂದುಗಳು %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = ಪ್ರಸಕ್ತ AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" ವೈರ್ಡ್ ಗುಣಧರ್ಮಗಳು\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "ವಾಹಕ(ಕ್ಯಾರಿಯರ್)" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "ಆನ್‌" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "ಆಫ್" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPV4 ಸಿದ್ಧತೆಗಳು:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "ಸಾಧನಗಳ ಸ್ಥಿತಿ" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ಯಶಸ್ಸು: '%s' ಎಂಬ ಸಾಧನದಿಂದ ಯಶಸ್ವಿಯಾಗಿ ಸಂಪರ್ಕವನ್ನು ಕಡಿದುಹಾಕಲಾಗಿದೆ." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ದೋಷ: '%s' (%s) ಎಂಬ ಸಾಧನದ ಸಂಪರ್ಕವನ್ನು ಕಡಿದು ಹಾಕುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ಸಾಧನದ ಸ್ಥಿತಿ: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ದೋಷ: iface ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi ಸ್ಕ್ಯಾನ್ ಪಟ್ಟಿ" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ದೋಷ: '%s' ಎಂಬುದು ಒಂದು WiFi ಸಾಧನವಾಗಿಲ್ಲ." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "ಸಾಧನ:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "ದೋಷ: hwaddr ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ hwaddr ನ ನಿಲುಕಣಾ ಬಿಂದುವು ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP ನಿಯತಾಂಕಗಳು" + +#: ../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 "ಫ್ರೀಕ್ವೆನ್ಸಿ:" + +#: ../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 "ದೃಢತೆ:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "ಫ್ಲಾಗ್‌ಗಳು:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "ಗೌಪ್ಯತೆ" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA ಫ್ಲಾಗ್‌ಗಳು:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN ಫ್ಲಾಗ್‌ಗಳು:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'dev wifi' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'dev' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ಬಳಕೆ: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "ನಿದ್ರಿಸುವ" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "NetworkManager ಸ್ಥಿತಿ" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM ಚಾಲನೆಯಲ್ಲಿದೆ:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "ಚಾಲನೆಯಲ್ಲಿದೆ" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "ಚಾಲನೆಯಲ್ಲಿಲ್ಲ" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM ಸ್ಥಿತಿ:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM ವೈರ್ಲೆಸ್‌ ಯಂತ್ರಾಂಶ:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM ಯಂತ್ರಾಂಶ:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN ಯಂತ್ರಾಂಶ:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wifi' ನಿಯತಾಂಕ: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wwan' ರ ನಿಯತಾಂಕ: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'nm' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ಬಳಕೆ: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "'%s' ಎಂಬ ವಸ್ತುವಿನ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ಉಪಕರಣ, ಆವೃತ್ತಿ %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "'%s' ಎಂಬ ಆಯ್ಕೆಯ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli -help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d ಎಂಬ ಸಂಕೇತವು ಕಂಡುಬಂದಿದೆ, ಮುಚ್ಚಲಾಗುತ್ತಿದೆ......" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ದೋಷ: NetworkManager ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "ಯಶಸ್ವಿಯಾಗಿದೆ" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -106,7 +950,7 @@ msgstr "IV ಯು ಹೆಕ್ಸಾ-ದಶಮಾಂಶ ಅಲ್ಲದ ಅಂ #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ಖಾಸಗಿ ಕೀಲಿ ಸಿಫರ್ '%s' ತಿಳಿದಿಲ್ಲ." @@ -165,43 +1009,38 @@ msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು IV ಅನ್ನು ಹೊ msgid "Failed to decrypt the private key: %s / %s." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#: ../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 "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಅನಿರೀಕ್ಷಿತವಾದ ಪ್ಯಾಡಿಂಗ್ ಗಾತ್ರ" -#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಸಿಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "ಗೂಢಲಿಪೀಕರಣ ಸಿಫರ್ ಸಂದರ್ಭವನ್ನು ಆರಂಭಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %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 "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." @@ -230,7 +1069,7 @@ msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸ msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ಕಡತವನ್ನು ಪರಿಶೀಲಿಸಲಾಗಿಲ್ಲ: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "ಕ್ರಿಪ್ಟೊ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." @@ -272,7 +1111,6 @@ msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ #: ../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 "" "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ದತ್ತಾಂಶದ ಗಾತ್ರವು " @@ -283,151 +1121,149 @@ msgstr "" msgid "Failed to finalize decryption of the private key: %d." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಿಕೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../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 "ಗೂಢಲಿಪೀಕರಿಸಲಾಗುವ ಸಿಫರ್ ಜಾಗವನ್ನು ಆರಂಭಿಸಲು ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:371 +#: ../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 "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "ಗೂಢಲಿಪೀಕರಿಸುವ ಸನ್ನಿವೇಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಅನಿರೀಕ್ಷಿತವಾದ ದತ್ತಾಂಶದ ಮೊತ್ತ." -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "ಗುಪ್ತಪದವನ್ನು UCS2 ಗೆ ಬದಲಾಯಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ಡೀಕೋಡರ್ ಅನ್ನು ಆರಂಭಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ಕಡತವನ್ನು ಖಚಿತಪಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" -#: ../libnm-util/crypto_nss.c:556 -#| msgid "Could not decode private key." +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "ಮನಸ್ಸಿಗೆ ಬಂದ ದತ್ತಾಂಶವನ್ನು ಉತ್ಪಾದಿಸಲಾಗಲಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1818 #, c-format -#| msgid "Not enough memory to decrypt private key." msgid "Not enough memory to make encryption key." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." -#: ../libnm-util/nm-utils.c:1633 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:1928 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ಕಡತ ರಚನೆಗೆ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:1940 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IV ಅನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:1952 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." +msgstr "" +"ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:1971 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "PEM ಕಡತ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 #, c-format msgid "error processing netlink message: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್ ಸಂದೇಶವನ್ನು ಸಂಸ್ಕರಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:259 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು " "ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:269 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %" "s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:277 #, c-format msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:285 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ನಿಯೋಜಿಸಲು " "ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 msgid "error occurred while waiting for data on socket" msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 #, c-format msgid "error updating link cache: %s" msgstr "ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ಅಪ್‌ಡೇಟ್ ಮಾಡುವಾಗ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ಅಮಾನ್ಯವಾದ ಆಯ್ಕೆ. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:558 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager ನಿಂದ ನಿರ್ಮಿಸಲಾಗಿದೆ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -436,42 +1272,66 @@ msgstr "" "# %s ಇಂದ ಒಗ್ಗೂಡಿಸಲಾಗಿದೆ\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ಬಳಸಬಹುದಾದ ಯಾವುದೆ DHCP ಕ್ಲೈಂಟ್ ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ಕಂಡು ಬಂದಿದೆ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ಕಂಡು ಬಂದಿದೆ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ಬೆಂಬಲವಿರದ DHCP ಕ್ಲೈಂಟ್ '%s'" + +#: ../src/ip6-manager/nm-netlink-listener.c:199 #, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" msgid "unable to allocate netlink handle: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/ip6-manager/nm-netlink-listener.c:209 #, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" msgid "unable to connect to netlink: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/ip6-manager/nm-netlink-listener.c:306 #, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" msgid "unable to join netlink group: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಮಟ್ಟ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಡೊಮೈನ್ '%s'" + +#: ../src/named-manager/nm-named-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " "ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:316 msgid "The nameservers listed below may not be recognized." msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "ಸ್ವಯಂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3229 msgid "System" -msgstr "ಗಣಕ" +msgstr "ವ್ಯವಸ್ಥೆ" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" @@ -494,15 +1354,15 @@ msgid "System policy prevents modification of system settings" msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents modification of the persistent system hostname" msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" +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 ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" - +msgstr "" +"ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" From a7ab278498a4f67b8c57bd1a275ddc020baf36f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C4=8Cernock=C3=BD?= Date: Sat, 24 Apr 2010 00:15:40 -0700 Subject: [PATCH 294/392] po: update Czech translation (bgo #616630) --- po/cs.po | 1525 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 1319 insertions(+), 206 deletions(-) diff --git a/po/cs.po b/po/cs.po index ed0ac8c904..1be6b82e1a 100644 --- a/po/cs.po +++ b/po/cs.po @@ -5,66 +5,1283 @@ # Miloslav Trmac , 2004 - 2006. # Jakub Friedl , 2006. # Jiří Eischmann , 2008. -# +# Marek Černocký , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-17 22:27+0200\n" -"PO-Revision-Date: 2008-09-17 22:08+0200\n" -"Last-Translator: Petr Kovar \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-09 03:24+0000\n" +"PO-Revision-Date: 2010-04-23 13:02+0200\n" +"Last-Translator: Marek Černocký \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Použití: nmcli con {PŘÍKAZ | help}\n" +" PŘÍKAZ := {list | status | up | down}\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--" +"timeout <časový_limit>]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Připojení" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Název" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Systémová připojení:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Uživatelská připojení:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Chyba: schází argument %s." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Chyba: %s - takové připojení neexistuje." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Připojení v rámci systému" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Uživatelská připojení" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Neznámý parametr: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Chyba: nezadán žádný platný parametr." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "ano" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktivní připojení" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Výchozí" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Služba" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Zařízení" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "žádné aktivní připojení nebo zařízení „%s“" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "žádné aktivní připojení nebo zařízení" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktivuje se" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktivováno" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "neznámo" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN se připojuje (příprava)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN se připojuje (požaduje ověření)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN se připojuje" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN se připojuje (získává se nastavení IP)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN připojena" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN se nezdařilo připojit" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN odpojena" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "neznámý důvod" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "žádný" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "uživatel byl odpojen" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "základní síťové připojení bylo přerušeno" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "služba VPN neočekávaně zastavena" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "služba VPN vrátila neplatné nastavení" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "pokusu o připojení vypršel časový limit" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "služba VPN se nespustila v časovém limitu" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "službu VPN se nezdařilo spustit" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "žádná platná utajení VPN" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "neplatná utajení VPN" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "připojení odstraněno" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "stav: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Připojení aktivováno\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Chyba: Selhala aktivace připojení." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stav: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Chyba: Selhala aktivace připojení: %s" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Chyba: Časový limit %d sekund vypršel." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Chyba: Selhala aktivace připojení: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Chyba: Získání aktivního připojení pro „%s“ selhalo." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stav aktivního připojení: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Cesta aktivního připojení: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Chyba: Neznámé připojení: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Chyba: hodnota časového limitu „%s“ není platná." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Chyba: nebylo určeno id nebo uuid." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Chyba: Nenalezeno vhodné zařízení: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Chyba: Nenalezeno vhodné zařízení." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Varování: Připojení není aktivní\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „con“ platný." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Chyba: nelze se připojit ke sběrnici D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Chyba: Nelze získat systémová nastavení." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Chyba: Nelze získat uživatelská nastavení." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Chyba: Nelze získat připojení: služba správy nastavení neběží." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Použití: nmcli dev {PŘÍKAZ | help}\n" +"\n" +" PŘÍKAZ := {status | list | disconnect | wifi}\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout <časový_limit>]\n" +" wifi [list [iface ] | apinfo iface hwaddr " +"]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "není pod správou" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "nedostupné" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "odpojeno" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "připojuje se (příprava)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "připojuje se (nastavování)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "připojuje se (požadováno ověření)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "připojuje se (získává se nastavení IP)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "připojeno" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "připojení se nezdařilo" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Neznámý" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(nic)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: chyba převodu adresy IP4 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frekv %d MHz, Rychlost %d Mb/s, Síla sig %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Šifrováno: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Podnikové" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Zařízení" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Ovladač" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(neznámo)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Stav" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW adresa" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Schopnosti:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Detekce nosného signálu" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Rychlost" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Vlastnosti bezdrátové části\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Šifrování WEP" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Šifrování WPA" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Šifrování WPA2" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Šifra TKIP" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Šifra CCMP" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Bezdrátový přístupový bod %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = aktuální přístupový bod)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Vlastnosti drátové části\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Nosný signál" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "zapnut" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "vypnut" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Nastavení IPv4:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adresa" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Předčíslí" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Brána" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Stav zařízení" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Chyba: schází argument „%s“." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Chyba: Zařízení „%s“ nenalezeno." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Úspěch: Zařízení „%s“ úspěšně odpojeno." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Chyba: Odpojení zařízení „%s“ (%s) selhalo: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stav zařízení: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Chyba: nebylo určeno rozhraní." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Seznam prohledání WiFi" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Chyba: Zařízení „%s“ není zařízení WiFi." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Zařízení:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Chyba: musí být určena hardwarová adresa." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Chyba: Přístupový bod s hardwarovou adresou „%s“ nenalezen." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parametry přístupového bodu" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Kmitočet:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Režim:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Max. přenosová rychlost:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Síla signálu:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Příznaky:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "soukromé" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Příznaky WPA:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Příznaky RSN:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev wifi“ platný." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev“ platný." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Použití: nmcli nm {PŘÍKAZ | help}\n" +"\n" +" PŘÍKAZ := {status | sleep | wakeup | wifi | wwan}\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "uspán" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "připojuje se" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "povoleno" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "zakázáno" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Stav správce sítě NetworkManager" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "Běh NM:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "běží" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "neběží" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Stav NM:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Bezdrátový hardware NM:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "Bezdrátové sítě NM:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "Hardware WWAN NM" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "Sítě WWAN NM:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Chyba: neplatný parametr pro „wifi“: „%s“" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Chyba: neplatný parametr pro „wwan“: „%s“" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „nm“ platný." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Použití: %s [PŘEPÍNAČE] OBJEKT {PŘÍKAZ | help}\n" +"\n" +"PŘEPÍNAČE\n" +" -t[erse] stručný výpis\n" +" -p[retty] hezký výpis\n" +" -v[ersion] zobrazit verzi programu\n" +" -h[elp] zobrazit tuto nápovědu\n" +"\n" +"OBJEKT\n" +" nm stav NetworkManageru\n" +" con připojení v NetworkManageru\n" +" dev zařízení spravovaná NetworkManagerem\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objekt „%s“ je neznámý, zkuste „nmcli help“." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nástroj nmcli, verze %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Přepínač „%s“ je neznámý, zkuste „nmcli -help“." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Zachycen signál %d, vypíná se…" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Chyba: Nelze se připojit ke správci sítě NetworkManager." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Úspěch" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Soubor klíče PEM neměl koncovou značku „%s“." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Nevypadá jako soubor soukromého klíče PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Není dostatek paměti pro uložení dat souboru PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Vadný soubor PEM: značka Proc-Type nebyla první značkou." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Vadný soubor PEM: neznámá značka Proc-Type „%s“." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Vadný soubor PEM: značka DEK-Info nebyla druhou značkou." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Vadný soubor PEM: nebyl nalezen IV ve značce DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Vadný soubor PEM: neplatný formát IV ve značce DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Vadný soubor PEM: neznámá šifra soukromého klíče „%s“." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Nelze dekódovat soukromý klíč." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Certifikát PEM „%s“ nemá koncovou značku „%s“." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Selhalo dekódování certifikátu." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nedostatek paměti pro uložení dat certifikátu." + +#: ../libnm-util/crypto.c:294 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Not enough memory to store file data." +msgstr "Nedostatek paměti na uložení dat souboru." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV musí mít na délku sudý počet bajtů." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nedostatek paměti pro uložení IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV obsahuje jiné než šestnáctkové číslice." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Šifra soukromého klíče „%s“ je neznámá." + +#: ../libnm-util/crypto.c:391 +#, c-format +#| msgid "Not enough memory to store decrypted private key." +msgid "Not enough memory to decrypt private key." +msgstr "Nedostatek paměti pro dešifrování soukromého klíče." + +#: ../libnm-util/crypto.c:511 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Unable to determine private key type." +msgstr "Nelze určit typ soukromého klíče." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nedostatek paměti pro uložení dešifrovaného soukromého klíče." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Selhala inicializace šifrovacího programu." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Selhala inicializace programu pro MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Neplatná délka IV (musí být nejméně %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nedostatek paměti pro vyrovnávací paměť dešifrovaného klíče." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Selhala inicializace kontextu dešifrovací šifry: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Selhalo nastavení symetrického klíče pro dešifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Selhalo nastavení IV pro dekódování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Selhalo dekódování soukromého klíče: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Selhalo dešifrování soukromého klíče: neočekávané zarovnání délky." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key." +msgstr "Selhalo dešifrování soukromého klíče." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nelze alokovat paměť pro šifrování." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Selhala inicializace kontextu šifrovací šifry: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Selhalo nastavení symetrického klíče pro šifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Selhalo nastavení IV pro šifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Selhalo šifrování dat: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Chyba při inicializaci dat certifikátu: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Nelze dekódovat certifikát: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Nelze inicializovat dekodér PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Nelze dekódovat soubor PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Nelze ověřit soubor PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Selhala inicializace šifrovacího programu: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Selhala inicializace kontextu MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Neplatná délka IV (musí být nejméně %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Selhala inicializace slotu dešifrovací šifry." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Selhalo nastavení symetrického klíče pro dešifrování." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Selhalo nastavení IV pro dešifrování." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Selhala inicializace dešifrovacího kontextu." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Selhalo dešifrování soukromého klíče: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Selhalo dešifrování soukromého klíče: dešifrovaná data jsou příliš velká." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Selhalo dokončení dešifrování soukromého klíče: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Selhala inicializace slotu šifrovací šifry." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Selhalo nastavení symetrického klíče pro šifrování." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Selhalo nastavení IV pro šifrování." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Selhala inicializace kontextu šifrování." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Selhalo šifrování: %d" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Neočekávané množství dat po zašifrování." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Nelze dekódovat certifikát: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Nelze převést heslo na UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Nelze inicializovat dekodér PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Nelze dekódovat soubor PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Nelze ověřit soubor PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Nelze vygenerovat náhodná data." + +#: ../libnm-util/nm-utils.c:1818 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Nedostatek paměti pro vytvoření šifrovacího klíče." + +#: ../libnm-util/nm-utils.c:1928 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Nelze alokovat paměť pro vytvoření souboru PEM." + +#: ../libnm-util/nm-utils.c:1940 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nelze alokovat paměť pro zápis IV do souboru PEM." + +#: ../libnm-util/nm-utils.c:1952 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nelze alokovat paměť pro zápis šifrovaného klíče do souboru PEM." + +#: ../libnm-util/nm-utils.c:1971 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Nelze alokovat paměť pro data souboru PEM." + +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 #, c-format msgid "error processing netlink message: %s" msgstr "chyba při zpracování zprávy netlink: %s" -#: ../src/nm-netlink-monitor.c:250 +#: ../src/nm-netlink-monitor.c:259 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "nelze alokovat ovládání netlinku pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:269 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "nelze se připojit k netlinku pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:268 +#: ../src/nm-netlink-monitor.c:277 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "nelze se připojit ke skupině netlink pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:276 +#: ../src/nm-netlink-monitor.c:285 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "" -"nelze alokovat vyrovnávací paměť netlinku pro sledování stavu spojení: %s" +msgstr "nelze alokovat mezipaměť netlinku pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:439 +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 +msgid "error occurred while waiting for data on socket" +msgstr "vyskytla se chyba při čekání na data ze soketu" + +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 #, c-format msgid "error updating link cache: %s" -msgstr "chyba při aktualizaci link cache: %s" +msgstr "chyba při aktualizaci mezipaměti spojení: %s" -#: ../src/nm-netlink-monitor.c:497 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "při čekání na data ze socketu došlo k chybě" - -#: ../src/NetworkManager.c:250 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Neplatná volba. Platné volby uvidíte při použití --help.\n" +msgstr "" +"Neplatný přepínač. Platné přepínače si můžete zobrazit pomocí --help.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:89 +#: ../src/main.c:558 +#, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Pomocí --help si prosím zobrazte seznam platných přepínačů.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Vytvořeno NetworkManagerem\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:95 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -73,201 +1290,97 @@ msgstr "" "# Sloučeno z %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "nebyl nalezen žádný použitelný klient DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "„dhclient“ byl nalezen." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "„dhcpcd“ byl nalezen." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nepodporovaný klient DHCP „%s“" + +#: ../src/ip6-manager/nm-netlink-listener.c:199 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "nelze alokovat ovládání netlinku: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:209 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "nelze se připojit k netlinku: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:306 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "nelze se připojit ke skupině netlink: %s" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Neznámá úroveň evidence „%s“" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Neznámá doména evidence „%s“" + +#: ../src/named-manager/nm-named-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "Poznámka: libc resolver nemůže podporovat více než 3 nameservery." +msgstr "" +"Poznámka: překladač adres z libc nemůže podporovat více než 3 jmenné servery." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:316 msgid "The nameservers listed below may not be recognized." -msgstr "Nameservery uvedené v seznamu dole nelze rozpoznat." +msgstr "Jmenné servery uvedené v následujícím seznamu nelze rozpoznat." -#: ../system-settings/src/main.c:366 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" -msgstr "Auto %s" +msgstr "%s (automaticky)" -#: ../libnm-util/crypto.c:125 -#, c-format -msgid "PEM key file had no end tag '%s'." -msgstr "Soubor klíče PEM neměl koncovou značku '%s'." +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Systém" -#: ../libnm-util/crypto.c:135 -#, c-format -msgid "Doesn't look like a PEM private key file." -msgstr "Nevypadá jako soubor soukromého klíče PEM." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Sdílení připojení přes chráněnou síť WiFi" -#: ../libnm-util/crypto.c:143 -#, c-format -msgid "Not enough memory to store PEM file data." -msgstr "Není dostatek paměti na uložení dat PEM souboru." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Sdílení připojení přes otevřenou síť WiFi" -#: ../libnm-util/crypto.c:159 -#, c-format -msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "Nesprávný PEM soubor: Proc-Type nebylo první značkou." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Měnit trvalý systémový název počítače" -#: ../libnm-util/crypto.c:167 -#, c-format -msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Nesprávný PEM soubor: neznámá značka Proc-Type '%s'." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Měnit systémová připojení" -#: ../libnm-util/crypto.c:177 -#, c-format -msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "Nesprávný PEM soubor: DEK-Info nebylo druhou značkou." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Systémová politika zabránila změně systémového nastavení." -#: ../libnm-util/crypto.c:188 -#, c-format -msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Nesprávný PEM soubor: nebylo nalezeno IV ve značce DEK-Info." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Systémová politika zabránila změně trvalého systémového názvu počítače" -#: ../libnm-util/crypto.c:195 -#, c-format -msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Nesprávný PEM soubor: neplatný formát IV ve značce DEK-Info." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes chráněnou síť WiFi" -#: ../libnm-util/crypto.c:208 -#, c-format -msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "Nesprávný PEM soubor: neznámá šifra soukromého klíče '%s'." - -#: ../libnm-util/crypto.c:227 -#, c-format -msgid "Could not decode private key." -msgstr "Nelze dekódovat soukromý klíč." - -#: ../libnm-util/crypto.c:271 -#, c-format -msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "PEM certifikát '%s' nemá koncovou značku '%s'." - -#: ../libnm-util/crypto.c:281 -#, c-format -msgid "Failed to decode certificate." -msgstr "Selhalo dekódování certifikátu." - -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 -#, c-format -msgid "Not enough memory to store certificate data." -msgstr "Není dostatek paměti na uložení dat certifikátu." - -#: ../libnm-util/crypto.c:328 -#, c-format -msgid "IV must be an even number of bytes in length." -msgstr "IV musí být sudé číslo bajtů na délku." - -#: ../libnm-util/crypto.c:337 -#, c-format -msgid "Not enough memory to store the IV." -msgstr "Není dostatek paměti pro uložení IV." - -#: ../libnm-util/crypto.c:348 -#, c-format -msgid "IV contains non-hexadecimal digits." -msgstr "IV obsahuje nešestnáctkové číslice." - -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:157 -#, c-format -msgid "Private key cipher '%s' was unknown." -msgstr "Šifra soukromého klíče '%s' je neznámá." - -#: ../libnm-util/crypto.c:395 -#, c-format -msgid "Not enough memory to create private key decryption key." -msgstr "" -"Není dostatek paměti pro vytvoření dešifrovacího klíče k soukromému klíči." - -#: ../libnm-util/crypto.c:513 -#, c-format -msgid "Not enough memory to store decrypted private key." -msgstr "Není dostatek paměti pro uložení dešifrovaného soukromého klíče." - -#: ../libnm-util/crypto_gnutls.c:45 -msgid "Failed to initialize the crypto engine." -msgstr "Nelze inicializovat šifrovací engine." - -#: ../libnm-util/crypto_gnutls.c:89 -#, c-format -msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Nelze inicializovat MD5 engine: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:166 -#, c-format -msgid "Not enough memory for decrypted key buffer." -msgstr "Není dostatek paměti pro vyrovnávací paměť dešifrovaného klíče." - -#: ../libnm-util/crypto_gnutls.c:160 -#, c-format -msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Nelze inicializovat kontext dekódovací šifry: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:169 -#, c-format -msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Nelze nastavit symetrický klíč pro dekódování: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:178 -#, c-format -msgid "Failed to set IV for decryption: %s / %s." -msgstr "Nelze nastavit IV pro dekódování: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:187 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "Nelze dekódovat soukromý klíč: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:225 -#, c-format -msgid "Error initializing certificate data: %s" -msgstr "Chyba při inicializaci dat certifikátu: %s" - -#: ../libnm-util/crypto_gnutls.c:237 -#, c-format -msgid "Couldn't decode certificate: %s" -msgstr "Nelze dekódovat certifikát: %s" - -#: ../libnm-util/crypto_nss.c:52 -#, c-format -msgid "Failed to initialize the crypto engine: %d." -msgstr "Nelze inicializovat šifrovací engine: %d." - -#: ../libnm-util/crypto_nss.c:98 -#, c-format -msgid "Failed to initialize the MD5 context: %d." -msgstr "Nelze inicializovat MD5 kontext: %d." - -#: ../libnm-util/crypto_nss.c:174 -#, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "Nelze inicializovat slot dekódovací šifry." - -#: ../libnm-util/crypto_nss.c:184 -#, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "Nelze nastavit symetrický klíč pro dekódování." - -#: ../libnm-util/crypto_nss.c:194 -#, c-format -msgid "Failed to set IV for decryption." -msgstr "Nelze nastavit IV pro dekódování." - -#: ../libnm-util/crypto_nss.c:202 -#, c-format -msgid "Failed to initialize the decryption context." -msgstr "Nelze inicializovat kontext dekódování." - -#: ../libnm-util/crypto_nss.c:215 -#, c-format -msgid "Failed to decrypt the private key: %d." -msgstr "Nelze dekódovat soukromý klíč: %d." - -#: ../libnm-util/crypto_nss.c:227 -#, c-format -msgid "Failed to finalize decryption of the private key: %d." -msgstr "Nelze dokončit dekódování soukromého klíče: %d." - -#: ../libnm-util/crypto_nss.c:271 -#, c-format -msgid "Couldn't decode certificate: %d" -msgstr "Nelze dekódovat certifikát: %d" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes otevřenou síť WiFi" From 9b944dec961e06865c622fbaf597ac35353f26a0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 25 Apr 2010 09:52:01 -0700 Subject: [PATCH 295/392] core: ignore mobile broadband ethernet devices that aren't usable (rh #585214) Not all ethernet devices are immediately usable; newer mobile broadband devices (Ericsson, Option, Sierra) require setup on the tty before the ethernet device is usable. 2.6.33 and later kernels set the 'DEVTYPE' uevent variable which we can use to ignore the interface as a NMDevice subclass. ModemManager will pick it up though and so we'll handle it through the mobile broadband stuff. --- src/nm-udev-manager.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c index 0ced962c27..1e84c04cc6 100644 --- a/src/nm-udev-manager.c +++ b/src/nm-udev-manager.c @@ -401,18 +401,36 @@ out: static void net_add (NMUdevManager *self, GUdevDevice *device) { - gint devtype; + gint etype; const char *iface; + const char *devtype; g_return_if_fail (device != NULL); - devtype = g_udev_device_get_sysfs_attr_as_int (device, "type"); - if (devtype != 1) + etype = g_udev_device_get_sysfs_attr_as_int (device, "type"); + if (etype != 1) { + nm_log_dbg (LOGD_HW, "ignoring interface with type %d", etype); return; /* Not using ethernet encapsulation, don't care */ + } + + /* Not all ethernet devices are immediately usable; newer mobile broadband + * devices (Ericsson, Option, Sierra) require setup on the tty before the + * ethernet device is usable. 2.6.33 and later kernels set the 'DEVTYPE' + * uevent variable which we can use to ignore the interface as a NMDevice + * subclass. ModemManager will pick it up though and so we'll handle it + * through the mobile broadband stuff. + */ + devtype = g_udev_device_get_property (device, "DEVTYPE"); + if (devtype && !strcmp (devtype, "wwan")) { + nm_log_dbg (LOGD_HW, "ignoring interface with devtype '%s'", devtype); + return; + } iface = g_udev_device_get_name (device); - if (!iface) + if (!iface) { + nm_log_dbg (LOGD_HW, "failed to get device's interface"); return; + } g_signal_emit (self, signals[DEVICE_ADDED], 0, device, device_creator); } From 0ad8fc1adc6ee3e59ab8963f94c106cb71af3345 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 25 Apr 2010 22:48:10 -0700 Subject: [PATCH 296/392] libnm-glib: use max timeout for settings dbus calls These calls may require authentication, and thus could be in-progress for much longer than the default D-Bus timeout, which is pretty short. --- libnm-glib/nm-remote-connection.c | 4 +++- libnm-glib/nm-remote-settings-system.c | 3 ++- libnm-glib/nm-remote-settings.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 64956471be..5d104d0680 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2009 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -324,12 +324,14 @@ constructor (GType type, nm_connection_get_path (NM_CONNECTION (object)), NM_DBUS_IFACE_SETTINGS_CONNECTION); g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); priv->secrets_proxy = dbus_g_proxy_new_for_name (priv->bus, service, nm_connection_get_path (NM_CONNECTION (object)), NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS); g_assert (priv->secrets_proxy); + dbus_g_proxy_set_default_timeout (priv->secrets_proxy, G_MAXINT); dbus_g_proxy_add_signal (priv->proxy, "Updated", DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (priv->proxy, "Updated", G_CALLBACK (updated_cb), object, NULL); diff --git a/libnm-glib/nm-remote-settings-system.c b/libnm-glib/nm-remote-settings-system.c index 4e30fda800..95098c7e60 100644 --- a/libnm-glib/nm-remote-settings-system.c +++ b/libnm-glib/nm-remote-settings-system.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -280,6 +280,7 @@ constructor (GType type, NM_DBUS_PATH_SETTINGS, NM_DBUS_IFACE_SETTINGS_SYSTEM); g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 55ae0f3a14..92814a15ce 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. */ #include @@ -414,6 +414,7 @@ constructor (GType type, NM_DBUS_PATH_SETTINGS, NM_DBUS_IFACE_SETTINGS); g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); dbus_g_proxy_add_signal (priv->proxy, "NewConnection", DBUS_TYPE_G_OBJECT_PATH, From f53a2aeac9e4eaa46f433f22acff516accf35867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 26 Apr 2010 11:05:36 +0200 Subject: [PATCH 297/392] cli: use the same version string as NetworkManager daemon --- cli/src/nmcli.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index 110030644e..328a6d8ee5 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -45,7 +45,11 @@ #include "devices.h" #include "network-manager.h" -#define NMCLI_VERSION "0.2" +#if defined(NM_DIST_VERSION) +# define NMCLI_VERSION NM_DIST_VERSION +#else +# define NMCLI_VERSION VERSION +#endif typedef struct { From d1f63c62f098c906d64d325f5ce01f71a57f99b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 26 Apr 2010 17:32:18 +0200 Subject: [PATCH 298/392] cli: align UTF-8 strings properly Not all utf-8 characters occupy 1 screen column. Some may be 2-column wide, some are unprintable - zero columns. --- cli/src/utils.c | 28 +++++++++++++++++++++++----- cli/src/utils.h | 1 + 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/cli/src/utils.c b/cli/src/utils.c index 087a984850..0096a0aed2 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -74,6 +74,24 @@ ssid_to_printable (const char *str, gsize len) return printable_str; } +/* + * Find out how many columns an UTF-8 string occupies on the screen + */ +int +nmc_string_screen_width (const char *start, const char *end) +{ + int width = 0; + + if (end == NULL) + end = start + strlen (start); + + while (start < end) { + width += g_unichar_iswide (g_utf8_get_char (start)) ? 2 : g_unichar_iszerowidth (g_utf8_get_char (start)) ? 0 : 1; + start = g_utf8_next_char (start); + } + return width; +} + /* * Parse comma separated fields in 'fields_str' according to 'fields_array'. * IN: 'field_str': comma-separated fields names @@ -174,12 +192,12 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) enum { ML_HEADER_WIDTH = 79 }; if (main_header && pretty) { /* Print the main header */ - int header_width = g_utf8_strlen (fields.header_name, -1) + 4; + int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4; table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width; line = g_strnfill (ML_HEADER_WIDTH, '='); width1 = strlen (fields.header_name); - width2 = g_utf8_strlen (fields.header_name, -1); + width2 = nmc_string_screen_width (fields.header_name, NULL); printf ("%s\n", line); printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); printf ("%s\n", line); @@ -232,7 +250,7 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) g_string_append_c (str, ':'); /* Column separator */ } else { width1 = strlen (value); - width2 = g_utf8_strlen (value, -1); /* Width of the string (in screen colums) */ + width2 = nmc_string_screen_width (value, NULL); /* Width of the string (in screen colums) */ if (strlen (value) == 0) value = "--"; g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, value); @@ -243,12 +261,12 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) /* Print the main table header */ if (main_header && pretty) { - int header_width = g_utf8_strlen (fields.header_name, -1) + 4; + int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4; table_width = table_width < header_width ? header_width : table_width; line = g_strnfill (table_width, '='); width1 = strlen (fields.header_name); - width2 = g_utf8_strlen (fields.header_name, -1); + width2 = nmc_string_screen_width (fields.header_name, NULL); printf ("%s\n", line); printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); printf ("%s\n", line); diff --git a/cli/src/utils.h b/cli/src/utils.h index e12dae85d9..308f6401b5 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -28,6 +28,7 @@ int matches (const char *cmd, const char *pattern); int next_arg (int *argc, char ***argv); char *ssid_to_printable (const char *str, gsize len); +int nmc_string_screen_width (const char *start, const char *end); GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error); void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); From 08c33651c7bff1b4635fe5f0170b8eca3a522800 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 13:51:19 -0700 Subject: [PATCH 299/392] test: needs -ldl too for logger code --- src/tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 39a994c39b..62612a0e15 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -35,6 +35,7 @@ test_policy_hosts_CPPFLAGS = \ $(GLIB_CFLAGS) test_policy_hosts_LDADD = \ + -ldl \ $(top_builddir)/src/libtest-policy-hosts.la \ $(GLIB_LIBS) From 11a6225aac73d87ab4f4f0102fb0177893608494 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 14:06:58 -0700 Subject: [PATCH 300/392] ip6: correctly handle routes with no gateways For these we don't need to set any gateway at all, and the kernel assumes that it's a default route without a next hop. --- src/nm-system.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index ccb0a47a19..20d06b83ad 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -460,7 +460,7 @@ nm_system_device_set_ip6_route (const char *iface, g_return_val_if_fail (route != NULL, NULL); /* Destination */ - dest_addr = nl_addr_build (AF_INET6, (struct in6_addr *)ip6_dest, sizeof (*ip6_dest)); + dest_addr = nl_addr_build (AF_INET6, (struct in6_addr *) ip6_dest, sizeof (*ip6_dest)); g_return_val_if_fail (dest_addr != NULL, NULL); nl_addr_set_prefixlen (dest_addr, (int) ip6_prefix); @@ -469,7 +469,7 @@ nm_system_device_set_ip6_route (const char *iface, /* Gateway */ if (ip6_gateway && !IN6_IS_ADDR_UNSPECIFIED (ip6_gateway)) { - gw_addr = nl_addr_build (AF_INET6, (struct in6_addr *)ip6_gateway, sizeof (*ip6_gateway)); + gw_addr = nl_addr_build (AF_INET6, (struct in6_addr *) ip6_gateway, sizeof (*ip6_gateway)); if (gw_addr) { rtnl_route_set_gateway (route, gw_addr); rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); @@ -993,9 +993,7 @@ replace_default_ip6_route (const char *iface, const struct in6_addr *gw) { struct rtnl_route *route = NULL; struct nl_handle *nlh; - struct nl_addr *dst_addr = NULL; struct nl_addr *gw_addr = NULL; - struct in6_addr dst; int iface_idx, err = -1; g_return_val_if_fail (iface != NULL, -ENODEV); @@ -1015,31 +1013,28 @@ replace_default_ip6_route (const char *iface, const struct in6_addr *gw) rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); rtnl_route_set_oif (route, iface_idx); - /* Build up the destination address */ - memset (&dst, 0, sizeof (dst)); - dst_addr = nl_addr_build (AF_INET6, &dst, sizeof (dst)); - if (!dst_addr) { - err = -ENOMEM; - goto out; + if (gw && !IN6_IS_ADDR_UNSPECIFIED (gw)) { + /* Build up the gateway address */ + gw_addr = nl_addr_build (AF_INET6, (void *) gw, sizeof (*gw)); + if (!gw_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (gw_addr, -1); + rtnl_route_set_gateway (route, gw_addr); } - nl_addr_set_prefixlen (dst_addr, 0); - rtnl_route_set_dst (route, dst_addr); - - /* Build up the gateway address */ - gw_addr = nl_addr_build (AF_INET6, (void *) gw, sizeof (*gw)); - if (!gw_addr) { - err = -ENOMEM; - goto out; - } - nl_addr_set_prefixlen (gw_addr, 0); - rtnl_route_set_gateway (route, gw_addr); /* Add the new default route */ err = rtnl_route_add (nlh, route, NLM_F_REPLACE); + if (err == -EEXIST) { + /* FIXME: even though we use NLM_F_REPLACE the kernel won't replace + * the route if it's the same. Should try to remove it first, then + * add the new one again here. + */ + err = 0; + } out: - if (dst_addr) - nl_addr_put (dst_addr); if (gw_addr) nl_addr_put (gw_addr); rtnl_route_put (route); From de1a4dcc4b74885cf8f136f00eb30b06f0836646 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 14:08:10 -0700 Subject: [PATCH 301/392] ip6: fix autoconf address and route scraping Two things: 1) we need to bounce IPv6 on the interface because otherwise the kernel won't start listening for new RAs. So code gets added to handle the 'disable_ipv6' /proc/sys/net/ipv6 parameter for each interface. 2) Second, we need to grab a default route (if we find one) before reading addresses, so that we can add it to each address that we get out of the kernel. Most of the time we'll get an -EEXIST error when adding address, but that's OK since we're just trying to add the same route back that the kernel already added from the RA. We also need to make sure the route and address caches are up-to-date otherwise we won't get a complete picture of the routing table. --- src/ip6-manager/nm-ip6-manager.c | 172 +++++++++++++++++++++---------- 1 file changed, 115 insertions(+), 57 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 7767870186..6bf928c1a8 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -30,6 +30,7 @@ #include "NetworkManagerUtils.h" #include "nm-marshal.h" #include "nm-logging.h" +#include "nm-system.h" /* Pre-DHCP addrconf timeout, in seconds */ #define NM_IP6_TIMEOUT 10 @@ -72,6 +73,10 @@ typedef struct { gboolean accept_ra_save_valid; guint32 accept_ra_save; + char *disable_ip6_path; + gboolean disable_ip6_save_valid; + guint32 disable_ip6_save; + guint finish_addrconf_id; guint config_changed_id; @@ -192,6 +197,12 @@ nm_ip6_device_destroy (NMIP6Device *device) device->accept_ra_save ? "1\n" : "0\n"); } + /* reset the saved IPv6 value */ + if (device->disable_ip6_save_valid) { + nm_utils_do_sysctl (device->disable_ip6_path, + device->disable_ip6_save ? "1\n" : "0\n"); + } + if (device->finish_addrconf_id) g_source_remove (device->finish_addrconf_id); if (device->config_changed_id) @@ -699,13 +710,38 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us nm_ip6_device_sync_from_netlink (device, config_changed); } +static gboolean +get_proc_sys_net_value (const char *path, const char *iface, guint32 *out_value) +{ + GError *error; + char *contents = NULL; + gboolean success = FALSE; + long int tmp; + + if (!g_file_get_contents (path, &contents, NULL, &error)) { + nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", + iface, path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + errno = 0; + tmp = strtol (contents, NULL, 10); + if ((errno == 0) && (tmp == 0 || tmp == 1)) { + *out_value = (guint32) tmp; + success = TRUE; + } + g_free (contents); + } + + return success; +} + static NMIP6Device * nm_ip6_device_new (NMIP6Manager *manager, int ifindex) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); NMIP6Device *device; - GError *error = NULL; - char *contents = NULL; g_return_val_if_fail (ifindex > 0, NULL); @@ -724,15 +760,6 @@ nm_ip6_device_new (NMIP6Manager *manager, int ifindex) goto error; } - device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", - device->iface); - if (!device->accept_ra_path) { - nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 addrconf object " - "property 'accept_ra_path'.", - device->iface); - goto error; - } - device->manager = manager; device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); @@ -742,23 +769,20 @@ nm_ip6_device_new (NMIP6Manager *manager, int ifindex) /* Grab the original value of "accept_ra" so we can restore it when the * device is taken down. */ - if (!g_file_get_contents (device->accept_ra_path, &contents, NULL, &error)) { - nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", - device->iface, device->accept_ra_path, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - g_clear_error (&error); - } else { - long int tmp; + device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", + device->iface); + g_assert (device->accept_ra_path); + device->accept_ra_save_valid = get_proc_sys_net_value (device->accept_ra_path, + device->iface, + &device->accept_ra_save); - errno = 0; - tmp = strtol (contents, NULL, 10); - if ((errno == 0) && (tmp == 0 || tmp == 1)) { - device->accept_ra_save = (guint32) tmp; - device->accept_ra_save_valid = TRUE; - } - g_free (contents); - } + /* and the original value of IPv6 enable/disable */ + device->disable_ip6_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/disable_ipv6", + device->iface); + g_assert (device->disable_ip6_path); + device->disable_ip6_save_valid = get_proc_sys_net_value (device->disable_ip6_path, + device->iface, + &device->disable_ip6_save); return device; @@ -782,25 +806,25 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, priv = NM_IP6_MANAGER_GET_PRIVATE (manager); device = nm_ip6_device_new (manager, ifindex); + g_return_if_fail (device != NULL); + g_return_if_fail ( strchr (device->iface, '/') == NULL + && strcmp (device->iface, "all") != 0 + && strcmp (device->iface, "default") != 0); if (s_ip6) method = nm_setting_ip6_config_get_method (s_ip6); if (!method) method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + /* Establish target state and turn router advertisement acceptance on or off */ if ( !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) - || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) + || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { device->target_state = NM_IP6_DEVICE_GOT_LINK_LOCAL; - else + nm_utils_do_sysctl (device->accept_ra_path, "0\n"); + } else { device->target_state = NM_IP6_DEVICE_GOT_ADDRESS; - - g_return_if_fail ( strchr (device->iface, '/') == NULL - && strcmp (device->iface, "all") != 0 - && strcmp (device->iface, "default") != 0); - - /* Turn router advertisement acceptance on or off... */ - nm_utils_do_sysctl (device->accept_ra_path, - device->target_state >= NM_IP6_DEVICE_GOT_ADDRESS ? "1\n" : "0\n"); + nm_utils_do_sysctl (device->accept_ra_path, "1\n"); + } } static gboolean @@ -838,6 +862,15 @@ nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex) info, (GDestroyNotify) g_free); + /* Bounce IPv6 on the interface to ensure the kernel will start looking for + * new RAs; there doesn't seem to be a better way to do this right now. + */ + if (device->target_state >= NM_IP6_DEVICE_GOT_ADDRESS) { + nm_utils_do_sysctl (device->disable_ip6_path, "1\n"); + g_usleep (200); + nm_utils_do_sysctl (device->disable_ip6_path, "0\n"); + } + device->ip6flags_poll_id = g_timeout_add_seconds (1, poll_ip6_flags, priv->monitor); /* Kick off the initial IPv6 flags request */ @@ -860,6 +893,12 @@ nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, int ifindex) GINT_TO_POINTER (ifindex)); } +#define FIRST_ROUTE(m) ((struct rtnl_route *) nl_cache_get_first (m)) +#define NEXT_ROUTE(m) ((struct rtnl_route *) nl_cache_get_next ((struct nl_object *) m)) + +#define FIRST_ADDR(m) ((struct rtnl_addr *) nl_cache_get_first (m)) +#define NEXT_ADDR(m) ((struct rtnl_addr *) nl_cache_get_next ((struct nl_object *) m)) + NMIP6Config * nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) { @@ -873,6 +912,8 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) struct rtnl_route *rtnlroute; struct nl_addr *nldest, *nlgateway; struct in6_addr *dest, *gateway; + gboolean defgw_set = FALSE; + struct in6_addr defgw; uint32_t metric; NMIP6Route *ip6route; int i; @@ -896,30 +937,20 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) return NULL; } - /* Add addresses */ - for (rtnladdr = (struct rtnl_addr *)nl_cache_get_first (priv->addr_cache); - rtnladdr; - rtnladdr = (struct rtnl_addr *)nl_cache_get_next ((struct nl_object *)rtnladdr)) { - if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) - continue; - - nladdr = rtnl_addr_get_local (rtnladdr); - if (!nladdr || nl_addr_get_family (nladdr) != AF_INET6) - continue; - - addr = nl_addr_get_binary_addr (nladdr); - ip6addr = nm_ip6_address_new (); - nm_ip6_address_set_prefix (ip6addr, rtnl_addr_get_prefixlen (rtnladdr)); - nm_ip6_address_set_address (ip6addr, addr); - nm_ip6_config_take_address (config, ip6addr); - } + /* Make sure we refill the route and address caches, otherwise we won't get + * up-to-date information here since the netlink route/addr change messages + * may be lagging a bit. + */ + nl_cache_refill (priv->nlh, priv->route_cache); + nl_cache_refill (priv->nlh, priv->addr_cache); /* Add routes */ - for (rtnlroute = (struct rtnl_route *)nl_cache_get_first (priv->route_cache); - rtnlroute; - rtnlroute = (struct rtnl_route *)nl_cache_get_next ((struct nl_object *)rtnlroute)) { + for (rtnlroute = FIRST_ROUTE (priv->route_cache); rtnlroute; rtnlroute = NEXT_ROUTE (rtnlroute)) { + /* Make sure it's an IPv6 route for this device */ if (rtnl_route_get_oif (rtnlroute) != device->ifindex) continue; + if (rtnl_route_get_family (rtnlroute) != AF_INET6) + continue; nldest = rtnl_route_get_dst (rtnlroute); if (!nldest || nl_addr_get_family (nldest) != AF_INET6) @@ -931,6 +962,15 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) continue; gateway = nl_addr_get_binary_addr (nlgateway); + if (rtnl_route_get_dst_len (rtnlroute) == 0) { + /* Default gateway route; don't add to normal routes but to each address */ + if (!defgw_set) { + memcpy (&defgw, gateway, sizeof (defgw)); + defgw_set = TRUE; + } + continue; + } + ip6route = nm_ip6_route_new (); nm_ip6_route_set_dest (ip6route, dest); nm_ip6_route_set_prefix (ip6route, rtnl_route_get_dst_len (rtnlroute)); @@ -941,6 +981,24 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) nm_ip6_config_take_route (config, ip6route); } + /* Add addresses */ + for (rtnladdr = FIRST_ADDR (priv->addr_cache); rtnladdr; rtnladdr = NEXT_ADDR (rtnladdr)) { + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) + continue; + + nladdr = rtnl_addr_get_local (rtnladdr); + if (!nladdr || nl_addr_get_family (nladdr) != AF_INET6) + continue; + + addr = nl_addr_get_binary_addr (nladdr); + ip6addr = nm_ip6_address_new (); + nm_ip6_address_set_prefix (ip6addr, rtnl_addr_get_prefixlen (rtnladdr)); + nm_ip6_address_set_address (ip6addr, addr); + nm_ip6_config_take_address (config, ip6addr); + if (defgw_set) + nm_ip6_address_set_gateway (ip6addr, &defgw); + } + /* Add DNS servers */ if (device->rdnss_servers) { NMIP6RDNSS *rdnss = (NMIP6RDNSS *)(device->rdnss_servers->data); From b127f4aa98d722a5c48272b7a5d1ba8c9e847db9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 15:04:01 -0700 Subject: [PATCH 302/392] ip6: move class boilerplate/setup to the bottom --- src/ip6-manager/nm-ip6-manager.c | 377 ++++++++++++++++--------------- 1 file changed, 190 insertions(+), 187 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 6bf928c1a8..4ea9538d5b 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -51,6 +51,16 @@ typedef struct { #define NM_IP6_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_MANAGER, NMIP6ManagerPrivate)) +G_DEFINE_TYPE (NMIP6Manager, nm_ip6_manager, G_TYPE_OBJECT) + +enum { + ADDRCONF_COMPLETE, + CONFIG_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + typedef enum { NM_IP6_DEVICE_UNCONFIGURED, NM_IP6_DEVICE_GOT_LINK_LOCAL, @@ -64,6 +74,8 @@ typedef struct { time_t expires; } NMIP6RDNSS; +/******************************************************************/ + typedef struct { NMIP6Manager *manager; char *iface; @@ -92,100 +104,6 @@ typedef struct { guint32 ra_flags; } NMIP6Device; -G_DEFINE_TYPE (NMIP6Manager, nm_ip6_manager, G_TYPE_OBJECT) - -enum { - ADDRCONF_COMPLETE, - CONFIG_CHANGED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -static NMIP6Manager *nm_ip6_manager_new (void); - -static void netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer user_data); - -static void nm_ip6_device_destroy (NMIP6Device *device); - -NMIP6Manager * -nm_ip6_manager_get (void) -{ - static NMIP6Manager *singleton = NULL; - - if (!singleton) - singleton = nm_ip6_manager_new (); - g_assert (singleton); - - return g_object_ref (singleton); -} - -static void -nm_ip6_manager_init (NMIP6Manager *manager) -{ - NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - - priv->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, - NULL, - (GDestroyNotify) nm_ip6_device_destroy); - - priv->monitor = nm_netlink_monitor_get (); - nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_IFADDR, NULL); - nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_PREFIX, NULL); - nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_ND_USEROPT, NULL); - nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_LINK, NULL); - - g_signal_connect (priv->monitor, "notification", - G_CALLBACK (netlink_notification), manager); - - priv->nlh = nm_netlink_get_default_handle (); - priv->addr_cache = rtnl_addr_alloc_cache (priv->nlh); - priv->route_cache = rtnl_route_alloc_cache (priv->nlh); -} - -static void -finalize (GObject *object) -{ - NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); - - g_hash_table_destroy (priv->devices); - g_object_unref (priv->monitor); - nl_cache_free (priv->addr_cache); - nl_cache_free (priv->route_cache); - - G_OBJECT_CLASS (nm_ip6_manager_parent_class)->finalize (object); -} - -static void -nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (manager_class); - - g_type_class_add_private (manager_class, sizeof (NMIP6ManagerPrivate)); - - /* virtual methods */ - object_class->finalize = finalize; - - /* signals */ - signals[ADDRCONF_COMPLETE] = - g_signal_new ("addrconf-complete", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMIP6ManagerClass, addrconf_complete), - NULL, NULL, - _nm_marshal_VOID__INT_UINT_BOOLEAN, - G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); - - signals[CONFIG_CHANGED] = - g_signal_new ("config-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), - NULL, NULL, - _nm_marshal_VOID__INT_UINT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); -} - static void nm_ip6_device_destroy (NMIP6Device *device) { @@ -219,22 +137,85 @@ nm_ip6_device_destroy (NMIP6Device *device) g_slice_free (NMIP6Device, device); } -static NMIP6Manager * -nm_ip6_manager_new (void) +static gboolean +get_proc_sys_net_value (const char *path, const char *iface, guint32 *out_value) { - NMIP6Manager *manager; - NMIP6ManagerPrivate *priv; + GError *error; + char *contents = NULL; + gboolean success = FALSE; + long int tmp; - manager = g_object_new (NM_TYPE_IP6_MANAGER, NULL); - priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - - if (!priv->devices) { - nm_log_err (LOGD_IP6, "not enough memory to initialize IP6 manager tables"); - g_object_unref (manager); - manager = NULL; + if (!g_file_get_contents (path, &contents, NULL, &error)) { + nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", + iface, path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + errno = 0; + tmp = strtol (contents, NULL, 10); + if ((errno == 0) && (tmp == 0 || tmp == 1)) { + *out_value = (guint32) tmp; + success = TRUE; + } + g_free (contents); } - return manager; + return success; +} + +static NMIP6Device * +nm_ip6_device_new (NMIP6Manager *manager, int ifindex) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + NMIP6Device *device; + + g_return_val_if_fail (ifindex > 0, NULL); + + device = g_slice_new0 (NMIP6Device); + if (!device) { + nm_log_err (LOGD_IP6, "(%d): out of memory creating IP6 addrconf object.", + ifindex); + return NULL; + } + + device->ifindex = ifindex; + device->iface = g_strdup (nm_netlink_index_to_iface (ifindex)); + if (!device->iface) { + nm_log_err (LOGD_IP6, "(%d): could not find interface name from index.", + ifindex); + goto error; + } + + device->manager = manager; + + device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); + + g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); + + /* Grab the original value of "accept_ra" so we can restore it when the + * device is taken down. + */ + device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", + device->iface); + g_assert (device->accept_ra_path); + device->accept_ra_save_valid = get_proc_sys_net_value (device->accept_ra_path, + device->iface, + &device->accept_ra_save); + + /* and the original value of IPv6 enable/disable */ + device->disable_ip6_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/disable_ipv6", + device->iface); + g_assert (device->disable_ip6_path); + device->disable_ip6_save_valid = get_proc_sys_net_value (device->disable_ip6_path, + device->iface, + &device->disable_ip6_save); + + return device; + +error: + nm_ip6_device_destroy (device); + return NULL; } static NMIP6Device * @@ -245,6 +226,8 @@ nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) return g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); } +/******************************************************************/ + typedef struct { NMIP6Device *device; guint dhcp_opts; @@ -710,87 +693,6 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us nm_ip6_device_sync_from_netlink (device, config_changed); } -static gboolean -get_proc_sys_net_value (const char *path, const char *iface, guint32 *out_value) -{ - GError *error; - char *contents = NULL; - gboolean success = FALSE; - long int tmp; - - if (!g_file_get_contents (path, &contents, NULL, &error)) { - nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", - iface, path, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - g_clear_error (&error); - } else { - errno = 0; - tmp = strtol (contents, NULL, 10); - if ((errno == 0) && (tmp == 0 || tmp == 1)) { - *out_value = (guint32) tmp; - success = TRUE; - } - g_free (contents); - } - - return success; -} - -static NMIP6Device * -nm_ip6_device_new (NMIP6Manager *manager, int ifindex) -{ - NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - NMIP6Device *device; - - g_return_val_if_fail (ifindex > 0, NULL); - - device = g_slice_new0 (NMIP6Device); - if (!device) { - nm_log_err (LOGD_IP6, "(%d): out of memory creating IP6 addrconf object.", - ifindex); - return NULL; - } - - device->ifindex = ifindex; - device->iface = g_strdup (nm_netlink_index_to_iface (ifindex)); - if (!device->iface) { - nm_log_err (LOGD_IP6, "(%d): could not find interface name from index.", - ifindex); - goto error; - } - - device->manager = manager; - - device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); - - g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); - - /* Grab the original value of "accept_ra" so we can restore it when the - * device is taken down. - */ - device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", - device->iface); - g_assert (device->accept_ra_path); - device->accept_ra_save_valid = get_proc_sys_net_value (device->accept_ra_path, - device->iface, - &device->accept_ra_save); - - /* and the original value of IPv6 enable/disable */ - device->disable_ip6_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/disable_ipv6", - device->iface); - g_assert (device->disable_ip6_path); - device->disable_ip6_save_valid = get_proc_sys_net_value (device->disable_ip6_path, - device->iface, - &device->disable_ip6_save); - - return device; - -error: - nm_ip6_device_destroy (device); - return NULL; -} - void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, int ifindex, @@ -1009,3 +911,104 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) return config; } + +/******************************************************************/ + +static NMIP6Manager * +nm_ip6_manager_new (void) +{ + NMIP6Manager *manager; + NMIP6ManagerPrivate *priv; + + manager = g_object_new (NM_TYPE_IP6_MANAGER, NULL); + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + if (!priv->devices) { + nm_log_err (LOGD_IP6, "not enough memory to initialize IP6 manager tables"); + g_object_unref (manager); + manager = NULL; + } + + return manager; +} + +NMIP6Manager * +nm_ip6_manager_get (void) +{ + static NMIP6Manager *singleton = NULL; + + if (!singleton) { + singleton = nm_ip6_manager_new (); + g_assert (singleton); + } else + g_object_ref (singleton); + + return singleton; +} + +static void +nm_ip6_manager_init (NMIP6Manager *manager) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + priv->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, + (GDestroyNotify) nm_ip6_device_destroy); + + priv->monitor = nm_netlink_monitor_get (); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_IFADDR, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_PREFIX, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_ND_USEROPT, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_LINK, NULL); + + g_signal_connect (priv->monitor, "notification", + G_CALLBACK (netlink_notification), manager); + + priv->nlh = nm_netlink_get_default_handle (); + priv->addr_cache = rtnl_addr_alloc_cache (priv->nlh); + priv->route_cache = rtnl_route_alloc_cache (priv->nlh); +} + +static void +finalize (GObject *object) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); + + g_hash_table_destroy (priv->devices); + g_object_unref (priv->monitor); + nl_cache_free (priv->addr_cache); + nl_cache_free (priv->route_cache); + + G_OBJECT_CLASS (nm_ip6_manager_parent_class)->finalize (object); +} + +static void +nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMIP6ManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + + /* signals */ + signals[ADDRCONF_COMPLETE] = + g_signal_new ("addrconf-complete", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMIP6ManagerClass, addrconf_complete), + NULL, NULL, + _nm_marshal_VOID__INT_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); + + signals[CONFIG_CHANGED] = + g_signal_new ("config-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), + NULL, NULL, + _nm_marshal_VOID__INT_UINT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); +} + From 5331c22adf3335cfd57ddb017fadb0556d37d9bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 16:09:25 -0700 Subject: [PATCH 303/392] dns: filter duplicates while constructing resolv.conf --- src/named-manager/nm-named-manager.c | 44 ++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 2963652f06..0e3310112d 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -97,6 +97,26 @@ typedef struct { GPtrArray *searches; } NMResolvConfData; +static void +add_string_item (GPtrArray *array, const char *str) +{ + int i; + + g_return_if_fail (array != NULL); + g_return_if_fail (str != NULL); + + /* Check for dupes before adding */ + for (i = 0; i < array->len; i++) { + const char *candidate = g_ptr_array_index (array, i); + + if (candidate && !strcmp (candidate, str)) + return; + } + + /* No dupes, add the new item */ + g_ptr_array_add (array, g_strdup (str)); +} + static void merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) { @@ -109,19 +129,22 @@ merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) addr.s_addr = nm_ip4_config_get_nameserver (src, i); if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) - g_ptr_array_add (rc->nameservers, g_strdup (buf)); + add_string_item (rc->nameservers, buf); } num = nm_ip4_config_get_num_domains (src); for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip4_config_get_domain (src, i); if (!rc->domain) - rc->domain = nm_ip4_config_get_domain (src, i); - g_ptr_array_add (rc->searches, g_strdup (nm_ip4_config_get_domain (src, i))); + rc->domain = domain; + add_string_item (rc->searches, domain); } num = nm_ip4_config_get_num_searches (src); for (i = 0; i < num; i++) - g_ptr_array_add (rc->searches, g_strdup (nm_ip4_config_get_search (src, i))); + add_string_item (rc->searches, nm_ip4_config_get_search (src, i)); } static void @@ -139,23 +162,26 @@ merge_one_ip6_config (NMResolvConfData *rc, NMIP6Config *src) /* inet_ntop is probably supposed to do this for us, but it doesn't */ if (IN6_IS_ADDR_V4MAPPED (addr)) { if (inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, INET_ADDRSTRLEN) > 0) - g_ptr_array_add (rc->nameservers, g_strdup (buf)); + add_string_item (rc->nameservers, buf); } else { if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) - g_ptr_array_add (rc->nameservers, g_strdup (buf)); + add_string_item (rc->nameservers, buf); } } num = nm_ip6_config_get_num_domains (src); for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip6_config_get_domain (src, i); if (!rc->domain) - rc->domain = nm_ip6_config_get_domain (src, i); - g_ptr_array_add (rc->searches, g_strdup (nm_ip6_config_get_domain (src, i))); + rc->domain = domain; + add_string_item (rc->searches, domain); } num = nm_ip6_config_get_num_searches (src); for (i = 0; i < num; i++) - g_ptr_array_add (rc->searches, g_strdup (nm_ip6_config_get_search (src, i))); + add_string_item (rc->searches, nm_ip6_config_get_search (src, i)); } From 871f9934fa0ea25906e338a74d02bb361f6490bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Apr 2010 23:56:01 -0700 Subject: [PATCH 304/392] build: default to pppd-2.4.5 plugin dir People should be using 2.4.5 now anyway, since it's been out for quite a while and includes the fixes for the bogus DNS servers. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index adfe67fe9b..5918c26728 100644 --- a/configure.ac +++ b/configure.ac @@ -296,7 +296,7 @@ AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [pat if test -n "$with_pppd_plugin_dir" ; then PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" else - PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4" + PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5" fi AC_SUBST(PPPD_PLUGIN_DIR) From ea1e6f2f7b5d491085ca94df9830ad94b23cc8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 27 Apr 2010 15:59:46 +0200 Subject: [PATCH 305/392] ip6: fix a crash when /proc/sys/net/ipv6/conf//* files are not present --- src/ip6-manager/nm-ip6-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 4ea9538d5b..d5afcbc048 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -140,7 +140,7 @@ nm_ip6_device_destroy (NMIP6Device *device) static gboolean get_proc_sys_net_value (const char *path, const char *iface, guint32 *out_value) { - GError *error; + GError *error = NULL; char *contents = NULL; gboolean success = FALSE; long int tmp; From 17e0749c76a388fd84527bea47eb5c3310ef602a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Apr 2010 17:08:06 -0700 Subject: [PATCH 306/392] ip6: disconnect netlink signal handler on dispose --- src/ip6-manager/nm-ip6-manager.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index d5afcbc048..90a3041a20 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -47,6 +47,8 @@ typedef struct { struct nl_handle *nlh; struct nl_cache *addr_cache, *route_cache; + + guint netlink_id; } NMIP6ManagerPrivate; #define NM_IP6_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_MANAGER, NMIP6ManagerPrivate)) @@ -221,8 +223,12 @@ error: static NMIP6Device * nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) { - NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + NMIP6ManagerPrivate *priv; + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL); + + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); return g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); } @@ -443,6 +449,8 @@ process_addr (NMIP6Manager *manager, struct nl_msg *msg) return NULL; device = nm_ip6_manager_get_device (manager, rtnl_addr_get_ifindex (rtnladdr)); + if (!device) + return NULL; old_size = nl_cache_nitems (priv->addr_cache); nl_cache_include (priv->addr_cache, (struct nl_object *)rtnladdr, NULL); @@ -472,6 +480,8 @@ process_route (NMIP6Manager *manager, struct nl_msg *msg) return NULL; device = nm_ip6_manager_get_device (manager, rtnl_route_get_oif (rtnlroute)); + if (!device) + return NULL; old_size = nl_cache_nitems (priv->route_cache); nl_cache_include (priv->route_cache, (struct nl_object *)rtnlroute, NULL); @@ -961,8 +971,8 @@ nm_ip6_manager_init (NMIP6Manager *manager) nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_ND_USEROPT, NULL); nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_LINK, NULL); - g_signal_connect (priv->monitor, "notification", - G_CALLBACK (netlink_notification), manager); + priv->netlink_id = g_signal_connect (priv->monitor, "notification", + G_CALLBACK (netlink_notification), manager); priv->nlh = nm_netlink_get_default_handle (); priv->addr_cache = rtnl_addr_alloc_cache (priv->nlh); @@ -974,6 +984,8 @@ finalize (GObject *object) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); + g_signal_handler_disconnect (priv->monitor, priv->netlink_id); + g_hash_table_destroy (priv->devices); g_object_unref (priv->monitor); nl_cache_free (priv->addr_cache); From 257b4b34dabecca8bb4810a4c9b845c36e2542ea Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 28 Apr 2010 18:39:42 -0700 Subject: [PATCH 307/392] examples: add example for listing connections --- examples/python/Makefile.am | 5 +- examples/python/list-connections.py | 112 ++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 examples/python/list-connections.py diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am index a64727a7fd..fd654cb508 100644 --- a/examples/python/Makefile.am +++ b/examples/python/Makefile.am @@ -1,4 +1,7 @@ EXTRA_DIST = \ nm-state.py \ - add-system-connection.py + add-system-connection.py \ + vpn.py \ + list-connections.py + diff --git a/examples/python/list-connections.py b/examples/python/list-connections.py new file mode 100644 index 0000000000..ad8d9047c4 --- /dev/null +++ b/examples/python/list-connections.py @@ -0,0 +1,112 @@ +#!/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 Red Hat, Inc. +# + +import dbus + +# This example asks both the system settings service and the user settings +# service for all configured connections. It also asks for secrets, demonstrating +# the mechanisms each settings service uses to prevent unauthorized access to +# a user's network passwords + +bus = dbus.SystemBus() + +def merge_secrets(proxy, config, setting_name): + try: + # returns a dict of dicts mapping name::setting, where setting is a dict + # mapping key::value. Each member of the 'setting' dict is a secret + secrets = proxy.GetSecrets(setting_name, [], False) + + # Copy the secrets into our connection config + for setting in secrets: + for key in secrets[setting]: + config[setting_name][key] = setting[key] + except Exception, e: + pass + +def dict_to_string(d, indent): + # Try to trivially translate a dictionary's elements into nice string + # formatting. + dstr = "" + for key in d: + val = d[key] + str_val = "" + add_string = True + if type(val) == type(dbus.Array([])): + for elt in val: + if type(elt) == type(dbus.Byte(1)): + str_val += "%s " % int(elt) + elif type(elt) == type(dbus.String("")): + str_val += "%s" % elt + elif type(val) == type(dbus.Dictionary({})): + dstr += dict_to_string(val, indent + " ") + add_string = False + else: + str_val = val + if add_string: + dstr += "%s%s: %s\n" % (indent, key, str_val) + return dstr + +def connection_to_string(config): + # dump a connection configuration to a the console + for setting_name in config: + print " Setting: %s" % setting_name + print dict_to_string(config[setting_name], " ") + print "" + + +def print_one_services_connections(service_name, desc): + # Ask the settings service for the list of connections it provides + proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManagerSettings") + settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings") + connection_paths = settings.ListConnections() + + print "%s connections --------------------------------------------\n" % desc + + # List each connection's name, UUID, and type + for path in connection_paths: + con_proxy = bus.get_object(service_name, path) + connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection") + config = connection.GetSettings() + + # Now get secrets too; we grab the secrets for each type of connection + # (since there isn't a "get all secrets" call because most of the time + # you only need 'wifi' secrets or '802.1x' secrets, not everything) and + # merge that into the configuration data + connection_secrets = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection.Secrets") + merge_secrets(connection_secrets, config, '802-11-wireless') + merge_secrets(connection_secrets, config, '802-11-wireless-security') + merge_secrets(connection_secrets, config, '802-1x') + merge_secrets(connection_secrets, config, 'gsm') + merge_secrets(connection_secrets, config, 'cdma') + merge_secrets(connection_secrets, config, 'ppp') + + # Get the details of the 'connection' setting + s_con = config['connection'] + print "name: %s" % s_con['id'] + print " uuid: %s" % s_con['uuid'] + print " type: %s" % s_con['type'] + print " ----------------------------" + connection_to_string(config) + + print "" + +# Print out connection information for all connections +print_one_services_connections("org.freedesktop.NetworkManagerSystemSettings", "System") +print_one_services_connections("org.freedesktop.NetworkManagerUserSettings", "User") + From e01039dcd28b6c545715a742d14c116512472011 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 29 Apr 2010 08:26:28 -0700 Subject: [PATCH 308/392] examples: add example printing out all BSSIDs we can see --- examples/python/Makefile.am | 3 +- examples/python/show-bssids.py | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 examples/python/show-bssids.py diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am index fd654cb508..179e2f3c9a 100644 --- a/examples/python/Makefile.am +++ b/examples/python/Makefile.am @@ -2,6 +2,7 @@ EXTRA_DIST = \ nm-state.py \ add-system-connection.py \ vpn.py \ - list-connections.py + list-connections.py \ + show-bssids.py diff --git a/examples/python/show-bssids.py b/examples/python/show-bssids.py new file mode 100644 index 0000000000..5d8778c731 --- /dev/null +++ b/examples/python/show-bssids.py @@ -0,0 +1,78 @@ +#!/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 Red Hat, Inc. +# + + +# This example prints out all the AP BSSIDs that all WiFi devices on the +# machine can see. Useful for location-based services like Skyhook that +# can geolocate you based on the APs you can see. + +import dbus + +bus = dbus.SystemBus() + +# Get a proxy for the base NetworkManager object +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") + +all_aps = [] + +print "Associated APs:" + +# Get all network devices +devices = manager.GetDevices() +for d in devices: + dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d) + prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Make sure the device is enabled before we try to use it + state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") + if state <= 2: + continue + + # Get device's type; we only want wifi devices + iface = prop_iface.Get("org.freedesktop.NetworkManager.Device", "Interface") + dtype = prop_iface.Get("org.freedesktop.NetworkManager.Device", "DeviceType") + if dtype == 2: # WiFi + # Get a proxy for the wifi interface + wifi_iface = dbus.Interface(dev_proxy, "org.freedesktop.NetworkManager.Device.Wireless") + wifi_prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Get the associated AP's object path + connected_path = wifi_prop_iface.Get("org.freedesktop.NetworkManager.Device.Wireless", "ActiveAccessPoint") + + # Get all APs the card can see + aps = wifi_iface.GetAccessPoints() + for path in aps: + ap_proxy = bus.get_object("org.freedesktop.NetworkManager", path) + ap_prop_iface = dbus.Interface(ap_proxy, "org.freedesktop.DBus.Properties") + bssid = ap_prop_iface.Get("org.freedesktop.NetworkManager.AccessPoint", "HwAddress") + + # Cache the BSSID + if not bssid in all_aps: + all_aps.append(bssid) + + # Print the current AP's BSSID + if path == connected_path: + print "%s (%s)" % (bssid, iface) + +# and print out all APs the wifi devices can see +print"\nFound APs:" +for bssid in all_aps: + print bssid + From 9830c60d119eb89917ce2572181110030977b99b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 29 Apr 2010 11:31:43 -0700 Subject: [PATCH 309/392] dhcp: fix superclass type of dhcpcd plugin From Mikhail Efremov --- src/dhcp-manager/nm-dhcp-dhcpcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 56b74810dc..716949324c 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -36,7 +36,7 @@ #include "nm-utils.h" #include "nm-logging.h" -G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_DHCPCD) +G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT) #define NM_DHCP_DHCPCD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdPrivate)) From 3d69429a1e6707b5837e79a1d70532e72d0d3324 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 11:18:12 -0700 Subject: [PATCH 310/392] dbus: add Debian D-Bus permission config From Michael Biebl and the debian packages. --- src/NetworkManager.conf | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf index 87814bec2a..0dea2d65af 100644 --- a/src/NetworkManager.conf +++ b/src/NetworkManager.conf @@ -57,6 +57,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 93d1d819389211df57c5f0584a05d742af59d6ad Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 11:44:56 -0700 Subject: [PATCH 311/392] Revert "dbus: add Debian D-Bus permission config" This reverts commit 3d69429a1e6707b5837e79a1d70532e72d0d3324. Apparently the 'netdev' group rules aren't as widespread anymore and Debian ships with ConsoleKit by default, and thus can use at_console. --- src/NetworkManager.conf | 45 ----------------------------------------- 1 file changed, 45 deletions(-) diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf index 0dea2d65af..87814bec2a 100644 --- a/src/NetworkManager.conf +++ b/src/NetworkManager.conf @@ -57,51 +57,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From cc0c2783b6e4a6dd0a23bffcf13addcd6f0346c6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 15:29:53 -0700 Subject: [PATCH 312/392] libnm-util: fix IPv6 address array -> string transform Only used for debugging, but it's nice to see the actual address instead of a transform error. --- libnm-util/nm-utils.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index c9c34f1ba6..5a8a8800db 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -861,10 +861,11 @@ nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValu g_string_append (printable, "{ "); elements = (GValueArray *) g_ptr_array_index (ptr_array, i++); - if ( (elements->n_values != 2) + if ( (elements->n_values != 3) || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) - || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT)) { - g_string_append (printable, "invalid"); + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY)) { + g_string_append (printable, "invalid }"); continue; } @@ -872,7 +873,7 @@ nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValu tmp = g_value_array_get_nth (elements, 0); ba_addr = g_value_get_boxed (tmp); if (ba_addr->len != 16) { - g_string_append (printable, "invalid"); + g_string_append (printable, "invalid }"); continue; } addr = (struct in6_addr *) ba_addr->data; @@ -885,7 +886,7 @@ nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValu tmp = g_value_array_get_nth (elements, 1); prefix = g_value_get_uint (tmp); if (prefix > 128) { - g_string_append (printable, "invalid"); + g_string_append (printable, "invalid }"); continue; } g_string_append_printf (printable, "px = %u", prefix); @@ -895,7 +896,7 @@ nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValu tmp = g_value_array_get_nth (elements, 2); ba_addr = g_value_get_boxed (tmp); if (ba_addr->len != 16) { - g_string_append (printable, "invalid"); + g_string_append (printable, "invalid }"); continue; } addr = (struct in6_addr *) ba_addr->data; From 7e980d8be3a5e09739c99b9c4178b8e15f799e6d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 15:49:41 -0700 Subject: [PATCH 313/392] ip6: fix manual IP config application --- src/nm-device.c | 58 ++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 9d6ee5f410..ef540204f1 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1520,7 +1520,7 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); const char *ip_iface; - NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; NMActRequest *req; NMConnection *connection; @@ -1533,7 +1533,8 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) ip_iface = nm_device_get_ip_iface (self); - if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { priv->ip6_waiting_for_config = TRUE; nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; @@ -1542,7 +1543,10 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { priv->ip6_ready = TRUE; ret = NM_ACT_STAGE_RETURN_STOP; - } + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) + ret = NM_ACT_STAGE_RETURN_SUCCESS; + + /* Other methods (shared) aren't implemented yet */ return ret; } @@ -1911,7 +1915,6 @@ real_act_stage4_get_ip6_config (NMDevice *self, NMDeviceStateReason *reason) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; NMConnection *connection; NMSettingIP6Config *s_ip6; const char *ip_iface; @@ -1931,40 +1934,45 @@ real_act_stage4_get_ip6_config (NMDevice *self, if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, nm_device_get_ip_ifindex (self)); - if (*config) { - /* Merge user-defined overrides into the IP6Config to be applied */ - nm_utils_merge_ip6_config (*config, s_ip6); - ret = NM_ACT_STAGE_RETURN_SUCCESS; - } else { + if (!*config) { *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; goto out; } + + /* Merge user-defined overrides into the IP6Config to be applied */ + nm_utils_merge_ip6_config (*config, s_ip6); + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + *config = nm_ip6_config_new (); + if (!*config) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; + } + nm_utils_merge_ip6_config (*config, s_ip6); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) g_assert (priv->dhcp6_client); /* sanity check */ /* Autoconf might have triggered DHCPv6 too */ if (priv->dhcp6_client) { *config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); - if (*config) { - /* Merge user-defined overrides into the IP4Config to be applied */ - nm_utils_merge_ip6_config (*config, s_ip6); - - nm_dhcp6_config_reset (priv->dhcp6_config); - nm_dhcp_client_foreach_option (priv->dhcp6_client, - dhcp6_add_option_cb, - priv->dhcp6_config); - - /* Notify of new DHCP4 config */ - g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); - ret = NM_ACT_STAGE_RETURN_SUCCESS; - } else { + if (!*config) { *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; + goto out; } - } else - ret = NM_ACT_STAGE_RETURN_SUCCESS; + + /* Merge user-defined overrides into the IP4Config to be applied */ + nm_utils_merge_ip6_config (*config, s_ip6); + + nm_dhcp6_config_reset (priv->dhcp6_config); + nm_dhcp_client_foreach_option (priv->dhcp6_client, + dhcp6_add_option_cb, + priv->dhcp6_config); + + /* Notify of new DHCP6 config */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + } out: - return ret; + return *config ? NM_ACT_STAGE_RETURN_SUCCESS : NM_ACT_STAGE_RETURN_FAILURE; } /* From b24f5c8da9d1ed65378e7101385ee04e52475e63 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 16:09:02 -0700 Subject: [PATCH 314/392] ip6: 'manual' method doesn't use the IP6 manager --- src/ip6-manager/nm-ip6-manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 90a3041a20..61cf5be218 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -729,8 +729,7 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; /* Establish target state and turn router advertisement acceptance on or off */ - if ( !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) - || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { device->target_state = NM_IP6_DEVICE_GOT_LINK_LOCAL; nm_utils_do_sysctl (device->accept_ra_path, "0\n"); } else { From a64600d7968a7dd48ade7879871cbdfd15286c55 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 16:09:36 -0700 Subject: [PATCH 315/392] ip6: bump the autoconf RA timeout a bit The RA interval is configurable on the router and we don't want to miss one. 20s is still a lot less than we allow for DHCP so the latency isn't that big of an issue. --- src/ip6-manager/nm-ip6-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 61cf5be218..ca532e3e93 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -33,7 +33,7 @@ #include "nm-system.h" /* Pre-DHCP addrconf timeout, in seconds */ -#define NM_IP6_TIMEOUT 10 +#define NM_IP6_TIMEOUT 20 /* FIXME? Stolen from the kernel sources */ #define IF_RA_OTHERCONF 0x80 From 7b3103b5ebfac1baf46622baa4f6febbe18f1f20 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 16:10:29 -0700 Subject: [PATCH 316/392] ip6: initialize IPv6 address config a bit later Stage 1 gets overridded by most device subclasses and it turns out they don't every chain back up to NMDevice's stage1 implementation. It's a bit complicated to make them all do that, so for now just move the IPv6 address config a bit later. --- src/nm-device.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index ef540204f1..ce47bc66f7 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -672,26 +672,19 @@ ip6_method_matches (NMConnection *connection, const char *match) return method && !strcmp (method, match); } -static void +static gboolean addrconf6_setup (NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMActRequest *req; NMConnection *connection; - const char *ip_iface; NMSettingIP6Config *s_ip6; - priv->ip6_waiting_for_config = FALSE; - priv->ip6_dhcp_opt = IP6_DHCP_OPT_NONE; - req = nm_device_get_act_request (self); g_assert (req); connection = nm_act_request_get_connection (req); g_assert (connection); - if (!ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) - return; - if (!priv->ip6_manager) { priv->ip6_manager = nm_ip6_manager_get (); priv->ip6_addrconf_sigid = g_signal_connect (priv->ip6_manager, @@ -704,11 +697,15 @@ addrconf6_setup (NMDevice *self) self); } - ip_iface = nm_device_get_ip_iface (self); + priv->ip6_dhcp_opt = IP6_DHCP_OPT_NONE; + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); nm_ip6_manager_prepare_interface (priv->ip6_manager, nm_device_get_ip_ifindex (self), s_ip6); + priv->ip6_waiting_for_config = TRUE; + + return TRUE; } static void @@ -738,7 +735,6 @@ addrconf6_cleanup (NMDevice *self) static NMActStageReturn real_act_stage1_prepare (NMDevice *self, NMDeviceStateReason *reason) { - addrconf6_setup (self); return NM_ACT_STAGE_RETURN_SUCCESS; } @@ -1535,7 +1531,10 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { - priv->ip6_waiting_for_config = TRUE; + if (!addrconf6_setup (self)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; + } nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) @@ -1548,6 +1547,7 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) /* Other methods (shared) aren't implemented yet */ +out: return ret; } @@ -1931,7 +1931,8 @@ real_act_stage4_get_ip6_config (NMDevice *self, s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, nm_device_get_ip_ifindex (self)); if (!*config) { From 8a597067128225fbb9fdc16ee9f79099e7e27d35 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 17:30:11 -0700 Subject: [PATCH 317/392] ip6: ensure manager singleton is cleared when disposed --- src/ip6-manager/nm-ip6-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index ca532e3e93..b9b5639ecf 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -941,11 +941,11 @@ nm_ip6_manager_new (void) return manager; } +static NMIP6Manager *singleton = NULL; + NMIP6Manager * nm_ip6_manager_get (void) { - static NMIP6Manager *singleton = NULL; - if (!singleton) { singleton = nm_ip6_manager_new (); g_assert (singleton); @@ -990,6 +990,8 @@ finalize (GObject *object) nl_cache_free (priv->addr_cache); nl_cache_free (priv->route_cache); + singleton = NULL; + G_OBJECT_CLASS (nm_ip6_manager_parent_class)->finalize (object); } From 2282f352a42b81d6eed88decbdc5328bc02cdc3a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 17:30:36 -0700 Subject: [PATCH 318/392] ip6: better logging of IPv6 autoconf process --- src/ip6-manager/nm-ip6-manager.c | 133 +++++++++++++++++++++++++++---- 1 file changed, 116 insertions(+), 17 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index b9b5639ecf..e9a60ee8c4 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -349,6 +349,25 @@ callback_info_new (NMIP6Device *device, guint dhcp_opts, gboolean success) return info; } +static const char * +state_to_string (NMIP6DeviceState state) +{ + switch (state) { + case NM_IP6_DEVICE_UNCONFIGURED: + return "unconfigured"; + case NM_IP6_DEVICE_GOT_LINK_LOCAL: + return "got-link-local"; + case NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT: + return "got-ra"; + case NM_IP6_DEVICE_GOT_ADDRESS: + return "got-address"; + case NM_IP6_DEVICE_TIMED_OUT: + return "timed-out"; + default: + return "unknown"; + } +} + static void nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) { @@ -359,11 +378,19 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) struct in6_addr *addr; CallbackInfo *info; guint dhcp_opts = IP6_DHCP_OPT_NONE; + gboolean found_linklocal = FALSE; + + nm_log_dbg (LOGD_IP6, "(%s): syncing with netlink (ra_flags 0x%X) (state/target '%s'/'%s')", + device->iface, device->ra_flags, + state_to_string (device->state), + state_to_string (device->target_state)); /* Look for any IPv6 addresses the kernel may have set for the device */ for (rtnladdr = (struct rtnl_addr *) nl_cache_get_first (priv->addr_cache); rtnladdr; rtnladdr = (struct rtnl_addr *) nl_cache_get_next ((struct nl_object *) rtnladdr)) { + char buf[INET6_ADDRSTRLEN]; + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) continue; @@ -372,16 +399,33 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) continue; addr = nl_addr_get_binary_addr (nladdr); + + if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) { + nm_log_dbg (LOGD_IP6, "(%s): netlink address: %s", + device->iface, buf); + } + if (IN6_IS_ADDR_LINKLOCAL (addr)) { if (device->state == NM_IP6_DEVICE_UNCONFIGURED) device->state = NM_IP6_DEVICE_GOT_LINK_LOCAL; + found_linklocal = TRUE; } else { if (device->state < NM_IP6_DEVICE_GOT_ADDRESS) device->state = NM_IP6_DEVICE_GOT_ADDRESS; } } - /* We only care about router advertisements if we want for a real IPv6 address */ + /* There might be a LL address hanging around on the interface from + * before in the initial run, but if it goes away later, make sure we + * regress from GOT_LINK_LOCAL back to UNCONFIGURED. + */ + if ((device->state == NM_IP6_DEVICE_GOT_LINK_LOCAL) && !found_linklocal) + device->state = NM_IP6_DEVICE_UNCONFIGURED; + + nm_log_dbg (LOGD_IP6, "(%s): addresses synced (state %s)", + device->iface, state_to_string (device->state)); + + /* We only care about router advertisements if we want a real IPv6 address */ if (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) { if ( (device->ra_flags & IF_RA_RCVD) && (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT)) @@ -409,6 +453,10 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) if (device->finish_addrconf_id) g_source_remove (device->finish_addrconf_id); + nm_log_dbg (LOGD_IP6, "(%s): reached target state or Managed-mode requested (state '%s') (dhcp opts 0x%X)", + device->iface, state_to_string (device->state), + dhcp_opts); + info = callback_info_new (device, dhcp_opts, TRUE); device->finish_addrconf_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, finish_addrconf, @@ -443,14 +491,20 @@ process_addr (NMIP6Manager *manager, struct nl_msg *msg) struct rtnl_addr *rtnladdr; int old_size; + nm_log_dbg (LOGD_IP6, "processing netlink new/del address message"); + rtnladdr = NULL; nl_msg_parse (msg, ref_object, &rtnladdr); - if (!rtnladdr) + if (!rtnladdr) { + nm_log_dbg (LOGD_IP6, "error processing netlink new/del address message"); return NULL; + } device = nm_ip6_manager_get_device (manager, rtnl_addr_get_ifindex (rtnladdr)); - if (!device) + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); return NULL; + } old_size = nl_cache_nitems (priv->addr_cache); nl_cache_include (priv->addr_cache, (struct nl_object *)rtnladdr, NULL); @@ -460,8 +514,10 @@ process_addr (NMIP6Manager *manager, struct nl_msg *msg) * every time it gets another router advertisement. We only want * to notify higher levels if we actually changed something. */ - if (nl_cache_nitems (priv->addr_cache) == old_size) + if (nl_cache_nitems (priv->addr_cache) == old_size) { + nm_log_dbg (LOGD_IP6, "(%s): address cache unchanged, ignoring message"); return NULL; + } return device; } @@ -474,22 +530,30 @@ process_route (NMIP6Manager *manager, struct nl_msg *msg) struct rtnl_route *rtnlroute; int old_size; + nm_log_dbg (LOGD_IP6, "processing netlink new/del route message"); + rtnlroute = NULL; nl_msg_parse (msg, ref_object, &rtnlroute); - if (!rtnlroute) + if (!rtnlroute) { + nm_log_dbg (LOGD_IP6, "error processing netlink new/del route message"); return NULL; + } device = nm_ip6_manager_get_device (manager, rtnl_route_get_oif (rtnlroute)); - if (!device) + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); return NULL; + } old_size = nl_cache_nitems (priv->route_cache); nl_cache_include (priv->route_cache, (struct nl_object *)rtnlroute, NULL); rtnl_route_put (rtnlroute); /* As above in process_addr */ - if (nl_cache_nitems (priv->route_cache) == old_size) + if (nl_cache_nitems (priv->route_cache) == old_size) { + nm_log_dbg (LOGD_IP6, "(%s): route cache unchanged, ignoring message"); return NULL; + } return device; } @@ -506,11 +570,16 @@ process_prefix (NMIP6Manager *manager, struct nl_msg *msg) * way to notice immediately that an RA was received. */ + nm_log_dbg (LOGD_IP6, "processing netlink new prefix message"); + pmsg = (struct prefixmsg *) NLMSG_DATA (nlmsg_hdr (msg)); device = nm_ip6_manager_get_device (manager, pmsg->prefix_ifindex); - if (!device || device->addrconf_complete) + if (!device || device->addrconf_complete) { + nm_log_dbg (LOGD_IP6, "(%s): ignoring unknown or completed device", + device ? device->iface : "(none)"); return NULL; + } return device; } @@ -542,16 +611,22 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) NMIP6RDNSS server, *sa, *sb; gboolean changed; + nm_log_dbg (LOGD_IP6, "processing netlink nduseropt message"); + ndmsg = (struct nduseroptmsg *) NLMSG_DATA (nlmsg_hdr (msg)); if (ndmsg->nduseropt_family != AF_INET6 || ndmsg->nduseropt_icmp_type != ND_ROUTER_ADVERT || - ndmsg->nduseropt_icmp_code != 0) + ndmsg->nduseropt_icmp_code != 0) { + nm_log_dbg (LOGD_IP6, "ignoring non-Router Advertisement message"); return NULL; + } device = nm_ip6_manager_get_device (manager, ndmsg->nduseropt_ifindex); - if (!device) + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); return NULL; + } servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); @@ -574,6 +649,13 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime); for (addr = (struct in6_addr *) (rdnss_opt + 1); nd_opt_len >= 2; addr++, nd_opt_len -= 2) { + char buf[INET6_ADDRSTRLEN]; + + if (inet_ntop (AF_INET6, &addr, buf, INET6_ADDRSTRLEN) > 0) { + nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s", + device->iface, buf); + } + server.addr = *addr; g_array_append_val (servers, server); } @@ -599,6 +681,7 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) } if (changed) { + nm_log_dbg (LOGD_IP6, "(%s): RA-provided nameservers changed", device->iface); g_array_free (device->rdnss_servers, TRUE); device->rdnss_servers = servers; } else @@ -632,12 +715,17 @@ process_newlink (NMIP6Manager *manager, struct nl_msg *msg) int err; ifi = nlmsg_data (hdr); - if (ifi->ifi_family != AF_INET6) + if (ifi->ifi_family != AF_INET6) { + nm_log_dbg (LOGD_IP6, "ignoring netlink message family %d", ifi->ifi_family); return NULL; + } device = nm_ip6_manager_get_device (manager, ifi->ifi_index); - if (!device || device->addrconf_complete) + if (!device || device->addrconf_complete) { + nm_log_dbg (LOGD_IP6, "(%s): ignoring unknown or completed device", + device ? device->iface : "(none)"); return NULL; + } /* FIXME: we have to do this manually for now since libnl doesn't yet * support the IFLA_PROTINFO attribute of NEWLINK messages. When it does, @@ -647,16 +735,24 @@ process_newlink (NMIP6Manager *manager, struct nl_msg *msg) */ err = nlmsg_parse (hdr, sizeof (*ifi), tb, IFLA_MAX, link_policy); - if (err < 0) + if (err < 0) { + nm_log_dbg (LOGD_IP6, "(%s): error parsing PROTINFO attribute", device->iface); return NULL; - if (!tb[IFLA_PROTINFO]) + } + if (!tb[IFLA_PROTINFO]) { + nm_log_dbg (LOGD_IP6, "(%s): message had no PROTINFO attribute", device->iface); return NULL; + } err = nla_parse_nested (pi, IFLA_INET6_MAX, tb[IFLA_PROTINFO], link_prot_policy); - if (err < 0) + if (err < 0) { + nm_log_dbg (LOGD_IP6, "(%s): error parsing PROTINFO flags", device->iface); return NULL; - if (!pi[IFLA_INET6_FLAGS]) + } + if (!pi[IFLA_INET6_FLAGS]) { + nm_log_dbg (LOGD_IP6, "(%s): message had no PROTINFO flags", device->iface); return NULL; + } device->ra_flags = nla_get_u32 (pi[IFLA_INET6_FLAGS]); nm_log_dbg (LOGD_IP6, "(%s): got IPv6 flags 0x%X", device->iface, device->ra_flags); @@ -673,6 +769,7 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us gboolean config_changed = FALSE; hdr = nlmsg_hdr (msg); + nm_log_dbg (LOGD_HW, "netlink notificate type %d", hdr->nlmsg_type); switch (hdr->nlmsg_type) { case RTM_NEWADDR: case RTM_DELADDR: @@ -699,8 +796,10 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us return; } - if (device) + if (device) { + nm_log_dbg (LOGD_IP6, "(%s): syncing device with netlink changes", device->iface); nm_ip6_device_sync_from_netlink (device, config_changed); + } } void From 9f85d3533ebb50ca4e8a3f6b153308ea7498a3d0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Apr 2010 17:33:44 -0700 Subject: [PATCH 319/392] ip6: fix log message arguments --- src/ip6-manager/nm-ip6-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index e9a60ee8c4..0b7949d974 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -515,7 +515,8 @@ process_addr (NMIP6Manager *manager, struct nl_msg *msg) * to notify higher levels if we actually changed something. */ if (nl_cache_nitems (priv->addr_cache) == old_size) { - nm_log_dbg (LOGD_IP6, "(%s): address cache unchanged, ignoring message"); + nm_log_dbg (LOGD_IP6, "(%s): address cache unchanged, ignoring message", + device->iface); return NULL; } @@ -551,7 +552,8 @@ process_route (NMIP6Manager *manager, struct nl_msg *msg) /* As above in process_addr */ if (nl_cache_nitems (priv->route_cache) == old_size) { - nm_log_dbg (LOGD_IP6, "(%s): route cache unchanged, ignoring message"); + nm_log_dbg (LOGD_IP6, "(%s): route cache unchanged, ignoring message", + device->iface); return NULL; } From 398b41a61d2ed0e9fb29f993b2f5c5256032f8e3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 08:05:39 -0700 Subject: [PATCH 320/392] trivial: IP6Config object cleanups --- src/nm-ip6-config.c | 4 ++-- src/nm-ip6-config.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index e3fe92dbd3..89b8c1a665 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -183,7 +183,7 @@ const struct in6_addr *nm_ip6_config_get_ptp_address (NMIP6Config *config) return &NM_IP6_CONFIG_GET_PRIVATE (config)->ptp_address; } -void nm_ip6_config_set_ptp_address (NMIP6Config *config, struct in6_addr *ptp_addr) +void nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_addr) { g_return_if_fail (NM_IS_IP6_CONFIG (config)); @@ -197,7 +197,7 @@ void nm_ip6_config_add_nameserver (NMIP6Config *config, const struct in6_addr *n int i; g_return_if_fail (NM_IS_IP6_CONFIG (config)); - g_return_if_fail (nameserver > 0); + g_return_if_fail (nameserver != NULL); priv = NM_IP6_CONFIG_GET_PRIVATE (config); diff --git a/src/nm-ip6-config.h b/src/nm-ip6-config.h index 4fd959d531..1e75a121c8 100644 --- a/src/nm-ip6-config.h +++ b/src/nm-ip6-config.h @@ -60,7 +60,7 @@ NMIP6Address *nm_ip6_config_get_address (NMIP6Config *config, guint32 i) guint32 nm_ip6_config_get_num_addresses (NMIP6Config *config); const struct in6_addr *nm_ip6_config_get_ptp_address (NMIP6Config *config); -void nm_ip6_config_set_ptp_address (NMIP6Config *config, struct in6_addr *ptp_addr); +void nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_addr); void nm_ip6_config_add_nameserver (NMIP6Config *config, const struct in6_addr *nameserver); const struct in6_addr *nm_ip6_config_get_nameserver (NMIP6Config *config, guint i); From e3de3b65ef209e4431ba7c93c474d1805c1b4699 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 08:09:12 -0700 Subject: [PATCH 321/392] logging: print DHCP client pid in warnings --- src/dhcp-manager/nm-dhcp-manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 635fe320b0..c2aacbbbe5 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -235,19 +235,19 @@ nm_dhcp_manager_handle_event (DBusGProxy *proxy, client = get_client_for_pid (manager, (GPid) temp); if (client == NULL) { - nm_log_warn (LOGD_DHCP, "unhandled DHCP event for interface %s", iface); + nm_log_warn (LOGD_DHCP, "(pid %d) unhandled DHCP event for interface %s", temp, iface); goto out; } if (strcmp (iface, nm_dhcp_client_get_iface (client))) { - nm_log_warn (LOGD_DHCP, "received DHCP event from unexpected interface '%s' (expected '%s')", - iface, nm_dhcp_client_get_iface (client)); + nm_log_warn (LOGD_DHCP, "(pid %d) received DHCP event from unexpected interface '%s' (expected '%s')", + temp, iface, nm_dhcp_client_get_iface (client)); goto out; } reason = get_option (options, "reason"); if (reason == NULL) { - nm_log_warn (LOGD_DHCP, "DHCP event didn't have a reason"); + nm_log_warn (LOGD_DHCP, "(pid %d) DHCP event didn't have a reason", temp); goto out; } From d1be3793a159f4e2c2a21b5f67b38704f3900cee Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 08:10:49 -0700 Subject: [PATCH 322/392] dhcp6: info-only requests don't require addresses They aren't actual leases so an info-only request doesn't return an address. --- src/dhcp-manager/nm-dhcp-client.c | 59 +++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 9f9719473a..30d5c7504e 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -44,6 +44,7 @@ typedef struct { guint timeout_id; guint watch_id; GHashTable * options; + gboolean info_only; } NMDHCPClientPrivate; #define NM_DHCP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CLIENT, NMDHCPClientPrivate)) @@ -186,6 +187,8 @@ real_stop (NMDHCPClient *self) watch_cleanup (self); stop_process (priv->pid, priv->iface); + + priv->info_only = FALSE; } static gboolean @@ -278,6 +281,8 @@ nm_dhcp_client_start_ip6 (NMDHCPClient *self, g_return_val_if_fail (priv->ipv6 == TRUE, FALSE); g_return_val_if_fail (priv->uuid != NULL, FALSE); + priv->info_only = info_only; + nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", priv->iface, priv->timeout); @@ -894,6 +899,8 @@ ip6_options_to_config (NMDHCPClient *self) struct in6_addr tmp_addr; NMIP6Address *addr = NULL; char *str = NULL; + GHashTableIter iter; + gpointer key, value; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); @@ -901,6 +908,12 @@ ip6_options_to_config (NMDHCPClient *self) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); g_return_val_if_fail (priv->options != NULL, NULL); + g_hash_table_iter_init (&iter, priv->options); + while (g_hash_table_iter_next (&iter, &key, &value)) { + nm_log_dbg (LOGD_DHCP6, "(%s): option '%s'=>'%s'", + priv->iface, (const char *) key, (const char *) value); + } + ip6_config = nm_ip6_config_new (); if (!ip6_config) { nm_log_warn (LOGD_DHCP6, "(%s): couldn't allocate memory for an IP6Config!", priv->iface); @@ -914,27 +927,43 @@ ip6_options_to_config (NMDHCPClient *self) } str = g_hash_table_lookup (priv->options, "new_ip6_address"); - if (str && (inet_pton (AF_INET6, str, &tmp_addr) > 0)) { + if (str) { + if (!inet_pton (AF_INET6, str, &tmp_addr)) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCP returned invalid address '%s'", + priv->iface); + goto error; + } + nm_ip6_address_set_address (addr, &tmp_addr); nm_log_info (LOGD_DHCP6, " address %s", str); - } else - goto error; - - str = g_hash_table_lookup (priv->options, "new_ip6_prefixlen"); - if (str) { - long unsigned int prefix; - - errno = 0; - prefix = strtoul (str, NULL, 10); - if (errno != 0 || prefix > 128) + } else { + /* No address in managed mode is a hard error */ + if (priv->info_only == FALSE) goto error; - nm_ip6_address_set_prefix (addr, (guint32) prefix); - nm_log_info (LOGD_DHCP6, " prefix %lu", prefix); + /* But "info-only" setups don't necessarily need an address */ + nm_ip6_address_unref (addr); + addr = NULL; } - nm_ip6_config_take_address (ip6_config, addr); - addr = NULL; + /* Only care about prefix if we got an address */ + if (addr) { + str = g_hash_table_lookup (priv->options, "new_ip6_prefixlen"); + if (str) { + long unsigned int prefix; + + errno = 0; + prefix = strtoul (str, NULL, 10); + if (errno != 0 || prefix > 128) + goto error; + + nm_ip6_address_set_prefix (addr, (guint32) prefix); + nm_log_info (LOGD_DHCP6, " prefix %lu", prefix); + } + + nm_ip6_config_take_address (ip6_config, addr); + addr = NULL; + } str = g_hash_table_lookup (priv->options, "new_host_name"); if (str) From 0e546480fac5c663802131ec2acbd6b3d62ee342 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 08:12:25 -0700 Subject: [PATCH 323/392] dhcp6: fix merging of DHCPv6 config into interface config If we're doing autoconf + DHCPv6 info-only, we need to combine the DHCP and IPv6 configuration into the final device configuration. --- src/nm-device.c | 73 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index ce47bc66f7..01f1d7288f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1909,6 +1909,42 @@ nm_device_activate_schedule_stage4_ip4_config_timeout (NMDevice *self) nm_device_get_iface (self)); } +static void +merge_dhcp_config_to_master (NMIP6Config *dst, NMIP6Config *src) +{ + guint32 i; + + g_return_if_fail (src != NULL); + g_return_if_fail (dst != NULL); + + /* addresses */ + for (i = 0; i < nm_ip6_config_get_num_addresses (src); i++) + nm_ip6_config_add_address (dst, nm_ip6_config_get_address (src, i)); + + /* ptp address; only replace if src doesn't have one */ + if (!nm_ip6_config_get_ptp_address (dst)) + nm_ip6_config_set_ptp_address (dst, nm_ip6_config_get_ptp_address (src)); + + /* nameservers */ + for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) + nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i)); + + /* routes */ + for (i = 0; i < nm_ip6_config_get_num_routes (src); i++) + nm_ip6_config_add_route (dst, nm_ip6_config_get_route (src, i)); + + /* domains */ + for (i = 0; i < nm_ip6_config_get_num_domains (src); i++) + nm_ip6_config_add_domain (dst, nm_ip6_config_get_domain (src, i)); + + /* dns searches */ + for (i = 0; i < nm_ip6_config_get_num_searches (src); i++) + nm_ip6_config_add_search (dst, nm_ip6_config_get_search (src, i)); + + if (!nm_ip6_config_get_mss (dst)) + nm_ip6_config_set_mss (dst, nm_ip6_config_get_mss (src)); +} + static NMActStageReturn real_act_stage4_get_ip6_config (NMDevice *self, NMIP6Config **config, @@ -1929,8 +1965,6 @@ real_act_stage4_get_ip6_config (NMDevice *self, connection = nm_act_request_get_connection (nm_device_get_act_request (self)); g_assert (connection); - s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, @@ -1939,30 +1973,43 @@ real_act_stage4_get_ip6_config (NMDevice *self, *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; goto out; } - - /* Merge user-defined overrides into the IP6Config to be applied */ - nm_utils_merge_ip6_config (*config, s_ip6); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { *config = nm_ip6_config_new (); if (!*config) { *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; goto out; } - nm_utils_merge_ip6_config (*config, s_ip6); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) g_assert (priv->dhcp6_client); /* sanity check */ /* Autoconf might have triggered DHCPv6 too */ if (priv->dhcp6_client) { - *config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); - if (!*config) { + NMIP6Config *dhcp; + + dhcp = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); + if (!dhcp) { *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; goto out; } - /* Merge user-defined overrides into the IP4Config to be applied */ - nm_utils_merge_ip6_config (*config, s_ip6); + /* For "managed" and DHCP-only setups, we use only the DHCP-supplied + * IPv6 config. But when autoconf is enabled, we have to merge the + * autoconf config and the DHCP-supplied config, then merge the + * user's overrides from the connection to get the final configuration + * that gets applied to the device. + */ + if (*config) { + /* Merge autoconf and DHCP configs */ + merge_dhcp_config_to_master (*config, dhcp); + g_object_unref (dhcp); + dhcp = NULL; + } else { + *config = dhcp; + } + /* Copy the new DHCPv6 configuration into the DHCP config object that's + * exported over D-Bus to clients. + */ nm_dhcp6_config_reset (priv->dhcp6_config); nm_dhcp_client_foreach_option (priv->dhcp6_client, dhcp6_add_option_cb, @@ -1972,6 +2019,12 @@ real_act_stage4_get_ip6_config (NMDevice *self, g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); } + /* Merge user-defined overrides into the IP6Config to be applied */ + if (*config) { + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + nm_utils_merge_ip6_config (*config, s_ip6); + } + out: return *config ? NM_ACT_STAGE_RETURN_SUCCESS : NM_ACT_STAGE_RETURN_FAILURE; } From 00bcc42a357beac1dbc5e0ba55dcabfdfe9d9900 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 09:26:57 -0700 Subject: [PATCH 324/392] logging: log DHCP state changes --- src/nm-device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nm-device.c b/src/nm-device.c index 01f1d7288f..4da051e21c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1267,6 +1267,14 @@ dhcp_state_changed (NMDHCPClient *client, ipv6 = nm_dhcp_client_get_ipv6 (client); dev_state = nm_device_get_state (device); + if (ipv6) { + nm_log_dbg (LOGD_DHCP6, "(%s): new DHCPv6 client state %d", + nm_device_get_iface (device), dev_state); + } else { + nm_log_dbg (LOGD_DHCP4, "(%s): new DHCPv4 client state %d", + nm_device_get_iface (device), dev_state); + } + switch (state) { case DHC_BOUND4: /* lease obtained */ case DHC_BOUND6: From 41f3a670922a63ac5baf13cb1e44b33303f66640 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 09:27:32 -0700 Subject: [PATCH 325/392] dhcp: fix client end state when it exits normally --- src/dhcp-manager/nm-dhcp-client.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 30d5c7504e..cf50efddce 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -212,11 +212,22 @@ daemon_watch_cb (GPid pid, gint status, gpointer user_data) NMDHCPClient *self = NM_DHCP_CLIENT (user_data); NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + if (priv->ipv6) { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 client pid %d exited with status %d", + priv->iface, pid, + WIFEXITED (status) ? WEXITSTATUS (status) : -1); + } else { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv4 client pid %d exited with status %d", + priv->iface, pid, + WIFEXITED (status) ? WEXITSTATUS (status) : -1); + } + if (!WIFEXITED (status)) { priv->state = DHC_ABEND; nm_log_warn (LOGD_DHCP, "DHCP client died abnormally"); - } - priv->pid = 0; + } else + priv->state = DHC_END; + priv->pid = -1; watch_cleanup (self); timeout_cleanup (self); @@ -875,7 +886,7 @@ nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); if (test && !state_is_bound (priv->state)) { - nm_log_warn (LOGD_DHCP4, "(%s): DHCP client didn't bind to a lease.", priv->iface); + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 client didn't bind to a lease.", priv->iface); return NULL; } @@ -1008,7 +1019,7 @@ nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); if (test && !state_is_bound (priv->state)) { - nm_log_warn (LOGD_DHCP6, "(%s): dhcp client didn't bind to a lease.", priv->iface); + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 client didn't bind to a lease.", priv->iface); return NULL; } From 8398ccba592f96518f64bc82491b3f26a41e272f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 09:48:31 -0700 Subject: [PATCH 326/392] dhcp: simplify option iteration Also removes the failure return when the lease isn't bound, because nothing was respecting the return value anyway. --- src/dhcp-manager/nm-dhcp-client.c | 69 +++++++++++++------------------ 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index cf50efddce..22468db5e2 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -553,48 +553,14 @@ nm_dhcp_client_new_options (NMDHCPClient *self, #define NEW_TAG "new_" #define OLD_TAG "old_" -typedef struct { - GHFunc func; - gpointer user_data; -} DhcpForeachInfo; - -static void -iterate_dhcp_config_option (gpointer key, - gpointer value, - gpointer user_data) -{ - DhcpForeachInfo *info = (DhcpForeachInfo *) user_data; - char *tmp_key = NULL; - const char **p; - static const char *filter_options[] = { - "interface", "pid", "reason", "dhcp_message_type", NULL - }; - - /* Filter out stuff that's not actually new DHCP options */ - for (p = filter_options; *p; p++) { - if (!strcmp (*p, (const char *) key)) - return; - if (!strncmp ((const char *) key, OLD_TAG, strlen (OLD_TAG))) - return; - } - - /* Remove the "new_" prefix that dhclient passes back */ - if (!strncmp ((const char *) key, NEW_TAG, strlen (NEW_TAG))) - tmp_key = g_strdup ((const char *) (key + strlen (NEW_TAG))); - else - tmp_key = g_strdup ((const char *) key); - - (*info->func) ((gpointer) tmp_key, value, info->user_data); - g_free (tmp_key); -} - gboolean nm_dhcp_client_foreach_option (NMDHCPClient *self, GHFunc func, gpointer user_data) { NMDHCPClientPrivate *priv; - DhcpForeachInfo info = { NULL, NULL }; + GHashTableIter iter; + gpointer iterkey, itervalue; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); @@ -608,12 +574,35 @@ nm_dhcp_client_foreach_option (NMDHCPClient *self, } else { nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 client didn't bind to a lease.", priv->iface); } - return FALSE; } - info.func = func; - info.user_data = user_data; - g_hash_table_foreach (priv->options, iterate_dhcp_config_option, &info); + g_hash_table_iter_init (&iter, priv->options); + while (g_hash_table_iter_next (&iter, &iterkey, &itervalue)) { + const char *key = iterkey, *value = itervalue; + const char **p; + static const char *filter_options[] = { + "interface", "pid", "reason", "dhcp_message_type", NULL + }; + gboolean ignore = FALSE; + + /* Filter out stuff that's not actually new DHCP options */ + for (p = filter_options; *p; p++) { + if (!strcmp (*p, key) || !strncmp (key, OLD_TAG, strlen (OLD_TAG))) { + ignore = TRUE; + break; + } + } + + if (!ignore) { + const char *tmp_key = value; + + /* Remove the "new_" prefix that dhclient passes back */ + if (!strncmp (key, NEW_TAG, strlen (NEW_TAG))) + tmp_key = key + strlen (NEW_TAG); + + func ((gpointer) tmp_key, (gpointer) value, user_data); + } + } return TRUE; } From 07de58bbeb6dd2daecec32f7d9842ee6751b8df7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 09:53:49 -0700 Subject: [PATCH 327/392] dhcp: clean up client spawn return value --- src/dhcp-manager/nm-dhcp-dhclient.c | 2 +- src/dhcp-manager/nm-dhcp-dhcpcd.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 37543edc0b..d7a6e32fb3 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -482,7 +482,7 @@ dhclient_start (NMDHCPClient *client, { NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); GPtrArray *argv = NULL; - GPid pid = 0; + GPid pid = -1; GError *error = NULL; const char *iface, *uuid; char *binary_name, *cmd_str; diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 716949324c..403431fcb4 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -92,7 +92,7 @@ real_ip4_start (NMDHCPClient *client, { NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); GPtrArray *argv = NULL; - GPid pid = 0; + GPid pid = -1; GError *error = NULL; char *pid_contents = NULL, *binary_name, *cmd_str; const char *iface, *uuid, *hostname; @@ -147,6 +147,7 @@ real_ip4_start (NMDHCPClient *client, &dhcpcd_child_setup, NULL, &pid, &error)) { nm_log_warn (LOGD_DHCP4, "dhcpcd failed to start. error: '%s'", error->message); g_error_free (error); + pid = -1; } else nm_log_info (LOGD_DHCP4, "dhcpcd started with pid %d", pid); From 39c2797848d6bd335e100dcf3a90ee6a9b51f07e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 10:12:25 -0700 Subject: [PATCH 328/392] dhcp: don't reset pid on client exit Clients in IPv6 info-only mode may exit after getting a response from the server, since there are no leases involved in info-only mode. To ensure that the client's options are received when the event comes in (which could be after we get the child watch callback for the exit) we still need the client's PID. --- src/dhcp-manager/nm-dhcp-client.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 22468db5e2..c2ead0e702 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -227,7 +227,6 @@ daemon_watch_cb (GPid pid, gint status, gpointer user_data) nm_log_warn (LOGD_DHCP, "DHCP client died abnormally"); } else priv->state = DHC_END; - priv->pid = -1; watch_cleanup (self); timeout_cleanup (self); From bec6147e9b1668f9317b190faa4dee069fec3831 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 May 2010 10:16:38 -0700 Subject: [PATCH 329/392] dhcp6: track client mode better and handle info-only early-exit Ignore early exits of the client in info-only mode; since there is no address lease the client doesn't need to stick around after getting DNS/etc options from the server. --- src/nm-device.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 4da051e21c..9fa2523b9f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -134,9 +134,9 @@ typedef struct { gulong ip6_addrconf_sigid; gulong ip6_config_changed_sigid; gboolean ip6_waiting_for_config; - guint32 ip6_dhcp_opt; NMDHCPClient * dhcp6_client; + guint32 dhcp6_mode; gulong dhcp6_state_sigid; gulong dhcp6_timeout_sigid; NMDHCP6Config * dhcp6_config; @@ -607,10 +607,10 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, return; } - priv->ip6_dhcp_opt = dhcp_opts; + priv->dhcp6_mode = dhcp_opts; /* If addrconf is all that's required, we're done */ - if (dhcp_opts == IP6_DHCP_OPT_NONE) { + if (priv->dhcp6_mode == IP6_DHCP_OPT_NONE) { nm_device_activate_schedule_stage4_ip6_config_get (self); return; } @@ -627,7 +627,7 @@ ip6_addrconf_complete (NMIP6Manager *ip6_manager, " as requested by IPv6 router...", priv->iface); - ret = dhcp6_start (self, connection, dhcp_opts, &reason); + ret = dhcp6_start (self, connection, priv->dhcp6_mode, &reason); switch (ret) { case NM_ACT_STAGE_RETURN_SUCCESS: /* Shouldn't get this, but handle it anyway */ @@ -656,6 +656,8 @@ ip6_config_changed (NMIP6Manager *ip6_manager, if (!nm_device_get_act_request (self)) return; + /* FIXME: re-run DHCPv6 here to get any new nameservers or whatever */ + nm_device_activate_schedule_stage4_ip6_config_get (self); } @@ -697,8 +699,6 @@ addrconf6_setup (NMDevice *self) self); } - priv->ip6_dhcp_opt = IP6_DHCP_OPT_NONE; - s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); nm_ip6_manager_prepare_interface (priv->ip6_manager, nm_device_get_ip_ifindex (self), @@ -1302,9 +1302,16 @@ dhcp_state_changed (NMDHCPClient *client, nm_device_activate_schedule_stage4_ip4_config_timeout (device); } break; + case DHC_END: /* dhclient exited normally */ + /* In IPv6 info-only mode, the client doesn't handle leases so it + * may exit right after getting a response from the server. That's + * normal. In that case we just ignore the exit. + */ + if (ipv6 && (priv->dhcp6_mode == IP6_DHCP_OPT_OTHERCONF)) + break; + /* Otherwise, fall through */ case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ case DHC_ABEND: /* dhclient exited abnormally */ - case DHC_END: /* dhclient exited normally */ if (ipv6) nm_dhcp6_config_reset (priv->dhcp6_config); else @@ -1537,6 +1544,8 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) ip_iface = nm_device_get_ip_iface (self); + priv->dhcp6_mode = IP6_DHCP_OPT_NONE; + if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { if (!addrconf6_setup (self)) { @@ -1545,9 +1554,10 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) } nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) - ret = dhcp6_start (self, connection, IP6_DHCP_OPT_MANAGED, reason); - else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED; + ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason); + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { priv->ip6_ready = TRUE; ret = NM_ACT_STAGE_RETURN_STOP; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) @@ -2538,6 +2548,8 @@ dhcp6_cleanup (NMDevice *self, gboolean stop) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + priv->dhcp6_mode = IP6_DHCP_OPT_NONE; + if (priv->dhcp6_config) { g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); g_object_unref (priv->dhcp6_config); From c34cc017ba08a2f80db35a3085e59c059bbc7a9e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 00:24:40 -0700 Subject: [PATCH 330/392] dhcp: handle client early exit correctly When the client exits it may take a short amount of time for the dhclient hook script to deliver the options to NetworkManager; so we need to keep the client object around a bit (so we know what NMDHCPClient the options getting delivered are for). If we don't, the DHCPManager will dispose of the DHCPClient object and then when the options come in, it can't match up the PID from the options with the PID of an existing NMDHCPClient. So put the clients on a removal timer that keeps them around for a bit before we let the manager dispose of them. Since we're keeping the PID around too instead of zeroing it when the client exits (for the reason above), track whether the client is really dead yet so we don't indiscriminately kill a random process that happens to re-use the PID. --- src/dhcp-manager/nm-dhcp-client.c | 73 +++++++++++++++++++++++++----- src/dhcp-manager/nm-dhcp-client.h | 1 + src/dhcp-manager/nm-dhcp-manager.c | 23 ++-------- 3 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index c2ead0e702..6bf9058976 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -41,10 +41,13 @@ typedef struct { guchar state; GPid pid; + gboolean dead; guint timeout_id; guint watch_id; + guint32 remove_id; GHashTable * options; gboolean info_only; + } NMDHCPClientPrivate; #define NM_DHCP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CLIENT, NMDHCPClientPrivate)) @@ -54,6 +57,7 @@ G_DEFINE_TYPE_EXTENDED (NMDHCPClient, nm_dhcp_client, G_TYPE_OBJECT, G_TYPE_FLAG enum { STATE_CHANGED, TIMEOUT, + REMOVE, LAST_SIGNAL }; @@ -206,11 +210,46 @@ daemon_timeout (gpointer user_data) return FALSE; } +static gboolean +signal_remove (gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + + NM_DHCP_CLIENT_GET_PRIVATE (self)->remove_id = 0; + g_signal_emit (G_OBJECT (self), signals[REMOVE], 0); + return FALSE; +} + +static void +dhcp_client_set_state (NMDHCPClient *self, + NMDHCPState state, + gboolean emit_state, + gboolean remove_now) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + priv->state = state; + + if (emit_state) + g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], 0, priv->state); + + if (state == DHC_END || state == DHC_ABEND) { + /* Start the remove signal timer */ + if (remove_now) { + g_signal_emit (G_OBJECT (self), signals[REMOVE], 0); + } else { + if (!priv->remove_id) + priv->remove_id = g_timeout_add_seconds (5, signal_remove, self); + } + } +} + static void daemon_watch_cb (GPid pid, gint status, gpointer user_data) { NMDHCPClient *self = NM_DHCP_CLIENT (user_data); NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + NMDHCPState new_state; if (priv->ipv6) { nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 client pid %d exited with status %d", @@ -223,15 +262,16 @@ daemon_watch_cb (GPid pid, gint status, gpointer user_data) } if (!WIFEXITED (status)) { - priv->state = DHC_ABEND; + new_state = DHC_ABEND; nm_log_warn (LOGD_DHCP, "DHCP client died abnormally"); } else - priv->state = DHC_END; + new_state = DHC_END; watch_cleanup (self); timeout_cleanup (self); + priv->dead = TRUE; - g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], 0, priv->state); + dhcp_client_set_state (self, new_state, TRUE, FALSE); } static void @@ -349,8 +389,9 @@ nm_dhcp_client_stop (NMDHCPClient *self) priv = NM_DHCP_CLIENT_GET_PRIVATE (self); /* Kill the DHCP client */ - if (priv->pid > 0) { + if (!priv->dead) { NM_DHCP_CLIENT_GET_CLASS (self)->stop (self); + priv->dead = TRUE; nm_log_info (LOGD_DHCP, "(%s): canceled DHCP transaction, DHCP client pid %d", priv->iface, priv->pid); @@ -359,7 +400,7 @@ nm_dhcp_client_stop (NMDHCPClient *self) /* And clean stuff up */ priv->pid = -1; - priv->state = DHC_END; + dhcp_client_set_state (self, DHC_END, FALSE, TRUE); g_hash_table_remove_all (priv->options); @@ -530,23 +571,19 @@ nm_dhcp_client_new_options (NMDHCPClient *self, timeout_cleanup (self); } - priv->state = new_state; if (priv->ipv6) { nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 state changed %s -> %s", priv->iface, state_to_string (old_state), - state_to_string (priv->state)); + state_to_string (new_state)); } else { nm_log_info (LOGD_DHCP4, "(%s): DHCPv4 state changed %s -> %s", priv->iface, state_to_string (old_state), - state_to_string (priv->state)); + state_to_string (new_state)); } - g_signal_emit (G_OBJECT (self), - signals[STATE_CHANGED], - 0, - priv->state); + dhcp_client_set_state (self, new_state, TRUE, FALSE); } #define NEW_TAG "new_" @@ -1089,6 +1126,9 @@ dispose (GObject *object) * the DHCP client. */ + if (priv->remove_id) + g_source_remove (priv->remove_id); + g_hash_table_destroy (priv->options); g_free (priv->iface); @@ -1159,5 +1199,14 @@ nm_dhcp_client_class_init (NMDHCPClientClass *client_class) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + signals[REMOVE] = + g_signal_new ("remove", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, remove), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 146cf57b3f..92b2b8fe51 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -99,6 +99,7 @@ typedef struct { /* Signals */ void (*state_changed) (NMDHCPClient *self, NMDHCPState state); void (*timeout) (NMDHCPClient *self); + void (*remove) (NMDHCPClient *self); } NMDHCPClientClass; GType nm_dhcp_client_get_type (void); diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index c2aacbbbe5..7b110fb232 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -358,7 +358,7 @@ nm_dhcp_manager_new (const char *client, GError **error) return singleton; } -#define STATE_ID_TAG "state-id" +#define REMOVE_ID_TAG "remove-id" #define TIMEOUT_ID_TAG "timeout-id" static void @@ -367,7 +367,7 @@ remove_client (NMDHCPManager *self, NMDHCPClient *client) NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); guint id; - id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), STATE_ID_TAG)); + id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), REMOVE_ID_TAG)); if (id) g_signal_handler_disconnect (client, id); @@ -383,29 +383,16 @@ remove_client (NMDHCPManager *self, NMDHCPClient *client) g_hash_table_remove (priv->clients, client); } -static void -client_state_changed (NMDHCPClient *client, NMDHCPState new_state, gpointer user_data) -{ - if (new_state == DHC_ABEND || new_state == DHC_END) - remove_client (NM_DHCP_MANAGER (user_data), client); -} - -static void -client_timeout (NMDHCPClient *client, gpointer user_data) -{ - remove_client (NM_DHCP_MANAGER (user_data), client); -} - static void add_client (NMDHCPManager *self, NMDHCPClient *client) { NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); guint id; - id = g_signal_connect (client, "state-changed", G_CALLBACK (client_state_changed), self); - g_object_set_data (G_OBJECT (client), STATE_ID_TAG, GUINT_TO_POINTER (id)); + id = g_signal_connect_swapped (client, "remove", G_CALLBACK (remove_client), self); + g_object_set_data (G_OBJECT (client), REMOVE_ID_TAG, GUINT_TO_POINTER (id)); - id = g_signal_connect (client, "timeout", G_CALLBACK (client_timeout), self); + id = g_signal_connect_swapped (client, "timeout", G_CALLBACK (remove_client), self); g_object_set_data (G_OBJECT (client), TIMEOUT_ID_TAG, GUINT_TO_POINTER (id)); g_hash_table_insert (priv->clients, client, g_object_ref (client)); From 28d2c5592bd36a835fdc8df9949c9a0a61ca6024 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 00:24:50 -0700 Subject: [PATCH 331/392] dhcp: ensure getting DHCP IP config fails if the client died early If the client never delivered any options to NM, make sure we don't return a valid IP config object to callers when they request one. --- src/dhcp-manager/nm-dhcp-client.c | 10 ++++++++++ src/nm-system.c | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 6bf9058976..5cebaa84ee 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -915,6 +915,11 @@ nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) return NULL; } + if (!g_hash_table_size (priv->options)) { + /* We never got a response from the DHCP client */ + return NULL; + } + return ip4_options_to_config (self); } @@ -1048,6 +1053,11 @@ nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) return NULL; } + if (!g_hash_table_size (priv->options)) { + /* We never got a response from the DHCP client */ + return NULL; + } + return ip6_options_to_config (self); } diff --git a/src/nm-system.c b/src/nm-system.c index 20d06b83ad..726da0a825 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -486,18 +486,23 @@ nm_system_device_set_ip6_route (const char *iface, /* Add the route */ err = rtnl_route_add (nlh, route, 0); +g_message ("%s: 1 err %d", __func__, err); if (err == -ESRCH && ip6_gateway) { /* Gateway might be over a bridge; try adding a route to gateway first */ struct rtnl_route *route2; +g_message ("%s: 2", __func__); route2 = create_route (iface_idx, mss); if (route2) { +g_message ("%s: 3", __func__); /* Add route to gateway over bridge */ rtnl_route_set_dst (route2, gw_addr); err = rtnl_route_add (nlh, route2, 0); +g_message ("%s: 4 err %d", __func__, err); if (!err) { /* Try adding the route again */ err = rtnl_route_add (nlh, route, 0); +g_message ("%s: 5 err %d", __func__, err); if (err) rtnl_route_del (nlh, route2, 0); } From 32b255e1281a9962404e3a47b0e0c6c64b91d1af Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 00:32:26 -0700 Subject: [PATCH 332/392] trivial: remove some debugging leftovers --- src/nm-system.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 726da0a825..20d06b83ad 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -486,23 +486,18 @@ nm_system_device_set_ip6_route (const char *iface, /* Add the route */ err = rtnl_route_add (nlh, route, 0); -g_message ("%s: 1 err %d", __func__, err); if (err == -ESRCH && ip6_gateway) { /* Gateway might be over a bridge; try adding a route to gateway first */ struct rtnl_route *route2; -g_message ("%s: 2", __func__); route2 = create_route (iface_idx, mss); if (route2) { -g_message ("%s: 3", __func__); /* Add route to gateway over bridge */ rtnl_route_set_dst (route2, gw_addr); err = rtnl_route_add (nlh, route2, 0); -g_message ("%s: 4 err %d", __func__, err); if (!err) { /* Try adding the route again */ err = rtnl_route_add (nlh, route, 0); -g_message ("%s: 5 err %d", __func__, err); if (err) rtnl_route_del (nlh, route2, 0); } From 5ca72c78a0ae3ff818c7d47de2738fe776e0c470 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 00:44:44 -0700 Subject: [PATCH 333/392] ip6: avoid autoconf routes where dest == gateway These return errors when we try to add them via netlink (both internal code and using /sbin/ip) so we'll ignore them for now. --- src/ip6-manager/nm-ip6-manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 0b7949d974..cafe9cc430 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -983,6 +983,13 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) continue; } + /* Also ignore routes where the destination and gateway are the same, + * which apparently get added by the kernel but return -EINVAL when + * we try to add them via netlink. + */ + if (gateway && !memcmp (dest, gateway, sizeof (struct in6_addr))) + continue; + ip6route = nm_ip6_route_new (); nm_ip6_route_set_dest (ip6route, dest); nm_ip6_route_set_prefix (ip6route, rtnl_route_get_dst_len (rtnlroute)); From 71c7ecba081bad942ca9445fd267a68385ba4cee Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 13:22:29 -0700 Subject: [PATCH 334/392] libnm-util: more IPv6 address gateway fixes --- libnm-util/nm-setting-ip6-config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index 3e42216cbd..05f21f037e 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -834,6 +834,7 @@ nm_ip6_address_dup (NMIP6Address *source) address = nm_ip6_address_new (); address->prefix = source->prefix; memcpy (&address->address, &source->address, sizeof (struct in6_addr)); + memcpy (&address->gateway, &source->gateway, sizeof (struct in6_addr)); return address; } @@ -870,7 +871,8 @@ nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other) g_return_val_if_fail (other->refcount > 0, FALSE); if ( memcmp (&address->address, &other->address, sizeof (struct in6_addr)) - || address->prefix != other->prefix) + || address->prefix != other->prefix + || memcmp (&address->gateway, &other->gateway, sizeof (struct in6_addr))) return FALSE; return TRUE; } From 806b74db348a16b0a0ed0f0c38105126f8272a7d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 16:51:26 -0700 Subject: [PATCH 335/392] libnm-util: add 'may-fail' for IPv4 and IPv6 When this property is TRUE, IP configuration can continue as long as at least on IP configuration type succeeds. This allows connections to networks where the user does not necessarily know whether the network supports IPv4 or IPv6 and does not require that both complete succesfully. Since most of the time the user doesn't really care what type of connectivity they have, as long as they have *some* connectivity, this allows better "Just Works" behavior as long as the system settings plugins and connection editors/applets use the right defaults. Suggested defaults for may-fail are: IPv4: no (ie, require IPv4 connectivity) IPv6: yes (ie, do not require IPv6 connectivity) Users who require a specific type of connectivity are probably knowlegable enough to check the box as needed for their network. --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 6 +++-- libnm-util/nm-setting-ip4-config.c | 41 ++++++++++++++++++++++++++++++ libnm-util/nm-setting-ip4-config.h | 3 +++ libnm-util/nm-setting-ip6-config.c | 40 +++++++++++++++++++++++++++++ libnm-util/nm-setting-ip6-config.h | 2 ++ 6 files changed, 91 insertions(+), 3 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index bb4736f45b..ddc68408ab 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "4:3:3" + -version-info "4:4:3" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 1c8446ba2e..ed1d8a484f 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -168,8 +168,7 @@ global: nm_setting_ip4_config_get_dhcp_hostname; nm_setting_ip4_config_get_dhcp_send_hostname; nm_setting_ip4_config_get_never_default; - nm_setting_ip6_config_error_get_type; - nm_setting_ip6_config_error_quark; + nm_setting_ip4_config_get_may_fail; nm_ip6_address_new; nm_ip6_address_dup; nm_ip6_address_ref; @@ -194,6 +193,8 @@ global: nm_ip6_route_set_next_hop; nm_ip6_route_get_metric; nm_ip6_route_set_metric; + nm_setting_ip6_config_error_get_type; + nm_setting_ip6_config_error_quark; nm_setting_ip6_config_get_type; nm_setting_ip6_config_new; nm_setting_ip6_config_get_method; @@ -220,6 +221,7 @@ global: nm_setting_ip6_config_get_ignore_auto_routes; nm_setting_ip6_config_get_ignore_auto_dns; nm_setting_ip6_config_get_never_default; + nm_setting_ip6_config_get_may_fail; nm_setting_need_secrets; nm_setting_ppp_error_get_type; nm_setting_ppp_error_quark; diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index c1d7f01c76..a1a9674af7 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -83,6 +83,7 @@ typedef struct { gboolean dhcp_send_hostname; char *dhcp_hostname; gboolean never_default; + gboolean may_fail; } NMSettingIP4ConfigPrivate; enum { @@ -98,6 +99,7 @@ enum { PROP_DHCP_SEND_HOSTNAME, PROP_DHCP_HOSTNAME, PROP_NEVER_DEFAULT, + PROP_MAY_FAIL, LAST_PROP }; @@ -438,6 +440,14 @@ nm_setting_ip4_config_get_never_default (NMSettingIP4Config *setting) return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->never_default; } +gboolean +nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->may_fail; +} + static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -641,6 +651,9 @@ set_property (GObject *object, guint prop_id, case PROP_NEVER_DEFAULT: priv->never_default = g_value_get_boolean (value); break; + case PROP_MAY_FAIL: + priv->may_fail = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -688,6 +701,9 @@ get_property (GObject *object, guint prop_id, case PROP_NEVER_DEFAULT: g_value_set_boolean (value, priv->never_default); break; + case PROP_MAY_FAIL: + g_value_set_boolean (value, priv->may_fail); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -968,6 +984,31 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "the default route by NetworkManager.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP4Config:may-fail: + * + * If TRUE, allow overall network configuration to proceed even if IPv4 + * configuration fails or times out. Note that at least one IP configuration + * must succeed or overall network configuration will still fail. For + * example, in IPv6-only networks, setting this property to TRUE allows + * the overall network configuration to succeed if IPv4 configuration fails + * but IPv6 configuration completes successfully. + **/ + g_object_class_install_property + (object_class, PROP_MAY_FAIL, + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, + "May Fail", + "If TRUE, allow overall network configuration to " + "proceed even if IPv4 configuration fails or times " + "out. Note that at least one IP configuration must " + "succeed or overall network configuration will still " + "fail. For example, in IPv6-only networks, setting " + "this property to TRUE allows the overall network " + "configuration to succeed if IPv4 configuration " + "fails but IPv6 configuration completes successfully.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); } diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h index 777f53f126..80ddd4758e 100644 --- a/libnm-util/nm-setting-ip4-config.h +++ b/libnm-util/nm-setting-ip4-config.h @@ -64,6 +64,7 @@ GQuark nm_setting_ip4_config_error_quark (void); #define NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname" #define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname" #define NM_SETTING_IP4_CONFIG_NEVER_DEFAULT "never-default" +#define NM_SETTING_IP4_CONFIG_MAY_FAIL "may-fail" #define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto" #define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local" @@ -169,6 +170,8 @@ const char * nm_setting_ip4_config_get_dhcp_hostname (NMSettingIP4Config * gboolean nm_setting_ip4_config_get_never_default (NMSettingIP4Config *setting); +gboolean nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting); + G_END_DECLS #endif /* NM_SETTING_IP4_CONFIG_H */ diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index 05f21f037e..f92595b705 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -79,6 +79,7 @@ typedef struct { gboolean ignore_auto_routes; gboolean ignore_auto_dns; gboolean never_default; + gboolean may_fail; } NMSettingIP6ConfigPrivate; @@ -92,6 +93,7 @@ enum { PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_NEVER_DEFAULT, + PROP_MAY_FAIL, LAST_PROP }; @@ -414,6 +416,14 @@ nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting) return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->never_default; } +gboolean +nm_setting_ip6_config_get_may_fail (NMSettingIP6Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE); + + return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->may_fail; +} + static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -535,6 +545,9 @@ set_property (GObject *object, guint prop_id, case PROP_NEVER_DEFAULT: priv->never_default = g_value_get_boolean (value); break; + case PROP_MAY_FAIL: + priv->may_fail = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -572,6 +585,9 @@ get_property (GObject *object, guint prop_id, case PROP_NEVER_DEFAULT: g_value_set_boolean (value, priv->never_default); break; + case PROP_MAY_FAIL: + g_value_set_boolean (value, priv->may_fail); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -802,6 +818,30 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + /** + * NMSettingIP6Config:may-fail: + * + * If TRUE, allow overall network configuration to proceed even if IPv6 + * configuration fails or times out. Note that at least one IP configuration + * must succeed or overall network configuration will still fail. For + * example, in IPv4-only networks, setting this property to TRUE allows + * the overall network configuration to succeed if IPv6 configuration fails + * but IPv4 configuration completes successfully. + **/ + g_object_class_install_property + (object_class, PROP_MAY_FAIL, + g_param_spec_boolean (NM_SETTING_IP6_CONFIG_MAY_FAIL, + "May Fail", + "If TRUE, allow overall network configuration to " + "proceed even if IPv6 configuration fails or times " + "out. Note that at least one IP configuration must " + "succeed or overall network configuration will still " + "fail. For example, in IPv4-only networks, setting " + "this property to TRUE allows the overall network " + "configuration to succeed if IPv6 configuration " + "fails but IPv4 configuration completes successfully.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); } /********************************************************************/ diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index 78617c4547..e3e286e684 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -62,6 +62,7 @@ GQuark nm_setting_ip6_config_error_quark (void); #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" #define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default" +#define NM_SETTING_IP6_CONFIG_MAY_FAIL "may-fail" #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore" #define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" @@ -163,6 +164,7 @@ gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting); gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting); +gboolean nm_setting_ip6_config_get_may_fail (NMSettingIP6Config *setting); G_END_DECLS From 7025e054d943ae146f1b9f375d47b6871811bc28 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 00:08:02 -0700 Subject: [PATCH 336/392] libnm-util: clarify may-fail behavior --- libnm-util/nm-setting-ip4-config.c | 6 +++--- libnm-util/nm-setting-ip6-config.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index a1a9674af7..186e41e243 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -989,7 +989,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) * NMSettingIP4Config:may-fail: * * If TRUE, allow overall network configuration to proceed even if IPv4 - * configuration fails or times out. Note that at least one IP configuration + * configuration times out. Note that at least one IP configuration * must succeed or overall network configuration will still fail. For * example, in IPv6-only networks, setting this property to TRUE allows * the overall network configuration to succeed if IPv4 configuration fails @@ -1000,8 +1000,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, "May Fail", "If TRUE, allow overall network configuration to " - "proceed even if IPv4 configuration fails or times " - "out. Note that at least one IP configuration must " + "proceed even if IPv4 configuration times out. " + "Note that at least one IP configuration must " "succeed or overall network configuration will still " "fail. For example, in IPv6-only networks, setting " "this property to TRUE allows the overall network " diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index f92595b705..e8af058041 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -822,7 +822,7 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * NMSettingIP6Config:may-fail: * * If TRUE, allow overall network configuration to proceed even if IPv6 - * configuration fails or times out. Note that at least one IP configuration + * configuration times out. Note that at least one IP configuration * must succeed or overall network configuration will still fail. For * example, in IPv4-only networks, setting this property to TRUE allows * the overall network configuration to succeed if IPv6 configuration fails @@ -833,8 +833,8 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) g_param_spec_boolean (NM_SETTING_IP6_CONFIG_MAY_FAIL, "May Fail", "If TRUE, allow overall network configuration to " - "proceed even if IPv6 configuration fails or times " - "out. Note that at least one IP configuration must " + "proceed even if IPv6 configuration times out. " + "Note that at least one IP configuration must " "succeed or overall network configuration will still " "fail. For example, in IPv4-only networks, setting " "this property to TRUE allows the overall network " From 3fb8cdb35fca27cef848f0e2046fd3fa9c2750ee Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 00:59:06 -0700 Subject: [PATCH 337/392] mesh: let parent class handle IP config timeout --- src/nm-device-olpc-mesh.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c index f73108a793..546ecfafe4 100644 --- a/src/nm-device-olpc-mesh.c +++ b/src/nm-device-olpc-mesh.c @@ -637,15 +637,6 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) return NM_ACT_STAGE_RETURN_SUCCESS; } -static NMActStageReturn -real_act_stage4_ip4_config_timeout (NMDevice *dev, - NMIP4Config **config, - NMDeviceStateReason *reason) -{ - return NM_ACT_STAGE_RETURN_FAILURE; -} - - static void dispose (GObject *object) { @@ -734,7 +725,6 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass) parent_class->act_stage1_prepare = real_act_stage1_prepare; parent_class->act_stage2_config = real_act_stage2_config; - parent_class->act_stage4_ip4_config_timeout = real_act_stage4_ip4_config_timeout; /* Properties */ g_object_class_install_property From 8aef7ef411a88a43fb79d139b3ecd003e9c1b5d6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 01:19:54 -0700 Subject: [PATCH 338/392] core: allow selective failure of IP configuration (rh #567978) As long as at least one IP config method completes, and as long as methods that the user required to complete do complete, allow the connection to complete. --- src/nm-device-bt.c | 8 ++- src/nm-device-modem.c | 8 ++- src/nm-device-private.h | 2 + src/nm-device-wifi.c | 106 ++++++++++++++++++++++++++++------------ src/nm-device.c | 87 +++++++++++++++++++++++++-------- 5 files changed, 158 insertions(+), 53 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 8cf179e1ed..ef2c98db0e 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -275,10 +275,16 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) case NM_DEVICE_STATE_PREPARE: case NM_DEVICE_STATE_CONFIG: case NM_DEVICE_STATE_NEED_AUTH: - case NM_DEVICE_STATE_IP_CONFIG: case NM_DEVICE_STATE_ACTIVATED: nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); break; + case NM_DEVICE_STATE_IP_CONFIG: + if (nm_device_ip_config_should_fail (device, FALSE)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } + break; default: break; } diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index b13ce6c3bb..3ba26ddcdd 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.c @@ -72,10 +72,16 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) case NM_DEVICE_STATE_PREPARE: case NM_DEVICE_STATE_CONFIG: case NM_DEVICE_STATE_NEED_AUTH: - case NM_DEVICE_STATE_IP_CONFIG: case NM_DEVICE_STATE_ACTIVATED: nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); break; + case NM_DEVICE_STATE_IP_CONFIG: + if (nm_device_ip_config_should_fail (device, FALSE)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } + break; default: break; } diff --git a/src/nm-device-private.h b/src/nm-device-private.h index 5c71aa1a78..371f17f10d 100644 --- a/src/nm-device-private.h +++ b/src/nm-device-private.h @@ -40,4 +40,6 @@ void nm_device_handle_autoip4_event (NMDevice *self, const char *event, const char *address); +gboolean nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6); + #endif /* NM_DEVICE_PRIVATE_H */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index b598f2b675..1fa2937253 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2676,7 +2676,11 @@ handle_auth_or_fail (NMDeviceWifi *self, NMConnection *connection; g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NM_ACT_STAGE_RETURN_FAILURE); - g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + + if (!req) { + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + } connection = nm_act_request_get_connection (req); g_assert (connection); @@ -3187,21 +3191,19 @@ real_act_stage4_get_ip4_config (NMDevice *dev, static NMActStageReturn -real_act_stage4_ip4_config_timeout (NMDevice *dev, - NMIP4Config **config, - NMDeviceStateReason *reason) +handle_ip_config_timeout (NMDeviceWifi *self, + NMConnection *connection, + gboolean may_fail, + gboolean *chain_up, + NMDeviceStateReason *reason) { - NMDeviceWifi *self = NM_DEVICE_WIFI (dev); - NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self); + NMAccessPoint *ap; NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; - NMIP4Config *real_config = NULL; - NMActRequest *req = nm_device_get_act_request (dev); - NMConnection *connection; gboolean auth_enforced = FALSE, encrypted = FALSE; - g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); - g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (connection != NULL, NM_ACT_STAGE_RETURN_FAILURE); + ap = nm_device_wifi_get_activation_ap (self); g_assert (ap); /* If nothing checks the security authentication information (as in @@ -3209,9 +3211,8 @@ real_act_stage4_ip4_config_timeout (NMDevice *dev, * the encryption key is likely wrong. Ask the user for a new one. * Otherwise the failure likely happened after a successful authentication. */ - connection = nm_act_request_get_connection (req); auth_enforced = ap_auth_enforced (connection, ap, &encrypted); - if (encrypted && !auth_enforced) { + if (encrypted && !auth_enforced && !may_fail) { NMSettingConnection *s_con; s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); @@ -3220,39 +3221,83 @@ real_act_stage4_ip4_config_timeout (NMDevice *dev, nm_log_warn (LOGD_DEVICE | LOGD_WIFI, "Activation (%s/wireless): could not get IP configuration for " "connection '%s'.", - nm_device_get_iface (dev), nm_setting_connection_get_id (s_con)); + nm_device_get_iface (NM_DEVICE (self)), + nm_setting_connection_get_id (s_con)); - ret = handle_auth_or_fail (self, req, TRUE); + ret = handle_auth_or_fail (self, NULL, TRUE); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { nm_log_info (LOGD_DEVICE | LOGD_WIFI, "Activation (%s/wireless): asking for new secrets", - nm_device_get_iface (dev)); + nm_device_get_iface (NM_DEVICE (self))); } else { *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; } - } else if (nm_ap_get_mode (ap) == NM_802_11_MODE_ADHOC) { - NMDeviceWifiClass *klass; - NMDeviceClass * parent_class; - - /* For Ad-Hoc networks, chain up to parent to get a Zeroconf IP */ - klass = NM_DEVICE_WIFI_GET_CLASS (self); - parent_class = NM_DEVICE_CLASS (g_type_class_peek_parent (klass)); - ret = parent_class->act_stage4_ip4_config_timeout (dev, &real_config, reason); } else { /* Non-encrypted network or authentication is enforced by some - * entity (AP, RADIUS server, etc), but IP configure failed. Alert - * the user. + * entity (AP, RADIUS server, etc), but IP configure failed. Let the + * superclass handle it. */ - *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; - ret = NM_ACT_STAGE_RETURN_FAILURE; + *chain_up = TRUE; } - *config = real_config; - return ret; } +static NMActStageReturn +real_act_stage4_ip4_config_timeout (NMDevice *dev, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + gboolean may_fail = FALSE, chain_up = FALSE; + NMActStageReturn ret; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + may_fail = nm_setting_ip4_config_get_may_fail (s_ip4); + + ret = handle_ip_config_timeout (NM_DEVICE_WIFI (dev), connection, may_fail, &chain_up, reason); + if (chain_up) + ret = NM_DEVICE_CLASS (nm_device_wifi_parent_class)->act_stage4_ip4_config_timeout (dev, config, reason); + + return ret; +} + +static NMActStageReturn +real_act_stage4_ip6_config_timeout (NMDevice *dev, + NMIP6Config **config, + NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP6Config *s_ip6; + gboolean may_fail = FALSE, chain_up = FALSE; + NMActStageReturn ret; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) + may_fail = nm_setting_ip6_config_get_may_fail (s_ip6); + + ret = handle_ip_config_timeout (NM_DEVICE_WIFI (dev), connection, may_fail, &chain_up, reason); + if (chain_up) + ret = NM_DEVICE_CLASS (nm_device_wifi_parent_class)->act_stage4_ip6_config_timeout (dev, config, reason); + + return ret; +} + static void activation_success_handler (NMDevice *dev) { @@ -3725,6 +3770,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) parent_class->act_stage2_config = real_act_stage2_config; parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; parent_class->act_stage4_ip4_config_timeout = real_act_stage4_ip4_config_timeout; + parent_class->act_stage4_ip6_config_timeout = real_act_stage4_ip6_config_timeout; parent_class->deactivate = real_deactivate; parent_class->deactivate_quickly = real_deactivate_quickly; parent_class->can_interrupt_activation = real_can_interrupt_activation; diff --git a/src/nm-device.c b/src/nm-device.c index 9fa2523b9f..a09a69218f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -177,6 +177,11 @@ static NMActStageReturn dhcp6_start (NMDevice *self, guint32 dhcp_opt, NMDeviceStateReason *reason); +static void addrconf6_cleanup (NMDevice *self); +static void dhcp6_cleanup (NMDevice *self, gboolean stop); +static void dhcp4_cleanup (NMDevice *self, gboolean stop); + + static void device_interface_init (NMDeviceInterface *device_interface_class) { @@ -574,6 +579,35 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family) } } +gboolean +nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + + g_return_val_if_fail (self != NULL, TRUE); + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Fail the connection if the failed IP method is required to complete */ + if (ip6) { + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6 && !nm_setting_ip6_config_get_may_fail (s_ip6)) + return TRUE; + } else { + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4 && !nm_setting_ip4_config_get_may_fail (s_ip4)) + return TRUE; + } + + return FALSE; +} + static void ip6_addrconf_complete (NMIP6Manager *ip6_manager, int ifindex, @@ -1318,9 +1352,12 @@ dhcp_state_changed (NMDHCPClient *client, nm_dhcp4_config_reset (priv->dhcp4_config); /* dhclient quit and can't get/renew a lease; so kill the connection */ - if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DHCP_FAILED); - else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + if (ipv6) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + else + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); break; case DHC_STOP: @@ -1797,8 +1834,7 @@ nm_device_activate_stage4_ip4_config_get (gpointer user_data) ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip4_config (self, &ip4_config, &reason); if (ret == NM_ACT_STAGE_RETURN_POSTPONE) goto out; - else if (!ip4_config || (ret == NM_ACT_STAGE_RETURN_FAILURE)) - { + else if (!ip4_config || (ret == NM_ACT_STAGE_RETURN_FAILURE)) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; } @@ -1852,9 +1888,12 @@ real_act_stage4_ip4_config_timeout (NMDevice *self, /* Notify of invalid DHCP4 config object */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); - /* DHCP failed; connection must fail */ - *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; - return NM_ACT_STAGE_RETURN_FAILURE; + if (nm_device_ip_config_should_fail (self, FALSE)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NM_ACT_STAGE_RETURN_FAILURE; + } + + return NM_ACT_STAGE_RETURN_SUCCESS; } @@ -1882,17 +1921,18 @@ nm_device_activate_stage4_ip4_config_timeout (gpointer user_data) iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip4_config_timeout (self, &ip4_config, &reason); - if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) goto out; - } else if (!ip4_config || (ret == NM_ACT_STAGE_RETURN_FAILURE)) { + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; } g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); - g_assert (ip4_config); - g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), - NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + if (ip4_config) { + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + } nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET); @@ -2125,11 +2165,15 @@ real_act_stage4_ip6_config_timeout (NMDevice *self, g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); - /* Notify of invalid DHCP6 config object */ + /* Notify of invalid DHCP4 config object */ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); - *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; - return NM_ACT_STAGE_RETURN_FAILURE; + if (nm_device_ip_config_should_fail (self, TRUE)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NM_ACT_STAGE_RETURN_FAILURE; + } + + return NM_ACT_STAGE_RETURN_SUCCESS; } @@ -2157,17 +2201,18 @@ nm_device_activate_stage4_ip6_config_timeout (gpointer user_data) iface); ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip6_config_timeout (self, &ip6_config, &reason); - if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) goto out; - } else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); goto out; } g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); - g_assert (ip6_config); - g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), - NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + if (ip6_config) { + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + } nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET6); From 13e1aaa423e3ad65a849b55d65f273272b454336 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 01:33:55 -0700 Subject: [PATCH 339/392] ifcfg-rh: add support for non-fatal IP configuration failure --- system-settings/plugins/ifcfg-rh/reader.c | 2 ++ .../tests/network-scripts/ifcfg-test-wired-ipv6-manual | 1 + system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 8 ++++++++ system-settings/plugins/ifcfg-rh/writer.c | 8 ++++++++ 4 files changed, 19 insertions(+) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index c98cf6e272..28244206a9 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1233,6 +1233,7 @@ make_ip4_setting (shvarFile *ifcfg, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "PEERDNS", TRUE), NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "PEERROUTES", TRUE), NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, never_default, + NM_SETTING_IP4_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV4_FAILURE_FATAL", TRUE), NULL); /* Handle manual settings */ @@ -1488,6 +1489,7 @@ make_ip6_setting (shvarFile *ifcfg, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, !svTrueValue (ifcfg, "IPV6_PEERDNS", TRUE), NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, !svTrueValue (ifcfg, "IPV6_PEERROUTES", TRUE), NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default, + NM_SETTING_IP6_CONFIG_MAY_FAIL, !svTrueValue (ifcfg, "IPV6_FAILURE_FATAL", FALSE), NULL); if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual index 4be4044f18..45db0e4c4b 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual @@ -16,3 +16,4 @@ IPV6INIT=yes IPV6_AUTOCONF=no IPV6ADDR="1001:abba::1234/56" IPV6ADDR_SECONDARIES="2001:abba::2234/64 3001:abba::3234/96" +IPV6_FAILURE_FATAL=no diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 9a370be45a..7ca0ecf87c 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -2011,6 +2011,12 @@ test_read_wired_ipv6_manual (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + ASSERT (nm_setting_ip6_config_get_may_fail (s_ip6) == TRUE, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_MAY_FAIL); + /* IP addresses */ ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 3, "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected %s / %s key value", @@ -5157,6 +5163,7 @@ test_write_wired_static (void) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE, NULL); addr = nm_ip4_address_new (); @@ -5188,6 +5195,7 @@ test_write_wired_static (void) g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE, NULL); /* Add addresses */ diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index d1e1458f73..30ef6e3941 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1087,6 +1087,10 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "DHCP_CLIENT_ID", value, FALSE); } + svSetValue (ifcfg, "IPV4_FAILURE_FATAL", + nm_setting_ip4_config_get_may_fail (s_ip4) ? "no" : "yes", + FALSE); + /* Static routes - route- file */ route_path = utils_get_route_path (ifcfg->fileName); if (!route_path) { @@ -1373,6 +1377,10 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) FALSE); } + svSetValue (ifcfg, "IPV6_FAILURE_FATAL", + nm_setting_ip6_config_get_may_fail (s_ip6) ? "no" : "yes", + FALSE); + /* Static routes go to route6- file */ route6_path = utils_get_route6_path (ifcfg->fileName); if (!route6_path) { From dd699c585f125ca512913c2c2d5e7a182749d349 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 02:11:59 -0700 Subject: [PATCH 340/392] core: better logging for interface address syncing --- src/nm-system.c | 61 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 20d06b83ad..517460d4fe 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -196,8 +196,10 @@ sync_addresses (const char *iface, int ifindex, int family, struct nl_cache *addr_cache; struct rtnl_addr *filter_addr, *match_addr; struct nl_object *match; + struct nl_addr *nladdr; int i, err; guint32 log_domain = (family == AF_INET) ? LOGD_IP4 : LOGD_IP6; + char buf[INET6_ADDRSTRLEN + 1]; log_domain |= LOGD_DEVICE; @@ -218,20 +220,22 @@ sync_addresses (const char *iface, int ifindex, int family, if (family) rtnl_addr_set_family (filter_addr, family); + nm_log_dbg (log_domain, "(%s): syncing addresses (family %d)", iface, family); + /* Walk through the cache, comparing the addresses already on * the interface to the addresses in addrs. */ for (match = nl_cache_get_first (addr_cache); match; match = nl_cache_get_next (match)) { - match_addr = (struct rtnl_addr *)match; + gboolean buf_valid = FALSE; + match_addr = (struct rtnl_addr *) match; /* Skip addresses not on our interface */ - if (!nl_object_match_filter (match, (struct nl_object *)filter_addr)) + if (!nl_object_match_filter (match, (struct nl_object *) filter_addr)) continue; if (addrs) { for (i = 0; i < num_addrs; i++) { - if (addrs[i] && - nl_object_identical (match, (struct nl_object *)addrs[i])) + if (addrs[i] && nl_object_identical (match, (struct nl_object *) addrs[i])) break; } @@ -245,10 +249,31 @@ sync_addresses (const char *iface, int ifindex, int family, } } + nladdr = rtnl_addr_get_local (match_addr); + /* Don't delete IPv6 link-local addresses; they don't belong to NM */ - if (rtnl_addr_get_family (match_addr) == AF_INET6 && - rtnl_addr_get_scope (match_addr) == RT_SCOPE_LINK) { - continue; + if (rtnl_addr_get_family (match_addr) == AF_INET6) { + struct in6_addr *tmp; + + if (rtnl_addr_get_scope (match_addr) == RT_SCOPE_LINK) { + nm_log_dbg (log_domain, "(%s): ignoring IPv6 link-local address", iface); + continue; + } + + tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET6, tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } else if (rtnl_addr_get_family (match_addr) == AF_INET) { + struct in_addr *tmp; + + tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET, tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } + + if (buf_valid) { + nm_log_dbg (log_domain, "(%s): removing address '%s/%d'", + iface, buf, nl_addr_get_prefixlen (nladdr)); } /* Otherwise, match_addr should be removed from the interface. */ @@ -264,9 +289,29 @@ sync_addresses (const char *iface, int ifindex, int family, /* Now add the remaining new addresses */ for (i = 0; i < num_addrs; i++) { + struct in6_addr *in6tmp; + struct in_addr *in4tmp; + gboolean buf_valid = FALSE; + if (!addrs[i]) continue; + nladdr = rtnl_addr_get_local (addrs[i]); + if (rtnl_addr_get_family (addrs[i]) == AF_INET6) { + in6tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET6, in6tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } else if (rtnl_addr_get_family (addrs[i]) == AF_INET) { + in4tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET, in4tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } + + if (buf_valid) { + nm_log_dbg (log_domain, "(%s): adding address '%s/%d'", + iface, buf, nl_addr_get_prefixlen (nladdr)); + } + err = rtnl_addr_add (nlh, addrs[i], 0); if (err < 0) { nm_log_err (log_domain, @@ -1094,7 +1139,7 @@ static void flush_addresses (const char *iface, gboolean ipv4_only) g_return_if_fail (iface != NULL); iface_idx = nm_netlink_iface_to_index (iface); if (iface_idx >= 0) - sync_addresses (iface, iface_idx, ipv4_only ? AF_INET : 0, NULL, 0); + sync_addresses (iface, iface_idx, ipv4_only ? AF_INET : AF_UNSPEC, NULL, 0); } /* From 670de9b5fb7ef6f538136bdeeb8f0d50aeea3d6c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 02:42:48 -0700 Subject: [PATCH 341/392] ip6: tune RDNSS parsing logging --- src/ip6-manager/nm-ip6-manager.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index cafe9cc430..8066d30639 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -294,6 +294,8 @@ rdnss_expired (gpointer user_data) NMIP6Device *device = user_data; CallbackInfo info = { device, IP6_DHCP_OPT_NONE }; + nm_log_dbg (LOGD_IP6, "(%s): IPv6 RDNSS information expired", device->iface); + set_rdnss_timeout (device); emit_config_changed (&info); return FALSE; @@ -322,6 +324,12 @@ set_rdnss_timeout (NMIP6Device *device) * bit. */ if (rdnss->expires <= now + 1) { + char buf[INET6_ADDRSTRLEN + 1]; + + if (inet_ntop (AF_INET6, &(rdnss->addr), buf, sizeof (buf)) > 0) { + nm_log_dbg (LOGD_IP6, "(%s): removing expired RA-provided nameserver %s", + device->iface, buf); + } g_array_remove_index_fast (device->rdnss_servers, i--); continue; } @@ -651,11 +659,12 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime); for (addr = (struct in6_addr *) (rdnss_opt + 1); nd_opt_len >= 2; addr++, nd_opt_len -= 2) { - char buf[INET6_ADDRSTRLEN]; + char buf[INET6_ADDRSTRLEN + 1]; - if (inet_ntop (AF_INET6, &addr, buf, INET6_ADDRSTRLEN) > 0) { - nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s", - device->iface, buf); + if (inet_ntop (AF_INET6, addr, buf, sizeof (buf))) { + nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s (expires in %d seconds)", + device->iface, buf, + ntohl (rdnss_opt->nd_opt_rdnss_lifetime)); } server.addr = *addr; From c21416e9565b9a1274ca605e7baeee8ce2f6f94f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 02:48:18 -0700 Subject: [PATCH 342/392] ip6: don't prematurely remove RDNSS nameservers (rh #588192) --- src/ip6-manager/nm-ip6-manager.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 8066d30639..1b544a2449 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -693,10 +693,13 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) if (changed) { nm_log_dbg (LOGD_IP6, "(%s): RA-provided nameservers changed", device->iface); - g_array_free (device->rdnss_servers, TRUE); - device->rdnss_servers = servers; - } else - g_array_free (servers, TRUE); + } + + /* Always copy in new servers (even if unchanged) to get their updated + * expiration times. + */ + g_array_free (device->rdnss_servers, TRUE); + device->rdnss_servers = servers; /* Timeouts may have changed even if IPs didn't */ set_rdnss_timeout (device); From 10d6bc8d2ecbe996091b0c224ba14b7fdfe9123f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 03:02:57 -0700 Subject: [PATCH 343/392] ip6: fail if the RA-provided address disappears or RDNSS expires --- src/ip6-manager/nm-ip6-manager.c | 27 ++++++++++++++++++++++----- src/ip6-manager/nm-ip6-manager.h | 3 ++- src/nm-device.c | 8 ++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 1b544a2449..5101faf2a8 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -282,7 +282,10 @@ emit_config_changed (gpointer user_data) NMIP6Manager *manager = device->manager; device->config_changed_id = 0; - g_signal_emit (manager, signals[CONFIG_CHANGED], 0, device->ifindex, info->dhcp_opts); + g_signal_emit (manager, signals[CONFIG_CHANGED], 0, + device->ifindex, + info->dhcp_opts, + info->success); return FALSE; } @@ -386,7 +389,7 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) struct in6_addr *addr; CallbackInfo *info; guint dhcp_opts = IP6_DHCP_OPT_NONE; - gboolean found_linklocal = FALSE; + gboolean found_linklocal = FALSE, found_other = FALSE; nm_log_dbg (LOGD_IP6, "(%s): syncing with netlink (ra_flags 0x%X) (state/target '%s'/'%s')", device->iface, device->ra_flags, @@ -420,6 +423,7 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) } else { if (device->state < NM_IP6_DEVICE_GOT_ADDRESS) device->state = NM_IP6_DEVICE_GOT_ADDRESS; + found_other = TRUE; } } @@ -473,7 +477,20 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) } } else if (config_changed) { if (!device->config_changed_id) { - info = callback_info_new (device, dhcp_opts, TRUE); + gboolean success = TRUE; + + /* If for some reason an RA-provided address disappeared, we need + * to make sure we fail the connection as it's no longer valid. + */ + if ( (device->state == NM_IP6_DEVICE_GOT_ADDRESS) + && (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) + && !found_other) { + nm_log_dbg (LOGD_IP6, "(%s): RA-provided address no longer valid", + device->iface); + success = FALSE; + } + + info = callback_info_new (device, dhcp_opts, success); device->config_changed_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, emit_config_changed, info, @@ -1141,7 +1158,7 @@ nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), NULL, NULL, - _nm_marshal_VOID__INT_UINT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); + _nm_marshal_VOID__INT_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); } diff --git a/src/ip6-manager/nm-ip6-manager.h b/src/ip6-manager/nm-ip6-manager.h index db920662b9..7cd0ef70e6 100644 --- a/src/ip6-manager/nm-ip6-manager.h +++ b/src/ip6-manager/nm-ip6-manager.h @@ -64,7 +64,8 @@ typedef struct { */ void (*config_changed) (NMIP6Manager *manager, guint32 ifindex, - guint dhcp_opts); + guint dhcp_opts, + gboolean success); } NMIP6ManagerClass; GType nm_ip6_manager_get_type (void); diff --git a/src/nm-device.c b/src/nm-device.c index a09a69218f..d8f7b64f02 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -681,6 +681,7 @@ static void ip6_config_changed (NMIP6Manager *ip6_manager, int ifindex, guint dhcp_opts, + gboolean success, gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); @@ -692,6 +693,13 @@ ip6_config_changed (NMIP6Manager *ip6_manager, /* FIXME: re-run DHCPv6 here to get any new nameservers or whatever */ + if (!success && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) { + nm_device_state_changed (self, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + return; + } + nm_device_activate_schedule_stage4_ip6_config_get (self); } From 7926b3ca95f2c0c611e271f805437cca9dc004ea Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 03:42:43 -0700 Subject: [PATCH 344/392] ip6: turn RA acceptance off when RAs shouldn't be used (rh #588163) Make sure we don't inadvertenly let the kernel assign an RA address when connections that don't allow RA are used. --- src/NetworkManagerUtils.c | 29 ++++++++++++++ src/NetworkManagerUtils.h | 4 ++ src/ip6-manager/nm-ip6-manager.c | 63 ++++-------------------------- src/ip6-manager/nm-ip6-manager.h | 3 +- src/nm-device.c | 66 +++++++++++++++++++++++++++++++- 5 files changed, 107 insertions(+), 58 deletions(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 4bd57d9944..fe64e1fea7 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -594,3 +594,32 @@ nm_utils_do_sysctl (const char *path, const char *value) return TRUE; } +gboolean +nm_utils_get_proc_sys_net_value (const char *path, + const char *iface, + guint32 *out_value) +{ + GError *error = NULL; + char *contents = NULL; + gboolean success = FALSE; + long int tmp; + + if (!g_file_get_contents (path, &contents, NULL, &error)) { + nm_log_warn (LOGD_DEVICE, "(%s): error reading %s: (%d) %s", + iface, path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + errno = 0; + tmp = strtol (contents, NULL, 10); + if ((errno == 0) && (tmp == 0 || tmp == 1)) { + *out_value = (guint32) tmp; + success = TRUE; + } + g_free (contents); + } + + return success; +} + diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index fa8b598db2..e3d1793b4d 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -73,4 +73,8 @@ void value_hash_add_bool (GHashTable *hash, gboolean nm_utils_do_sysctl (const char *path, const char *value); +gboolean nm_utils_get_proc_sys_net_value (const char *path, + const char *iface, + guint32 *out_value); + #endif /* NETWORK_MANAGER_UTILS_H */ diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 5101faf2a8..333638adb3 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -83,10 +83,6 @@ typedef struct { char *iface; int ifindex; - char *accept_ra_path; - gboolean accept_ra_save_valid; - guint32 accept_ra_save; - char *disable_ip6_path; gboolean disable_ip6_save_valid; guint32 disable_ip6_save; @@ -111,12 +107,6 @@ nm_ip6_device_destroy (NMIP6Device *device) { g_return_if_fail (device != NULL); - /* reset the saved RA value */ - if (device->accept_ra_save_valid) { - nm_utils_do_sysctl (device->accept_ra_path, - device->accept_ra_save ? "1\n" : "0\n"); - } - /* reset the saved IPv6 value */ if (device->disable_ip6_save_valid) { nm_utils_do_sysctl (device->disable_ip6_path, @@ -135,37 +125,9 @@ nm_ip6_device_destroy (NMIP6Device *device) if (device->ip6flags_poll_id) g_source_remove (device->ip6flags_poll_id); - g_free (device->accept_ra_path); g_slice_free (NMIP6Device, device); } -static gboolean -get_proc_sys_net_value (const char *path, const char *iface, guint32 *out_value) -{ - GError *error = NULL; - char *contents = NULL; - gboolean success = FALSE; - long int tmp; - - if (!g_file_get_contents (path, &contents, NULL, &error)) { - nm_log_warn (LOGD_IP6, "(%s): error reading %s: (%d) %s", - iface, path, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); - g_clear_error (&error); - } else { - errno = 0; - tmp = strtol (contents, NULL, 10); - if ((errno == 0) && (tmp == 0 || tmp == 1)) { - *out_value = (guint32) tmp; - success = TRUE; - } - g_free (contents); - } - - return success; -} - static NMIP6Device * nm_ip6_device_new (NMIP6Manager *manager, int ifindex) { @@ -195,23 +157,13 @@ nm_ip6_device_new (NMIP6Manager *manager, int ifindex) g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); - /* Grab the original value of "accept_ra" so we can restore it when the - * device is taken down. - */ - device->accept_ra_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", - device->iface); - g_assert (device->accept_ra_path); - device->accept_ra_save_valid = get_proc_sys_net_value (device->accept_ra_path, - device->iface, - &device->accept_ra_save); - /* and the original value of IPv6 enable/disable */ device->disable_ip6_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/disable_ipv6", device->iface); g_assert (device->disable_ip6_path); - device->disable_ip6_save_valid = get_proc_sys_net_value (device->disable_ip6_path, - device->iface, - &device->disable_ip6_save); + device->disable_ip6_save_valid = nm_utils_get_proc_sys_net_value (device->disable_ip6_path, + device->iface, + &device->disable_ip6_save); return device; @@ -835,8 +787,9 @@ netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer us void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, - int ifindex, - NMSettingIP6Config *s_ip6) + int ifindex, + NMSettingIP6Config *s_ip6, + const char *accept_ra_path) { NMIP6ManagerPrivate *priv; NMIP6Device *device; @@ -861,10 +814,10 @@ nm_ip6_manager_prepare_interface (NMIP6Manager *manager, /* Establish target state and turn router advertisement acceptance on or off */ if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { device->target_state = NM_IP6_DEVICE_GOT_LINK_LOCAL; - nm_utils_do_sysctl (device->accept_ra_path, "0\n"); + nm_utils_do_sysctl (accept_ra_path, "0\n"); } else { device->target_state = NM_IP6_DEVICE_GOT_ADDRESS; - nm_utils_do_sysctl (device->accept_ra_path, "1\n"); + nm_utils_do_sysctl (accept_ra_path, "1\n"); } } diff --git a/src/ip6-manager/nm-ip6-manager.h b/src/ip6-manager/nm-ip6-manager.h index 7cd0ef70e6..77c1106841 100644 --- a/src/ip6-manager/nm-ip6-manager.h +++ b/src/ip6-manager/nm-ip6-manager.h @@ -73,7 +73,8 @@ GType nm_ip6_manager_get_type (void); NMIP6Manager *nm_ip6_manager_get (void); void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, int ifindex, - NMSettingIP6Config *s_ip6); + NMSettingIP6Config *s_ip6, + const char *accept_ra_path); void nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex); void nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, diff --git a/src/nm-device.c b/src/nm-device.c index d8f7b64f02..88c57ba75b 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -135,6 +135,9 @@ typedef struct { gulong ip6_config_changed_sigid; gboolean ip6_waiting_for_config; + char * ip6_accept_ra_path; + guint32 ip6_accept_ra_save; + NMDHCPClient * dhcp6_client; guint32 dhcp6_mode; gulong dhcp6_state_sigid; @@ -207,6 +210,41 @@ nm_device_init (NMDevice *self) priv->rfkill_type = RFKILL_TYPE_UNKNOWN; } +static void +update_accept_ra_save (NMDevice *self) +{ + NMDevicePrivate *priv; + const char *ip_iface; + char *new_path; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + ip_iface = nm_device_get_ip_iface (self); + + new_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", ip_iface); + g_assert (new_path); + + if (priv->ip6_accept_ra_path) { + /* If the IP iface is different from before, use the new value */ + if (!strcmp (new_path, priv->ip6_accept_ra_path)) { + g_free (new_path); + return; + } + g_free (priv->ip6_accept_ra_path); + } + + /* Grab the original value of "accept_ra" so we can restore it when NM exits */ + priv->ip6_accept_ra_path = new_path; + if (!nm_utils_get_proc_sys_net_value (priv->ip6_accept_ra_path, + ip_iface, + &priv->ip6_accept_ra_save)) { + g_free (priv->ip6_accept_ra_path); + priv->ip6_accept_ra_path = NULL; + } +} + static GObject* constructor (GType type, guint n_construct_params, @@ -246,6 +284,8 @@ constructor (GType type, priv->dhcp_manager = nm_dhcp_manager_get (); + update_accept_ra_save (dev); + priv->initialized = TRUE; return object; @@ -744,7 +784,8 @@ addrconf6_setup (NMDevice *self) s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); nm_ip6_manager_prepare_interface (priv->ip6_manager, nm_device_get_ip_ifindex (self), - s_ip6); + s_ip6, + priv->ip6_accept_ra_path); priv->ip6_waiting_for_config = TRUE; return TRUE; @@ -1589,6 +1630,8 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) ip_iface = nm_device_get_ip_iface (self); + update_accept_ra_save (self); + priv->dhcp6_mode = IP6_DHCP_OPT_NONE; if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) @@ -1600,13 +1643,21 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + /* Router advertisements shouldn't be used in pure DHCP mode */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); + priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED; ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { priv->ip6_ready = TRUE; ret = NM_ACT_STAGE_RETURN_STOP; - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* Router advertisements shouldn't be used in manual mode */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); ret = NM_ACT_STAGE_RETURN_SUCCESS; + } /* Other methods (shared) aren't implemented yet */ @@ -2676,6 +2727,10 @@ nm_device_deactivate_quickly (NMDevice *self) dnsmasq_cleanup (self); aipd_cleanup (self); + /* Turn off router advertisements until they are needed */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); + /* Call device type-specific deactivation */ if (NM_DEVICE_GET_CLASS (self)->deactivate_quickly) NM_DEVICE_GET_CLASS (self)->deactivate_quickly (self); @@ -3247,6 +3302,13 @@ dispose (GObject *object) addrconf6_cleanup (self); dnsmasq_cleanup (self); + /* reset the saved RA value */ + if (priv->ip6_accept_ra_path) { + nm_utils_do_sysctl (priv->ip6_accept_ra_path, + priv->ip6_accept_ra_save ? "1\n" : "0\n"); + } + g_free (priv->ip6_accept_ra_path); + /* Take the device itself down and clear its IPv4 configuration */ if (priv->managed && take_down) { NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; From 0ab71998cefd8bcf0c93d45d0f642e596c7ed00c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 04:12:18 -0700 Subject: [PATCH 345/392] ifcfg-rh: test implicit may-fail configuration --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 7ca0ecf87c..35cea36cf5 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -560,6 +560,13 @@ test_read_wired_static (const char *file, const char *expected_id) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + /* Implicit may-fail */ + ASSERT (nm_setting_ip4_config_get_may_fail (s_ip4) == FALSE, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_MAY_FAIL); + /* DNS Addresses */ ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2, "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", @@ -648,6 +655,13 @@ test_read_wired_static (const char *file, const char *expected_id) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_METHOD); + /* Implicit may-fail */ + ASSERT (nm_setting_ip6_config_get_may_fail (s_ip6) == TRUE, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_MAY_FAIL); + /* DNS Addresses */ ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2, "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", From 719738d1335b8c41ebcd20b8eec11804beb70e43 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 04:53:13 -0700 Subject: [PATCH 346/392] keyfile: fix for IPv6 address gateways --- system-settings/plugins/keyfile/io/reader.c | 44 ++- system-settings/plugins/keyfile/io/writer.c | 34 ++- .../keyfile/tests/keyfiles/Makefile.am | 3 +- .../tests/keyfiles/Test_Wired_Connection_IP6 | 20 ++ .../plugins/keyfile/tests/test-keyfile.c | 277 +++++++++++++++++- 5 files changed, 362 insertions(+), 16 deletions(-) create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index 3a4ec42e84..a71c05c577 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -337,13 +337,30 @@ split_prefix (char *addr) return slash; } +static char * +split_gw (char *str) +{ + char *comma; + + g_return_val_if_fail (str != NULL, NULL); + + /* Find the prefix and split the string */ + comma = strchr (str, ','); + if (comma && comma > str) { + comma++; + *(comma - 1) = '\0'; + return comma; + } + return NULL; +} + static GPtrArray * read_ip6_addresses (GKeyFile *file, const char *setting_name, const char *key) { GPtrArray *addresses; - struct in6_addr addr; + struct in6_addr addr, gw; guint32 prefix; int i = 0; @@ -351,10 +368,11 @@ read_ip6_addresses (GKeyFile *file, /* Look for individual addresses */ while (i++ < 1000) { - char *tmp, *key_name, *str_prefix; + char *tmp, *key_name, *str_prefix, *str_gw; int ret; GValueArray *values; GByteArray *address; + GByteArray *gateway; GValue value = { 0 }; key_name = g_strdup_printf ("%s%d", key, i); @@ -377,6 +395,7 @@ read_ip6_addresses (GKeyFile *file, g_value_array_free (values); goto next; } + address = g_byte_array_new (); g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); @@ -401,6 +420,26 @@ read_ip6_addresses (GKeyFile *file, g_value_array_append (values, &value); g_value_unset (&value); + /* Gateway (optional) */ + str_gw = split_gw (str_prefix); + if (str_gw) { + ret = inet_pton (AF_INET6, str_gw, &gw); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s gateway '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + + if (!IN6_IS_ADDR_UNSPECIFIED (&gw)) { + gateway = g_byte_array_new (); + g_byte_array_append (gateway, (guint8 *) gw.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, gateway); + g_value_array_append (values, &value); + g_value_unset (&value); + } + } + g_ptr_array_add (addresses, values); next: @@ -422,7 +461,6 @@ ip6_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) const char *setting_name = nm_setting_get_name (setting); addresses = read_ip6_addresses (keyfile, setting_name, key); - if (addresses) { g_object_set (setting, key, addresses, NULL); g_ptr_array_foreach (addresses, free_one_ip6_address, NULL); diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index 2e194072e3..355d624c19 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -226,18 +226,27 @@ ip6_dns_writer (GKeyFile *file, } static gboolean -ip6_array_to_addr (GValueArray *values, guint32 idx, char *buf, size_t buflen) +ip6_array_to_addr (GValueArray *values, + guint32 idx, + char *buf, + size_t buflen, + gboolean *out_is_unspec) { GByteArray *byte_array; GValue *addr_val; + struct in6_addr *addr; g_return_val_if_fail (buflen >= INET6_ADDRSTRLEN, FALSE); - /* address */ addr_val = g_value_array_get_nth (values, idx); byte_array = g_value_get_boxed (addr_val); + addr = (struct in6_addr *) byte_array->data; + + if (out_is_unspec && IN6_IS_ADDR_UNSPECIFIED (addr)) + *out_is_unspec = TRUE; + errno = 0; - if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, buflen)) { + if (!inet_ntop (AF_INET6, addr, buf, buflen)) { GString *ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 10); /* error converting the address */ @@ -259,18 +268,24 @@ ip6_array_to_addr_prefix (GValueArray *values) GValue *prefix_val; char *ret = NULL; GString *ip6_str; - char buf[INET6_ADDRSTRLEN]; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; /* address */ - if (ip6_array_to_addr (values, 0, buf, sizeof (buf))) { + if (ip6_array_to_addr (values, 0, buf, sizeof (buf), NULL)) { /* Enough space for the address, '/', and the prefix */ - ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 5); + ip6_str = g_string_sized_new ((INET6_ADDRSTRLEN * 2) + 5); /* prefix */ g_string_append (ip6_str, buf); prefix_val = g_value_array_get_nth (values, 1); g_string_append_printf (ip6_str, "/%u", g_value_get_uint (prefix_val)); + if (ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) { + if (!is_unspec) + g_string_append_printf (ip6_str, ",%s", buf); + } + ret = ip6_str->str; g_string_free (ip6_str, FALSE); } @@ -337,7 +352,8 @@ ip6_route_writer (GKeyFile *file, GValueArray *values = g_ptr_array_index (array, i); char *key_name; guint32 int_val; - char buf[INET6_ADDRSTRLEN]; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; memset (list, 0, sizeof (list)); @@ -347,7 +363,9 @@ ip6_route_writer (GKeyFile *file, continue; /* Next Hop */ - if (!ip6_array_to_addr (values, 2, buf, sizeof (buf))) + if (!ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) + continue; + if (is_unspec) continue; list[1] = g_strdup (buf); diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am index a4ba7bf01d..bf5a5ab060 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -2,7 +2,8 @@ EXTRA_DIST = \ Test_Wired_Connection \ Test_GSM_Connection \ Test_Wireless_Connection \ - Test_Wired_Connection_MAC_Case + Test_Wired_Connection_MAC_Case \ + Test_Wired_Connection_IP6 check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 new file mode 100644 index 0000000000..a42dd5d2a5 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 @@ -0,0 +1,20 @@ + +[connection] +id=Test Wired Connection IP6 +uuid=4e80a56d-c99f-4aad-a6dd-b449bc398c57 +type=802-3-ethernet +autoconnect=true +timestamp=6654332 + +[802-3-ethernet] +auto-negotiate=true +mtu=1400 + +[ipv4] +method=disabled + +[ipv6] +method=manual +addresses1=abcd:1234:ffff::cdde/64,abcd:1234:ffff::cdd1 +dns=1111:dddd::aaaa;1::cafe; + diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 29fe19d2fd..aae823642b 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.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) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -510,7 +510,8 @@ add_one_ip4_route (NMSettingIP4Config *s_ip4, static void add_one_ip6_address (NMSettingIP6Config *s_ip6, const char *addr, - guint32 prefix) + guint32 prefix, + const char *gw) { struct in6_addr tmp; NMIP6Address *ip6_addr; @@ -521,6 +522,11 @@ add_one_ip6_address (NMSettingIP6Config *s_ip6, inet_pton (AF_INET6, addr, &tmp); nm_ip6_address_set_address (ip6_addr, &tmp); + if (gw) { + inet_pton (AF_INET6, gw, &tmp); + nm_ip6_address_set_gateway (ip6_addr, &tmp); + } + nm_setting_ip6_config_add_address (s_ip6, ip6_addr); nm_ip6_address_unref (ip6_addr); } @@ -666,8 +672,8 @@ test_write_wired_connection (void) NULL); /* Addresses */ - add_one_ip6_address (s_ip6, address6_1, 64); - add_one_ip6_address (s_ip6, address6_2, 56); + add_one_ip6_address (s_ip6, address6_1, 64, NULL); + add_one_ip6_address (s_ip6, address6_2, 56, NULL); /* Routes */ add_one_ip6_route (s_ip6, route6_1, route6_1_nh, 64, 3); @@ -708,6 +714,266 @@ test_write_wired_connection (void) g_object_unref (connection); } +#define TEST_WIRED_IP6_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection_IP6" + +static void +test_read_ip6_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + GError *error = NULL; + const char *tmp; + const char *expected_id = "Test Wired Connection IP6"; + const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; + struct in6_addr addr6; + const char *expected6_address1 = "abcd:1234:ffff::cdde"; + const char *expected6_gw1 = "abcd:1234:ffff::cdd1"; + NMIP6Address *ip6_addr; + + connection = connection_from_file (TEST_WIRED_IP6_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRED_IP6_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRED_IP6_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "connection-verify-wired", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "connection-verify-ip4", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "connection-verify-ip6", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_gw1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert GW address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_gateway (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + g_object_unref (connection); +} + +static void +test_write_ip6_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + struct in6_addr addr6; + const char *dns = "1::cafe"; + const char *address = "abcd::beef"; + const char *gw = "dcba::beef"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Work Wired IP6", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + ASSERT (s_wired != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + + /* Addresses */ + add_one_ip6_address (s_ip6, address, 64, gw); + + /* DNS servers */ + inet_pton (AF_INET6, dns, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + + /* DNS searches */ + nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com"); + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + #define TEST_WIRED_MAC_CASE_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection_MAC_Case" static void @@ -1042,6 +1308,9 @@ int main (int argc, char **argv) test_read_valid_wired_connection (); test_write_wired_connection (); + test_read_ip6_wired_connection (); + test_write_ip6_wired_connection (); + test_read_wired_mac_case (); test_read_valid_wireless_connection (); From e1eee774971b99c9281ede14f0a3034b63ea69a6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 3 May 2010 20:34:22 -0700 Subject: [PATCH 347/392] hostname: return NULL from failed hostname lookup, not zero-length string --- src/nm-policy-hostname.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index 02eb560263..a273a9202f 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -51,8 +51,12 @@ static gboolean hostname_thread_run_cb (gpointer user_data) { HostnameThread *ht = (HostnameThread *) user_data; + const char *hostname = NULL; - (*ht->callback) (ht, ht->ret, ht->hostname, ht->user_data); + if (strlen (ht->hostname)) + hostname = ht->hostname; + + (*ht->callback) (ht, ht->ret, hostname, ht->user_data); return FALSE; } @@ -148,9 +152,14 @@ nm_policy_set_system_hostname (const char *new_hostname, const char *msg) { char old_hostname[HOST_NAME_MAX + 1]; int ret = 0; - const char *name = new_hostname ? new_hostname : FALLBACK_HOSTNAME; + const char *name; gboolean set_hostname = TRUE, changed = FALSE; + if (new_hostname) + g_warn_if_fail (strlen (new_hostname)); + + name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME; + old_hostname[HOST_NAME_MAX] = '\0'; errno = 0; ret = gethostname (old_hostname, HOST_NAME_MAX); From e99ad944111026abc8b29a379e5aaaceec9f608c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 10:04:55 -0700 Subject: [PATCH 348/392] api: fix SetLogging description typo --- introspection/nm-manager.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 406b5cfd1e..3adbd9cb2b 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -110,7 +110,7 @@ A combination of logging domains separated by commas (','), or "NONE" to disable logging. Each domain enables logging for operations - related to that domain. Available domains are: [NONE, HW, RKILL, + related to that domain. Available domains are: [NONE, HW, RFKILL, ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, USER_SET, SYS_SET, SUSPEND, CORE, DEVICE, OLPC] From defaee09e5a95d00bcd3c3cafd107bfc40cd59f8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 12:06:00 -0700 Subject: [PATCH 349/392] logging: correctly print new logging level and domains on changes Previously the input would simply be printed, but if you're not changing either the level or domains (ie sending "") then the unchanged logging domains wouldn't be printed, only "". --- src/logging/nm-logging.c | 30 ++++++++++++++++++++++++++++++ src/logging/nm-logging.h | 3 +++ src/nm-manager.c | 7 ++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index ac30eb42c6..c82084456b 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -179,6 +179,36 @@ nm_logging_setup (const char *level, const char *domains, GError **error) return TRUE; } +const char * +nm_logging_level_to_string (void) +{ + const LogDesc *diter; + + for (diter = &level_descs[0]; diter->name; diter++) { + if (diter->num == log_level) + return diter->name; + } + g_warn_if_reached (); + return ""; +} + +char * +nm_logging_domains_to_string (void) +{ + const LogDesc *diter; + GString *str; + + str = g_string_sized_new (75); + for (diter = &domain_descs[0]; diter->name; diter++) { + if (diter->num & log_domains) { + if (str->len) + g_string_append_c (str, ','); + g_string_append (str, diter->name); + } + } + return g_string_free (str, FALSE); +} + void _nm_log (const char *loc, const char *func, guint32 domain, diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 2dc52d1e53..2eedf5ff14 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -88,6 +88,9 @@ void _nm_log (const char *loc, const char *func, guint32 domain, guint32 level, const char *fmt, ...); +const char *nm_logging_level_to_string (void); +char *nm_logging_domains_to_string (void); + /* Undefine the nm-utils.h logging stuff to ensure errors */ #undef nm_print_backtrace #undef nm_get_timestamp diff --git a/src/nm-manager.c b/src/nm-manager.c index abe505bba5..f158e50982 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2774,7 +2774,12 @@ impl_manager_set_logging (NMManager *manager, GError **error) { if (nm_logging_setup (level, domains, error)) { - nm_log_info (LOGD_CORE, "logging: level '%s' domains '%s'", level, domains); + char *new_domains = nm_logging_domains_to_string (); + + nm_log_info (LOGD_CORE, "logging: level '%s' domains '%s'", + nm_logging_level_to_string (), + new_domains); + g_free (new_domains); return TRUE; } return FALSE; From 291211ac2ba6a99c8d5a09a6ec1f91f4bc0f0a30 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 12:07:57 -0700 Subject: [PATCH 350/392] dbus: ensure only root can change debug levels --- src/NetworkManager.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf index 87814bec2a..8d08314002 100644 --- a/src/NetworkManager.conf +++ b/src/NetworkManager.conf @@ -56,6 +56,10 @@ + + @@ -64,6 +68,10 @@ + + From 46c5a48ff2d46f60f1cf71ca55408e1aab4211b7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 12:45:36 -0700 Subject: [PATCH 351/392] ip6: use IN6_ARE_ADDR_EQUAL not memcmp --- src/ip6-manager/nm-ip6-manager.c | 10 +++++----- src/nm-ip6-config.c | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 333638adb3..be22e6465b 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -652,7 +652,7 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) for (i = 0; i < servers->len; i++) { sa = &(g_array_index (servers, NMIP6RDNSS, i)); sb = &(g_array_index (device->rdnss_servers, NMIP6RDNSS, i)); - if (memcmp (&sa->addr, &sb->addr, sizeof (struct in6_addr)) != 0) { + if (IN6_ARE_ADDR_EQUAL (&sa->addr, &sb->addr) == FALSE) { changed = TRUE; break; } @@ -965,11 +965,11 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) continue; } - /* Also ignore routes where the destination and gateway are the same, - * which apparently get added by the kernel but return -EINVAL when - * we try to add them via netlink. + /* Also ignore link-local routes where the destination and gateway are + * the same, which apparently get added by the kernel but return -EINVAL + * when we try to add them via netlink. */ - if (gateway && !memcmp (dest, gateway, sizeof (struct in6_addr))) + if (gateway && IN6_ARE_ADDR_EQUAL (dest, gateway)) continue; ip6route = nm_ip6_route_new (); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 89b8c1a665..2fea38f331 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -203,9 +203,8 @@ void nm_ip6_config_add_nameserver (NMIP6Config *config, const struct in6_addr *n /* No dupes */ nameservers = (struct in6_addr *)priv->nameservers->data; - for (i = 0; i < priv->nameservers->len; i++) { - g_return_if_fail (memcmp (nameserver, &nameservers[i], sizeof (struct in6_addr)) != 0); - } + for (i = 0; i < priv->nameservers->len; i++) + g_return_if_fail (IN6_ARE_ADDR_EQUAL (nameserver, &nameservers[i]) == FALSE); g_array_append_val (priv->nameservers, *nameserver); } @@ -572,7 +571,7 @@ addr_array_compare (GArray *a, GArray *b) addrs_b = (struct in6_addr *)b->data; for (i = 0; i < a->len; i++) { for (j = 0, found = FALSE; j < b->len; j++) { - if (memcmp (&addrs_a[i], &addrs_b[j], sizeof (struct in6_addr)) == 0) { + if (IN6_ARE_ADDR_EQUAL (&addrs_a[i], &addrs_b[j])) { found = TRUE; break; } From 79df93ce334b4ff376880cad82233de4589b4a3d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 15:03:59 -0700 Subject: [PATCH 352/392] logging: log PID with syslog messages --- src/logging/nm-logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index c82084456b..9d1905da08 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -360,9 +360,9 @@ void nm_logging_start (gboolean become_daemon) { if (become_daemon) - openlog (G_LOG_DOMAIN, 0, LOG_DAEMON); + openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON); else - openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_USER); + openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER); g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, From d9cca4978427ce728a061da1f5b3c157cc40585b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 16:12:52 -0700 Subject: [PATCH 353/392] logging: silence ignorable warning Since the NMDevice's interface isn't always the same as a kernel interface name, we won't always have an entry in /proc/sys/net for it. --- src/NetworkManagerUtils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index fe64e1fea7..22cf2fa0d8 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -605,10 +605,10 @@ nm_utils_get_proc_sys_net_value (const char *path, long int tmp; if (!g_file_get_contents (path, &contents, NULL, &error)) { - nm_log_warn (LOGD_DEVICE, "(%s): error reading %s: (%d) %s", - iface, path, - error ? error->code : -1, - error && error->message ? error->message : "(unknown)"); + nm_log_dbg (LOGD_DEVICE, "(%s): error reading %s: (%d) %s", + iface, path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_clear_error (&error); } else { errno = 0; From ad1017974b68ed107caab8357c41043a0e56f1e7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 16:14:29 -0700 Subject: [PATCH 354/392] core: treat missing IPv6 setting as "ignore" (rh #588814) Caused IPv6 configuration to fail the device even if IPv6 was supposed to be disabled/ignored. --- src/nm-device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index 88c57ba75b..f2bbfc0b63 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -750,8 +750,14 @@ ip6_method_matches (NMConnection *connection, const char *match) const char *method = NULL; s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - if (s_ip6) + if (s_ip6) { method = nm_setting_ip6_config_get_method (s_ip6); + g_assert (method); + } + + /* Treat missing IP6 setting as IGNORE */ + if (!s_ip6 && !strcmp (match, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + return TRUE; return method && !strcmp (method, match); } From 1c5236029c255afc6454cc3b8c779482af2244f7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 20:23:09 -0700 Subject: [PATCH 355/392] core: pass ifindex and address family when flushing routes Use the interfaces kernel index when we can to avoid unecessary iface->index lookups; and let callers figure out which address family they really want to flush. --- src/modem-manager/nm-modem.c | 3 ++- src/nm-device.c | 2 +- src/nm-system.c | 36 +++++++++++++++++------------ src/nm-system.h | 4 ++-- src/vpn-manager/nm-vpn-connection.c | 3 ++- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index d9413edf28..e07b818bbb 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -661,7 +661,8 @@ real_deactivate_quickly (NMModem *self, NMDevice *device) case MM_MODEM_IP_METHOD_STATIC: case MM_MODEM_IP_METHOD_DHCP: iface = nm_device_get_ip_iface (device); - nm_system_device_flush_routes_with_iface (iface); + /* FIXME: use AF_UNSPEC here when we have IPv6 support */ + nm_system_device_flush_routes_with_iface (iface, AF_INET); nm_system_device_flush_addresses_with_iface (iface); nm_system_device_set_up_down_with_iface (iface, FALSE, NULL); break; diff --git a/src/nm-device.c b/src/nm-device.c index f2bbfc0b63..30429030ac 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2767,7 +2767,7 @@ nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason) nm_device_deactivate_quickly (self); /* Take out any entries in the routing table and any IP address the device had. */ - nm_system_device_flush_routes (self); + nm_system_device_flush_routes (self, nm_device_get_ip6_config (self) ? AF_UNSPEC : AF_INET); nm_system_device_flush_addresses (self); nm_device_update_ip4_address (self); diff --git a/src/nm-system.c b/src/nm-system.c index 517460d4fe..32be53ff37 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1211,21 +1211,25 @@ check_one_route (struct nl_object *object, void *user_data) } } -static void flush_routes (const char *iface, gboolean ipv4_only) +static void flush_routes (int ifindex, const char *iface, int family) { - int iface_idx; RouteCheckData check_data; g_return_if_fail (iface != NULL); - iface_idx = nm_netlink_iface_to_index (iface); - if (iface_idx >= 0) { - memset (&check_data, 0, sizeof (check_data)); - check_data.iface = iface; - check_data.iface_idx = iface_idx; - check_data.family = ipv4_only ? AF_INET : 0; - foreach_route (check_one_route, &check_data); + if (ifindex < 0) { + ifindex = nm_netlink_iface_to_index (iface); + if (ifindex < 0) { + nm_log_dbg (LOGD_DEVICE, "(%s) failed to lookup interface index", iface); + return; + } } + + memset (&check_data, 0, sizeof (check_data)); + check_data.iface = iface; + check_data.iface_idx = ifindex; + check_data.family = family; + foreach_route (check_one_route, &check_data); } /* @@ -1234,23 +1238,25 @@ static void flush_routes (const char *iface, gboolean ipv4_only) * Flush all network addresses associated with a network device * */ -void nm_system_device_flush_routes (NMDevice *dev) +void nm_system_device_flush_routes (NMDevice *dev, int family) { g_return_if_fail (dev != NULL); - flush_routes (nm_device_get_ip_iface (dev), - nm_device_get_ip6_config (dev) == NULL); + flush_routes (nm_device_get_ip_ifindex (dev), + nm_device_get_ip_iface (dev), + family); } /* * nm_system_device_flush_routes_with_iface * - * Flush all routes associated with a network device + * Flush all routes associated with a network device. 'family' is an + * address family, either AF_INET, AF_INET6, or AF_UNSPEC. * */ -void nm_system_device_flush_routes_with_iface (const char *iface) +void nm_system_device_flush_routes_with_iface (const char *iface, int family) { - flush_routes (iface, FALSE); + flush_routes (-1, iface, family); } typedef struct { diff --git a/src/nm-system.h b/src/nm-system.h index e48e493c61..2eee01417d 100644 --- a/src/nm-system.h +++ b/src/nm-system.h @@ -33,8 +33,8 @@ * implemented in the backend files in backends/ directory */ -void nm_system_device_flush_routes (NMDevice *dev); -void nm_system_device_flush_routes_with_iface (const char *iface); +void nm_system_device_flush_routes (NMDevice *dev, int family); +void nm_system_device_flush_routes_with_iface (const char *iface, int family); gboolean nm_system_replace_default_ip4_route (const char *iface, guint32 gw, diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index a714e991e8..91c7754265 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -878,7 +878,8 @@ vpn_cleanup (NMVPNConnection *connection) if (priv->tundev) { nm_system_device_set_up_down_with_iface (priv->tundev, FALSE, NULL); - nm_system_device_flush_routes_with_iface (priv->tundev); + /* FIXME: use AF_UNSPEC here when we have IPv6 support */ + nm_system_device_flush_routes_with_iface (priv->tundev, AF_INET); nm_system_device_flush_addresses_with_iface (priv->tundev); } From 17b49b957cb3d92a86ccdce0559e6b753bd7aa98 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 20:24:17 -0700 Subject: [PATCH 356/392] ip6: don't flush link-local IPv6 routes (rh #587836) Since a link-local address should pretty much always be assigned to an active interface, avoid flushing the routes that allow link-local communication to work. --- src/nm-system.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/nm-system.c b/src/nm-system.c index 32be53ff37..35aa36a111 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1203,6 +1203,25 @@ check_one_route (struct nl_object *object, void *user_data) if (data->family && rtnl_route_get_family (route) != data->family) return; + /* We don't want to flush IPv6 link-local routes that may exist on the + * the interface since the LL address and routes should normally stay + * assigned all the time. + */ + if ( (data->family == AF_INET6 || data->family == AF_UNSPEC) + && (rtnl_route_get_family (route) == AF_INET6)) { + struct nl_addr *nl; + struct in6_addr *addr = NULL; + + nl = rtnl_route_get_dst (route); + if (nl) + addr = nl_addr_get_binary_addr (nl); + + if (addr) { + if (IN6_IS_ADDR_LINKLOCAL (addr) || IN6_IS_ADDR_MC_LINKLOCAL (addr)) + return; + } + } + err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); if (err < 0) { nm_log_err (LOGD_DEVICE, From 14bfae6802b52205cd59a11ca78ec84f6f33bb58 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 04:54:03 -0700 Subject: [PATCH 357/392] cli: fix build on 32-bit platforms --- cli/src/connections.c | 2 +- cli/src/settings.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index e275467b8b..e9aa597d11 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -373,7 +373,7 @@ show_connection (NMConnection *data, gpointer user_data) if (s_con) { /* Obtain field values */ timestamp = nm_setting_connection_get_timestamp (s_con); - timestamp_str = g_strdup_printf ("%ld", timestamp); + timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); diff --git a/cli/src/settings.c b/cli/src/settings.c index 5701c6bda0..becc3262ad 100644 --- a/cli/src/settings.c +++ b/cli/src/settings.c @@ -495,7 +495,7 @@ setting_connection_details (NMSetting *setting, NmCli *nmc) print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ timestamp = nm_setting_connection_get_timestamp (s_con); - timestamp_str = g_strdup_printf ("%ld", timestamp); + timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); nmc->allowed_fields[0].value = NM_SETTING_CONNECTION_SETTING_NAME; nmc->allowed_fields[1].value = nm_setting_connection_get_id (s_con); @@ -1075,7 +1075,7 @@ setting_serial_details (NMSetting *setting, NmCli *nmc) bits_str = g_strdup_printf ("%d", nm_setting_serial_get_bits (s_serial)); parity_str = g_strdup_printf ("%c", nm_setting_serial_get_parity (s_serial)); stopbits_str = g_strdup_printf ("%d", nm_setting_serial_get_stopbits (s_serial)); - send_delay_str = g_strdup_printf ("%ld", nm_setting_serial_get_send_delay (s_serial)); + send_delay_str = g_strdup_printf ("%" G_GUINT64_FORMAT, nm_setting_serial_get_send_delay (s_serial)); nmc->allowed_fields[0].value = NM_SETTING_SERIAL_SETTING_NAME; nmc->allowed_fields[1].value = baud_str; From 88e6f25b7eb45ca04ad8a01df1ef1cb9c005f917 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 03:10:40 -0700 Subject: [PATCH 358/392] po: add translatable --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 6cf236ad37..4d7faa5873 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -5,6 +5,7 @@ cli/src/connections.c cli/src/devices.c cli/src/network-manager.c cli/src/nmcli.c +cli/src/settings.c cli/src/utils.c libnm-util/crypto.c libnm-util/crypto_gnutls.c From e2f848c2d979363c16fb9ca4e13bae97348a68b3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 12:52:45 -0700 Subject: [PATCH 359/392] bt: ensure connect timeout is canceled on success (rh #586961) --- src/nm-device-bt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index ef2c98db0e..7d9c952ea8 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -576,13 +576,17 @@ check_connect_continue (NMDeviceBt *self) nm_device_get_ip_iface (device), dun ? "DUN" : (pan ? "PAN" : "unknown")); + /* Kill the connect timeout since we're connected now */ + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + if (pan) { /* Bluez says we're connected now. Start IP config. */ nm_device_activate_schedule_stage3_ip_config_start (device); } else if (dun) { /* Wait for ModemManager to find the modem */ - if (priv->timeout_id) - g_source_remove (priv->timeout_id); priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); nm_log_info (LOGD_BT | LOGD_MB, "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " From 57d9cc3c4aa9eaa78ec049c54d08f5b9ecc46253 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 12:53:20 -0700 Subject: [PATCH 360/392] bt: increase DUN modem find timeout a bit --- src/nm-device-bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 7d9c952ea8..ecdd7400f9 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -587,7 +587,7 @@ check_connect_continue (NMDeviceBt *self) nm_device_activate_schedule_stage3_ip_config_start (device); } else if (dun) { /* Wait for ModemManager to find the modem */ - priv->timeout_id = g_timeout_add_seconds (20, modem_find_timeout, self); + priv->timeout_id = g_timeout_add_seconds (30, modem_find_timeout, self); nm_log_info (LOGD_BT | LOGD_MB, "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " "waiting for modem to appear.", From 266e389cd345c3bbb8ba3768c980db46f8096a6e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 13:09:12 -0700 Subject: [PATCH 361/392] bt: more debug logging --- src/nm-device-bt.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index ecdd7400f9..3ef08de8b6 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -635,6 +635,9 @@ bluez_connect_cb (DBusGProxy *proxy, g_free (device); } + nm_log_dbg (LOGD_BT, "(%s): connect request successful", + nm_device_get_iface (NM_DEVICE (self))); + /* Stage 3 gets scheduled when Bluez says we're connected */ priv->have_iface = TRUE; check_connect_continue (self); @@ -651,6 +654,17 @@ bluez_property_changed (DBusGProxy *proxy, NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); gboolean connected; NMDeviceState state; + const char *prop_str = "(unknown)"; + + if (G_VALUE_HOLDS_STRING (value)) + prop_str = g_value_get_string (value); + else if (G_VALUE_HOLDS_BOOLEAN (value)) + prop_str = g_value_get_boolean (value) ? "true" : "false"; + + nm_log_dbg (LOGD_BT, "(%s): bluez property '%s' changed to '%s'", + nm_device_get_iface (device), + property, + prop_str); if (strcmp (property, "Connected")) return; @@ -659,6 +673,9 @@ bluez_property_changed (DBusGProxy *proxy, connected = g_value_get_boolean (value); if (connected) { if (state == NM_DEVICE_STATE_CONFIG) { + nm_log_dbg (LOGD_BT, "(%s): connected to the device", + nm_device_get_iface (device)); + priv->connected = TRUE; check_connect_continue (self); } @@ -690,6 +707,9 @@ bt_connect_timeout (gpointer user_data) { NMDeviceBt *self = NM_DEVICE_BT (user_data); + nm_log_dbg (LOGD_BT, "(%s): initial connection timed out", + nm_device_get_iface (NM_DEVICE (self))); + NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0; nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, @@ -754,6 +774,9 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) return NM_ACT_STAGE_RETURN_FAILURE; } + nm_log_dbg (LOGD_BT, "(%s): requesting connection to the device", + nm_device_get_iface (device)); + /* Connect to the BT device */ dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", bluez_connect_cb, From 391fb0f0f2d569e3f8dd23e6b99fdf7743760d09 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 May 2010 13:20:18 -0700 Subject: [PATCH 362/392] ip6: set accept_ra to initial value for ignored connections (rh #588619) --- src/nm-device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nm-device.c b/src/nm-device.c index 30429030ac..7d9913d478 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1656,6 +1656,12 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED; ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + /* reset the saved RA value when ipv6 is ignored */ + if (priv->ip6_accept_ra_path) { + nm_utils_do_sysctl (priv->ip6_accept_ra_path, + priv->ip6_accept_ra_save ? "1\n" : "0\n"); + } + priv->ip6_ready = TRUE; ret = NM_ACT_STAGE_RETURN_STOP; } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { From 2242788e987aab52612dd3ebabf115a4920848b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 6 May 2010 16:28:42 +0200 Subject: [PATCH 363/392] examples: fix a prefix --- examples/python/add-system-connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 examples/python/add-system-connection.py diff --git a/examples/python/add-system-connection.py b/examples/python/add-system-connection.py old mode 100644 new mode 100755 index 3cf350e799..39eaabee0d --- a/examples/python/add-system-connection.py +++ b/examples/python/add-system-connection.py @@ -25,7 +25,7 @@ s_con = dbus.Dictionary({ 'uuid': '7371bb78-c1f7-42a3-a9db-5b9566e8ca07', 'id': 'MyConnection'}) -addr1 = dbus.Array([dbus.UInt32(50462986L), dbus.UInt32(0L), dbus.UInt32(16908554L)], signature=dbus.Signature('u')) +addr1 = dbus.Array([dbus.UInt32(50462986L), dbus.UInt32(8L), dbus.UInt32(16908554L)], signature=dbus.Signature('u')) s_ip4 = dbus.Dictionary({ 'addresses': dbus.Array([addr1], signature=dbus.Signature('au')), 'method': 'manual'}) From 3239f4af79d40ed7dc8b8082ba26d0bcb1d18ca1 Mon Sep 17 00:00:00 2001 From: Kiyoto Hashida Date: Sat, 8 May 2010 09:51:42 -0700 Subject: [PATCH 364/392] po: updated Japanese translation (bgo #618002) --- po/ja.po | 2047 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 1287 insertions(+), 760 deletions(-) diff --git a/po/ja.po b/po/ja.po index 55eed6cd5e..7dc8ba50fc 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,819 +1,1346 @@ +# translation of ja.po to Japanese # Japanese translation for NetworkManager # Copyright (C) 2005 Dan Williams # This file is distributed under the same license as the NetworkManager package. -# Satoru SATOH , 2005-2007. # +# Satoru SATOH , 2005-2007. +# Kiyoto Hashida , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager trunk\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-07-23 00:33+0900\n" -"PO-Revision-Date: 2007-07-23 01:47+0900\n" -"Last-Translator: Satoru SATOH \n" -"Language-Team: Japanese \n" +"Project-Id-Version: ja\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-30 03:24+0000\n" +"PO-Revision-Date: 2010-05-07 18:50+0900\n" +"Last-Translator: Kiyoto Hashida \n" +"Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" +"Plural-Forms: Plural-Forms: nplurals=1; plural=0;\n\n" +"\n" +"\n" +"\n" +"X-Generator: KBabel 1.11.4\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:417 -msgid "Cannot add VPN connection" -msgstr "VPN 接続を追加できません" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:419 -msgid "" -"No suitable VPN software was found on your system. Contact your system " -"administrator." -msgstr "" -"適切な VPN ソフトウェアがシステム上にみつかりませんでした。システム管理者に連" -"絡してください。" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:461 -msgid "Cannot import VPN connection" -msgstr "VPN 接続をインポートできません" - -#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#: ../cli/src/connections.c:86 #, c-format msgid "" -"Cannot find suitable software for VPN connection type '%s' to import the " -"file '%s'. Contact your system administrator." +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" msgstr "" -"ファイル '%s' をインポートするための VPN 接続タイプ '%s' 用の適切なソフトウェ" -"アがシステム上にみつかりませんでした。システム管理者に連絡してください。" +"使用法: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#: ../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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "名前" + +#: ../cli/src/connections.c:163 #, c-format -msgid "Error retrieving VPN connection '%s'" -msgstr "VPN 接続 '%s' 読み出し中にエラー" +msgid "System connections:\n" +msgstr "システム接続:\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#: ../cli/src/connections.c:167 #, c-format -msgid "" -"Could not find the UI files for VPN connection type '%s'. Contact your " -"system administrator." -msgstr "" -"VPN 接続タイプ '%s' の UI ファイルをみつけられませんでした。システム管理者に" -"連絡してください。" +msgid "User connections:\n" +msgstr "ユーザー接続:\n" -#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 #, c-format -msgid "Delete VPN connection \"%s\"?" -msgstr "VPN 接続 \"%s\" を削除しますか?" +msgid "Error: %s argument is missing." +msgstr "エラー: %s 引数がありません。" -#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#: ../cli/src/connections.c:189 #, c-format -msgid "" -"All information about the VPN connection \"%s\" will be lost and you may " -"need your system administrator to provide information to create a new " -"connection." -msgstr "" -"VPN 接続 \"%s\" についてすべての情報が失われ、新しい接続を作成するにはシステ" -"ム管理者に情報を提供してもらう必要があります。" +msgid "Error: %s - no such connection." +msgstr "エラー: %s - そのような接続はありません。" -#: ../gnome/vpn-properties/nm-vpn-properties.c:924 -msgid "Unable to load" -msgstr "読み込めません" +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "システム全域接続" -#: ../gnome/vpn-properties/nm-vpn-properties.c:926 -msgid "Cannot find some needed resources (the glade file)!" -msgstr "必要ないくつかのリソース (glade ファイル) をみつけられません!" +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "ユーザー接続" -#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), -#. NULL, -#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -#. GTK_STOCK_CANCEL, -#. GTK_RESPONSE_REJECT, -#. GTK_STOCK_APPLY, -#. GTK_RESPONSE_ACCEPT, -#. NULL)); -#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 -msgid "Create VPN Connection" -msgstr "VPN 接続を作成" +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "不明なパラメータ: %s\n" -#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); -#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); -#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); -#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); -#. make the druid window modal wrt. our main window -#. gtk_window_set_modal (druid_window, TRUE); -#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); -#. Edit dialog -#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 -msgid "Edit VPN Connection" -msgstr "VPN 接続を編集" +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "エラー: 有効なパラメータが指定されていません。" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 -msgid "Add a new VPN connection" -msgstr "新しい VPN 接続を追加" +#. 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 "はい" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 -msgid "Delete the selected VPN connection" -msgstr "選択した VPN 接続を削除" +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "いいえ" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 -msgid "E_xport" -msgstr "エクスポート(_X)" +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "アクティブな接続" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 -msgid "Edit the selected VPN connection" -msgstr "選択した VPN 接続を編集" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "デフォルト" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 -msgid "Export the VPN settings to a file" -msgstr "VPN 設定をファイルにエクスポート" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "サービス" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 -msgid "Export the selected VPN connection to a file" -msgstr "選択した VPN 接続をファイルにエクスポート" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "デバイス" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 -msgid "Manage Virtual Private Network Connections" -msgstr "仮想プライベートネットワーク (VPN) 接続を管理" +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "デバイス '%s'上にアクティブな接続がありません" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 -msgid "VPN Connections" +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "アクティブな接続、又はデバイスがありません" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "アクティベート中" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "アクティベート済み" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "不明" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN 接続(準備)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN 接続(認証が必要)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" msgstr "VPN 接続" -#: ../src/nm-ap-security-wep.c:52 -msgid "40-bit WEP" -msgstr "40-bit WEP" +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 接続(IP 設定を取得)" -#: ../src/nm-ap-security-wep.c:54 -msgid "104-bit WEP" -msgstr "104-bit WEP" +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN 接続済み" -#: ../src/nm-ap-security-wpa-psk.c:51 -msgid "WPA TKIP" -msgstr "WPA TKIP" +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN 接続失敗" -#: ../src/nm-ap-security-wpa-psk.c:53 -msgid "WPA CCMP" -msgstr "WPA CCMP" +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN 切断済み" -#: ../src/nm-ap-security-wpa-psk.c:55 -msgid "WPA Automatic" -msgstr "WPA 自動" +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "不明な理由" -#: ../src/nm-ap-security-wpa-psk.c:60 -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" - -#: ../src/nm-ap-security-wpa-psk.c:62 -msgid "WPA2 CCMP" -msgstr "WPA2 CCMP" - -#: ../src/nm-ap-security-wpa-psk.c:64 -msgid "WPA2 Automatic" -msgstr "WPA2 自動" - -#: ../src/nm-ap-security.c:326 +#: ../cli/src/connections.c:769 msgid "none" msgstr "なし" -#: ../src/nm-netlink-monitor.c:174 +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "ユーザーの接続が切断されました。" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "基本ネットワーク接続が妨害されました。" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN サービスが予期しない停止をしました" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN サービスは無効な設定を返しました" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "接続試行は時間切れです" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN サービスは時間内に開始していません" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN サービスの開始は失敗しました" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "有効な VPN シークレットはありません" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "無効な VPN シークレット" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "接続は削除されました" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "状態: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "接続はアクティベート済み\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "エラー: 接続のアクティベーションに失敗" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "状態: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "エラー: 接続のアクティベーションに失敗: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "エラー: 制限時間の %d 秒が経過" + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "エラー: 接続のアクティベーションに失敗: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "エラー: '%s'用のアクティブ接続の取得に失敗" + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "アクティブ接続の状態: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "アクティブ接続のパス: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "エラー: 不明な接続: %s" + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "エラー: 制限時間値の '%s' は有効でありません" + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "エラー: id か又は uuid の指定が必要です" + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "エラー: 適切なデバイスが見付かりません: %s" + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "エラー: 適切なデバイスが見付かりません" + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告: 接続はアクティブでありません\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "エラー: 'con' コマンド '%s' は有効ではありません" + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "エラー: D-Bus に接続できませんでした" + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "エラー: システム設定を取得できませんでした" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "エラー: ユーザー設定を取得できませんでした" + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "エラー: 接続を取得できません: 設定サービスが稼働していません" + +#: ../cli/src/devices.c:73 #, c-format msgid "" -"unable to create netlink socket for monitoring wired ethernet devices - %s" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" msgstr "" -"有線 Ethernet デバイスを監視するためのネットリンクソケットを作成できません - " -"%s" +"使用法: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" -#: ../src/nm-netlink-monitor.c:192 +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "管理無し" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "利用不可" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "切断済み" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "接続中(準備)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "接続中(設定中)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "接続中(認証が必要)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "接続中(IP 設定を取得中)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "接続済み" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "接続に失敗" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "不明" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(なし)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 アドレス 0x%X を変換中にエラー発生" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, 周波数 %d MHz, レート %d Mb/s, 強さ %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "デバイス" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ドライバー" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(不明)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "状態" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW アドレス" + +#: ../cli/src/devices.c:319 #, c-format msgid "" -"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +"\n" +" Capabilities:\n" msgstr "" -"有線 Ethernet デバイスを監視するためのネットリンクソケットをバインドできませ" -"ん - %s" +"\n" +" 能力:\n" -#: ../src/nm-netlink-monitor.c:416 -msgid "operation took too long" -msgstr "処理に時間がかかりすぎています" +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "キャリア検出" -#: ../src/nm-netlink-monitor.c:513 -msgid "received data from wrong type of sender" -msgstr "間違ったタイプの送り先からデータを受信しました" +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../src/nm-netlink-monitor.c:526 -msgid "received data from unexpected sender" -msgstr "予期しない送り先からデータを受信しました" +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "速度" -#: ../src/nm-netlink-monitor.c:655 -msgid "too much data was sent over socket and some of it was lost" -msgstr "ソケットを介して送信されたデータが多すぎたためいくらか失われました" +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" 無線接続のプロパティ\n" -#: ../src/nm-netlink-monitor.c:755 +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP 暗号化" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA 暗号化" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 暗号化" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP 暗号" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP 暗号" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" 無線アクセスポイント %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = 現在の AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" 有線接続のプロパティ\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "キャリア" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "オン" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "オフ" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 セッティング:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "デバイスのステータス" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "エラー: '%s' 引数がありません。" + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "エラー: デバイス'%s' が見付かりません" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功: デバイス '%s' は正常に切断されました。" + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "エラー: デバイス '%s' (%s) の切断に失敗しました: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "デバイスの状態: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "エラー: iface を指定する必要があります。" + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi スキャン一覧" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "エラー: デバイス '%s' は WiFi デバイスではありません。" + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "デバイス:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "エラー: hwaddr を指定する必要があります。" + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "エラー: hwaddr '%s' のアクセスポイントが見付かりません" + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP パラメータ" + +#: ../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 "周波数:" + +#: ../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 "強さ:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "フラグ:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "プライバシー" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA フラグ:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN フラグ:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "エラー: 'dev wifi' コマンド '%s' は無効です。" + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "エラー: 'dev' コマンド '%s' は無効です。" + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"使用法: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "休止中" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "接続中" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "NetworkManager のステータス" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM が実行中:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "実行中" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "実行していません" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM の状態: " + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM ワイヤレスハードウェア:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM ワイヤレス:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN ハードウェア:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "エラー: 無効な'wifi' パラメータ: '%s'" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "エラー: 無効な'wwan' パラメータ: '%s'" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "エラー: 'nm' コマンド '%s' は無効です。" + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"使用法: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "オブジェクト'%s' は不明です。'nmcli help' を試して下さい。" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ツール、バージョン %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "オプション '%s' は不明です、'nmcli -help' を試して下さい。" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "シグナル %d が出ました、シャットダウンします..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "エラー: NetworkManager へ接続出来ませんでした。" + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "成功" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM キーファイルは終了タグ '%s' を持ちません。" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM プライベートキーファイルではないようです。" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ファイルデータの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "不正形式の PEM ファイル: Proc-Type は最初のタグではありません。" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "不正形式の PEM ファイル: 不明な Proc-Type タグ '%s' です。" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "不正形式の PEM ファイル: DEK-Info は2つ目のタグではありません。" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "不正形式の PEM ファイル: DEK-Info タグ内に IV が見付かりません。" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "不正形式の PEM ファイル: DEK-Info タグ内に無効な形式の IV" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "不正形式の PEM ファイル: 不明なプライベートキー暗号文 '%s'。" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "プライベートキーを復号できませんでした。" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 証明書 '%s' は終了タグ '%s'持ちません。" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "証明書の復号に失敗しました。" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "証明書データの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ファイルデータの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV はその長さで偶数のバイト数でなければなりません。" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV の保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV は 16進法でない数字を含んでいます。" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "プライベートキー暗号文 '%s' は不明です。" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "プライベートキーの解読に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "プライベートキーのタイプを判定できません。" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "復号したプライベートキーの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "暗号化エンジンの初期化に失敗しました。" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 エンジンの初期化に失敗しました: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV の長さが無効です (最低 %zd の長さが必要)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "復号したキーバッファ用に十分なメモリーがありません。" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "復号化暗号文コンテキストの初期化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "復号用のシンメトリックキーの設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "復号用の IV の設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "プライベートキーの復号に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "プライベートキーの復号に失敗しました: 予想外の不要語句の長さです。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "プライベートキーの復号に失敗しました。" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "暗号化用のメモリー割り当てが出来ませんでした。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "暗号化暗号文コンテキストの初期化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "暗号化用のシンメトリックキーの設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "暗号化用の IV の設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "データの暗号化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "証明書データの初期化にエラー発生: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "証明書をデコードできませんでした: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 デコーダを初期化できません: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ファイルをデコードできません: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ファイルを確証できません: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "暗号化エンジンの初期化に失敗しました: %d。" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 コンテキストの初期化に失敗しました: %d。" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "IV の長さが無効です (最低でも %d は必要)。" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "復号化暗号文スロットの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "復号化用シンメトリックキーの設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "復号化用 IV の設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "復号化コンテキストの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "プライベートキーの復号に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "プライベートキーの復号に失敗しました: 復号したデータが大きすぎます。" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "プライベートキー復号化の完了に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "暗号化暗号文スロットの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "暗号化用のシンメトリックキーの設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "暗号化用の IV の設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "暗号化コンテキストの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "暗号化に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "暗号化の後に予期しないデータの量があります。" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "証明書のデコードが出来ません: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "パスワードを UCS2 に変換できません: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 デコーダを初期化出来ません: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ファイルをデコード出来ません: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ファイルを確証出来ません: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ランダムデータを生成できません。" + +#: ../libnm-util/nm-utils.c:1924 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "暗号化キーを作成するのに十分なメモリーがありません。" + +#: ../libnm-util/nm-utils.c:2034 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ファイル作成用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2046 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ファイルへの IV の書き込み用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2058 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ファイルへの暗号化キーの書き込み用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2077 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ファイルデータ用にメモリーを割り当て出来ません。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink メッセージのプロセス中にエラー発生: %s" + +#: ../src/nm-netlink-monitor.c:214 msgid "error occurred while waiting for data on socket" msgstr "ソケット上でデータを待っている際にエラーが発生しました" -# そういう仕様の名前なので訳すべきでない。 -#: ../src/nm-ap-security-wpa-eap.c:93 ../src/nm-ap-security-wpa-eap.c:112 -msgid "WPA2 Enterprise" -msgstr "WPA2-Enterprise" +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "リンク状況監視用のネットリンクに接続できません: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ハンドル信任情報の伝達を有効にできません: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "リンクステータス監視用のネットリンクハンドルを割り当て出来ません: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "リンク状況監視用のネットリンクのリンクキャッシュを割り当てできません: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink グループへ参加できません: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "リンクキャッシュの更新中にエラー: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "無効なオプション。--help を使用して有効なオプションの一覧をご覧下さい。\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s --help を使用して有効なオプションの一覧をご覧下さい。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager で作成されています\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s からマージされています\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "使用できる DHCP クライアントが見付かりませんでした。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' が見付かりました" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' は見付かりません。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "サポートの無い DHCP クライアント '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "不明なログインレベル '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "不明なログドメイン '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "注記: libc リゾルバは 3つ以上のネームサーバーをサポートできません。" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "以下の一覧にあるネームサーバーは認識されないかも知れません。" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "自動 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +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 ネットワーク経由の接続共有を阻止します。" -#: ../src/nm-ap-security-wpa-eap.c:95 ../src/nm-ap-security-wpa-eap.c:115 -msgid "WPA Enterprise" -msgstr "WPA-Enterprise" - -#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:80 -msgid "LEAP" -msgstr "LEAP" - -#~ msgid "Passphrase for wireless network %s" -#~ msgstr "無線ネットワーク %s のパスフレーズ" - -#~ msgid "Connection to the wireless network '%s' failed." -#~ msgstr "無線ネットワーク '%s' への接続に失敗" - -#~ msgid "Connection to the wired network failed." -#~ msgstr "有線ネットワークへの接続に失敗" - -#~ msgid "Error displaying connection information:" -#~ msgstr "接続情報を表示中にエラー:" - -#~ msgid "Could not find some required resources (the glade file)!" -#~ msgstr "いくつか必要なリソース(glade ファイル) をみつけられませんでした!" - -#~ msgid "No active connections!" -#~ msgstr "アクティブな接続がありません!" - -#~ msgid "%d Mb/s" -#~ msgstr "%d Mb/s" - -#~ msgid "Wired Ethernet (%s)" -#~ msgstr "有線 Ethernet (%s)" - -#~ msgid "Wireless Ethernet (%s)" -#~ msgstr "無線 Ethernet (%s)" - -#~ msgid "Unknown" -#~ msgstr "不明" - -#~ msgid "NetworkManager Applet" -#~ msgstr "NetworkManager アプレット" - -#~ msgid "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." - -#~ msgid "" -#~ "Notification area applet for managing your network devices and " -#~ "connections." -#~ msgstr "ネットワークデバイスと接続を管理するための通知エリアアプレット" - -#~ msgid "translator-credits" -#~ msgstr "Satoru SATOH " - -#~ 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 ログイン失敗" - -#~ msgid "Could not start the VPN connection '%s' due to a login failure." -#~ msgstr "ログインに失敗したため VPN 接続 '%s' を開始できませんでした" - -#~ msgid "VPN Start Failure" -#~ msgstr "VPN 開始に失敗" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' due to a failure launching the " -#~ "VPN program." -#~ msgstr "" -#~ "VPN プログラムを起動できなかったため VPN 接続 '%s' を開始できませんでした" - -#~ msgid "VPN Connect Failure" -#~ msgstr "VPN 接続に失敗" - -#~ msgid "Could not start the VPN connection '%s' due to a connection error." -#~ msgstr "接続エラーのため VPN 接続 '%s' を開始できませんでした" - -#~ msgid "VPN Configuration Error" -#~ msgstr "VPN 接続エラー" - -#~ msgid "The VPN connection '%s' was not correctly configured." -#~ msgstr "VPN 接続 '%s' は適切に設定されました。" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' because the VPN server did not " -#~ "return an adequate network configuration." -#~ msgstr "" -#~ "VPN サーバが返事を返さず、適切なネットワーク設定がなされないため VPN 接続 " -#~ "'%s' を開始できませんでした。" - -#~ msgid "VPN Login Message" -#~ msgstr "VPN ログインメッセージ" - -#~ msgid "" -#~ "The NetworkManager Applet could not find some required resources (the " -#~ "glade file was not found)." -#~ msgstr "" -#~ "NetworkManager アプレットに必要ないくつかのリソース (glade ファイル) をみ" -#~ "つけられませんでした。" - -#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." -#~ msgstr "" -#~ "ネットワークデバイス \"%s (%s)\" は無線スキャンをサポートしていません。" - -#~ msgid "The network device \"%s (%s)\" does not support link detection." -#~ msgstr "" -#~ "ネットワークデバイス \"%s (%s)\" はリンク検出をサポートしていません。" - -#~ msgid "(unknown)" -#~ msgstr "(不明)" - -#~ msgid "Preparing device %s for the wired network..." -#~ msgstr "有線ネットワーク用のデバイス %s を準備しています..." - -#~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "無線ネットワーク '%s' 用のデバイス %s を準備しています..." - -#~ msgid "Configuring device %s for the wired network..." -#~ msgstr "有線ネットワーク用のデバイス %s を設定しています..." - -#~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "無線ネットワーク '%s' に参加しようとしています..." - -#~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "無線ネットワーク '%s' のネットワーク鍵を待っています..." - -#~ msgid "Requesting a network address from the wired network..." -#~ msgstr "有線ネットワークのネットワークアドレスを要求しています..." - -#~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "無線ネットワーク '%s' のネットワークアドレスを要求しています..." - -#~ msgid "Finishing connection to the wired network..." -#~ msgstr "有線ネットワークへの接続処理を終了しています..." - -#~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "無線ネットワーク '%s' への接続処理を終了しています..." - -#~ msgid "NetworkManager is not running" -#~ msgstr "NetworkManager は実行されていません" - -#~ msgid "Networking disabled" -#~ msgstr "ネットワークは有効にされていません" - -#~ msgid "No network connection" -#~ msgstr "ネットワーク接続がありません" - -#~ msgid "Wired network connection" -#~ msgstr "有線ネットワーク接続" - -#~ msgid "Connected to an Ad-Hoc wireless network" -#~ msgstr "Ad-Hoc 無線ネットワークに接続しました" - -#~ msgid "Wireless network connection to '%s' (%d%%)" -#~ msgstr "'%s' (%d%%) に無線ネットワーク接続" - -#~ msgid "VPN connection to '%s'" -#~ msgstr "'%s' への VPN 接続" - -#~ msgid "VPN connecting to '%s'" -#~ msgstr "'%s' に VPN 接続しています" - -#~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "他の無線ネットワークに接続(_C)..." - -#~ msgid "Create _New Wireless Network..." -#~ msgstr "新しい無線ネットワークを作成(_N)..." - -#~ msgid "_VPN Connections" -#~ msgstr "VPN 接続(_V)" - -#~ msgid "_Configure VPN..." -#~ msgstr "VPN を設定(_C)..." - -#~ msgid "_Disconnect VPN..." -#~ msgstr "VPN を切断(_D)..." - -#~ msgid "_Dial Up Connections" -#~ msgstr "ダイアルアップ接続(_D)" - -#~ msgid "Connect to %s..." -#~ msgstr "%s に接続..." - -#~ msgid "Disconnect from %s..." -#~ msgstr "%s への接続を切断..." - -#~ msgid "No network devices have been found" -#~ msgstr "ネットワークデバイスがみつかりませんでした" - -#~ msgid "NetworkManager is not running..." -#~ msgstr "NetworkManager は実行されていません..." - -#~ msgid "Enable _Networking" -#~ msgstr "ネットワークを有効にする(_N)" - -#~ msgid "Enable _Wireless" -#~ msgstr "無線を有効にする(_W)" - -#~ msgid "Connection _Information" -#~ msgstr "接続情報(_I)" - -#~ msgid "_Help" -#~ msgstr "ヘルプ(_H)" - -#~ msgid "_About" -#~ msgstr "情報(_A)" - -#~ msgid "" -#~ "The NetworkManager applet could not find some required resources. It " -#~ "cannot continue.\n" -#~ msgstr "" -#~ "NetworkManager アプレットに必要ないくつかのリソースをみつけることができま" -#~ "せんでした。続行できません。\n" - -#~ msgid "Open System" -#~ msgstr "システムを開く" - -#~ msgid "Shared Key" -#~ msgstr "共有鍵" - -#~ msgid "Automatic (Default)" -#~ msgstr "自動(デフォルト)" - -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" - -#~ msgid "TKIP" -#~ msgstr "TKIP" - -#~ msgid "Dynamic WEP" -#~ msgstr "動的 WEP" - -#~ msgid "None" -#~ msgstr "なし" - -#~ msgid "WEP 64/128-bit ASCII" -#~ msgstr "WEP 64/128-bit ASCII" - -#~ msgid "WEP 64/128-bit Hex" -#~ msgstr "WEP 64/128-bit 十六進数" - -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "WEP 128-bit パスフレーズ" - -#~ msgid "TLS" -#~ msgstr "TLS" - -#~ msgid "TTLS" -#~ msgstr "TTLS" - -#~ msgid "WPA2 Personal" -#~ msgstr "WPA2-Personal" - -#~ msgid "WPA Personal" -#~ msgstr "WPA-Personal" - -#~ msgid "Orientation" -#~ msgstr "向き" - -#~ msgid "The orientation of the tray." -#~ msgstr "トレイの向き" - -#~ msgid "Wired Network (%s)" -#~ msgstr "有線ネットワーク (%s)" - -#~ msgid "_Wired Network" -#~ msgstr "有線ネットワーク(_W)" - -#~ msgid "Wireless Network (%s)" -#~ msgid_plural "Wireless Networks (%s)" -#~ msgstr[0] "無線ネットワーク (%s)" - -#~ msgid "Wireless Network" -#~ msgid_plural "Wireless Networks" -#~ msgstr[0] "無線ネットワーク" - -#~ msgid " (invalid Unicode)" -#~ msgstr " (不正な Unicode)" - -#~ msgid "" -#~ "By default, the wireless network's name is set to your computer's name, %" -#~ "s, with no encryption enabled" -#~ msgstr "" -#~ "デフォルトでは無線ネットワークの名前はあなたのコンピュータ名 (%s) に設定さ" -#~ "れ、暗号がないものとされます。" - -#~ msgid "Create new wireless network" -#~ msgstr "新しい無線ネットワークを作成" - -#~ msgid "" -#~ "Enter the name and security settings of the wireless network you wish to " -#~ "create." -#~ msgstr "" -#~ "作成したい無線ネットワークの名前とセキュリティ設定を入力して下さい。" - -#~ msgid "Create New Wireless Network" -#~ msgstr "新しい無線ネットワークを作成" - -#~ msgid "Existing wireless network" -#~ msgstr "既存の無線ネットワーク" - -#~ msgid "Enter the name of the wireless network to which you wish to connect." -#~ msgstr "接続したい無線ネットワークの名前を入力して下さい。" - -#~ msgid "Connect to Other Wireless Network" -#~ msgstr "他の無線ネットワークに接続" - -#~ msgid "Error connecting to wireless network" -#~ msgstr "無線ネットワークに接続中にエラー" - -#~ msgid "" -#~ "The requested wireless network requires security capabilities unsupported " -#~ "by your hardware." -#~ msgstr "" -#~ "要求された無線ネットワークにはあなたのハードウェアがサポートしていないセ" -#~ "キュリティ機能が必要です。" - -#~ msgid "Cannot start VPN connection '%s'" -#~ msgstr "VPN 接続 '%s' を開始できません" - -#~ msgid "" -#~ "Could not find the authentication dialog for VPN connection type '%s'. " -#~ "Contact your system administrator." -#~ msgstr "" -#~ "VPN 接続タイプ '%s' の認証ダイアログをみつけられませんでした。システム管理" -#~ "者に連絡して下さい。" - -#~ msgid "" -#~ "There was a problem launching the authentication dialog for VPN " -#~ "connection type '%s'. Contact your system administrator." -#~ msgstr "" -#~ "VPN 接続タイプ '%s' の認証ダイアログを起動中に問題が生じました。システム管" -#~ "理者に連絡して下さい。" - -#~ msgid " " -#~ msgstr " " - -#~ msgid "" -#~ "Active Connection Information" -#~ msgstr "アクティブな接続の情報" - -#~ msgid "" -#~ "Passphrase Required by Wireless " -#~ "Network\n" -#~ "\n" -#~ "A passphrase or encryption key is required to access the wireless network " -#~ "'%s'." -#~ msgstr "" -#~ "無線ネットワークにはパスフレーズが必" -#~ "要です\n" -#~ "\n" -#~ "無線ネットワーク '%s' にアクセスするにはパスフレーズか暗号化鍵が必要です。" - -#~ msgid "" -#~ "Reduced Network Functionality\n" -#~ "\n" -#~ "%s It will not be completely functional." -#~ msgstr "" -#~ "限定されたネットワーク機能\n" -#~ "\n" -#~ "%s 完全には機能しません。" - -#~ msgid "" -#~ "Wireless Network Login " -#~ "Confirmation\n" -#~ "\n" -#~ "You have chosen to log in to the wireless network '%s'. If you are sure " -#~ "that this wireless network is secure, click the checkbox below and " -#~ "NetworkManager will not require confirmation on subsequent log ins." -#~ msgstr "" -#~ "無線ネットワークログイン確認\n" -#~ "\n" -#~ "無線ネットワーク '%s' にログインするように選択しました。もしこの無線ネット" -#~ "ワークがセキュアであることを確信できるのであれば下のチェックボタンをクリッ" -#~ "クして NetworkManager がログインの後で確認を必要としないようにすることがで" -#~ "きます。" - -#~ msgid "Anonymous Identity:" -#~ msgstr "匿名:" - -#~ msgid "Authentication:" -#~ msgstr "認証:" - -#~ msgid "Broadcast Address:" -#~ msgstr "ブロードキャストアドレス:" - -#~ msgid "CA Certificate File:" -#~ msgstr "CA 証明ファイル:" - -#~ msgid "C_onnect" -#~ msgstr "接続(_O)" - -#~ msgid "Client Certificate File:" -#~ msgstr "クライアント証明ファイル:" - -#~ msgid "Connection Information" -#~ msgstr "接続情報" - -#~ msgid "Default Route:" -#~ msgstr "デフォルトルート:" - -#~ msgid "Destination Address:" -#~ msgstr "宛先アドレス:" - -#~ msgid "Driver:" -#~ msgstr "ドライバ:" - -#~ msgid "EAP Method:" -#~ msgstr "EAP 方式:" - -#~ msgid "Hardware Address:" -#~ msgstr "ハードウェアアドレス:" - -#~ msgid "IP Address:" -#~ msgstr "IP アドレス:" - -# とりあえずこのように訳しておくが "Identity" のままの方が適切かもしれない。 -# (WPA-EAP Identity 認証方式: ユーザ ID とパスワードの組で認証) -#~ msgid "Identity:" -#~ msgstr "ユーザ ID:" - -#~ msgid "Interface:" -#~ msgstr "インターフェース:" - -#~ msgid "Key Type:" -#~ msgstr "鍵タイプ:" - -#~ msgid "Key management:" -#~ msgstr "鍵管理:" - -#~ msgid "Key:" -#~ msgstr "鍵:" - -#~ msgid "" -#~ "None\n" -#~ "WEP 128-bit Passphrase\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" -#~ msgstr "" -#~ "なし\n" -#~ "WEP 128-bit パスフレーズ\n" -#~ "WEP 64/128-bit 十六進数\n" -#~ "WEP 64/128-bit ASCII\n" - -#~ msgid "" -#~ "Open System\n" -#~ "Shared Key" -#~ msgstr "" -#~ "オープンシステム\n" -#~ "共有鍵" - -#~ msgid "Other Wireless Network..." -#~ msgstr "他の無線ネットワーク..." - -#~ msgid "Passphrase:" -#~ msgstr "パスフレーズ:" - -#~ msgid "Password:" -#~ msgstr "パスワード:" - -#~ msgid "Primary DNS:" -#~ msgstr "第一 DNS:" - -#~ msgid "Private Key File:" -#~ msgstr "秘密鍵ファイル:" - -#~ msgid "Private Key Password:" -#~ msgstr "秘密鍵パスワード:" - -#~ msgid "Secondary DNS:" -#~ msgstr "第二 DNS:" - -#~ msgid "Select the CA Certificate File" -#~ msgstr "CA 証明ファイルを選択" - -#~ msgid "Select the Client Certificate File" -#~ msgstr "クライアント証明ファイルを選択" - -#~ msgid "Select the Private Key File" -#~ msgstr "秘密鍵ファイルを選択" - -#~ msgid "Show key" -#~ msgstr "鍵を表示" - -#~ msgid "Show passphrase" -#~ msgstr "パスフレーズを表示" - -#~ msgid "Show password" -#~ msgstr "パスワードを表示" - -#~ msgid "Show passwords" -#~ msgstr "パスワードを表示" - -#~ msgid "Speed:" -#~ msgstr "速度:" - -#~ msgid "Subnet Mask:" -#~ msgstr "サブネットマスク:" - -#~ msgid "Type:" -#~ msgstr "タイプ:" - -#~ msgid "User Name:" -#~ msgstr "ユーザ名:" - -#~ msgid "Wireless Network Key Required" -#~ msgstr "無線ネットワーク鍵が必要です" - -#~ msgid "Wireless _adapter:" -#~ msgstr "無線アダプタ(_A):" - -#~ msgid "_Always Trust this Wireless Network" -#~ msgstr "この無線ネットワークを常に信頼する(_A)" - -#~ msgid "_Don't remind me again" -#~ msgstr "二度と催促しない(_D)" - -#~ msgid "_Fallback on this Network" -#~ msgstr "このネットワークにフォールバック(_F)" - -#~ msgid "_Login to Network" -#~ msgstr "ネットワークにログイン(_L)" - -#~ msgid "_Network Name:" -#~ msgstr "ネットワーク名(_N):" - -#~ msgid "_Wireless Security:" -#~ msgstr "無線セキュリティ(_W):" - -#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." -#~ msgstr "Ad-Hoc 無線ネットワーク '%s' に接続しました。" - -#~ msgid "You are now connected to the wireless network '%s'." -#~ msgstr "無線ネットワーク '%s' に接続しました。" - -#~ msgid "You are now connected to the wired network." -#~ msgstr "有線ネットワークに接続しました。" - -#~ msgid "Connection Established" -#~ msgstr "接続を確立" - -#~ msgid "Disconnected" -#~ msgstr "接続を切断" - -#~ msgid "The network connection has been disconnected." -#~ msgstr "ネットワーク接続が切断されました。" - -#~ msgid "Choose which type of VPN connection you wish to create." -#~ msgstr "作成したい VPN 接続のタイプを選択してください" - -#~ msgid "Connect to:" -#~ msgstr "接続先:" - -#~ msgid "Create VPN Connection - 1 of 2" -#~ msgstr "VPN 接続を作成 - 1 of 2" - -#~ msgid "Create VPN Connection - 2 of 2" -#~ msgstr "VPN 接続を作成 - 2 of 2" - -#~ msgid "Finish Creating VPN Connection" -#~ msgstr "VPN 接続の作成を終了" - -#~ msgid "" -#~ "This assistant will guide you through the creation of a connection to a " -#~ "Virtual Private Network (VPN).\n" -#~ "\n" -#~ "It will require some information, such as IP addresses and secrets. " -#~ "Please see your system administrator to obtain this information." -#~ msgstr "" -#~ "このアシスタントは仮想プライベートネットワーク (VPN) の接続の作成を手助け" -#~ "します。\n" -#~ "\n" -#~ "作成時には IP アドレスといったような情報が必要となります。システム管理者に" -#~ "確認してこれらの情報を得ておいてください。" - -#~ msgid "Modify Wireless Networks" -#~ msgstr "無線ネットワークを変更" - -#~ msgid "*" -#~ msgstr "*" - -#~ msgid "" -#~ "128-bit Passphrase (WEP)\n" -#~ "Ascii Key (WEP)\n" -#~ "Hex Key (WEP)" -#~ msgstr "" -#~ "128-bit パスフレーズ (WEP)\n" -#~ "ASCII 鍵 (WEP)\n" -#~ "16 進鍵 (WEP)" - -#~ msgid "Ascii Key:" -#~ msgstr "ASCII 鍵:" - -#~ msgid "You must log in to access the private network %s" -#~ msgstr "" -#~ "プライベートネットワーク %s にアクセスするにはログインしなければいけません" From eea261afe25f8d81eae189cfb29c0f047497cf44 Mon Sep 17 00:00:00 2001 From: Runa Bhattacharjee Date: Sat, 8 May 2010 09:52:41 -0700 Subject: [PATCH 365/392] po: update Bengali translation (bgo #617985) --- po/bn_IN.po | 1015 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 932 insertions(+), 83 deletions(-) diff --git a/po/bn_IN.po b/po/bn_IN.po index 4ace70d6d2..602ba3fa0c 100644 --- a/po/bn_IN.po +++ b/po/bn_IN.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2010-02-19 17:25+0530\n" +"POT-Creation-Date: 2010-04-30 03:24+0000\n" +"PO-Revision-Date: 2010-05-07 11:04+0530\n" "Last-Translator: Runa Bhattacharjee \n" "Language-Team: Bengali INDIA \n" "MIME-Version: 1.0\n" @@ -18,6 +18,850 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c: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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "নাম" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "সিস্টেমের সংযোগ:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "ব্যবহারকারীর সংযোগ:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ত্রুটি: %s আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ত্রুটি: %s - এই ধরনের কোনো সংযোগ উপস্থিত নেই।" + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "সিস্টেম ব্যাপী সংযোগ" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "ব্যবহারকারীর সংযোগ" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "অজানা পরামিতি: %s\n" + +#: ../cli/src/connections.c:221 +#, 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 "না" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "সক্রিয় সংযোগ" + +#: ../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:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "পরিসেবা" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "ডিভাইস" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' ডিভাইসের মধ্যে কোনো সক্রিয় সংযোগ উপস্থিত নেই" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "কোনো সক্রিয় সংযোগ অথবা ডিভাইস উপস্থিত নেই" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "সক্রিয় করা হচ্ছে" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "সক্রিয় করা হয়েছে" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "অজানা" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (প্রস্তুতি)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (অনুমোদন প্রয়োজন)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN সংযোগ স্থাপন করা হয়েছে" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN সংযোগ বিফল হয়েছে" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN সংযোগ বিচ্ছিন্ন করা হয়েছে" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "অজানা কারণ" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "শূণ্য" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "ব্যবহারকারীর সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "মূল নেটওয়ার্ক সংযোগ বিঘ্নিত হয়েছে" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "অপ্রত্যাশিতভাবে VPN পরিসেবা বন্ধ করা হয়েছে" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN পরিসেবা থেকে অবৈধ কনফিগারেশন পাওয়া গিয়েছে" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "সংযোগের প্রয়াসকালে সময়সীমা উত্তীর্ণ হয়েছে" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "যথাযত সময়ে VPN পরিসেবা আরম্ভ করা হয়নি" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN পরিসেবা আরম্ভ করা যায়নি" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "VPN-র বৈধ গোপন তথ্য উপস্থিত নেই" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "VPN-র অবৈধ গোপন তথ্য" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "সংযোগ মুছে ফেলা হয়েছে" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "অবস্থা: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "সংযোগ সক্রিয় করা হয়েছে\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ।" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "অবস্থা: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s।" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ত্রুটি: %d সেকেন্ডের সময়সীমা উত্তীর্ণ হয়েছে।" + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ত্রুটি: '%s'-র জন্য সক্রিয় সংযোগ প্রাপ্ত করতে ব্যর্থ।" + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "সক্রিয় সংযোগের অবস্থা: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "সক্রিয় সংযোগের পাথ: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ত্রুটি: অজানা সংযোগ: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ত্রুটি: '%s' সময়সীমার মান বৈধ নয়।" + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ত্রুটি: id অথবা uuid নির্ধারণ করা আবশ্যক।" + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ত্রুটি: প্রযোজ্য কোনো ডিভাইস পাওয়া যায়নি: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "ত্রুটি: কোনো প্রযোজ্য ডিভাইস পাওয়া যায়নি।" + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "সতর্কবার্তা: সংযোগ সক্রিয় নয়\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ত্রুটি: 'con' কমান্ড '%s', বৈধ নয়।" + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ত্রুটি: D-Bus-র সাথে সংযোগ করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ত্রুটি: সিস্টেমের বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ত্রুটি: ব্যবহারকারীর বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ" + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ত্রুটি: সংযোগ প্রাপ্ত করতে ব্যর্থ: বৈশিষ্ট্যের পরিসেবা বর্তমানে চলছে না।" + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "পরিচালিত নয়" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "উপলব্ধ নয়" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "বিচ্ছিন্ন" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "সংযোগ করা হচ্ছে (প্রস্তুতি)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "সংযোগ করা হচ্ছে (কনফিগার করা হচ্ছে)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "সংযোগ করা হচ্ছে (অনুমোদন প্রয়োজন)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "সংযোগ করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "সংযোগ স্থাপিত" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "সংযোগ বিফল" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "অজানা" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(শূণ্য)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ঠিকানা 0x%X রূপান্তর করতে ত্রুটি" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, ফ্রিকোয়েন্সি %d MHz, হার %d Mb/s, ক্ষমতা %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " এন্টারপ্রাইজ" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "ডিভাইস" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ড্রাইভার" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(অজানা)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "অবস্থা" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "হার্ডওয়্যারের ঠিকানা" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" কর্মক্ষমতা:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "পরিবহণকারী সনাক্তকরণ" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u মেগাবাইট/সেকেন্ড" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "গতি" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" বেতারের বৈশিষ্ট্য\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP এনক্রিপশন" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA এনক্রিপশন" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 এনক্রিপশন" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP সাইফার" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP সাইফার" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" বেতার অ্যাকসেস পয়েন্ট %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = বর্তমান অ্যাকসেস পয়েন্ট)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" তারযুক্ত সংযোগের বৈশিষ্ট্য\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "পরিবহণকারী" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "চালু" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "বন্ধ" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 সংক্রান্ত বৈশিষ্ট্য:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "ডিভাইসের অবস্থা" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ত্রুটি: '%s' আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ত্রুটি: '%s' ডিভাইস পাওয়া যায়নি।" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "সাফল্য: '%s' ডিভাইস সাফল্যের সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে।" + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ত্রুটি: '%s' (%s) ডিভাইসের সাথে সংযোগ বিচ্ছিন্ন করতে ব্যর্থ: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ডিভাইসের অবস্থা: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ত্রুটি: iface নির্ধারণ করা আবশ্যক।" + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "ওয়াই-ফাই স্ক্যানের তালিকা" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ত্রুটি: '%s' ডিভাইসটি ওয়াই-ফাই ডিভাইস নয়।" + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "ডিভাইস:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "ত্রুটি: hwaddr নির্ধারণ করা আবশ্যক।" + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ত্রুটি: hwaddr '%s' সহ অ্যাকসেস পয়েন্ট পাওয়া যায়নি।" + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u মেগাবাইট/সেকেন্ড" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "অ্যাকসেস পয়েন্ট সংক্রান্ত পরামিতি" + +#: ../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 "ফ্রিকোয়েন্সি:" + +#: ../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 "ক্ষমতা:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "ফ্ল্যাগ:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "গোপনীয়তা" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA ফ্ল্যাগ:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN ফ্ল্যাগ:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ত্রুটি: 'dev wifi' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ত্রুটি: 'dev' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "নিদ্রিত" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "সংযোগ করা হচ্ছে" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "NetworkManager-র অবস্থা" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM চলমান:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "চলমান" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "চলমান নয়" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM-র অবস্থা:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM-র বেতার সংক্রান্ত হার্ডওয়্যার:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM-র বেতার:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN হার্ডওয়্যার:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ত্রুটর: অবৈধ 'wifi' পরামিতি: '%s'।" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ত্রুটি: অবৈধ 'wwan' পরামিতি: '%s'।" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ত্রুটি: 'nm' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "'%s' অবজেক্ট অজানা, 'nmcli help' ব্যবহারের প্রচেষ্টা করুন।" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli সরঞ্জাম, সংস্করণ %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "'%s' বিকল্পটি অজানা, 'nmcli -help' ব্যবহারের প্রয়োগ করুন।" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d সংকেত প্রাপ্ত হয়েছে, বন্ধ করা হচ্ছে..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ত্রুটি: NetworkManager-র সাথে সংযোগ স্থাপন করতে ব্যর্থ।" + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "সফল" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -105,7 +949,7 @@ msgstr "IV-র মধ্যে হেক্সাডেসিম্যাল-ভ #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ব্যক্তিগত-কি'র সাইফার '%s' অজানা।" @@ -164,43 +1008,38 @@ msgstr "ডিক্রিপশনের উদ্দেশ্যে IV নি msgid "Failed to decrypt the private key: %s / %s." msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: %s / %s।" -#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#: ../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 "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: প্যাডিংয়ের দৈর্ঘ্য বৈধ নয়।" -#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ।" -#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "এনক্রিপ্ট করার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "এনক্রিপশন সাইফারের কনটেক্সট আরম্ভ করতে ব্যর্থ: %s / %s।" #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "এনক্রিপশনের জন্য সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ: %s / %s।" #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ: %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 "তথ্য এনক্রিপ্ট করতে ব্যর্থ: %s / %s।" @@ -229,7 +1068,7 @@ msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %s msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে ব্যর্থ: %d।" @@ -271,7 +1110,6 @@ msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করত #: ../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 "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: ডিক্রিপ্ট করা তথ্য অত্যাধিক বড়।" @@ -280,145 +1118,144 @@ msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করত msgid "Failed to finalize decryption of the private key: %d." msgstr "ব্যক্তিগত-কি'র ডিক্রিপশন সমাপ্ত করতে ব্যর্থ: %d।" -#: ../libnm-util/crypto_nss.c:363 +#: ../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 "এনক্রিপশন সাইফার স্লট আরম্ভ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:371 +#: ../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 "এনক্রিপশনের উদ্দেশ্যে সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "এনক্রিপশন কনটেক্সট আরম্ভ করতে ব্যর্থ।" -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "এনক্রিপ্ট করতে ব্যর্থ: %d।" -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "এনক্রিপ্ট করার পরে অপ্রত্যাশিত পরিমাণ তথ্য উপলব্ধ হয়েছে।" -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "সার্টিফিকেট ডিকোড করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "পাসওয়ার্ডকে UCS2-তে রূপান্তর করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ডিকোডার আরম্ভ করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %d" -#: ../libnm-util/crypto_nss.c:556 -#| msgid "Could not decode private key." +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "র‍্যান্ড তথ্য নির্মাণ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1924 #, c-format -#| msgid "Not enough memory to decrypt private key." msgid "Not enough memory to make encryption key." msgstr "এনক্রিপশন-কি নির্মাণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" -#: ../libnm-util/nm-utils.c:1633 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:2034 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ফাইল নির্মাণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ফাইলের মধ্যে IV লেখার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ফাইলের মধ্যে এনক্রিপ্ট করা কি লেখার জন্য মেমরি বরাদ্দ করা যায়নি।" -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:2077 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "PEM ফাইলের তথ্যে সংরক্ষণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "netlink বার্তা প্রক্রিয়াকরণে ত্রুটি: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "তথ্যের জন্য সকেটে অপেক্ষাকালে সমস্যা" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink-র সাথে সংযোগ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink দলে যোগ করতে ব্যর্থ: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink হ্যান্ডেলের পরিচয়ের তথ্য পরিবহণের ব্যবস্থা সক্রিয় করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink লিংক ক্যাশে বরাদ্দ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "তথ্যের জন্য সকেটে অপেক্ষাকালে সমস্যা" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink দলে যোগ করতে ব্যর্থ: %s" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "লিংক ক্যাশে আপডেট করতে সমস্যা: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "অবৈধ বিকল্প। বৈধ বিকল্পগুলির তালিকা দেখার জন্য অনুগ্রহ করে --help প্রয়োগ করুন।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s। বৈধ বিকল্পগুলির তালিকা দেখার জন্য অনুগ্রহ করে --help প্রয়োগ করুন।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager দ্বারা নির্মিত\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -427,40 +1264,49 @@ msgstr "" "# %s থেকে মার্জ করা হয়েছে\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" -msgid "unable to allocate netlink handle: %s" -msgstr "netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ব্যবহারযোগ্য DHCP ক্লায়েন্ট পাওয়া যায়নি।" -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" -msgid "unable to connect to netlink: %s" -msgstr "netlink-র সাথে সংযোগ করতে ব্যর্থ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' পাওয়া যায়নি।" -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" -msgid "unable to join netlink group: %s" -msgstr "netlink দলে যোগ করতে ব্যর্থ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' পাওয়া যায়নি।" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "অসমর্থিত DHCP ক্লায়েন্ট '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "লগের অজানা স্তর '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "অজানা লগ ডোমেইন '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "উল্লেখ্য: libc resolver দ্বারা ৩-টির বেশি নেম-সার্ভার সমর্থিত না হওয়ার সম্ভাবনা " "রয়েছে।" -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "নিম্নলিখিত নেম-সার্ভারগুলি সনাক্ত না হওয়ার সম্ভাবনা রয়েছে।" -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "স্বয়ংক্রিয় %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "সিস্টেম" @@ -487,17 +1333,20 @@ msgstr "" "নয়" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents modification of the persistent system hostname" msgstr "" -"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করা সম্ভব " -"নয়" +"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন " +"করা সম্ভব নয়" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "সিস্টেমের নিয়মনীতির কারণে, নিরাপদ ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে" +msgstr "" +"সিস্টেমের নিয়মনীতির কারণে, নিরাপদ ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ " +"ব্যবহার প্রতিরোধ করা হয়েছে" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "সিস্টেমের নিয়মনীতির কারণে, উন্মুক্ত ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে" +msgstr "" +"সিস্টেমের নিয়মনীতির কারণে, উন্মুক্ত ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ " +"ব্যবহার প্রতিরোধ করা হয়েছে" From 47b7bc2871b87e73e81083b1ef634aa0a378936b Mon Sep 17 00:00:00 2001 From: Sandeep Shedmake Date: Sat, 8 May 2010 09:55:08 -0700 Subject: [PATCH 366/392] po: update Marathi translation (bgo #615811) --- po/mr.po | 1138 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1080 insertions(+), 58 deletions(-) diff --git a/po/mr.po b/po/mr.po index 97988390dc..43e696572b 100644 --- a/po/mr.po +++ b/po/mr.po @@ -1,22 +1,867 @@ -# translation of NetworkManager.master.po to marathi +# translation of mr.po to Marathi # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Sandeep Shedmake , 2009. +# Sandeep Shedmake , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-06-08 03:24+0000\n" -"PO-Revision-Date: 2009-06-08 13:08+0530\n" -"Last-Translator: Sandeep Shedmake \n" -"Language-Team: marathi\n" +"Project-Id-Version: mr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-04-15 15:38+0530\n" +"PO-Revision-Date: 2010-04-21 10:08+0530\n" +"Last-Translator: Sandeep Shedmake \n" +"Language-Team: Marathi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"वापर: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c: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 "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "नाव" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "प्रणाली जोडणी:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "प्रणाली जोडणी:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "त्रुटी: %s घटक आढळले नाही." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "त्रुटी: %s - याप्रकारची जोडणी आढळली नाही." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "प्रणाली-भर जोडणी" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "वापरकर्त्याची जोडणी" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "अपरिचीत घटक: %s\n" + +#: ../cli/src/connections.c:221 +#, 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 "नाही" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "सक्रिय जोडणी" + +#: ../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:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "सर्व्हिस" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "साधणे" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "साधण '%s' वरील सक्रिय जोडणी आढळली नाही" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "सक्रिय जोडणी किंवा साधण आढळले नाही" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "सक्रिय करत आहे" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "सक्रिय केले" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "अपरिचीत" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN जोडणी (तयार करा)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN जोडणी (ओळख पटवणे आवश्यक आहे)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN जोडणी" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN जोडणी (IP संरचना प्राप्त करत आहे)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN जोडणी यशस्वी" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN जोडणी अपयशी" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN जोडणी खंडीत झाली" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "अपरिचीत कारण" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "काहिच नाही" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "वापरकर्ता खंडीत झाले" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "बेस नेटवर्क जोडणी खंडीत झाले" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN सेवा अनपेक्षीतरित्या थांबली" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN सेवाने अवैध संरचना रिटर्न केली" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "जोडणी प्रयत्नाची वेळ समाप्ती आढळली" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN सेवा वेळेवर सुरू झाली नाही" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN सेवा सुरू होण्यास अपयशी" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "वैध VPN गोपणीयता आढळले नाही" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "अवैध VPN गोपणीयता" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "जोडणी काढून टाकली" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "स्तर: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "जोडणी सक्रिय केली\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "स्तर: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "त्रुटी: वेळसमाप्ती %d सेकंद समाप्त." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "त्रुटी: '%s' करीता सक्रिय जोडणी प्राप्त करण्यास अपयशी." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "सक्रिय जोडणीचे स्तर: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "सक्रिय जोडणीचे मार्ग: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "त्रुटी: अपरिचीत जोडणी: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "त्रुटी: वेळसमाप्तीचे मुल्य '%s' वैध नाही." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "त्रुटी: id किंवा uuid निर्देशीत करणे आवश्यक आहे." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "त्रुटी: योग्य साधण आढळले नाही: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "त्रुटी: योग्य साधण आढळले नाही." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "सावधान: जोडणी सक्रिय नाही\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "त्रुटी: 'con' आदेश '%s' वैध नाही." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "त्रुटी: D-Bus सह जोडणी करणे अशक्य." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "त्रुटी: प्रणालीची संयोजना प्राप्त करणे अशक्य." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "त्रुटी: वापरकर्ताची संयोजना प्राप्त करणे अशक्य." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "त्रुटी: जोडणी प्राप्त करण्यास अशक्य: सेटिंग्स् सेवा कार्यरत नाही." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"वापरणी: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "अव्यवस्थापीत" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "अनुपल्बध" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "खंडीत" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "जोडणी (तयार करत आहे)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "जोडणी (संरचीत करत आहे)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "जोडणी (ओळख पटवणे आवश्यक आहे)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "जोडणी (IP संरचना प्राप्त करत आहे)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "जोडणी यशस्वी" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "जोडणी अपयशी" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "अपरिचीत" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(काहिच नाही)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 पत्ता 0x%X यांस रूपांतरीत करतेवेळी त्रुटी" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, फ्रिक्वेंसी %d MHz, रेट %d Mb/s, स्ट्रेंग्थ %d" + +#: ../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 " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " एनटरप्राइज" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "साधण" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "ड्राइव्हर" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(अपरिचीत)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "स्तर" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW पत्ता" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" क्षमता:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "कॅरीअर आढळले" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "वेग" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" वायरलेस् गुणधर्म\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP एनक्रिप्शन" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA एनक्रिप्शन" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 एनक्रिप्शन" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP सीफर" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP सीफर" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" वायरलेस एक्सेस् पॉईंट्स् %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = current AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" वायर्ड गुणधर्म\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "कॅरीअर" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "सुरू करा" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "बंद करा" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 संरचना:\n" + +#: ../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 "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "साधणाची स्थिती" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "त्रुटी: '%s' घटक आढळले नाही." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "त्रुटी: साधण '%s' आढळले नाही." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "यशस्वी: साधण '%s' यशस्वीरित्या खंडीत झाले." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "त्रुटी: साधण '%s' (%s) खंडीत होणे अपयशी झाले: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "साधणाचे स्तर: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "त्रुटी: iface निर्देशीत करणे आवश्यक आहे." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi स्कॅन सूची" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "त्रुटी: साधण '%s' WiFi साधण नाही." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "साधण:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "त्रुटी: hwaddr निर्देशीत करणे आवश्यक आहे." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "त्रुटी: ऍक्सेस पॉईंट hwaddr '%s' सह आढळले नाही." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP घटके" + +#: ../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 "फ्रिक्वेंसी:" + +#: ../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 "स्ट्रेंग्थ:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "फ्लॅग्स्:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "गोपणीयता" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA फ्लॅग्स्:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN फ्लॅग्स्:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "त्रुटी: 'dev wifi' आदेश '%s' वैध नाही." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "त्रुटी: 'dev' आदेश '%s' वैध नाही." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"वापरणी: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "अस्लीप्" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "जोडणी करत आहे" + +#: ../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: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:102 +msgid "NetworkManager status" +msgstr "NetworkManager स्थिती" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM कार्यरत आहे:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "कार्यरत आहे" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "कार्यरत नाही" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM स्तर:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM वायरलेस् हार्डवेअर:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM वायरलेस्:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN हार्डवेअर:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "त्रुटी: अवैध 'wifi' घटक: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "त्रुटी: अवैध 'wwan' घटक: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "त्रुटी: 'nm' आदेश '%s' वैध नाही." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"वापरणी: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "घटक '%s' अपरिचीत आहे, 'nmcli help' वापरून पहा." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli साधण, आवृत्ती %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "पर्याय '%s' अपरिचीत आहे, 'nmcli -help' वापरून पहा." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "संकेत %d प्राप्त झाले, बंद करत आहे..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "त्रुटी: NetworkManager सह जोडणी करण्यास अशक्य." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "यश" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -102,8 +947,9 @@ msgstr "IV साठवण्याकरीता स्मृती शिल msgid "IV contains non-hexadecimal digits." msgstr "IV अंतर्गत non-hexadecimal अंक." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "वैयक्तिक कि सिफर '%s' अपरिचीत नुरूप आढळले." @@ -123,72 +969,106 @@ msgstr "वैयक्तिक कि प्रकार ओळखणे अ msgid "Not enough memory to store decrypted private key." msgstr "जुणी वैयक्तिक कि साठवण्याकरीता स्मृती शिल्ल्क नाही." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "क्रिप्टो इंजीन प्रारंभ करण्यास अपयशी." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 इंजीन प्रारंभ करण्यास अपयशी: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "अवैध IV लांबी (किमान %zd असायला हवे)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "जुणे कि बफर करीता स्मृती शिल्लक नाही." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "डिक्रीपशन सिफर संदर्भ प्रारंभ करण्यास अपयशी: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "डिक्रीपशन करीता सम कि निश्चित करण्यास अपयशी: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "डिक्रीपशन करीता IV निश्चित करण्यास अपयशी: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "प्राइव्हेट कि डिक्रीप्ट करणे अशक्य: अनपेक्षीत पॅडींग लांबी." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "एनक्रिप्टींग करीता मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "एनक्रिप्शन सीफर संदर्भ सुरू करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "एनक्रिप्शनकरीता सम कि सेट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "एनक्रिप्शन करीता IV सेट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "डिक्रीप्ट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "प्रमाण माहिती प्रारंभ करण्यास त्रुटी: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "प्रमाणपत्र डिकोड करण्यास अशक्य: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 डिकोडर प्रारंभ करण्यास अशक्य: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 फाइल डिकोड करण्यास अपयशी: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 फाइल तपासण्यास अशक्य: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "क्रिप्टो इंजीन प्रारंभ करण्यास अपयशी: %d." @@ -198,105 +1078,181 @@ msgstr "क्रिप्टो इंजीन प्रारंभ करण msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 संदर्भ प्रारंभ करण्यास अपयशी: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "अवैध IV लांबी (किमान %d असायला हवे)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "डिक्रीपशन सिफर क्षेत्र प्रारंभ करण्यास अपयशी." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "डिक्रीपशन करीता सम कि निश्चित करण्यास अपयशी." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "डिक्रीपशन करीता IV निश्चित करण्यास अपयशी." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "डिक्रीपशन संदर्भ प्रारंभ करण्यास अपयशी." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "प्राइव्हेट कि डिक्रीप्ट करणे अशक्य: डिक्रीप्ट केलेला डाटा खूप मोठा आहे." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "वैयक्तिक किचे डिक्रीपशन ठरविण्यास अपयशी: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "एनक्रिप्शन सीफर स्लॉट सुरू करणे अशक्य." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "एनक्रिप्शन करीता सिमेट्रीक कि सेट करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "एनक्रिप्शनसाठी IV सेट करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "एनक्रिप्शन संदर्भ प्रारंभ करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "एनक्रिप्ट करण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "एनक्रिप्टींग नंतर अनपेक्षीत डाटाचे प्रमाण." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "प्रमाणपत्र डिकोड करणे अशक्य: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "परवलीचा शब्द UCS2 नुरूप रूपांतरन अशक्य: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 डिकोडर प्रारंभ करण्यास अशक्य: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 फाइल डिकोड करण्यास अशक्य: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 फाइल तपास करण्यास अशक्य: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "विनाक्रम डाटा निर्माण करणे अशक्य." + +#: ../libnm-util/nm-utils.c:1818 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "एनक्रिप्शन कि निर्माण करण्यास अतिरीक्त मेमरी आढळली नाही." + +#: ../libnm-util/nm-utils.c:1928 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM फाइल निर्माणकरीता मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:1940 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV ला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:1952 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "एनक्रिप्टेड किला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:1971 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM फाइल डाटाकरीता मेमरीचे वाटप करणे अशक्य." + +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 #, c-format msgid "error processing netlink message: %s" msgstr "netlink संदेश विश्लेषीत करतेवेळी त्रुटी: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:259 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink handle चे वाटप अशक्य: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:269 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink शी जुळवणी स्थापीत करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:277 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink गट शी जुळवणी स्थापीत करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:285 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink दुवा कॅशे वाटप करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 +msgid "error occurred while waiting for data on socket" +msgstr "सॉकेट वरील माहिती करीता प्रतिक्षा करतेवेळी त्रुटी आढळली" + +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 #, c-format msgid "error updating link cache: %s" msgstr "दुवा कॅशे अद्ययावत करतेवेळी त्रुटी: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "सॉकेट वरील माहिती करीता प्रतिक्षा करतेवेळी त्रुटी आढळली" - -#: ../src/NetworkManager.c:296 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "अवैध पर्याय. वैध पर्यायची यादी पहाण्याकरीता कृपया --help वापरा.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/main.c:558 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. वैध पर्यायची सूची पहाण्याकरीता कृपया --help वापरा.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager द्वारे निर्मीत\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -305,28 +1261,94 @@ msgstr "" "# %s पासून एकत्रीत केले\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "वापरण्याजोगी DHCP क्लाएंट आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "असमर्थीत DHCP क्लाएंट '%s'" + +#: ../src/ip6-manager/nm-netlink-listener.c:199 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "netlink हँडलचे वाटप करणे अशक्य: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:209 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "netlink शी जोडणी करणे अशक्य: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:306 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink गटसह जोडणी करणे अशक्य: %s" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "अपरिचीत लॉग स्तर '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "अपरिचीत लॉग डोमेन '%s'" + +#: ../src/named-manager/nm-named-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "NOTE: libc resolver 3 पेक्षा जास्त nameservers करीता समर्थन पुरवू शकणार नाही." +msgstr "NOTE: libc रिजॉलव्हर 3 पेक्षा जास्त नेमसर्व्हर्स् करीता समर्थन पुरवू शकणार नाही." -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/named-manager/nm-named-manager.c:316 msgid "The nameservers listed below may not be recognized." -msgstr "खालिल यादीतील nameservers अनोळखी राहतील." +msgstr "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील." -#: ../system-settings/plugins/ifcfg-rh/reader.c:2142 -msgid "System" -msgstr "प्रणाली" - -#: ../system-settings/src/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "स्वयं %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +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:2 +#: ../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 नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" + From 9afd18f37c20348d7770d5b0e39a4041a389cb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Sat, 8 May 2010 09:59:34 -0700 Subject: [PATCH 367/392] po: update Spanish translation (bgo #617357) --- po/es.po | 95 +++++++++++++++++++++++++++----------------------------- 1 file changed, 45 insertions(+), 50 deletions(-) diff --git a/po/es.po b/po/es.po index 6919c06759..1390671209 100644 --- a/po/es.po +++ b/po/es.po @@ -6,13 +6,14 @@ # Francisco Javier F. Serrador , 2004, 2005, 2006, 2010. # Lucas Vieites Fariña , 2005, 2006. # Jorge González , 2007, 2008, 2010. +# msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-09 03:24+0000\n" -"PO-Revision-Date: 2010-04-10 19:52+0200\n" +"POT-Creation-Date: 2010-04-27 15:25+0000\n" +"PO-Revision-Date: 2010-05-01 10:55+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -1186,83 +1187,85 @@ 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:1818 +#: ../libnm-util/nm-utils.c:1924 #, 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:1928 +#: ../libnm-util/nm-utils.c:2034 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:1940 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "No se pudo asignar memoria para escribir IV en el archivo PEM." -#: ../libnm-util/nm-utils.c:1952 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "No se pudo asignar memoria para escribir la clave cifrada en el archivo PEM." -#: ../libnm-util/nm-utils.c:1971 +#: ../libnm-util/nm-utils.c:2077 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 -#: ../src/nm-netlink-monitor.c:581 -#: ../src/ip6-manager/nm-netlink-listener.c:351 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "error al procesar el mensaje de netlink: %s" -#: ../src/nm-netlink-monitor.c:259 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ha ocurrido un error mientras esperaban datos en un socket" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"no se puede conectar con netlink para monitorizar el estado del enlace: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +#| msgid "unable to allocate netlink handle: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "no se pudo activar el manejador de paso de credenciales de netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "no se puede asignar el manejador netlink para monitorizar el estado del " "enlace: %s" -#: ../src/nm-netlink-monitor.c:269 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"no se puede conectar con netlink para monitorizar el estado del enlace: %s" - -#: ../src/nm-netlink-monitor.c:277 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" - -#: ../src/nm-netlink-monitor.c:285 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "no se puede asignar el enlace a la caché de netlink para monitorizar el " "estado del enlace: %s" -#: ../src/nm-netlink-monitor.c:493 -#: ../src/ip6-manager/nm-netlink-listener.c:381 -msgid "error occurred while waiting for data on socket" -msgstr "ha ocurrido un error mientras esperaban datos en un socket" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "no pudo unirse al grupo netlink: %s" -#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "error al actualizar el enlace caché: %s" -#: ../src/main.c:498 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/main.c:558 +#: ../src/main.c:562 #, 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. Use --help para ver una lista de las opciones válidas.\n" @@ -1296,21 +1299,6 @@ msgstr "no se pudo encontrar «dhcpd»." msgid "unsupported DHCP client '%s'" msgstr "no se soporta el cliente de DHCP «%s»" -#: ../src/ip6-manager/nm-netlink-listener.c:199 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "no se puede asignar el manejador netlink: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:209 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "no se puede conectar con netlink: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:306 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "no pudo unirse al grupo netlink: %s" - #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" @@ -1321,13 +1309,13 @@ msgstr "Nivel de registro «%s» desconocido" msgid "Unknown log domain '%s'" msgstr "Dominio de registro «%s» desconocido" -#: ../src/named-manager/nm-named-manager.c:314 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " "servidores de nombres." -#: ../src/named-manager/nm-named-manager.c:316 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." @@ -1336,7 +1324,7 @@ 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:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "Sistema" @@ -1378,3 +1366,10 @@ msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" "La política del sistema impide compartir conexiones a través de una red " "inalámbrica abierta" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "no se puede conectar con netlink: %s" From f3057a6844b6d8a9f6ed2d82dc9bb4a46e4318d9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 10 May 2010 00:35:07 -0700 Subject: [PATCH 368/392] release: bump version to 0.8.0.997 (0.8.1-beta1) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 98f8d605b7..c8499a7ef6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.8, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.8.0.997, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) AM_MAINTAINER_MODE From 3e68d3358311cd04ae85884ef593da7554f4b3e3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 10 May 2010 15:19:03 -0700 Subject: [PATCH 369/392] ip6: only honor kernel-provided RA flags if an RA was received (rh #588560) The kernel apparently caches the value and will send Managed/Other flags in the newlink message even if the router is no longer reachable and and RA hasn't been received for a while. So we need to make sure we check for IF_RA_RCVD before paying attention to Managed/Other. --- src/ip6-manager/nm-ip6-manager.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index be22e6465b..ba6be259f8 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -390,9 +390,10 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) device->iface, state_to_string (device->state)); /* We only care about router advertisements if we want a real IPv6 address */ - if (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) { - if ( (device->ra_flags & IF_RA_RCVD) - && (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT)) + if ( (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) + && (device->ra_flags & IF_RA_RCVD)) { + + if (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; if (device->ra_flags & IF_RA_MANAGED) { From e273cefa32ce2271e82e2f09ae51f5cbdac4568c Mon Sep 17 00:00:00 2001 From: Sandeep Shedmake Date: Mon, 10 May 2010 16:33:12 -0700 Subject: [PATCH 370/392] po: update Marathi translation (bgo #618236) --- po/mr.po | 128 +++++++++++++++++++++++++------------------------------ 1 file changed, 58 insertions(+), 70 deletions(-) diff --git a/po/mr.po b/po/mr.po index 43e696572b..33cb1976e8 100644 --- a/po/mr.po +++ b/po/mr.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: mr\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-15 15:38+0530\n" -"PO-Revision-Date: 2010-04-21 10:08+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-30 03:24+0000\n" +"PO-Revision-Date: 2010-05-10 13:46+0530\n" "Last-Translator: Sandeep Shedmake \n" -"Language-Team: Marathi \n" +"Language-Team: Marathi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -41,7 +41,7 @@ msgstr "" #: ../cli/src/connections.c:158 msgid "Connections" -msgstr "जोडणी" +msgstr "जोडण्या" #: ../cli/src/connections.c:158 ../cli/src/connections.c:160 #: ../cli/src/connections.c:196 ../cli/src/connections.c:198 @@ -67,12 +67,12 @@ msgstr "नाव" #: ../cli/src/connections.c:163 #, c-format msgid "System connections:\n" -msgstr "प्रणाली जोडणी:\n" +msgstr "प्रणाली जोडण्या:\n" #: ../cli/src/connections.c:167 #, c-format msgid "User connections:\n" -msgstr "प्रणाली जोडणी:\n" +msgstr "वापरकर्ताच्या जोडण्या:\n" #: ../cli/src/connections.c:178 ../cli/src/connections.c:967 #: ../cli/src/connections.c:983 ../cli/src/connections.c:992 @@ -90,7 +90,7 @@ msgstr "त्रुटी: %s - याप्रकारची जोडणी #: ../cli/src/connections.c:196 msgid "System-wide connections" -msgstr "प्रणाली-भर जोडणी" +msgstr "प्रणाली-भर जोडण्या" #: ../cli/src/connections.c:205 msgid "User connections" @@ -131,7 +131,7 @@ msgstr "पूर्वनिर्धारीत" #: ../cli/src/connections.c:297 ../cli/src/connections.c:299 msgid "Service" -msgstr "सर्व्हिस" +msgstr "सर्व्हिस्" #: ../cli/src/connections.c:297 ../cli/src/connections.c:299 msgid "Devices" @@ -355,7 +355,7 @@ msgid "" " wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" msgstr "" -"वापरणी: nmcli dev { COMMAND | help }\n" +"वापर: nmcli dev { COMMAND | help }\n" "\n" " COMMAND := { status | list | disconnect | wifi }\n" "\n" @@ -419,7 +419,7 @@ msgstr "%s: IP4 पत्ता 0x%X यांस रूपांतरीत #: ../cli/src/devices.c:238 #, c-format msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, फ्रिक्वेंसी %d MHz, रेट %d Mb/s, स्ट्रेंग्थ %d" +msgstr "%s, %s, क्रिक %d MHz, रेट %d Mb/s, स्ट्रेंग्थ् %d" #: ../cli/src/devices.c:239 msgid "Ad-Hoc" @@ -443,7 +443,7 @@ msgstr " WPA2" #: ../cli/src/devices.c:260 msgid " Enterprise" -msgstr " एनटरप्राइज" +msgstr " एंटरप्राइज" #: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 msgid "Device" @@ -476,7 +476,7 @@ msgstr "" #: ../cli/src/devices.c:321 msgid "Carrier Detect" -msgstr "कॅरीअर आढळले" +msgstr "कॅरिअर आढळले" #: ../cli/src/devices.c:336 #, c-format @@ -485,7 +485,7 @@ msgstr "%u Mb/s" #: ../cli/src/devices.c:337 msgid "Speed" -msgstr "वेग" +msgstr "गती" #: ../cli/src/devices.c:348 #, c-format @@ -510,11 +510,11 @@ msgstr "WPA2 एनक्रिप्शन" #: ../cli/src/devices.c:359 msgid "TKIP cipher" -msgstr "TKIP सीफर" +msgstr "TKIP सिफर" #: ../cli/src/devices.c:361 msgid "CCMP cipher" -msgstr "CCMP सीफर" +msgstr "CCMP सिफर" #: ../cli/src/devices.c:368 #, c-format @@ -523,11 +523,11 @@ msgid "" " Wireless Access Points %s\n" msgstr "" "\n" -" वायरलेस एक्सेस् पॉईंट्स् %s\n" +" वायरलेस् ऍक्सेस् पॉईंटस् %s\n" #: ../cli/src/devices.c:368 msgid "(* = current AP)" -msgstr "(* = current AP)" +msgstr "(* = सध्याचे AP)" #: ../cli/src/devices.c:374 #, c-format @@ -536,11 +536,11 @@ msgid "" " Wired Properties\n" msgstr "" "\n" -" वायर्ड गुणधर्म\n" +" वायर्ड् गुणधर्म\n" #: ../cli/src/devices.c:377 ../cli/src/devices.c:379 msgid "Carrier" -msgstr "कॅरीअर" +msgstr "कॅरिअर" #: ../cli/src/devices.c:377 msgid "on" @@ -565,7 +565,7 @@ msgstr "पत्ता" #: ../cli/src/devices.c:401 msgid "Prefix" -msgstr "प्रिकिक्स्" +msgstr "प्रिफिक्स्" #: ../cli/src/devices.c:405 msgid "Gateway" @@ -577,7 +577,7 @@ msgstr "DNS" #: ../cli/src/devices.c:458 msgid "Status of devices" -msgstr "साधणाची स्थिती" +msgstr "साधणांची स्थिती" #: ../cli/src/devices.c:487 #, c-format @@ -656,7 +656,7 @@ msgstr "BSSID:" #: ../cli/src/devices.c:875 msgid "Frequency:" -msgstr "फ्रिक्वेंसी:" +msgstr "क्रिक्वेंसी:" #: ../cli/src/devices.c:876 msgid "Mode:" @@ -672,11 +672,11 @@ msgstr "इंफ्रास्ट्रक्चर" #: ../cli/src/devices.c:877 msgid "Maximal bitrate:" -msgstr "कमाल बीटरेट:" +msgstr "कमाल बिटरेट:" #: ../cli/src/devices.c:878 msgid "Strength:" -msgstr "स्ट्रेंग्थ:" +msgstr "स्ट्रेंग्थ्:" #: ../cli/src/devices.c:879 msgid "Flags:" @@ -718,7 +718,7 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" -"वापरणी: nmcli nm { COMMAND | help }\n" +"वापर: nmcli nm { COMMAND | help }\n" "\n" " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" "\n" @@ -755,7 +755,7 @@ msgstr "NetworkManager स्थिती" #: ../cli/src/network-manager.c:104 msgid "NM running:" -msgstr "NM कार्यरत आहे:" +msgstr "NM सुरू आहे:" #: ../cli/src/network-manager.c:104 msgid "running" @@ -819,7 +819,7 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"वापरणी: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"वापर: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" " -t[erse] terse output\n" @@ -1177,73 +1177,76 @@ msgstr "PKCS#12 फाइल तपास करण्यास अशक्य: msgid "Could not generate random data." msgstr "विनाक्रम डाटा निर्माण करणे अशक्य." -#: ../libnm-util/nm-utils.c:1818 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Not enough memory to make encryption key." msgstr "एनक्रिप्शन कि निर्माण करण्यास अतिरीक्त मेमरी आढळली नाही." -#: ../libnm-util/nm-utils.c:1928 +#: ../libnm-util/nm-utils.c:2034 msgid "Could not allocate memory for PEM file creation." msgstr "PEM फाइल निर्माणकरीता मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:1940 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IV ला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:1952 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "एनक्रिप्टेड किला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:1971 +#: ../libnm-util/nm-utils.c:2077 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल डाटाकरीता मेमरीचे वाटप करणे अशक्य." -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 -#: ../src/nm-netlink-monitor.c:581 -#: ../src/ip6-manager/nm-netlink-listener.c:351 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "netlink संदेश विश्लेषीत करतेवेळी त्रुटी: %s" -#: ../src/nm-netlink-monitor.c:259 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink handle चे वाटप अशक्य: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "सॉकेट वरील माहिती करीता प्रतिक्षा करतेवेळी त्रुटी आढळली" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink शी जुळवणी स्थापीत करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink गट शी जुळवणी स्थापीत करणे अशक्य: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink द्वारे परवानगी स्वीकारणे समर्थीत करण्यास अशक्य: %s" -#: ../src/nm-netlink-monitor.c:285 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink handle चे वाटप अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink दुवा कॅशे वाटप करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:493 -#: ../src/ip6-manager/nm-netlink-listener.c:381 -msgid "error occurred while waiting for data on socket" -msgstr "सॉकेट वरील माहिती करीता प्रतिक्षा करतेवेळी त्रुटी आढळली" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink गटसह जोडणी करणे अशक्य: %s" -#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "दुवा कॅशे अद्ययावत करतेवेळी त्रुटी: %s" -#: ../src/main.c:498 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "अवैध पर्याय. वैध पर्यायची यादी पहाण्याकरीता कृपया --help वापरा.\n" -#: ../src/main.c:558 +#: ../src/main.c:562 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. वैध पर्यायची सूची पहाण्याकरीता कृपया --help वापरा.\n" @@ -1278,21 +1281,6 @@ msgstr "'dhcpcd' आढळले नाही." msgid "unsupported DHCP client '%s'" msgstr "असमर्थीत DHCP क्लाएंट '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:199 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "netlink हँडलचे वाटप करणे अशक्य: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:209 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "netlink शी जोडणी करणे अशक्य: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:306 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "netlink गटसह जोडणी करणे अशक्य: %s" - #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" @@ -1303,11 +1291,11 @@ msgstr "अपरिचीत लॉग स्तर '%s'" msgid "Unknown log domain '%s'" msgstr "अपरिचीत लॉग डोमेन '%s'" -#: ../src/named-manager/nm-named-manager.c:314 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: libc रिजॉलव्हर 3 पेक्षा जास्त नेमसर्व्हर्स् करीता समर्थन पुरवू शकणार नाही." -#: ../src/named-manager/nm-named-manager.c:316 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील." @@ -1316,7 +1304,7 @@ msgstr "खालिल यादीतील नेमसर्व्हर् msgid "Auto %s" msgstr "स्वयं %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "प्रणाली" From c62cfd2b632be0bd832fe9393a79739467c00f23 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 10 May 2010 16:35:14 -0700 Subject: [PATCH 371/392] dns: fix undefined reference when netconf is enabled (bgo #618300) Thanks to Dominique Leuenberger. --- src/named-manager/nm-named-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 12b0df03e1..fc3b6e2c17 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -213,7 +213,7 @@ run_netconfig (GError **error, gint *stdin_fd) argv[4] = NULL; tmp = g_strjoinv (" ", argv); - nm_log_debug (LOGD_DNS, "spawning '%s'", tmp); + nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp); g_free (tmp); if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup, @@ -230,7 +230,7 @@ write_to_netconfig (gint fd, const char *key, const char *value) int x; str = g_strdup_printf ("%s='%s'\n", key, value); - nm_log_debug (LOGD_DNS, "writing to netconfig: %s", str); + nm_log_dbg (LOGD_DNS, "writing to netconfig: %s", str); x = write (fd, str, strlen (str)); g_free (str); } From 32043b00361307a540dcde98dfebf2971410a469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 11 May 2010 18:57:57 +0200 Subject: [PATCH 372/392] cli: fix bssid in 802-11-wireless setting --- cli/src/settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/settings.c b/cli/src/settings.c index becc3262ad..1371bfbef5 100644 --- a/cli/src/settings.c +++ b/cli/src/settings.c @@ -681,7 +681,7 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); channel_str = g_strdup_printf ("%d", nm_setting_wireless_get_channel (s_wireless)); rate_str = g_strdup_printf ("%d", nm_setting_wireless_get_rate (s_wireless)); - bssid = nm_setting_wireless_get_mac_address (s_wireless); + bssid = nm_setting_wireless_get_bssid (s_wireless); if (bssid) bssid_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bssid->data[0], bssid->data[1], bssid->data[2], bssid->data[3], bssid->data[4], bssid->data[5]); tx_power_str = g_strdup_printf ("%d", nm_setting_wireless_get_tx_power (s_wireless)); From a7e0e6231123b09f717f43ea4064e062b3440223 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 13 May 2010 10:52:07 -0700 Subject: [PATCH 373/392] core: tell GIO to use local implementation (rh #588745) GIO will apparently normally try to use the remote VFS implemenation on the session bus. But NM (as a root service) shouldn't ever be trying to talk to anything on the session bus. Squash that. --- src/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.c b/src/main.c index 1d0ab5328c..f76cea9473 100644 --- a/src/main.c +++ b/src/main.c @@ -503,6 +503,12 @@ main (int argc, char *argv[]) exit (1); } + /* Make GIO ignore the remote VFS service; otherwise it tries to use the + * session bus to contact the remote service, and NM shouldn't ever be + * talking on the session bus. See rh #588745 + */ + setenv ("GIO_USE_VFS", "local", 1); + pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE); state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE); From f23ed97d33daf8571ecf4e1286607100aee580e1 Mon Sep 17 00:00:00 2001 From: Amitakhya Phukan Date: Thu, 13 May 2010 12:29:49 -0700 Subject: [PATCH 374/392] po: updated Assamese translation (rh #589230) --- po/as.po | 1694 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1585 insertions(+), 109 deletions(-) diff --git a/po/as.po b/po/as.po index 55a17a7cbe..2f79166f07 100644 --- a/po/as.po +++ b/po/as.po @@ -3,301 +3,1558 @@ # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. # -# Amitakhya Phukan , 2009. +# Amitakhya Phukan , 2009, 2010. +# Amitakhya Phukan , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.po.master.as\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-06-09 03:24+0000\n" -"PO-Revision-Date: 2009-06-10 17:20+0530\n" -"Last-Translator: Amitakhya Phukan \n" -"Language-Team: Assamese \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 16:47+0530\n" +"Last-Translator: Amitakhya Phukan \n" +"Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" +"X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "নাম" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "যন্ত্ৰ" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "স্ক'প" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "অবিকল্পিত" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS সেৱা" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "ধৰণ" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "সময়ৰ চাপ" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "সময়ৰ চাপ - ৰিয়েল" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "স্বয়ংক্ৰিয় সংযোগ" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "অকল পঢ়িব পৰা" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ভুল: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ভুল: 'con list': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "সংযোগৰ বিৱণ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "প্ৰণালী" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ব্যৱহাৰকৰ্তা" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "কেতিয়াও নহয়" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "হয়" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "নহয়" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "প্ৰণালীৰ সংযোগ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ব্যৱহাৰকৰ্তাৰ সংযোগ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ত্ৰুটি: %s তৰ্ক অনুপস্থিত ।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ত্ৰুটি: %s - এই ধৰণৰ কোনো সংযোগ নাই ।" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "অজ্ঞাত স্থিতিমাপ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ত্ৰুটি: বৈধ স্থিতিমাপ উল্লেখ কৰা নাযায় ।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ভুল: %s ।" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ভুল: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ভুল: 'con status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "সক্ৰিয় সংযোগ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' যন্ত্ৰত কোনো সক্ৰিয় সংযোগ নাই" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "কোনো সক্ৰিয় সংযোগ বা যন্ত্ৰ নাই" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "যন্ত্ৰ '%s' সংযোগ '%s' ৰ সৈতে সুসঙ্গত নহয়" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' সংযোগৰ কাৰণে কোনো যন্ত্ৰ নাই" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "সক্ৰিয় কৰা হৈছে" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "সক্ৰিয় কৰা হৈছে" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "অজ্ঞাত" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (প্ৰস্তুতি)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (অনুমোদন প্ৰয়োজন)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (IP বিন্যাস প্ৰাপ্ত কৰা হৈছে)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN সংযোগ বিফল হৈছে" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN সংযোগ বিচ্ছিন্ন কৰা হৈছে" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "অজ্ঞাত কাৰণ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "শূণ্য" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ব্যৱহাৰকৰ্তাৰ সৈতে সংযোগ বিচ্ছিন্ন কৰা হৈছে" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "মূল নে'টৱৰ্ক সংযোগ বিঘ্নিত হৈছে" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "অপ্ৰত্যাশিতভাবে VPN সেৱা বন্ধ কৰা হৈছে" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN সেৱাৰ পৰা অবৈধ বিন্যাস পোৱা গৈছে" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "সংযোগৰ প্ৰয়াসত সময়সীমা উত্তীৰ্ণ হৈছে" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "যথাযত সময়ত VPN সেৱা আৰম্ভ কৰা নহয়" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN সেৱা আৰম্ভ কৰা নাযায়" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "VPN ৰ বৈধ গোপন তথ্য নাই" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "VPN ৰ অবৈধ গোপন তথ্য" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "সংযোগ আঁতৰুৱা হৈছে" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "অৱস্থা: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "সংযোগ সক্ৰিয় কৰা হৈছে\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "অৱস্থা: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s ।" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ত্ৰুটি: %d চেকেন্ডৰ সময়সীমা উত্তীৰ্ণ হৈছে ।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ত্ৰুটি: '%s' ৰ বাবে সক্ৰিয় সংযোগ প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "সক্ৰিয় সংযোগৰ অৱস্থা: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "সক্ৰিয় সংযোগৰ পথ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ত্ৰুটি: অজ্ঞাত সংযোগ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ত্ৰুটি: '%s' সময়সীমাৰ মান বৈধ নহয় ।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ত্ৰুটি: id বা uuid নিৰ্ধাৰণ কৰা আৱশ্যক ।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ত্ৰুটি: প্ৰযোজ্য কোনো যন্ত্ৰ পোৱা নাযায়: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ত্ৰুটি: কোনো প্ৰযোজ্য যন্ত্ৰ পোৱা নাযায় ।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "সতৰ্কবাৰ্তা: সংযোগ সক্ৰিয় নহয়\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ত্ৰুটি: 'con' আদেশ '%s', বৈধ নহয় ।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ত্ৰুটি: D-Bus ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ত্ৰুটি: প্ৰণালীৰ বৈশিষ্ট্য প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ত্ৰুটি: ব্যৱহাৰকৰ্তাৰ বৈশিষ্ট্য প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ত্ৰুটি: সংযোগ প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ: বৈশিষ্ট্যৰ সেৱা বৰ্তমানে নাই চলা ।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "যন্ত্ৰ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "অৱস্থা" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "সাধাৰণ" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "কৰ্মক্ষমতা" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "ৱাইফাই গুণ" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "তাঁৰযুক্ত সংযোগৰ বৈশিষ্ট্য" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 পছন্দসমূহ" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "চালক" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "পৰিবহণকৰ্তা চিনাক্তকৰণ" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "গতি" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "পৰিবহণকৰ্তা" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ঠিকনা" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "উপসৰ্গ" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "গে'টৱে" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "মোড" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "হাৰ" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "চিগ্নেল" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "সুৰক্ষা" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "সক্ৰিয়" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "পৰিচালিত নহয়" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "উপলব্ধ নহয়" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "বিচ্ছিন্ন" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "সংযোগ কৰা হৈছে (প্ৰস্তুতি)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "সংযোগ কৰা হৈছে (বিন্যাস কৰা হৈছে)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "সংযোগ কৰা হৈছে (অনুমোদন প্ৰয়োজন)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "সংযোগ কৰা হৈছে (IP বিন্যাস প্ৰাপ্ত কৰা হৈছে)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "সংযোগ স্থাপিত" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "সংযোগ বিফল" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "অজ্ঞাত" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(শূণ্য)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ঠিকনা 0x%X ৰূপান্তৰ কৰিবলৈ ত্ৰুটি" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "এনক্ৰিপ্ট কৰা:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "এন্টাৰপ্ৰাইজ" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "এড-হক" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "অৱগাঁথনি" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ভুল: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ভুল: 'dev list': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "যন্ত্ৰৰ বিৱৰণ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(অজ্ঞাত)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "অজ্ঞাত)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "চলি আছে" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "বন্ধ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ভুল: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ভুল: 'dev status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "যন্ত্ৰৰ অৱস্থা" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ত্ৰুটি: '%s' তৰ্ক অনুপস্থিত ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ত্ৰুটি: '%s' যন্ত্ৰ পোৱা নাযায় ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "সফলতা: '%s' যন্ত্ৰ সফলতাৰে সংযোগ বিচ্ছিন্ন কৰা হৈছে ।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ত্ৰুটি: '%s' (%s) যন্ত্ৰৰ সৈতে সংযোগ বিচ্ছিন্ন কৰিবলৈ ব্যৰ্থ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "যন্ত্ৰৰ অৱস্থা: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ত্ৰুটি: iface নিৰ্ধাৰণ কৰা আৱশ্যক ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ভুল: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ভুল: 'dev wifi': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ৱাই-ফাই স্কেনৰ তালিকা" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ত্ৰুটি: hwaddr '%s' সহ এক্সেচ পইন্ট পোৱা নাযায় ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ত্ৰুটি: '%s' যন্ত্ৰ ৱাই-ফাই যন্ত্ৰ নহয় ।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ত্ৰুটি: 'dev wifi' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ত্ৰুটি: 'dev' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "চলমান" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "ৱাইফাই যান্ত্ৰিক সামগ্ৰী" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "ৱাইফাই" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN যান্ত্ৰিক সামগ্ৰী" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "নিদ্ৰিত" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "সংযোগ কৰা হৈছে" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ভুল: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ভুল: 'nm status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager ৰ অৱস্থা" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "সক্ৰিয়" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "নিষ্ক্ৰিয়" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "চলি আছে" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "চলা নাই" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ভুল : '--fields' ৰ মান '%s' ইয়াত বৈধ নহয়; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "ৱাইফাই সক্ৰিয়" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ত্ৰুটিৰ: অবৈধ 'wifi' স্থিতিমাপ: '%s' ।" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN সক্ৰিয়" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ত্ৰুটি: অবৈধ 'wwan' স্থিতিমাপ: '%s' ।" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ত্ৰুটি: 'nm' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ব্যৱহাৰপদ্ধতি: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ভুল: '%s' অব্জেক্ট অজ্ঞাত, 'nmcli help' ব্যৱহাৰৰ প্ৰচেষ্টা কৰক ।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ভুল: '--terse' বিকল্পক দ্বিতীয় বাৰৰ বাবে নিৰ্ধাৰিত কৰা হৈছে ।" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ভুল: '--terse' বিকল্প '--pretty' ৰ সৈতে আছুতীয়া ।" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ভুল: '--pretty' বিকল্পক দ্বিতীয় বাৰৰ বাবে নিৰ্ধাৰিত কৰা হৈছে ।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ভুল: '--pretty' বিকল্প '--terse' ৰ সৈতে আছুতীয়া ।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ত্ৰুটি: '%s' বিকল্পৰ বাবে তৰ্ক নাই ।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ত্ৰুটি: '%s' বিকল্প '%s' ৰ কাৰণে বৈধ তৰ্ক নহয় ।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ত্ৰুটি: '%s' বিকল্পমূহৰ কাৰণে ক্ষেত্ৰ নাই ।" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli সৰঞ্জাম, সংস্কৰণ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ভুল: '%s' বিকল্প অজ্ঞাত, 'nmcli -help' ব্যৱহাৰৰ প্ৰয়োগ কৰক ।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d সংকেত প্ৰাপ্ত হৈছে, বন্ধ কৰা হৈছে..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ত্ৰুটি: NetworkManager ৰ সৈতে সংযোগ স্থাপন কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "সফল" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (১০৪/১২৮-বিট গুপ্তশব্দ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (অজ্ঞাত)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (অজ্ঞাত)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "যি কোনো, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "স্বয়ংক্ৰিয়" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "নিৰ্ধাৰত কৰা হোৱা নাই" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ক্ষেত্ৰ অকলে থাকিব লাগিব" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "অবৈধ ক্ষেত্ৰ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' বিকল্পক '--fields' নিৰ্ধাৰণ কৰাৰ প্ৰয়োজন" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' বিকল্পক নিৰ্দিষ্ট '--fields' বিকল্পৰ মানৰ প্ৰয়োজন, '%s' নহয়" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "PEM চাবি নথিপত্ৰৰ কোনো সমাপ্তিৰ টেগ উপস্থিত নাই '%s' ।" +msgstr "PEM চাবি নথিপত্ৰৰ কোনো সমাপ্তিৰ টেগ নাই '%s' ।" #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "এটা PEM গোপনীয় চাবি নথিপত্ৰ নহয় ।" +msgstr "এটা PEM গোপনীয় চাবি নথিপত্ৰ নহয় ।" #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." -msgstr "PEM নথিপত্ৰৰ তথ্যে সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "PEM নথিপত্ৰৰ তথ্যে সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" #: ../libnm-util/crypto.c:154 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "ভুল PEM নথিপত্ৰ: প্ৰথম টেগ ৰূপে Proc-Type ব্যৱহাৰ কৰা নহয় ।" +msgstr "ভুল PEM নথিপত্ৰ: প্ৰথম টেগ ৰূপে Proc-Type ব্যৱহাৰ কৰা নহয় ।" #: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "ভুল PEM নথিপত্ৰ: অজ্ঞাত Proc-Type টেগ '%s' ।" +msgstr "ভুল PEM নথিপত্ৰ: অজ্ঞাত Proc-Type টেগ '%s' ।" #: ../libnm-util/crypto.c:172 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "ভুল PEM নথিপত্ৰ: দ্বিতীয় টেগ ৰূপে DEK-Info ধাৰ্য কৰা নহয় ।" +msgstr "ভুল PEM নথিপত্ৰ: দ্বিতীয় টেগ ৰূপে DEK-Info ধাৰ্য কৰা নহয় ।" #: ../libnm-util/crypto.c:183 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত কোনো IV পোৱা নাযায় ।" +msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত কোনো IV পোৱা নাযায় ।" #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত IV-ৰ বিন্যাস বৈধ নহয় ।" +msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত IV ৰ বিন্যাস বৈধ নহয় ।" #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "ভুল PEM নথিপত্ৰ: ব্যক্তিগত-চাবিৰ অজ্ঞাত ছাইফাৰ '%s' ।" +msgstr "ভুল PEM নথিপত্ৰ: ব্যক্তিগত-চাবিৰ অজ্ঞাত ছাইফাৰ '%s' ।" #: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "ব্যক্তিগত চাবি ডিকোড কৰিবলৈ ব্যৰ্থ ।" +msgstr "ব্যক্তিগত চাবি ডিকোড কৰিবলৈ ব্যৰ্থ ।" #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "'%s' PEM প্ৰমাণপত্ৰত সমাপ্তিৰ টেগ '%s' উপস্থিত নাই ।" +msgstr "'%s' PEM প্ৰমাণপত্ৰত সমাপ্তিৰ টেগ '%s' নাই ।" #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "প্ৰমাণপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ ।" +msgstr "প্ৰমাণপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ ।" #: ../libnm-util/crypto.c:286 #, c-format msgid "Not enough memory to store certificate data." -msgstr "প্ৰমাণপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "প্ৰমাণপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" #: ../libnm-util/crypto.c:294 #, c-format msgid "Not enough memory to store file data." -msgstr "নথিপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "নথিপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "IV-ৰ দৈৰ্ঘ্যৰ পৰিমাণ যুগ্ম সংখ্যক বাইটৰ হোৱা আৱশ্যক ।" +msgstr "IV ৰ দৈৰ্ঘ্যৰ পৰিমাণ যুগ্ম সংখ্যক বাইটৰ হোৱা আৱশ্যক ।" #: ../libnm-util/crypto.c:333 #, c-format msgid "Not enough memory to store the IV." -msgstr "IV সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "IV সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" #: ../libnm-util/crypto.c:344 #, c-format msgid "IV contains non-hexadecimal digits." -msgstr "IV-ত hexadecimal-নোহোৱা অন্য সংখ্যা উপস্থিত ।" +msgstr "IV-ত hexadecimal-নোহোৱা অন্য সংখ্যা উপস্থিত ।" -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "ব্যক্তিগত চাবিৰ ছাইফাৰ '%s' অজ্ঞাত ।" +msgstr "ব্যক্তিগত চাবিৰ ছাইফাৰ '%s' অজ্ঞাত ।" #: ../libnm-util/crypto.c:391 #, c-format msgid "Not enough memory to decrypt private key." -msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰাৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰাৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." -msgstr "ব্যক্তিগত চাবিৰ ধৰন নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" +msgstr "ব্যক্তিগত চাবিৰ ধৰণ নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "ডিক্ৰিপ্ট কৰা ব্যক্তিগত চাবি সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "ডিক্ৰিপ্ট কৰা ব্যক্তিগত চাবি সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." -msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" +msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "MD5 কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" +msgstr "MD5 কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV ৰ অবৈধ দৈৰ্ঘ্য (অন্তত %zd হোৱা আৱশ্যক) ।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." -msgstr "ডিক্ৰিপ্ট কৰা কি-বাফাৰৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" +msgstr "ডিক্ৰিপ্ট কৰা চাবিৰ বাফাৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "ডিক্ৰিপছন ছাইফাৰৰ সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" +msgstr "ডিক্ৰিপছন ছাইফাৰৰ সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "ডিক্ৰিপছনৰ বাবে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" +msgstr "ডিক্ৰিপছনৰ বাবে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" - -#: ../libnm-util/crypto_gnutls.c:187 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %s / %s ।" +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" #: ../libnm-util/crypto_gnutls.c:200 #, c-format -msgid "Failed to decrypt the private key." -msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ ।" +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %s / %s ।" -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: পেডিংৰ দৈৰ্ঘ্য বৈধ নহয় ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "এনক্ৰিপ্ট কৰাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "এনক্ৰিপশন চাইফাৰৰ সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "এনক্ৰিপশনৰ বাবে চিমেট্ৰিক-কি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "তথ্য এনক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "প্ৰমাণপত্ৰৰ তথ্য আৰম্ভ কৰিবলৈ সমস্যা: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "প্ৰমাণপত্ৰ ডি-কোড কৰিবলৈ ব্যৰ্থ: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 ডিকোডাৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 নথিপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 নথিপত্ৰ প্ৰমাণিত কৰিবলৈ ব্যৰ্থ: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" +msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "MD5 সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" +msgstr "MD5 সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 #, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "ডিক্ৰিপছন ছাইফাৰ স্লট আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" +msgid "Invalid IV length (must be at least %d)." +msgstr "IV ৰ অবৈধ দৈৰ্ঘ্য (অন্তত %d হোৱা আৱশ্যক) ।" #: ../libnm-util/crypto_nss.c:196 #, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" +msgid "Failed to initialize the decryption cipher slot." +msgstr "ডিক্ৰিপছন ছাইফাৰ স্লট আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" #: ../libnm-util/crypto_nss.c:206 #, c-format -msgid "Failed to set IV for decryption." -msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" +msgid "Failed to set symmetric key for decryption." +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "ডিক্ৰিপছন সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" +msgstr "ডিক্ৰিপছন সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %d ।" +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %d ।" -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: ডিক্ৰিপ্ট কৰা তথ্য অত্যাধিক ডাঙৰ ।" + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "ব্যক্তিগত চাবিৰ ডিক্ৰিপছন সমাপ্ত কৰিবলৈ ব্যৰ্থ: %d ।" +msgstr "ব্যক্তিগত চাবিৰ ডিক্ৰিপছন সমাপ্ত কৰিবলৈ ব্যৰ্থ: %d ।" -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "এনক্ৰিপশন চাইফাৰ স্লট আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে চিমেট্ৰিক-কি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "এনক্ৰিপশন সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "এনক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "এনক্ৰিপ্ট কৰাৰ পিছত অপ্ৰত্যাশিত পৰিমাণ তথ্য উপলব্ধ হৈছে ।" + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "প্ৰমাণপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "গুপ্তশব্দক UCS2 লৈ ৰূপান্তৰ কৰিবলৈ ব্যৰ্থ: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ডিকোডাৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 নথিপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 নথিপত্ৰ প্ৰমাণিত কৰিবলৈ ব্যৰ্থ: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "বিশৃঙ্খল তথ্য নিৰ্মাণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "এনক্ৰিপশন-কি নিৰ্মাণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM নথিপত্ৰ নিৰ্মাণৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM নথিপত্ৰত IV লিখাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM নথিপত্ৰত এনক্ৰিপ্ট কৰা চাবি লিখাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰা নাযায় ।" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM নথিপত্ৰৰ তথ্যে সংৰক্ষণৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "netlink বাৰ্তা প্ৰক্ৰিয়াকৰণত ভুল: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "তথ্যৰ বাবে ছকেটত অপেক্ষা কৰোঁতে সমস্যা" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink handle credential passing সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink হেন্ডেল বিতৰণ কৰিবলৈ ব্যৰ্থ: %s" -#: ../src/nm-netlink-monitor.c:265 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink-ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ: %s" - -#: ../src/nm-netlink-monitor.c:273 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink দলত যোগ কৰিবলৈ ব্যৰ্থ: %s" - -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink লিংক কেশ্বে বিতৰণ কৰিবলৈ ব্যৰ্থ: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink দলে যোগ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "লিংক কোশ্বে উন্নত কৰিবলৈ সমস্যা: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "তথ্যৰ বাবে ছকেটত অপেক্ষা কৰোঁতে সমস্যা" - -#: ../src/NetworkManager.c:296 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "অবৈধ বিকল্প । বৈধ বিকল্পসমূহৰ তালিকা চোৱাৰ বাবে অনুগ্ৰহ কৰি --help প্ৰয়োগ কৰক ।\n" +msgstr "" +"অবৈধ বিকল্প । বৈধ বিকল্পসমূহৰ তালিকা চোৱাৰ বাবে অনুগ্ৰহ কৰি --help প্ৰয়োগ কৰক " +"।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s । বৈধ বিকল্পসমূহৰ তালিকা চোৱাৰ বাবে অনুগ্ৰহ কৰি --help প্ৰয়োগ কৰক ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager দ্বাৰা নিৰ্মিত\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -306,28 +1563,247 @@ msgstr "" "# %s ৰ পৰা একত্ৰিত কৰা হৈছে\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ব্যৱহাৰযোগ্য DHCP ক্লায়েন্ট পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "অসমৰ্থিত DHCP ক্লায়েন্ট '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "অজ্ঞাত লগ স্তৰ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "অজ্ঞাত লগ ডোমেইন '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "মন কৰিব: libc resolver ৰ দ্বাৰা ৩ তকৈ অধিক নামৰ সেৱক সমৰ্থিত ন'হ'বও পাৰে ।" +msgstr "মন কৰিব: libc resolver ৰ দ্বাৰা ৩ তকৈ অধিক নামৰ সেৱক সমৰ্থিত ন'হ'বও পাৰে ।" -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." -msgstr "নিম্নলিখিত নাম-সেৱকসমূহ চিনাক্ত ন'হ'বও পাৰে ।" +msgstr "নিম্নলিখিত নাম-সেৱকসমূহ চিনাক্ত ন'হ'বও পাৰে ।" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2142 -msgid "System" -msgstr "প্ৰণালী" - -#: ../system-settings/src/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "স্বয়ংক্ৰিয় %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "প্ৰণালী" + #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "নিৰাপদ ৱাই-ফাইলৈ নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন কৰক" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" msgstr "প্ৰণালীৰ সংযোগ পৰিবৰ্তন কৰক" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধিনিষেধৰ কাৰণে প্ৰণালীৰ বৈশিষ্ট্য পৰিবৰ্তন কৰা সম্ভৱ নহয়" +msgstr "" +"প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধিনিষেধৰ কাৰণে প্ৰণালীৰ বৈশিষ্ট্য পৰিবৰ্তন কৰা সম্ভৱ " +"নহয়" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধি নিষেধৰ কাৰণে প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন " +"কৰা সম্ভৱ নহয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"প্ৰণালীৰ নিয়মনীতিয়ে নিৰাপদ ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ " +"কৰিছে" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"প্ৰণালীৰ নিয়মনীতিয়ে উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ " +"কৰিছে" + +#~ msgid "Type" +#~ msgstr "ধৰণ" + +#~ msgid "Name" +#~ msgstr "নাম" + +#~ msgid "User connections:\n" +#~ msgstr "ব্যৱহাৰকৰ্তাৰ সংযোগ:\n" + +#~ msgid "System-wide connections" +#~ msgstr "প্ৰণালী ব্যাপী সংযোগ" + +#~ msgid "Default" +#~ msgstr "অবিকল্পিত" + +#~ msgid "Service" +#~ msgstr "সেৱা" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ফ্ৰিকোৱেন্সি %d MHz, হাৰ %d Mb/s, ক্ষমতা %d" + +#~ msgid "Device" +#~ msgstr "যন্ত্ৰ" + +#~ msgid "Driver" +#~ msgstr "চালক" + +#~ msgid "State" +#~ msgstr "অৱস্থা" + +#~ msgid "HW Address" +#~ msgstr "HW ঠিকনা" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " কৰ্মক্ষমতা:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "পৰিবহণকৰ্তা চিনাক্তকৰণ" + +#~ msgid "Speed" +#~ msgstr "গতি" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " বেতাঁৰ সংযোগৰ বৈশিষ্ট্য\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP এনক্ৰিপশন" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA এনক্ৰিপশন" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 এনক্ৰিপশন" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP চাইফাৰ" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP চাইফাৰ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " বেতাঁৰ এক্সেচ পইন্ট %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = বৰ্তমান AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " তাঁৰযুক্ত সংযোগৰ বৈশিষ্ট্য\n" + +#~ msgid "Carrier" +#~ msgstr "পৰিবহণকৰ্তা" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 ৰ বৈশিষ্ট্য:\n" + +#~ msgid "Address" +#~ msgstr "ঠিকনা" + +#~ msgid "Prefix" +#~ msgstr "উপসৰ্গ" + +#~ msgid "Gateway" +#~ msgstr "গে'টৱে" + +#~ msgid "Device:" +#~ msgstr "যন্ত্ৰ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ত্ৰুটি: hwaddr উল্লেখ কৰা আৱশ্যক ।" + +#~ msgid "AP parameters" +#~ msgstr "AP ৰ স্থিতিমাপ" + +#~ msgid "Frequency:" +#~ msgstr "ফ্ৰিকোৱেন্সি:" + +#~ msgid "Mode:" +#~ msgstr "মোড:" + +#~ msgid "Ad-hoc" +#~ msgstr "এড-হক" + +#~ msgid "Maximal bitrate:" +#~ msgstr "সৰ্বাধিক বিট ৰেট:" + +#~ msgid "Strength:" +#~ msgstr "ক্ষমতা:" + +#~ msgid "Flags:" +#~ msgstr "ফ্লেগ:" + +#~ msgid "privacy" +#~ msgstr "গোপনীয়" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ফ্লেগ:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ফ্লেগ:" + +#~ msgid "NM running:" +#~ msgstr "NM চলি আছে:" + +#~ msgid "NM state:" +#~ msgstr "NM ৰ অৱস্থা:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM বেতাঁৰ যান্ত্ৰিক সামগ্ৰী:" + +#~ msgid "NM wireless:" +#~ msgstr "NM বেতাঁৰ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN যান্ত্ৰিক সামগ্ৰী:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink দলত যোগ কৰিবলৈ ব্যৰ্থ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlink ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ: %s" From 88543c34a4c390c6b485a63533fba9e3a1696505 Mon Sep 17 00:00:00 2001 From: Timo Trinks Date: Thu, 13 May 2010 12:32:29 -0700 Subject: [PATCH 375/392] po: update German translation (rh #589230) --- po/de.po | 1415 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 855 insertions(+), 560 deletions(-) diff --git a/po/de.po b/po/de.po index ea2fe025cb..ad8f810f56 100644 --- a/po/de.po +++ b/po/de.po @@ -1,6 +1,4 @@ -# German translation of NetworkManager. -# Copyright (C) 2005 Dan Williams -# This file is distributed under the same license as the NetworkManager package. +# translation of de.po to # Hendrik Brandt , 2004, 2005. # Frank Arnold , 2005. # Hendrik Richter , 2006. @@ -8,20 +6,94 @@ # Andre Klapper , 2007. # Hauke Mehrtens , 2008. # Christian Kirbach , 2009, 2010. +# Timo Trinks , 2010. +# German translation of NetworkManager. +# Copyright (C) 2005 Dan Williams +# This file is distributed under the same license as the NetworkManager package. msgid "" msgstr "" -"Project-Id-Version: NetworkManager HEAD\n" +"Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-12 08:15+0100\n" -"PO-Revision-Date: 2010-03-12 08:17+0100\n" -"Last-Translator: Christian Kirbach \n" -"Language-Team: Deutsch \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:49+1000\n" +"Last-Translator: Timo Trinks \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "GERÄTE" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "BANDBREITE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "VORGABE" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-DIENST" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJEKT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "ZEITSTEMPEL" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "ZEITSTEMPEL-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "NURLESEN" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -42,312 +114,516 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Verbindungen" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "Typ" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "Name" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "System-Verbindungen:\n" +msgid "Error: 'con list': %s" +msgstr "Fehler: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "Benutzer-Verbindungen:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Fehler: 'con list': %s; erlaubte Felder: %s" -#: ../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:207 +msgid "Connection details" +msgstr "Verbindungsdetails" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "System" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "Benutzer" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "nie" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "nein" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "System-Verbindungen" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Benutzer-Verbindungen" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "Fehler: %s Argument fehlt." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "Fehler: %s - keine solche Verbindung." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Systemweite Verbindungen" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Benutzer-Verbindungen" - -#: ../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:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "Unbekannter Parameter: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "Fehler: Kein gültiger Parameter angegeben." -#. 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:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Fehler: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "nein" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Fehler: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Fehler: 'con status': %s; erlaubte Felder: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" -msgstr "Aktive Verbindungen " +msgstr "Aktive Verbindungen" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "Vorgabe" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "Dienst" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Gerät" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" -msgstr "keine aktive Verbindung auf Gerät »%s«" +msgstr "keine aktive Verbindung auf Gerät '%s'" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "keine aktive Verbindung auf Gerät" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "Gerät '%s' nicht mit Verbindung '%s' kompatibel" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "kein Gerät für Verbindung '%s' gefunden" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "wird aktiviert" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "aktiviert" -#: ../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:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "unbekannt" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN wird verbunden (vorbereiten)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" -msgstr "VPN wird verbunden (Legitimierung erforderlich)" +msgstr "VPN wird verbunden (Authentifizierung erforderlich)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN wird verbunden" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN wird verbunden (IP-Konfiguration wird ermittelt)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN verbunden" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN-Verbindung fehlgeschlagen" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN getrennt" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "unbekannter Grund" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "kein" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "der Benutzer wurde getrennt" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "die Basisverbindung wurde unterbrochen" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "der VPN-Dienst brach unerwartet ab" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "der VPN-Dienst gab eine ungültige Konfiguration zurück" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "Der Verbindungsversuch ist zeitlich abgelaufen" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "der VPN-Dienst ist nicht rechtzeitig gestartet" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "der VPN-Dienst konnte nicht starten" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "keine gültigen VPN-Geheimnisse" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "ungültige VPN-Geheimnisse" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "Die Verbindung wurde entfernt" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" -msgstr "Zustand: %s\n" +msgstr "Status: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "Verbindung aktiviert\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" -msgstr "Zustand: %s (%d)\n" +msgstr "Status: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Fehler: Zeitbeschränkung von %d Sekunden abgelaufen." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "Fehler: Erlangen der Verbindung für »%s« ist fehlgeschlagen." +msgstr "Fehler: Erlangen der Verbindung für '%s' ist fehlgeschlagen." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" -msgstr "Zustand der aktiven Verbindung: %s\n" +msgstr "Status der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "Pfad der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "Fehler: Unbekannte Verbindung: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "Fehler: Der Wert »%s« für den Zeitablauf ist nicht gültig." +msgstr "Fehler: Der Wert '%s' für den Zeitablauf ist nicht gültig." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Fehler: id oder uuid muss angegeben werden." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "Fehler: Kein passendes Gerät gefunden: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "Fehler: Kein passendes Gerät gefunden." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "Warnung: Verbindung ist derzeit nicht aktiv\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "Fehler: Der Befehl »%s« für »con« ist nicht gültig." +msgstr "Fehler: Der Befehl '%s' für 'con' ist nicht gültig." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Fehler: Es konnte nicht mit D-Bus verbunden werden." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden" -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" "Fehler: Verbindungen können nicht erlangt werden: Die Einstellungsdienste " "werden nicht ausgeführt." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "GERÄT" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATUS" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "ALLGEMEIN" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "FÄHIGKEITEN" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-EIGENSCHAFTEN" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "KABEL-EIGENSCHAFTEN" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-EINSTELLUNGEN" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "TREIBER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "ANBIETER-SUCHE" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "GESCHWINDIGKEIT" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "ANBIETER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESSE" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRÄFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODUS" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SICHERHEIT" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "AKTIV" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -357,7 +633,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Aufruf: nmcli dev { BEFEHL | help }\n" @@ -367,351 +643,237 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "nicht verwaltet" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "nicht verfügbar" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "getrennt" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "wird verbunden (vorbereiten)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "wird verbunden (konfigurieren)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" -msgstr "wird verbunden (Legitimierung erforderlich)" +msgstr "wird verbunden (Authentifizierung erforderlich)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "wird verbunden (IP-Konfiguration wird ermittelt)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "verbunden" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "Verbindung fehlgeschlagen" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "Unbekannt" -#. 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:277 msgid "(none)" msgstr "(keine)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X" -#: ../cli/src/devices.c:238 -#, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", Verschlüsselt:" - -#: ../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" - -# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr "Enterprise" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "Gerät" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Treiber" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(unbekannt)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "Zustand" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Hardware-Adresse" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -"Fähigkeiten:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Trägersignal erkannt" - -#: ../cli/src/devices.c:336 -#, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Geschwindigkeit" - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Eigenschaften der drahtlosen Verbindung\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP-Verschlüsselung" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA-Verschlüsselung" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2-Verschlüsselung" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP-Chiffre" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP-Chiffre" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Zugangspunkte für Drahtlosnetzwerk %s\n" - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = aktueller Zugangspunkt)" - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Eigenschaften der kabelgebundenen Verbindung\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Trägersignal" - -#: ../cli/src/devices.c:377 -msgid "on" -msgstr "an" - -#: ../cli/src/devices.c:379 -msgid "off" -msgstr "aus" - -#: ../cli/src/devices.c:387 -#, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4-Einstellungen:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adresse" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Präfix" - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Gateway" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" - -#: ../cli/src/devices.c:458 -msgid "Status of devices" -msgstr "Status von Geräten" - -#: ../cli/src/devices.c:487 -#, c-format -msgid "Error: '%s' argument is missing." -msgstr "Fehler: Argument »%s« fehlt." - -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 -#, c-format -msgid "Error: Device '%s' not found." -msgstr "Fehler: Gerät »%s« wurde nicht gefunden" - -#: ../cli/src/devices.c:539 -#, c-format -msgid "Success: Device '%s' successfully disconnected." -msgstr "Erfolg: Gerät »%s« wurde erfolgreich getrennt." - -#: ../cli/src/devices.c:564 -#, c-format -msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "Fehler: Trennung des Gerätes »%s« (%s) ist fehlgeschlagen: %s" - -#: ../cli/src/devices.c:572 -#, c-format -msgid "Device state: %d (%s)\n" -msgstr "Gerätezustand: %d (%s)\n" - -#: ../cli/src/devices.c:636 -#, c-format -msgid "Error: iface has to be specified." -msgstr "Fehler: Schnittstelle muss angegeben werden." - -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "Suchliste für WiFi" - -#: ../cli/src/devices.c:740 -#, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Fehler: Gerät »%s« ist kein WiFi-Gerät." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Gerät:" - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Fehler: Hardware-Adresse muss angegeben werden." - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "" -"Fehler: Der Zugangspunkt mit Hardware-Adresse »%s« wurde nicht gefunden." - -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:349 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:350 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Parameter des Zugangspunktes" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Verschlüsselt: " -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Frequenz:" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Modus:" +# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:380 msgid "Infrastructure" msgstr "Infrastuktur" -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Maximale Bitrate:" +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Fehler: 'dev list': %s" -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Stärke:" +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Fehler: 'dev list': %s; erlaubte Felder: %s" -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Flags:" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Gerätedetails" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "Datenschutzmodus" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(unbekannt)" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA-Flags:" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "unbekannt)" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN-Flags:" +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:907 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "an" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "aus" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Fehler: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Fehler: 'dev status': %s; erlaubte Felder: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Status von Geräten" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Fehler: Argument '%s' fehlt." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Fehler: Gerät '%s' wurde nicht gefunden" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Erfolg: Gerät '%s' wurde erfolgreich getrennt." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Fehler: Trennung des Gerätes '%s' (%s) ist fehlgeschlagen: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Gerätezustand: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Fehler: Schnittstelle muss angegeben werden." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Fehler: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Fehler: 'dev wifi': %s; erlaubte Felder: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Suchliste für WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Fehler: Der Zugangspunkt mit Hardware-Adresse '%s' wurde nicht gefunden." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fehler: Gerät '%s' ist kein WiFi-Gerät." + +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist nicht gültig." +msgstr "Fehler: Der Befehl '%s' für 'dev wifi' ist nicht gültig." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." -msgstr "Fehler: Der Befehl »%s« für »dev« ist nicht gültig." +msgstr "Fehler: Der Befehl '%s' für 'dev' ist nicht gültig." -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "WIRD AUSGEFÜHRT" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -736,89 +898,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "schlafend" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "wird verbunden" -#: ../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 "aktiviert" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Fehler: '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 "deaktiviert" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Fehler: 'nm status': %s; erlaubte Felder: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "Status von NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM läuft:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "aktiviert" -#: ../cli/src/network-manager.c: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 "deaktiviert" + +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "wird ausgeführt" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "wird nicht ausgeführt" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "Status von NM:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Fehler: '--fields' Wert '%s' hier nicht gültig; erlaubte Felder: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM Drahtlos-Hardware:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi aktiviert" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM drahtlos:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN-Hardware:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" - -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Fehler: Ungültiger »wifi«-Parameter: »%s«." +msgstr "Fehler: Ungültiger 'wifi'-Parameter: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN aktiviert" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Fehler: Ungültiger »wwan«-Parameter: »%s«." +msgstr "Fehler: Ungültiger '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 "Fehler: Der Befehl »%s« für »nm« ist nicht gültig." +msgstr "Fehler: Der Befehl '%s' für 'nm' ist nicht gültig." -#: ../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] |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" @@ -829,8 +993,11 @@ msgstr "" "Aufruf: %s [OPTIONEN] OBJEKT { BEFEHL | help }\n" "\n" "OPTIONEN\n" -" -t[erse] knappe Ausgabe\n" -" -p[retty] hübsche Ausgabe\n" +" -t[erse] knappe Ausgabe\n" +" -p[retty] hübsche Ausgabe\n" +" -m[ode] tabular|multiline Ausgabemodus\n" +" -f[ields] |all|common Ausgabefelder angeben\n" +" -e[scape] yes|no Spaltentrenner in den Werten mit Maskierungszeichen versehen\n" " -v[ersion] Programm-Version anzeigen\n" " -h[elp] dies Hilfe ausgeben\n" "\n" @@ -840,39 +1007,169 @@ msgstr "" " dev von NetworkManager verwaltete Verbindungen\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Fehler: Objekt '%s' ist unbekannt, versuchen Sie 'nmcli help'." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Fehler: Option '--terse' wird als zweite Option angegeben." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Fehler: Option '--terse' und '--pretty' schließen sich gegenseitig aus." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Fehler: Option '--pretty' wird als zweite Option angegeben." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Fehler: Option '--pretty' und '--terse' schließen sich gegenseitig aus." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Fehler: Fehlendes Argument für die Option '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Fehler: '%s' kein gültiges Argument für die Option '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Fehler: Felder für die Optionen '%s' fehlen." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli, Version %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Option »%s« ist unbekannt, versuchen Sie »nmcli -help«." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Fehler: Option '%s' ist unbekannt, versuchen Sie 'nmcli -help'." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Signal %d wurde empfangen, wird beendet …" -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "Fehler: Verbindung konnte nicht mit NetworkManager hergestellt werden." +msgstr "Fehler: Verbindung mit NetworkManager konnte nicht hergestellt werden." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Erfolg" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-Bit Passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (unbekannt)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (unbekannt)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "beliebig, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nicht gesetzt" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "Feld '%s' muss isoliert sein" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ungültiges Feld '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' erfordert die Angabe von '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' erfordert spezielle '--fields' Optionswerte , nicht '%s'" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag »%s«." +msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag '%s'." #: ../libnm-util/crypto.c:130 #, c-format @@ -882,8 +1179,7 @@ msgstr "Dies scheint kein privater PEM-Schlüssel zu sein." #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." -msgstr "" -"Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung." +msgstr "Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung." #: ../libnm-util/crypto.c:154 #, c-format @@ -893,7 +1189,7 @@ msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht der erste Tag." #: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag »%s«." +msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag '%s'." #: ../libnm-util/crypto.c:172 #, c-format @@ -914,7 +1210,7 @@ msgstr "Fehlerhafte PEM-Datei: falsches Format des IV in DEK-Info Tag." #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "" -"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung »%s« des privaten " +"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung '%s' des privaten " "Schlüssels." #: ../libnm-util/crypto.c:222 @@ -925,7 +1221,7 @@ msgstr "Der private Schlüssel konnte nicht dekodiert werden." #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "PEM-Zertifikat »%s« hat kein abschließendes Tag »%s«." +msgstr "PEM-Zertifikat '%s' hat kein abschließendes Tag '%s'." #: ../libnm-util/crypto.c:277 #, c-format @@ -962,7 +1258,7 @@ msgstr "IV enthält nicht hexadezimale Zeichen." #: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "Unbekannte Verschlüsselung »%s« des privaten Schlüssels." +msgstr "Unbekannte Verschlüsselung '%s' des privaten Schlüssels." #: ../libnm-util/crypto.c:391 #, c-format @@ -977,8 +1273,7 @@ msgstr "Die Art des privaten Schlüssels kann nicht bestimmt werden." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "" -"Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels." +msgstr "Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels." #: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." @@ -1024,8 +1319,7 @@ msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "" -"Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge." +msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge." #: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format @@ -1107,8 +1401,7 @@ msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." #: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." -msgstr "" -"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung." +msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung." #: ../libnm-util/crypto_nss.c:216 #, c-format @@ -1135,8 +1428,7 @@ msgstr "" #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "" -"Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d." +msgstr "Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d." #: ../libnm-util/crypto_nss.c:364 #, c-format @@ -1146,8 +1438,7 @@ msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." #: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." -msgstr "" -"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung." +msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung." #: ../libnm-util/crypto_nss.c:380 #, c-format @@ -1198,93 +1489,99 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" msgid "Could not generate random data." msgstr "Zufällige Daten konnten nicht erstellt werden." -#: ../libnm-util/nm-utils.c:1545 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels." -#: ../libnm-util/nm-utils.c:1655 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." -msgstr "" -"Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." +msgstr "Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." -#: ../libnm-util/nm-utils.c:1667 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "" "Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " "werden." -#: ../libnm-util/nm-utils.c:1679 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " "werden." -#: ../libnm-util/nm-utils.c:1698 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." -msgstr "" -"Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." +msgstr "Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." -#: ../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 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "Fehler beim Verarbeiten der netlink-Nachricht: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "" -"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung " -"angefordert werden: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "Es kann nicht mit netlink zur Überwachung der Netzwerkverbindung verbunden " "werden: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"Es kann nicht mit einer netlink-Gruppe zur Überwachung der " -"Netzwerkverbindung verbunden werden: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "Kann Weitergabe von Berechtigungen des netlink-Handle nicht aktivieren: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung " +"angefordert werden: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "Es kann kein netlink-Cache zur Überwachung der Netzwerkverbindung belegt " "werden: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %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 "Fehler beim Aktualisieren des Verbindungs-Cache: %s" -#: ../src/main.c:494 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" -"Ungültige Option. Verwenden Sie bitte »--help«, um eine Liste der gültigen " +"Ungültige Option. Verwenden Sie bitte '--help', um eine Liste der gültigen " "Optionen zu erhalten.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "" +"%s Verwenden Sie bitte '--help', um eine Liste der gültigen Optionen zu " +"erhalten.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Erstellt von NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -1293,28 +1590,40 @@ msgstr "" "# Zusammengefügt aus %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "Es Kann kein netlink-Handle angefordert werden: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "Kein brauchbarer DHCP-Client gefunden." -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "Es kann nicht mit netlink verbunden werden: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' wurde gefunden." -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' wurde gefunden." -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Nicht unterstützter DHCP-Client '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Unbekanntes Log-Level '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Unbekannte Log-Domain '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "HINWEIS: Der libc-Auflöser unterstützt eventuell nicht mehr als 3 Server zur " "Namensauflösung." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "" "Die nachfolgend aufgelisteten Server zur Namensauflösung werden eventuell " @@ -1325,7 +1634,7 @@ msgstr "" msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "System" @@ -1347,8 +1656,7 @@ msgstr "System-Verbindungen bearbeiten" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "" -"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" +msgstr "Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" @@ -1368,16 +1676,3 @@ msgstr "" "Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-" "Netzwerk" -#~ msgid "operation took too long" -#~ msgstr "Vorgang dauerte zu lange" - -#~ msgid "received data from wrong type of sender" -#~ msgstr "Daten von einem falschen Absendertyp erhalten" - -#~ msgid "received data from unexpected sender" -#~ msgstr "Daten von einem unerwarteten Absender erhalten" - -#~ msgid "too much data was sent over socket and some of it was lost" -#~ msgstr "" -#~ "Es wurden zu viele Daten über den Socket gesendet und einige davon sind " -#~ "verloren gegangen" From d10ee90576ad89adba4decade54efb16222b505f Mon Sep 17 00:00:00 2001 From: Sweta Kothari Date: Thu, 13 May 2010 12:33:07 -0700 Subject: [PATCH 376/392] po: update Gujarati translation (rh #589230) --- po/gu.po | 1425 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1365 insertions(+), 60 deletions(-) diff --git a/po/gu.po b/po/gu.po index bc2cd27dc3..83fba507ed 100644 --- a/po/gu.po +++ b/po/gu.po @@ -1,15 +1,15 @@ -# translation of NetworkManager.master.gu.po to Gujarati +# translation of gu.po to Gujarati # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # # Ankit Patel , 2004. -# Sweta Kothari , 2009. +# Sweta Kothari , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master.gu\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-05-19 03:24+0000\n" -"PO-Revision-Date: 2009-06-08 11:07+0530\n" +"Project-Id-Version: gu\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 14:38+0530\n" "Last-Translator: Sweta Kothari \n" "Language-Team: Gujarati\n" "MIME-Version: 1.0\n" @@ -19,6 +19,1146 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n!=1);\n" "\n" +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"વપરાશ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ભૂલ: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ભૂલ: 'con list': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "જોડાણો વિગતો" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "સિસ્ટમ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "વપરાશકર્તા" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "કદી નહિં" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "હાં" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ના" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "સિસ્ટમ જોડાણો" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "વપરાશકર્તા જોડાણો" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ભૂલ: %s દલીલ ગેરહાજર છે." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Error: %s - આવા જોડાણ નથી." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "અજ્ઞાત પરિમાણ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ભૂલ: યોગ્ય પરિમાણ સ્પષ્ટ થયેલ નથી." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ભૂલ: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ભૂલ: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ભૂલ: 'con status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "સક્રિય જોડાણો" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ઉપકરણ '%s' પર સક્રિય જોડાણ નથી" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "સક્રિય જોડાણ અથવા ઉપકરણ નથી" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "ઉપકરણ '%s' એ જોડાણ '%s' સાથે સુસંગત નથી" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "જોડાણ '%s' માટે ઉપકરણ મળ્યુ નથી" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "સક્રિય કરી રહ્યા છે" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "સક્રિય થયેલ છે" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "અજ્ઞાત" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN જોડાઇ રહ્યુ છે (તૈયાર કરો)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN જોડાઇ રહ્યુ છે (સત્તાધિકરણની જરૂર છે)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN જોડાઇ રહ્યુ છે" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN જોડાઇ રહ્યુ છે (IP રૂપરેખાંકનને મેળવી રહ્યા છે)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN જોડાયેલ છે" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN જોડાણ નિષ્ફળ" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN જોડાણ તૂટી ગયુ" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "અજ્ઞાત કારણ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "કંઇ નહિં" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "વપરાશકર્તાનું જોડાણ તૂટી ગયુ હતુ" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "આધાર નેટવર્ક જોડાણ અવરોધેલ હતુ" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN સેવા અનિચ્છનિય રીતે બંધ થયેલ છે" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN સેવા એ અયોગ્ય રૂપરેખાંકનને પાછુ મેળવેલ છે" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "જોડાણનો પ્રયત્ન કરવાનો સમય સમાપ્ત થઇ ગયો" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN સેવા એ સમય પર શરૂ થઇ ન હતી" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "શરૂ કરતી વખતે VPN સેવા નિષ્ફળ" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "યોગ્ય VPN ખાનગીઓ નથી" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "અયોગ્ય VPN ખાનગીપણા" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "જોડાણને દૂર કરાયેલ હતુ" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "પરિસ્થિતિ: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "સક્રિય થયેલ જોડાણ\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "પરિસ્થિતિ: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ભૂલ: સમયસમાપ્તિ %d સેકંડ નો સમય સમાપ્ત થઇ ગયો." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ભૂલ: '%s' માટે સક્રિય જોડાણ પ્રાપ્ત કરવામાં નિષ્ફળતા." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "સક્રિય જોડાણ પરિસ્થિતિ: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "સક્રિય જોડાણ પાથ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ભૂલ: અજ્ઞાત જોડાણ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ભૂલ: સમયસમાપ્તિ કિંમત '%s' યોગ્ય નથી." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ભૂલ: id અથવા uuid ને સ્પષ્ટ કરવુ જ પડશે." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ભૂલ: સુસંગત ઉપકરણ મળ્યુ નથી: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ભૂલ: સુસંગત ઉપકરણ મળ્યુ નથી." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ચેતવણી: જોડાણ સક્રિય થયેલ નથી\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ભૂલ: 'con' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ભૂલ: D-Bus નું જોડાણ કરી શક્યા નહિં." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ભૂલ: સિસ્ટમ સુયોજનોને મેળવી શક્યા નથી." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ભૂલ: વપરાશકર્તા સુયોજનોને મેળવી શક્યા નથી." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ભૂલ: જોડાણોને પ્રાપ્ત કરી શકાતા નથી: સુયોજનો સેવાઓ ચાલી રહી નથી." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"વપરાશ: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "અસંચાલિત થયેલ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ઉપલબ્ધ નથી" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "તૂટેલ જોડાણ" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "જોડાઇ રહ્યા છે (તૈયાર કરો)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "જોડાઇ રહ્યા છે (રૂપરેખાંકિત કરી રહ્યા છે)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "જોડાઇ રહ્યા છે (સત્તાધિકરણની જરૂર છે)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "જોડાઇ રહ્યા છે (IP રૂપરેખાંકનને મેળવી રહ્યા છે)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "જોડાયેલ" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "જોડાણ નિષ્ફળ" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "અજ્ઞાત" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(કંઇ નહિં)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: ભૂલ એ IP4 સરનામા 0x%X માં રૂપાંતર થઇ રહી છે" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "એનક્રિપ્ટ થયેલ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ઇન્ફ્રાસ્ટ્રક્ચર" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ભૂલ: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev list': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ઉપકરણ વિગતો" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(અજ્ઞાત)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "અજ્ઞાત)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ચાલુ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "બંધ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ભૂલ: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ઉપકરણોની પરિસ્થિતિ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ભૂલ: '%s' દલીલ ગેરહાજર છે." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ભૂલ: ઉપકરણ '%s' મળ્યુ નથી." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "સફળ: ઉપકરણ '%s' નું સફળતાપૂર્વક જોડાણ તૂટી ગયુ." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ભૂલ: ઉપકરણ '%s' (%s) નું જોડાણ તૂટવામાં નિષ્ફળતા: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ઉપકરણ પરિસ્થિતિ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ભૂલ: iface ને સ્પષ્ટ કરવુ જ પડશે." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ભૂલ: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev wifi': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi સ્કેન યાદી" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ભૂલ: hwaddr '%s' સાથે પ્રવેશ બિંદુ મળ્યુ નથી." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ભૂલ: ઉપકરણ '%s' એ WiFi ઉપકરણ નથી." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ભૂલ: 'dev wifi' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ભૂલ: 'dev' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"વપરાશ: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "સૂતેલું" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "જોડાઇ રહ્યા છે" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ભૂલ: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ભૂલ: 'nm status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager પરિસ્થિતિ" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "નિષ્ક્રિય થયેલ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ચાલી રહ્યુ છે" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ચાલી રહ્યુ નથી" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ભૂલ: '--fields' કિંમત '%s' એ અહિંયા યોગ્ય નથી; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ભૂલ: અયોગ્ય 'wifi' પરિમાણ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ભૂલ: અયોગ્ય 'wwan' પરિમાણ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ભૂલ: 'nm' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"વપરાશ: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ભૂલ: ઑબ્જેક્ટ '%s' અજ્ઞાત છે, 'nmcli help' નો પ્રયત્ન કરો." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ભૂલ: વિકલ્પ '--terse' એ બીજી વખત સ્પષ્ટ થયેલ છે." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ભૂલ: વિકલ્પ '--terse' એ '--pretty' સાથે પરસ્પર અનોખું છે." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ભૂલ: વિકલ્પ '--pretty' એ બીજી વખત સ્પષ્ટ થયેલ છે." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ભૂલ: વિકલ્પ '--pretty' એ '--terse' સાથે પરસ્પર અનોખું છે." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ભૂલ: '%s' વિકલ્પ માટે ગેરહાજર દલીલ." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ભૂલ: '%s' એ '%s' વિકલ્પ માટે યોગ્ય દલીલ નથી." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ભૂલ: '%s' વિકલ્પો માટે ક્ષેત્રો ગેરહાજર છે." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli સાધન, આવૃત્તિ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ભૂલ: વિકલ્પ '%s' એ અજ્ઞાત છે, 'nmcli -help' નો પ્રયત્ન કરો." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "સંકેત %d પકડ્યુ, બંધ કરી રહ્યા છે..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ભૂલ: NetworkManager નું જોડાણ કરી શક્યા નહિં." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "સફળ" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit પાસફ્રેઝ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (અજ્ઞાત)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (અજ્ઞાત)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "કોઇપણ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "સ્વયં" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "સુયોજિત નથી" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ક્ષેત્ર '%s' એ એકલુ હોવુ જ જોઇએ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "અયોગ્ય ક્ષેત્ર '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "વિકલ્પ '--terse' ને '--fields' ની જરૂર છે" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "વિકલ્પ '--terse' ને ચોક્કસ '--fields' વિકલ્પ કિંમતોની જરૂર છે, '%s' ની નહિં" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -104,8 +1244,9 @@ msgstr "IV ને સંગ્રહ કરવા માટે પૂરતી msgid "IV contains non-hexadecimal digits." msgstr "IV એ બિન-હેક્ઝાડેસિમલ આંકડાઓને સમાવે છે." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ખાનગી કી સાઇફર '%s' એ અજ્ઞાત હતુ." @@ -125,72 +1266,106 @@ msgstr "ખાનગી કી પ્રકાર ને નક્કી કર msgid "Not enough memory to store decrypted private key." msgstr "ડિક્રિપ્ટ થયેલ ખાનગી કીને સંગ્રહ કરવા માટે મેમરી પૂરતી નથી." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "ક્રિપ્ટો એંજિન ને પ્રારંભ કરવાનું નિષ્ફળ." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "MD5 એંજિનને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "અયોગ્ય IV લંબાઇ (ઓછામાં ઓછી %zd હોવી જ જોઇએ)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "ડિક્રિપ્ટ થયેલ કી બફર માટે પૂરતી મેમરી નથી." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "ડિક્રિપ્શન સાઇફર સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "ડિક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "ડિક્રિપ્શન માટે IV ને સુયોજિત કરવાનું નિષ્ફળ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ખાનગી કી ને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: અનિચ્છનિય પેડિંગ લંબાઇ." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "એનક્રિપ્ટ કર્યા પછી મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "એનક્રિપ્શન સાઇફર સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "એનક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "એનક્રિપ્શન માટે IV ને સુયોજિત કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "માહિતીને એનક્રિપ્ટ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "પ્રમાણપત્ર માહિતીને પ્રારંભ કરતી વખતે ભૂલ: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "પ્રમાણપત્રને ડિકોડ કરી શકાયુ નહિં: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "PKCS#12 ડિકોડરને પ્રારંભ કરી શકાયુ નહિં: %s " -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "PKCS#12 ફાઇલને ડિકોડ કરી શકાયુ નહિં: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ફાઇલને ચકાસી શકાયુ નહિં: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "ક્રિપ્ટો એંજિનને પ્રારંભ કરવાનું નિષ્ફળ: %d." @@ -200,105 +1375,184 @@ msgstr "ક્રિપ્ટો એંજિનને પ્રારંભ ક msgid "Failed to initialize the MD5 context: %d." msgstr "MD5 સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "અયોગ્ય IV લંબાઇ (ઓછામાં ઓછી %d હોવી જ જોઇએ)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "ડિક્રિપ્શન સાઇફર સ્લોટને પ્રારંભ કરવાનું નિષ્ફળ." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "ડિક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "ડિક્રિપ્શન માટે IV ને સુયોજિત કરવામાં નિષ્ફળ." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "ડિક્રિપ્શન સંદર્ભને આખરી રૂપ આપવામાં નિષ્ફળ." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "ખાનગી કી ને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: ડિક્રિપ્ટ થયેલ માહિતી ઘણી લાંબી છે." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "ખાનગી કીનાં ડિક્રિપ્શનનને આખરી રૂપ આપવાનું નિષ્ફળ: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "એનક્રિપ્શન સાઇફર સ્લોટને પ્રારંભ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "એનક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "એનક્રિપ્શન માટે IV ને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "એનક્રિપ્શન સંદર્ભને પ્રારંભ કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "એનક્રિપ્ટ કરવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "એનક્રિપ્ટ કર્યા પછી માહિતીની અનિચ્છનિય સંખ્યા." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "પ્રમાણપત્રને ડિકોડ કરી શકાયુ નહિં: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "UCS2 માં પાસવર્ડને રૂપાંતરિત કરી શકાયુ નહિં: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ડિકોડરને પ્રારંભ કરી શકાયુ નહિં: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ફાઇલને ડિકોડ કરી શકાયુ નહિં: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ફાઇલને ચકાસી શકાયુ નહિં: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "રેન્ડમ માહિતી ને ઉત્પન્ન કરી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "એનક્રિપ્શન કીને બનાવવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ફાઇલ બનાવવા માટે મેમરી ફાળવી શક્યા નહિંી પૂરતી નથી." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ફાઇલમાં IV ને લખવા માટે મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ફાઇલમાં અનક્રિપ્ટ થયેલ કી ને લખવા માટે મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ફાઇલ માહિતી માટે મેમરી ફાળવી શક્યા નહિં." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "નેટલિંક સંદેશ ને પ્રક્રિયા કરવામાં ભૂલ: %s" -#: ../src/nm-netlink-monitor.c:255 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંકને સંભાળવાનું ફાળવવામાં અસમર્થ: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ભૂલ ઉદ્ભવી જ્યારે સોકેટ પર માહિતી માટે રાહ જોઇ રહ્યા હોય" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંકને જોડવામાં અસમર્થ: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "કડી પરિસ્થિતિને મોનિટર કરવા માટે નેટલીંક જૂથ ને જોડાવવાનું અસમર્થ: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "નેટલિંકને સંભાળવાનો શ્રેયને જવાનું સક્રિય કરવા માટે અસમર્થ: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંકને સંભાળવાનું ફાળવવામાં અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંક કડી કેશને ફાળવવામાં અસમર્થ: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "નેટલીંક જૂથ ને જોડાવવાનું અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "કડી કેશને સુધારો કરતી વખતે ભૂલ: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "ભૂલ ઉદ્ભવી જ્યારે સોકેટ પર માહિતી માટે રાહ જોઇ રહ્યા હોય" - -#: ../src/NetworkManager.c:294 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "અયોગ્ય વિકલ્પ. મહેરબાની કરીને યોગ્ય વિકલ્પોની યાદી ને જોવા માટે --help ને વાપરો.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:97 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. મહેરબાની કરીને યોગ્ય વિકલ્પોની યાદીને જોવા માટે --help ને વાપરો.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# ને NetworkManager દ્દારા બનાવેલ છે\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -307,28 +1561,79 @@ msgstr "" "# ને %s માંથી ભેગુ કરેલ છે\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ન વાપરી શકાય તેવુ DHCP ક્લાઇન્ટ મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "બિનઆધારભૂત DHCP ક્લાઇન્ટ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "અજ્ઞાત લોગ સ્તર '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "અજ્ઞાત લોગ ડોમેઇન '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "નોંધ: libc સુધારનાર એ ૩ નામ સર્વરો કરતા વધારે આધારને સમાવી શકતુ નથી." -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "નીચે યાદી થયેલ નામસર્વરો એ ઓળખી શકાતા નથી." -#: ../system-settings/plugins/ifcfg-rh/reader.c:2149 -msgid "System" -msgstr "સિસ્ટમ" - -#: ../system-settings/src/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "%s સ્વયં કરો" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "સિસ્ટમ" + #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "સુરક્ષિત થયેલ WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ખુલ્લા WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "નિરંતર સિસ્ટમ યજમાનનામને બદલો" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" msgstr "સિસ્ટમ જોડાણોને બદલો" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +#: ../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 નેટવર્ક મારફતે વહેંચણી જોડાણોને રોકી રહ્યા છે" + From 39dc99ee3f53faa294251e63e9ebca699ee644b0 Mon Sep 17 00:00:00 2001 From: Rajesh Ranjan Date: Thu, 13 May 2010 12:34:56 -0700 Subject: [PATCH 377/392] po: update Hindi translation (rh #589230) --- po/hi.po | 1251 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1208 insertions(+), 43 deletions(-) diff --git a/po/hi.po b/po/hi.po index 291b17a802..9b6c3f1707 100644 --- a/po/hi.po +++ b/po/hi.po @@ -1,4 +1,4 @@ -# translation of NetworkManager.master.po to Hindi +# translation of hi.po to Hindi # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-02-24 03:25+0000\n" -"PO-Revision-Date: 2010-02-24 12:47+0530\n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 15:23+0530\n" "Last-Translator: Rajesh Ranjan \n" "Language-Team: Hindi \n" "MIME-Version: 1.0\n" @@ -16,6 +16,1151 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" +"\n" +"\n" +"\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"प्रयोग: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "त्रुटि: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "त्रुटि: 'con list': %s; अनुमतिप्राप्त क्षेत्र: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "कनेक्शन्स विवरण" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "तंत्र" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "उपयोक्ता" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "कभी नहीं" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "हाँ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "नहीं" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "सिस्टम कनेक्शन" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "उपयोक्ता कनेक्शन" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "त्रुटि: %s तर्क अनुपस्थित है." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "त्रुटि: %s - कोई ऐसा कनेक्शन नहीं." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "अज्ञात पैरामीटर: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "त्रुटि: कोई वैध पैरामीटर निर्दिष्ट नहीं." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "त्रुटि: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "त्रुटि: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "त्रुटि: 'con status': %s; अनुमतिप्राप्त क्षेत्र: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "सक्रिय कनेक्शन" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "युक्ति '%s' पर कोई सक्रिय कनेक्शन नहीं" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "कोई सक्रिय कनेक्शन या युक्ति नहीं" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "युक्ति '%s' '%s' के साथ संगत नहीं है" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' कनेक्शन के लिए कोई युक्ति नहीं मिला" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "सक्रिय कर रहा है" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "सक्रिय किया हुआ" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "अज्ञात" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN कनेक्टिंग (तैयार)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN कनेक्टिंग (सत्यापन जरूरी)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN कनेक्टिंग" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN कनेक्टिंग (IP विन्यास पा रहा है)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN कनेक्टेड" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN कनेक्शन विफल" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN डिसकनेक्टेंड" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "अज्ञात कारण" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "कुछ नहीं" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "उपयोक्ता डिसकनेक्ट किया गया था" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "मौलिक संजाल कनेक्शन में बाधा आई थी" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN सेवा अचानक रुक गई" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN सेवा ने अवैध विन्यास वापस किया" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "कनेक्शन प्रयास का समय समाप्त" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN सेवा समय पर आरंभ नहीं हुआ" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN सेवा आरंभ होने में विफल रहा" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "कोई वैध VPN गुप्त नहीं" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "अवैध VPN गुप्त" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "कनेक्शन हटाया गया था" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "स्थिति: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "कनेक्शन सक्रिय किया गया\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "त्रुटि: कनेक्शन सक्रिय किया जाना विफल." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "स्थिति: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "त्रुटि: कनेक्शन सक्रियकरण विफल: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "त्रुटि: समय समाप्ति %d सेकेंड में समाप्त." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "त्रुटि: कनेक्शन सक्रियकरण विफल: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "त्रुटि: '%s' के लिए सक्रिय कनेक्शन पा रहा है." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "सक्रिय कनेक्शन स्थिति: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "सक्रिय कनेक्शन पथ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "त्रुटि: अज्ञात कनेक्शन: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "त्रुटि: समय समाप्ति मान '%s' वैध नहीं है." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "त्रुटि: id या uuid को निर्दिष्ट किया जाना है." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "त्रुटि: कोई उपयुक्त युक्ति नहीं मिला: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "त्रुटि: कोई उपयुक्त युक्ति नहीं मिला." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "चेतावनी: कनेक्शन सक्रिय नहीं\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "त्रुटि: 'con' कमांड '%s' वैध नहीं है." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "त्रुटि: D-Bus से कनेक्ट नहीं कर पाया." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "त्रुटि: सिस्टम सेटिंग नहीं पा सका." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "त्रुटि: उपयोक्ता सेटिंग नहीं पा सका." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "त्रुटि: कनेक्शन नहीं पा सकता है: सेटिंग सेवा चल नहीं रही है." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"प्रयोग: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "अप्रबंधित" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "अनुपलब्ध" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "डिसकनेक्टेड" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "कनेक्टिंग (तैयार)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "कनेक्टिंग (विन्यस्त कर रहा है)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "कनेक्टिंग (सत्यापन जरूरी)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "कनेक्टिंग (IP विन्यास पा रहा है)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "कनेक्टेड" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "कनेक्शन विफल" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "अज्ञात" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(कोई नहीं)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 पता 0x%X को बदलने में त्रुटि" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "गोपित: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "एंटरप्राइज " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "तदर्थ" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "आधारभूत ढाँचा" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "त्रुटि: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev list': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "युक्ति विवरण" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(अज्ञात)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "अज्ञात)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "चालू" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "बंद" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "त्रुटि: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev status': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "युक्ति की स्थिति" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "त्रुटि: '%s' तर्क अनुपस्थित है." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "त्रुटि: युक्ति '%s' नहीं मिला." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "सफल: युक्ति '%s' सफलतापूर्वक डिसकनेक्डेड." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "त्रुटि: युक्ति '%s' (%s) डिसकनेक्टिंग विफल: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "युक्ति स्थिति: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "त्रुटि: iface को निर्दिष्टि करना है." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "त्रुटि: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev wifi': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi स्कैन सूची" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Error: hwaddr '%s' के साथ पहुँच नहीं मिला." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "त्रुटि: युक्ति '%s' एक WiFi युक्ति नहीं है." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "त्रुटि: 'dev wifi' कमांड '%s' वैध नहीं है." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "त्रुटि: 'dev' कमांड '%s' वैध नहीं है." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"प्रयोग: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "जुड़ रहा है" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "त्रुटि: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "त्रुटि: 'nm status': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager स्थिति" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "सक्षम" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "अक्षम" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "कार्यशील" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "नहीं चल रहा है" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "त्रुटि: '--fields' मान '%s' यहाँ वैध नहीं है; अनुमति प्राप्त क्षेत्र हैं: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi सक्षम" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "त्रुटि: अवैध 'wifi' पैरामीटर: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN सक्रिय" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "त्रुटि: अवैध 'wwan' पैरामीटर: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "त्रुटि: 'nm' कमांड '%s' वैध नहीं है." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"प्रयोग: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "त्रुटि: वस्तु '%s' अज्ञात है, 'nmcli help' आजमाएँ." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "त्रुटि: विकल्प '--terse' ने दूसरी बार निर्दिष्ट किया है." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "त्रुटि: विकल्प '--terse' '--pretty' के साथ परस्पर वहिर्वेषी है." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "त्रुटि: विकल्प '--pretty' दूसरी बार निर्दिष्ट किया है." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "त्रुटि: विकल्प '--pretty' परस्पर वहिर्वेशी है '--terse' के साथ." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "त्रुटि: '%s' विकल्प के लिए अनुपस्थित तर्क." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "त्रुटि: '%s' '%s' विकल्प के लिए वैध तर्क नहीं है." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "त्रुटि: '%s' विकल्प के लिए क्षेत्र अनुपस्थित है." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli टूल, संस्करण %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "त्रुटि: विकल्प '%s' अज्ञात है, 'nmcli -help' आजमाएँ." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "संकेत %d पकड़ा, बंद कर रहा है..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "त्रुटि: NetworkManager से कनेक्ट नहीं कर सका." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "सफल" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-बिट पासफ्रेज)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (अज्ञात)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (अज्ञात)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "कोई, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "सेट नहीं" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "क्षेत्र '%s' को अलग रहना है" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "अवैध क्षेत्र '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "विकल्प '--terse' के लिए '--fields' निर्दिष्ट करना है" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "विकल्प '--terse' के लिए '--fields' विकल्प मान की जरूरत है, न कि '%s'" #: ../libnm-util/crypto.c:120 #, c-format @@ -332,77 +1477,85 @@ msgstr "PKCS#12 फाइल जाँच नहीं सका: %d" msgid "Could not generate random data." msgstr "क्रमहीन आँकड़ा बना नहीं सका." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "गोपन कुंजी बनाने के लिए पर्याप्त मात्रा में स्मृति नहीं." -#: ../libnm-util/nm-utils.c:1632 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM फाइल निर्माण के लिए स्मृति नहीं आबंटित कर सका." -#: ../libnm-util/nm-utils.c:1644 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IV से PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." -#: ../libnm-util/nm-utils.c:1656 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "गोपित कुंजी को PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." -#: ../libnm-util/nm-utils.c:1675 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल आँकड़ा के लिए स्मृति नहीं आबंटित कर सका." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "netlink संदेश की प्रक्रिया में त्रुटि: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "लिंक स्थिति मॉनिटर करने के लिए नेटलिंक नियंत्रण का आबंटित नहीं कर सका: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "सॉकेट पर आँकड़ा के लिए प्रतीक्षा करने के दौरान त्रुटि" -#: ../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 "नेटलिंक को मॉनिटरिंग लिंक स्थिति के लिए कनेक्ट करने में असमर्थ: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "मॉनिटरिंग लिंक स्थिति के लिए नेटलिंक में शामिल होने में असमर्थ: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "नेटलिंक नियंत्रण श्रेय पासिंग सक्रिय करने में असमर्थ: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "लिंक स्थिति मॉनिटर करने के लिए नेटलिंक नियंत्रण का आबंटित नहीं कर सका: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "नेटलिंक कैश को मॉनिटरिंग लिंक स्थिति के लिए आबंटित करने में असमर्थ: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "सॉकेट पर आँकड़ा के लिए प्रतीक्षा करने के दौरान त्रुटि" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "नेटलिंक समूह में शामिल होने में असमर्थ: %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 "लिंक कैश अद्यतन करने में त्रुटि: %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 "अवैध विकल्प. कृपया --help का उपयोग वैध विकल्प देने के लिए करें.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:297 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. कृपया --help का उपयोग वैध विकल्प देने के लिए करें.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# संजाल प्रबंधक द्वारा निर्मित\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:313 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -411,26 +1564,38 @@ msgstr "" "#%s से मिलाया गया\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "नेटलिंक हैंडल आबंटित करने में असमर्थ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "कोई प्रयोज्य DHCP क्लाइंट नहीं मिला." -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "नेटलिंक में कनेक्ट करने में असमर्थ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' नहीं मिल सका." -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "नेटलिंक समूह में शामिल होने में असमर्थ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' नहीं मिल सका." -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "असमर्थित DHCP क्लाइंट '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "अज्ञात लॉग स्तर '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "अज्ञात लॉग डोमेन '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "नोट: libc समाधानकर्ता 3 नेमसर्वर से अधिक का समर्थन नहीं कर सकता है." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "नीचे सूची में दिया गया नेमसर्वर पहचाना नहीं जा सकता है." @@ -439,7 +1604,7 @@ msgstr "नीचे सूची में दिया गया नेमस msgid "Auto %s" msgstr "स्वतः %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3220 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "तंत्र" From f534cf0ea25187f738a80d6f4790cf000653e0f2 Mon Sep 17 00:00:00 2001 From: "li.org it team" Date: Thu, 13 May 2010 12:38:53 -0700 Subject: [PATCH 378/392] po: update Italian translation (rh #589230) --- po/it.po | 1433 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1354 insertions(+), 79 deletions(-) diff --git a/po/it.po b/po/it.po index 87675b3d94..5c61af0ac5 100644 --- a/po/it.po +++ b/po/it.po @@ -1,3 +1,4 @@ +# translation of it.po to # Italian translation for NetworkManager # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 THE NetworkManager CopyRight Holder # This file is distributed under the same license as the NetworkManager package. @@ -5,17 +6,1162 @@ # msgid "" msgstr "" -"Project-Id-Version: NetworkManager 0.7.1\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-18 15:24+0000\n" -"PO-Revision-Date: 2009-09-19 01:12+0200\n" -"Last-Translator: Francesco Marletta \n" -"Language-Team: Italian \n" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:47+1000\n" +"Last-Translator: \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DISPOSITIVI" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPO" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "PREDEFINITO" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "SERVIZIO-DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OGGETTO" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REALE" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNESSIONE" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "SOLO LETTURA" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Utilizzo: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Errore: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Errore: 'con list': %s; campi permessi: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Informazioni sulla connessione" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "utente" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "mai" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "si" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "no" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Connessioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Connessioni utente" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Errore: l'argomento %s è mancante." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Errore: %s - la connessione non esiste." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parametro sconosciuto: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Errore: Non è stato specificato alcun parametro valido." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Errore: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Errore: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Errore: 'con status': %s; campi permessi: %s" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Connessioni attive" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nessuna connessione attiva sul dispositivo '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "nessuna connessione attiva o dispositivo" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "dispositivo '%s' non compatibile con la connessione '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nessun dispositivo trovato per la connessione '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "attivazione in corso" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "attivato" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "sconosciuto" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Connessione VPN (preparazione)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Connessione VPN (autenticazione necessaria)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "connessione VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Connessione VPN (acquisizione configurazione IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "Connesso al VPN" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Connessione VPN fallita" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN scollegato" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "motivo sconosciuto" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "nessuno" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "l'utente è stato scollegato" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "la connessione di rete di base è stata interrotta" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "il servizio VPN si è arrestato inaspettatamente" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "il servizio VPN ha ritornato una configurazione non valida" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "il tentativo di connessione è scaduto" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "il servizio VPN non si è stato avviato in tempo" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "l'avvio del servizio VPN è fallito" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "nessun segreto VPN valido" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "segreti VPN non validi" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "la connessione è stata rimossa" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "stato: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Connessione attivata\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Errore: Attivazione connessione fallita." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stato: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Errore: Attivazione connessione fallita: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Errore: Timeout, %d sec scaduti." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Errore: Attivazione connessione fallita: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Errore: Ottenimento connessione attiva per '%s' fallita." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stato connessione attiva: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Percorso connessione attiva: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Errore: Connessione sconosciuta: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Errore: il valore di timeout '%s' non è valido." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Errore: specificare id o uuid." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Errore: Nessun dispositivo idoneo trovato: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Errore: Nessun dispositivo idoneo trovato." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Attenzione: Connessione non attiva\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Errore: il comando 'con' '%s' non è valido." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Errore: impossibile collegarsi a D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Errore: Impossibile ottenere le impostazioni del sistema." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Errore: Impossibile ottenere le impostazioni dell'utente." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Errore: Impossibile ottenere le connessioni: i servizi per le impostazioni " +"non sono in esecuzione." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DISPOSITIVO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATO" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERALE" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPACITÀ" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPRIETÀ-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPRIETÀ-CABLATO" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IMPOSTAZIONI-IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "RILEVAMENTO-CARRIER" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VELOCITÀ" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "INDIRIZZO" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFISSO" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODALITÀ" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "TASSO DI TRASFERIMENTO" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SEGNALE" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SICUREZZA" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ATTIVO" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Utilizzo: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "non gestito" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "non disponibile" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "scollegato" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "connessione in corso (preparazione)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "connessione in corso (configurazione)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "connessione in corso (autenticazione necessaria)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "connessione in corso (acquisizione configurazione IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "collegato" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "connessione fallita" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Sconosciuto" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(nessuno)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: errore nella conversione dell'indirizzo IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Cifrato: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastruttura" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Errore: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Errore: 'dev list': %s; campi permessi: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Informazioni del dispositivo" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(sconosciuto)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "sconosciuto)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "on" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "off" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Errore: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Errore: 'dev status': %s; campi permessi: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Stato dispositivo" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Errore: L'argomento '%s' è mancante." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Errore: Dispositivo '%s' non trovato." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Successo: Dispositivo '%s' scollegato con successo." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Errore: Scollegamento dispositivo '%s' (%s) fallito: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stato dispositivo: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Errore: specificare iface." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Errore: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; campi permessi: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Elenco scansione WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Errore: Punto di accesso con hwaddr '%s' non trovato." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Errore: Il dispositivo '%s' non è un dispositivo WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Errore: il comando 'dev wifi' '%s' non è valido." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Errore: il comando 'dev' '%s' non è valido." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "IN ESECUZIONE" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Utilizzo: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "dormiente" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "connessione" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Errore: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Errore: 'nm status': %s; campi permessi: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Stato NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "abilitato" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "disabilitato" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "in esecuzione" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "non in esecuzione" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Errore: qui il valore '--fields' '%s' non è valido; campi permessi: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi abilitato" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Errore: parametro 'wifi' non valido: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN abilitato" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Errore: parametro 'wwan' non valido: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Errore: comando 'nm' '%s' non valido." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Utilizzo: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] output dettagliato\n" +" -p[retty] output formattato\n" +" -m[ode] tabular|multiline modalità output\n" +" -f[ields] |all|common specifica campi sull'output\n" +" -e[scape] yes|no esegue l'escape dei separatori delle colonne " +"nei valori\n" +" -v[ersion] mostra la versione del programma\n" +" -h[elp] stampa questo aiuto\n" +"\n" +"OBJECT\n" +" nm stato NetworkManager\n" +" con connessioni NetworkManager\n" +" dev dispositivi gestiti da NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Errore: L'oggetto '%s' è sconosciuto, prova 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Errore: L'opzione '--terse' è stata specificata una seconda volta." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Errore: L'opzione '--terse' si esclude con '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Errore: L'opzione '--pretty' è stata specificata una seconda volta." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Errore: L'opzione '--pretty' si esclude con '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Errore: argomento mancante per l'opzione '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Errore: '%s' non è un argomento valido per l'opzione '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Errore: i campi per le opzioni '%s' sono mancanti." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "tool nmcli, versione %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Errore: L'opzione '%s' è sconosciuta, prova 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Catturato segnale %d, arresto in corso..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Errore: Impossibile collegarsi al NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Successo" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase di accesso a 104/128-bit)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (sconosciuto)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (sconosciuto)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "qualsiasi, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non impostato" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "il campo '%s' deve essere isolato" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo '%s' invalido" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Con l'opzione '--terse' è necessario specificare '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "L'opzione '--terse' necessita valori dell'opzione '--fields' specifici, non '%s'" #: ../libnm-util/crypto.c:120 #, c-format @@ -102,8 +1248,9 @@ msgstr "Memoria non sufficiente per archiviare l'IV." msgid "IV contains non-hexadecimal digits." msgstr "IV contiene cifre non esadecimali." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Il cifrario di chiave privata \"%s\" è sconosciuto." @@ -123,73 +1270,108 @@ msgstr "Impossibile stabilire il tipo di chiave privata." msgid "Not enough memory to store decrypted private key." msgstr "Memoria non sufficiente per archiviare la chiave privata decifrata." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Inizializzazione del motore di cifratura fallita." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Inizializzazione del motore MD5 fallita: %s / %s" -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Lunghezza IV non valida (deve avere almento %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Memoria non sufficiente per il buffer della chiave decifrata." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Inizializzazione del contesto di decifrazione fallita: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "" -"Impostazione della chiave simmetrica per la decifrazione fallita: %s / %s." +msgstr "Impostazione della chiave simmetrica per la decifrazione fallita: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Impostazione di IV per la decifrazione fallita: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Decifrazione della chiave privata fallita: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Impossibile decifrare la chiave privata: lunghezza spazio di riempimento non " +"previsto." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Decifrazione della chiave privata fallita." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Impossibile assegnare memoria per la cifratura." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Inizializzazione contesto del cifratore fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Impostazione della chiave simmetrica per la codifica fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Impostazione di IV per la cifratura fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Cifratura dati fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Errore nell'inizializzare i dati dei certificati: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Impossibile decodificare il certificato: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Impossibile inizializzare il decodificatore PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Impossibile decodificare il file PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Impossibile verificare il file PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Inizializzazione del motore di cifratura fallita: %d." @@ -199,111 +1381,192 @@ msgstr "Inizializzazione del motore di cifratura fallita: %d." msgid "Failed to initialize the MD5 context: %d." msgstr "Inizializzazione del contesto MD5 fallita: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Lunghezza di IV non valida (deve avere almeno %d)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Inizializzazione dello slot del decifratore fallita." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Impostazione della chiave simmetrica di decifrazione fallita." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Impostazione di IV per la decifrazione fallita." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Inizializzazione del contesto di decifrazione fallita." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Decifrazione della chiave privata fallita: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Decodifica della chiave privata fallita: i dati decifrati sono troppo lunghi." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Finalizzazione della decifrazione della chiave privata fallita: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Inizializzazione dello slot del cifratore fallita." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Impostazione della chiave simmetrica di cifratura fallita." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Impostazione di IV per la cifratura fallita." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Inizializzazione del contesto di cifratura fallita." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Cifratura fallita: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantità di dati non prevista dopo la cifratura." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Impossibile decodificare il certificato: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Impossibile convertire la password in UCS2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Impossibile inizializzare il decodificatore PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Impossibile decodificare il file PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Impossibile verificare il file PKCS#12: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Impossibile generare dati randomici." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Memoria non sufficiente per creare la chiave di cifratura." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Impossibile assegnare memoria per la creazione del file PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Impossibile assegnare memoria per la scrittura di IV sul file PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Impossibile assegnare memoria per la scrittura della chiave cifrata sul file " +"PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Impossibile assegnare memoria per i dati del file PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "errore nell'elaborare il messaggio netlink: %s" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "si è verificato un errore durante l'attesa dei dati sul socket" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "impossibile collegarsi a netlink per monitorare lo stato del collegamento: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "impossibile abilitare il passaggio delle credenziali handle netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "impossibile allocare un handle netlink per monitorare lo stato del " "collegamento: %s" -#: ../src/nm-netlink-monitor.c:270 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"impossibile collegarsi a netlink per monitorare lo stato del collegamento: %s" - -#: ../src/nm-netlink-monitor.c:278 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"impossibile unirsi a un gruppo netlink per monitorare lo stato del " -"collegamento: %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 "" "impossibile allocare la cache dei collegamenti netlink per monitorare lo " "stato del collegamento: %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 "si è verificato un errore durante l'attesa dei dati sul socket" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "impossibile unirsi a un gruppo netlink: %s" -#: ../src/NetworkManager.c:330 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "errore nell'aggiornare la cache dei link: %s" + +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opzione non valida. Usare --help per ottenere un elenco delle opzioni " "valide.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Usare --help per ottenere un elenco di opzioni valide.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Creato da NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -312,35 +1575,47 @@ msgstr "" "# Unito da %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "impossibile allocare un handle netlink: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "non è stato trovato alcun client DHCP utilizzabile." -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "impossibile collegarsi a netlink: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "è stato trovato 'dhclient'" -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "impossibile unirsi a un gruppo netlink: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "è stato trovato 'dhcpcd'" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "client DHCP '%s' non supportato" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Livello log '%s' sconosciuto" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Dominio log '%s' sconosciuto" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTA: il risolutore libc non supporta più di 3 server di nomi." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "I server di nomi elencati sotto non possono essere riconosciuti." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "%s (automatica)" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "Sistema" @@ -367,8 +1642,7 @@ msgstr "Modifica le connessioni di sistema" # [NdT] si tratta di un messaggio che descrive un'azione #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "" -"La politica di sistema impedisce di modificare le impostazioni di sistema" +msgstr "La politica di sistema impedisce di modificare le impostazioni di sistema" # [NdT] si tratta di un messaggio che descrive un'azione #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 @@ -390,3 +1664,4 @@ msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" "La politica di sistema impedisce di condividere connessioni attraverso una " "rete WiFi aperta" + From bbc4ccc50d3449522f85ccc1c83d3067e2b3c925 Mon Sep 17 00:00:00 2001 From: Shankar Prasad Date: Thu, 13 May 2010 12:39:41 -0700 Subject: [PATCH 379/392] po: update Kannada translation (rh #589230) --- po/kn.po | 1467 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 955 insertions(+), 512 deletions(-) diff --git a/po/kn.po b/po/kn.po index bd04652a29..be51ba0dec 100644 --- a/po/kn.po +++ b/po/kn.po @@ -7,10 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.po.master.kn\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-21 03:24+0000\n" -"PO-Revision-Date: 2010-04-20 18:07+0530\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:54+0530\n" "Last-Translator: Shankar Prasad \n" "Language-Team: kn-IN <>\n" "MIME-Version: 1.0\n" @@ -19,7 +18,76 @@ msgstr "" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -40,310 +108,514 @@ msgstr "" "]\n" " down id | uuid \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 "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "ಹೆಸರು" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳು:\n" +msgid "Error: 'con list': %s" +msgstr "ದೋಷ: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ದೋಷ: 'con list': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" -#: ../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:207 +msgid "Connection details" +msgstr "ಸಂಪರ್ಕದ ವಿವರಗಳು" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ವ್ಯವಸ್ಥೆ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ಬಳಕೆದಾರ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ಎಂದಿಗೂ ಬೇಡ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ಹೌದು" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ಇಲ್ಲ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "ದೋಷ: %s ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "ದೋಷ: %s - ಅಂತಹ ಯಾವುದೆ ಸಂಪರ್ಕಗಳಿಲ್ಲ." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "ವ್ಯವಸ್ಥೆಯಾದ್ಯಂತದ ಸಂಪರ್ಕಗಳು" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು" - -#: ../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:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "ಗೊತ್ತಿರದ ನಿಯತಾಂಕಗಳು: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, 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:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ದೋಷ: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "ಇಲ್ಲ" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ದೋಷ: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ದೋಷ: 'con status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕಗಳು" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "ಪೂರ್ವನಿಯೋಜಿತ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "ಸೇವೆ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "ಸಾಧನಗಳು" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "'%s' ಎಂಬ ಸಾಧನದಲ್ಲಿ ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕವು ಕಂಡುಬಂದಿಲ್ಲ" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಅಥವ ಸಾಧನವು ಕಂಡುಬಂದಿಲ್ಲ" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ಎಂಬ ಸಾಧನವು '%s' ಸಂಪರ್ಕದೊಂದಿಗೆ ಹೊಂದಿಕೊಳ್ಳುತ್ತಿಲ್ಲ" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' ಸಂಪರ್ಕಕ್ಕಾಗಿ ಯಾವುದೆ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "ಸಕ್ರಿಯಗೊಳ್ಳುತ್ತಿದೆ" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "ಸಕ್ರಿಯಗೊಂಡಿದೆ" -#: ../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:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "ಗೊತ್ತಿಲ್ಲದ" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN ಸಂಪರ್ಕಿತಗೊಳ್ಳುತ್ತಿದೆ" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN ಸಂಪರ್ಕವು ವಿಫಲಗೊಂಡಿದೆ" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN ಸಂಪರ್ಕ ಕಡಿದಿದೆ" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "ಗೊತ್ತಿರದ ಕಾರಣ" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "ಯಾವುದೂ ಇಲ್ಲ" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "ಬಳಕೆದಾರರೊಂದಿಗೆ ಸಂಪರ್ಕ ಕಡಿದುಹೋಗಿದೆ" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "ಮೂಲ ಜಾಲಬಂಧ ಸಂಪರ್ಕಕ್ಕೆ ತಡೆಯುಂಟಾಗಿದೆ" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN ಸೇವೆಯನ್ನು ಅನಿರೀಕ್ಷಿತವಾಗಿ ನಿಲ್ಲಿಸಲಾಗಿದೆ" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN ಸೇವೆಯು ಅಮಾನ್ಯವಾದ ಸಂರಚನೆಯನ್ನು ಮರಳಿಸಿದೆ" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "ಸಂಪರ್ಕದ ಪ್ರಯತ್ನದ ಕಾಲಾವಧಿ ಮೀರಿದೆ" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN ಸೇವೆಯು ಸರಿಯಾದ ಸಮಯದಲ್ಲಿ ಆರಂಭಗೊಳ್ಳಲಿಲ್ಲ" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN ಸೇವೆಯು ಆರಂಭಗೊಳ್ಳಲು ವಿಫಲಗೊಂಡಿದೆ" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "ಯಾವುದೆ ಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳಿಲ್ಲ (ಸೀಕ್ರೇಟ್‌ಗಳಿಲ್ಲ)" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "ಅಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳು" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "ಸಂಪರ್ಕವನ್ನು ತೆಗೆದು ಹಾಕಲಾಗಿದೆ" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "ಸ್ಥಿತಿ: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "ದೋಷ: ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "ಸ್ಥಿತಿ: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ದೋಷ: ಕಾಲಾವಧಿ %d sec ತೀರಿದೆ." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "ದೋಷ: '%s' ಗಾಗಿ ಸಕ್ರಿಯ ಸಂಪರ್ಕವನ್ನು ಪಡೆಯುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕದ ಸ್ಥಿತಿ: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಮಾರ್ಗ: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "ದೋಷ: ಗೊತ್ತಿರದ ಸಂಪರ್ಕ: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ದೋಷ: '%s' ಎಂಬ ಕಾಲಾವಧಿ ತೀರಿಕೆ ಮೌಲ್ಯವು ಅಮಾನ್ಯವಾಗಿದೆ." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ದೋಷ: id ಅಥವ uuid ಅನ್ನು ಸೂಚಿಸಬೇಕು." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "ಎಚ್ಚರಿಕೆ: ಸಂಪರ್ಕವು ಸಕ್ರಿಯವಾಗಿಲ್ಲ\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ದೋಷ: 'con' ಆಜ್ಷೆ '%s' ಎಂಬುದು ಮಾನ್ಯವಾದುದಲ್ಲ." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ದೋಷ: D-Bus ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "ದೋಷ: ವ್ಯವಸ್ಥೆಯ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "ದೋಷ: ಬಳಕೆದಾರ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "ದೋಷ: ಸಂಪರ್ಕಗಳನ್ನು ಪಡೆಯಲಾಗಿಲ್ಲ: ಸಿದ್ಧತೆಗಳು ಚಾಲನೆಯಲ್ಲಿಲ್ಲ." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -353,359 +625,246 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" -"ಬಳಕೆ: nmcli dev { COMMAND | help }\n" +"ಬಳಕೆ:: nmcli dev { COMMAND | help }\n" "\n" " COMMAND := { status | list | disconnect | wifi }\n" "\n" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "ನಿರ್ವಹಿಸದೆ ಇರುವ" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "ಲಭ್ಯವಿಲ್ಲ" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "ಸಂಪರ್ಕಕಡಿದು ಹೋಗಿದೆ" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಂರಚಿಸುವಿಕೆ)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "ಸಂಪರ್ಕಗೊಂಡಿದೆ" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "ಸಂಪರ್ಕ ವಿಫಲಗೊಂಡಿದೆ" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "ಗೊತ್ತಿರದ" -#. 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:277 msgid "(none)" msgstr "(ಯಾವುದೂ ಇಲ್ಲ)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ವಿಳಾಸ 0x%X ಅನ್ನು ಪರಿವರ್ತಿಸುವಲ್ಲಿ ದೋಷ" -#: ../cli/src/devices.c:238 -#, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, ಫ್ರೀಕ್ವೆ %d MHz, ದರ %d Mb/s, ದೃಢತೆ %d" - -#: ../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 " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" - -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " ಎಂಟರ್ಪೈಸ್" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "ಸಾಧನ" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ಚಾಲಕ" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(ಗೊತ್ತಿರದ)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "ಸ್ಥಿತಿ" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW ವಿಳಾಸ" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" ಸಾಮಾರ್ಥ್ಯಗಳು:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "ಕ್ಯಾರಿಯರ್ ಪತ್ತೆ" - -#: ../cli/src/devices.c:336 -#, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "ವೇಗ" - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" ವೈರ್ಲೆಸ್‌ ಗುಣಧರ್ಮಗಳು\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP ಗೂಢಲಿಪೀಕರಣ" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA ಗೂಢಲಿಪೀಕರಣ" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 ಗೂಢಲಿಪೀಕರಣ" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP ಸಿಫರ್" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP ಸಿಫರ್" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" ವೈರ್ಲೆಸ್ ನಿಲುಕಣಾ ಬಿಂದುಗಳು %s\n" - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = ಪ್ರಸಕ್ತ AP)" - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" ವೈರ್ಡ್ ಗುಣಧರ್ಮಗಳು\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "ವಾಹಕ(ಕ್ಯಾರಿಯರ್)" - -#: ../cli/src/devices.c:377 -msgid "on" -msgstr "ಆನ್‌" - -#: ../cli/src/devices.c:379 -msgid "off" -msgstr "ಆಫ್" - -#: ../cli/src/devices.c:387 -#, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPV4 ಸಿದ್ಧತೆಗಳು:\n" - -#: ../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 "DNS" - -#: ../cli/src/devices.c:458 -msgid "Status of devices" -msgstr "ಸಾಧನಗಳ ಸ್ಥಿತಿ" - -#: ../cli/src/devices.c:487 -#, c-format -msgid "Error: '%s' argument is missing." -msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ." - -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 -#, c-format -msgid "Error: Device '%s' not found." -msgstr "ದೋಷ: '%s' ಎಂಬ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." - -#: ../cli/src/devices.c:539 -#, c-format -msgid "Success: Device '%s' successfully disconnected." -msgstr "ಯಶಸ್ಸು: '%s' ಎಂಬ ಸಾಧನದಿಂದ ಯಶಸ್ವಿಯಾಗಿ ಸಂಪರ್ಕವನ್ನು ಕಡಿದುಹಾಕಲಾಗಿದೆ." - -#: ../cli/src/devices.c:564 -#, c-format -msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "ದೋಷ: '%s' (%s) ಎಂಬ ಸಾಧನದ ಸಂಪರ್ಕವನ್ನು ಕಡಿದು ಹಾಕುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s" - -#: ../cli/src/devices.c:572 -#, c-format -msgid "Device state: %d (%s)\n" -msgstr "ಸಾಧನದ ಸ್ಥಿತಿ: %d (%s)\n" - -#: ../cli/src/devices.c:636 -#, c-format -msgid "Error: iface has to be specified." -msgstr "ದೋಷ: iface ಅನ್ನು ಸೂಚಿಸಬೇಕು." - -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi ಸ್ಕ್ಯಾನ್ ಪಟ್ಟಿ" - -#: ../cli/src/devices.c:740 -#, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "ದೋಷ: '%s' ಎಂಬುದು ಒಂದು WiFi ಸಾಧನವಾಗಿಲ್ಲ." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "ಸಾಧನ:" - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "ದೋಷ: hwaddr ಅನ್ನು ಸೂಚಿಸಬೇಕು." - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "ದೋಷ: '%s' ಎಂಬ hwaddr ನ ನಿಲುಕಣಾ ಬಿಂದುವು ಕಾಣಿಸುತ್ತಿಲ್ಲ." - -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:349 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:350 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP ನಿಯತಾಂಕಗಳು" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ಗೂಢಲಿಪೀಕರಣಗೊಂಡ: " -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "ಫ್ರೀಕ್ವೆನ್ಸಿ:" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "ಕ್ರಮ:" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ಎಂಟರ್ಪ್ರೈಸ್ " -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" msgstr "ತಾತ್ಕಾಲಿಕ" -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:380 msgid "Infrastructure" msgstr "ಮೂಲಭೂತ ವ್ಯವಸ್ಥೆ" -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "ಗರಿಷ್ಟ ಬಿಟ್ ದರ:" +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ದೋಷ: 'dev list': %s" -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "ದೃಢತೆ:" +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev list'; %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "ಫ್ಲಾಗ್‌ಗಳು:" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ಸಾಧನದ ವಿವರಗಳು" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "ಗೌಪ್ಯತೆ" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ಗೊತ್ತಿರದ)" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA ಫ್ಲಾಗ್‌ಗಳು:" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ಗೊತ್ತಿರದ)" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN ಫ್ಲಾಗ್‌ಗಳು:" +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:907 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ಆನ್‌" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ಆಫ್" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ದೋಷ: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ಸಾಧನಗಳ ಸ್ಥಿತಿ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ಯಶಸ್ಸು: '%s' ಎಂಬ ಸಾಧನದಿಂದ ಯಶಸ್ವಿಯಾಗಿ ಸಂಪರ್ಕವನ್ನು ಕಡಿದುಹಾಕಲಾಗಿದೆ." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ದೋಷ: '%s' (%s) ಎಂಬ ಸಾಧನದ ಸಂಪರ್ಕವನ್ನು ಕಡಿದು ಹಾಕುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ಸಾಧನದ ಸ್ಥಿತಿ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ದೋಷ: iface ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ದೋಷ: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev wifi': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi ಸ್ಕ್ಯಾನ್ ಪಟ್ಟಿ" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ hwaddr ನ ನಿಲುಕಣಾ ಬಿಂದುವು ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ದೋಷ: '%s' ಎಂಬುದು ಒಂದು WiFi ಸಾಧನವಾಗಿಲ್ಲ." + +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ದೋಷ: '%s' ಎಂಬ 'dev wifi' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ದೋಷ: '%s' ಎಂಬ 'dev' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." -#: ../cli/src/network-manager.c:46 +#: ../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" @@ -719,7 +878,7 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" -"ಬಳಕೆ: nmcli nm { COMMAND | help }\n" +"Usage: nmcli nm { COMMAND | help }\n" "\n" " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" "\n" @@ -730,89 +889,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "ನಿದ್ರಿಸುವ" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ" -#: ../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 "ದೋಷ: '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 "ದೋಷ: 'nm status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "NetworkManager ಸ್ಥಿತಿ" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM ಚಾಲನೆಯಲ್ಲಿದೆ:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ಸಕ್ರಿಯಗೊಂಡ" -#: ../cli/src/network-manager.c: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 "ಅಶಕ್ತಗೊಂಡ" + +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "ಚಾಲನೆಯಲ್ಲಿದೆ" -#: ../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 "NM ಸ್ಥಿತಿ:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ದೋಷ: '--fields' '%s' ಎಂಬ ಮೌಲ್ಯವು ಇಲ್ಲಿ ಸರಿಯಾದುದಲ್ಲ.; ಅನುಮತಿ ಇರುವ ಕ್ಷೇತ್ರಗಳು: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM ವೈರ್ಲೆಸ್‌ ಯಂತ್ರಾಂಶ:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi ಸಕ್ರಿಯಗೊಂಡಿದೆ" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM ಯಂತ್ರಾಂಶ:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN ಯಂತ್ರಾಂಶ:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" - -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wifi' ನಿಯತಾಂಕ: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ಸಕ್ರಿಯಗೊಂಡಿದೆ" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wwan' ರ ನಿಯತಾಂಕ: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "ದೋಷ: '%s' ಎಂಬ 'nm' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." -#: ../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] |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" @@ -820,13 +981,17 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"ಬಳಕೆ: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"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] |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" @@ -834,35 +999,167 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "'%s' ಎಂಬ ವಸ್ತುವಿನ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ದೋಷ: '%s' ಎಂಬ ವಸ್ತುವಿನ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ದೋಷ: '--terse' ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಎರಡನೆ ಬಾರಿಗೆ ಸೂಚಿಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ದೋಷ: '--terse' ಎಂಬುದು '--pretty' ಯೊಂದಿಗೆ ಪರಸ್ಪರ ಮೀಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ದೋಷ: '--pretty' ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಎರಡನೆ ಬಾರಿಗೆ ಸೂಚಿಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ದೋಷ: '--pretty' ಎಂಬುದು '--terse' ಯೊಂದಿಗೆ ಪರಸ್ಪರ ಮೀಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ದೋಷ: '%s' ಎನ್ನುವುದು '%s' ಎಂಬ ಆಯ್ಕೆಗೆ ಸರಿಯಾದ ಆರ್ಗ್ಯುಮೆಂಟ್ ಆಗಿಲ್ಲ." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ದೋಷ: '%s' ಎಂಬ ಆಯ್ಕೆಯ ಕ್ಷೇತ್ರಗಳು ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli ಉಪಕರಣ, ಆವೃತ್ತಿ %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "'%s' ಎಂಬ ಆಯ್ಕೆಯ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli -help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ದೋಷ: '%s' ಎಂಬ ಆಯ್ಕೆಯ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli -help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "%d ಎಂಬ ಸಂಕೇತವು ಕಂಡುಬಂದಿದೆ, ಮುಚ್ಚಲಾಗುತ್ತಿದೆ......" -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "ದೋಷ: NetworkManager ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "ಯಶಸ್ವಿಯಾಗಿದೆ" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ಬಿಟ್‌ ಗುಪ್ತವಾಕ್ಯಾಂಶ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ಅಜ್ಞಾತ)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ಗೊತ್ತಿರದ)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ಯಾವುದಾದರೂ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ಸ್ವಯಂಚಾಲಿತ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ಹೊಂದಿಸಲಾಗಿಲ್ಲ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ಎಂಬ ಕ್ಷೇತ್ರವು ಒಂಟಿಯಾಗಿಯೆ ಇರಬೇಕು" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ಅಮಾನ್ಯವಾದ ಕ್ಷೇತ್ರ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ '--fields' ಅನ್ನು ಸೂಚಿಸಬೇಕಾಗುತ್ತದೆ" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ ನಿಶ್ಚಿತವಾದ '--fields' ಆಯ್ಕೆಯ ಮೌಲ್ಯದ ಅಗತ್ಯವಿರುತ್ತದೆಯೆ ಹೊರತು, '%s' " +"ಎಂಬುದಲ್ಲ" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1180,81 +1477,82 @@ msgstr "PKCS#12 ಕಡತವನ್ನು ಖಚಿತಪಡಿಸಲು ಸಾ msgid "Could not generate random data." msgstr "ಮನಸ್ಸಿಗೆ ಬಂದ ದತ್ತಾಂಶವನ್ನು ಉತ್ಪಾದಿಸಲಾಗಲಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1818 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." -#: ../libnm-util/nm-utils.c:1928 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ಕಡತ ರಚನೆಗೆ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1940 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IV ಅನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1952 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "" -"ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../libnm-util/nm-utils.c:1971 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ಕಡತ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 -#: ../src/nm-netlink-monitor.c:581 -#: ../src/ip6-manager/nm-netlink-listener.c:351 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "ನೆಟ್‌ಲಿಂಕ್ ಸಂದೇಶವನ್ನು ಸಂಸ್ಕರಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/nm-netlink-monitor.c:259 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "" -"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು " -"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %" "s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಕ್ರೆಡೆನ್ಶಿಯಲ್ ಪಾಸಿಂಗ್ ಅನ್ನು ಶಕ್ತಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:285 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು " +"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ನಿಯೋಜಿಸಲು " "ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:493 -#: ../src/ip6-manager/nm-netlink-listener.c:381 -msgid "error occurred while waiting for data on socket" -msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" -#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ಅಪ್‌ಡೇಟ್ ಮಾಡುವಾಗ ದೋಷ ಉಂಟಾಗಿದೆ: %s" -#: ../src/main.c:498 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ಅಮಾನ್ಯವಾದ ಆಯ್ಕೆ. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" -#: ../src/main.c:558 +#: ../src/main.c:562 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" @@ -1289,21 +1587,6 @@ msgstr "'dhcpcd' ಕಂಡು ಬಂದಿದೆ." msgid "unsupported DHCP client '%s'" msgstr "ಬೆಂಬಲವಿರದ DHCP ಕ್ಲೈಂಟ್ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:199 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:209 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:306 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" - #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" @@ -1314,13 +1597,13 @@ msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಮಟ್ಟ '%s'" msgid "Unknown log domain '%s'" msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಡೊಮೈನ್ '%s'" -#: ../src/named-manager/nm-named-manager.c:314 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " "ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." -#: ../src/named-manager/nm-named-manager.c:316 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." @@ -1329,7 +1612,7 @@ msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರ msgid "Auto %s" msgstr "ಸ್ವಯಂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3229 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "ವ್ಯವಸ್ಥೆ" @@ -1359,10 +1642,170 @@ 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 ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" +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 ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" +msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#~ msgid "Type" +#~ msgstr "ಬಗೆ" + +#~ msgid "Name" +#~ msgstr "ಹೆಸರು" + +#~ msgid "User connections:\n" +#~ msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು:\n" + +#~ msgid "System-wide connections" +#~ msgstr "ವ್ಯವಸ್ಥೆಯಾದ್ಯಂತದ ಸಂಪರ್ಕಗಳು" + +#~ msgid "Default" +#~ msgstr "ಪೂರ್ವನಿಯೋಜಿತ" + +#~ msgid "Service" +#~ msgstr "ಸೇವೆ" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ಫ್ರೀಕ್ವೆ %d MHz, ದರ %d Mb/s, ದೃಢತೆ %d" + +#~ msgid "Device" +#~ msgstr "ಸಾಧನ" + +#~ msgid "Driver" +#~ msgstr "ಚಾಲಕ" + +#~ msgid "State" +#~ msgstr "ಸ್ಥಿತಿ" + +#~ msgid "HW Address" +#~ msgstr "HW ವಿಳಾಸ" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ಸಾಮಾರ್ಥ್ಯಗಳು:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "ಕ್ಯಾರಿಯರ್ ಪತ್ತೆ" + +#~ msgid "Speed" +#~ msgstr "ವೇಗ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಲೆಸ್‌ ಗುಣಧರ್ಮಗಳು\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP ಸಿಫರ್" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP ಸಿಫರ್" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಲೆಸ್ ನಿಲುಕಣಾ ಬಿಂದುಗಳು %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = ಪ್ರಸಕ್ತ AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಡ್ ಗುಣಧರ್ಮಗಳು\n" + +#~ msgid "Carrier" +#~ msgstr "ವಾಹಕ(ಕ್ಯಾರಿಯರ್)" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPV4 ಸಿದ್ಧತೆಗಳು:\n" + +#~ msgid "Address" +#~ msgstr "ವಿಳಾಸ" + +#~ msgid "Prefix" +#~ msgstr "ಪ್ರಿಫಿಕ್ಸ್" + +#~ msgid "Gateway" +#~ msgstr "ಗೇಟ್‌ವೇ" + +#~ msgid "Device:" +#~ msgstr "ಸಾಧನ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ದೋಷ: hwaddr ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#~ msgid "AP parameters" +#~ msgstr "AP ನಿಯತಾಂಕಗಳು" + +#~ msgid "Frequency:" +#~ msgstr "ಫ್ರೀಕ್ವೆನ್ಸಿ:" + +#~ msgid "Mode:" +#~ msgstr "ಕ್ರಮ:" + +#~ msgid "Ad-hoc" +#~ msgstr "ತಾತ್ಕಾಲಿಕ" + +#~ msgid "Maximal bitrate:" +#~ msgstr "ಗರಿಷ್ಟ ಬಿಟ್ ದರ:" + +#~ msgid "Strength:" +#~ msgstr "ದೃಢತೆ:" + +#~ msgid "Flags:" +#~ msgstr "ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "privacy" +#~ msgstr "ಗೌಪ್ಯತೆ" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "NM running:" +#~ msgstr "NM ಚಾಲನೆಯಲ್ಲಿದೆ:" + +#~ msgid "NM state:" +#~ msgstr "NM ಸ್ಥಿತಿ:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM ವೈರ್ಲೆಸ್‌ ಯಂತ್ರಾಂಶ:" + +#~ msgid "NM wireless:" +#~ msgstr "NM ಯಂತ್ರಾಂಶ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN ಯಂತ್ರಾಂಶ:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" From 492d5d6434a880034ee3b735d9cb031efb5a1af1 Mon Sep 17 00:00:00 2001 From: Hyunsok Oh Date: Thu, 13 May 2010 12:40:42 -0700 Subject: [PATCH 380/392] po: update Korean translation (rh #589230) --- po/ko.po | 2293 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 1610 insertions(+), 683 deletions(-) diff --git a/po/ko.po b/po/ko.po index 6592c6ac5e..ad463ab1d2 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,714 +1,1641 @@ +# translation of ko.po to Korean # networkmanager korean translation. # Copyright (C) 2007 THE NetworkManager'S COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. +# +# # Young-Ho Cha , 2006-2007. # Namhyung Kim , 2007. -# -# +# Hyunsok Oh , 2010. +# Hyunsok Oh , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager\n" +"Project-Id-Version: ko\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-12-18 17:15+0000\n" -"PO-Revision-Date: 2007-12-24 18:29+0900\n" -"Last-Translator: Namhyung \n" -"Language-Team: GNOME Korea \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 13:48+1000\n" +"Last-Translator: Hyunsok Oh \n" +"Language-Team: Korean \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:188 ../src/nm-netlink-monitor.c:448 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "이름" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "장치" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "범위" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "디폴트" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-서비스" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "스펙-객체" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "유형" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "타임스탬프" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "실제 타임스탬프" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "자동연결" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "읽기전용" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"사용법: nmcli con { 명령어 | help }\n" +" 명령어 := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface <인터페이스>] [ap <하드웨어주소>] [--nowait] " +"[--timeout <타임아웃시간>]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "오류: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "오류: 'con list': %s; 허용된 필드: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "연결 상세 정보" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "시스템" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "사용자" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "하지않음" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "예" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "아니오" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "시스템 연결" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "사용자의 연결" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "오류: %s 인자가 없습니다." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "오류: %s - 그런 연결이 없습니다." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "알려져있지 않은 매개변수입니다: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "오류: 옳바른 매개변수가 지정되지 않았습니다." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "오류: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "오류: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "오류: 'con status': %s; 허용된 필드: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "활성화된 연결" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "장치 '%s'에 활성화된 연결이 없습니다" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "활성화된 연결이나 장치가 없습니다" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "장치 '%s'는 연걸 '%s'와 호환되지 않습니다" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "연결 '%s'에 대한 장치를 찾을 수 없습니다" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "활성화중" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "활성화됨" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "알 수 없음" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 연결 중 (준비)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 연결 중 (인증 필요)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 연결 중" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 연결 중 (IP 설정 얻는 중)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN 연결 됨" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 연결 실패" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN 연결 끊겼음" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "알 수 없는 이유" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "없음" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "사용자 연결이 끊어졌습니다" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "기반 네트워크 연결이 중지되었습니다" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 서비스가 예기치 못하게 중단되었습니다" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 서비스가 잘못된 설정을 반환했습니다" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "연결 시도가 시간을 초과했습니다" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 서비스가 제 시간에 시작되지 않았습니다" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 서비스를 시작하는 데 실패했습니다" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "옳바른 VPN 비밀 정보가 없습니다" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "잘못된 VPN 비밀정보" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "연결이 제거되었습니다" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "상태: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "연결이 활성화되었습니다\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "오류: 연결 활성화가 실패했습니다." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "상태: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "오류: 연결 활성화가 실패했습니다: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "오류: 제한시간 %d초를 초과했습니다." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "오류: 연결 활성화가 실패했습니다: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "오류: '%s'에 대한 활성화된 연결을 얻는 데 실패했습니다." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "활성화된 연결 상태: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "활성화된 연결 경로: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "오류: 알려지지 않은 연결: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "오류: 시간 제한 값 '%s'가 올바르지 않습니다." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "오류: id나 uuid를 지정해야만 합니다." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "오류: 적절한 장치를 찾을 수 없습니다: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "오류: 적절한 장치를 찾을 수 없습니다." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "경고: 연결이 활성화되어 있지 않습니다\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "오류: 'con' 명령 '%s'는 바른 명령이 아닙니다." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "오류: D-버스에 연결할 수 없습니다." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "오류: 시스템 설정을 얻을 수 없습니다." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "오류: 사용자 설정을 얻을 수 없습니다." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "오류: 연결을 얻을 수 없습니다: 설정 서비스가 실행중이지 않습니다." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "장치" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "상태" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "일반" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "기능" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-특성" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "유선 상태" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 설정" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4 DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "드라이버" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "하드웨어주소" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "캐리어 감지" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "속도" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "캐리어" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "주소" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "접두사" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "게이트웨이" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "모드" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "주파수" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "전송률" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "신호" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "보안" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA 플래그" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN 플래그" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "활성" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"사용법: nmcli dev { 명령어 | help }\n" +"\n" +" 명령어 := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface <인터페이스>]\n" +" disconnect iface <인터페이스> [--nowait] [--timeout <타임아웃시간>]\n" +" wifi [list [iface <인터페이스>] | hwaddr <하드웨어주소>]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "관리되지 않음" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "사용할 수 없음" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "연결 끊겼음" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "연결 중 (준비)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "연결 중 (설정중)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "연결 중 (인증 필요)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "연결 중 (IP 설정 가져오는 중)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "연결됨" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "연결 실패함" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "알 수 없음" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(없음)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 주소 0x%X를 변환하는 중 오류가 있습니다" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "암호화됨: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "기업용 WPA " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "애드혹" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "인프라스트럭쳐" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "오류: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "오류: 'dev list': %s; 허용된 필드: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "장치 상세정보" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(알 수 없음)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "알 수 없음)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "켜짐" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "꺼짐" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "오류: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "오류: 'dev status': %s; 허용되는 필드: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "장치 상태" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "오류: '%s' 인자가 없습니다." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "오류: 장치 '%s'를 찾을 수 없습니다." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "성공: 장치 '%s'가 성공적으로 연결 해제되었습니다." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "오류: 장치 '%s' (%s)의 연결 해제가 실패했습니다: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "장치 상태: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "오류: iface를 지정해야만 합니다." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "오류 'dev wifi': '%s'" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "오류: 'dev wifi': %s; 허용되는 필드: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "검색된 WiFi 목록" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "오류: 하드웨어주소가 '%s'인 억세스 포인트를 찾을 수 없습니다." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "오류: 장치 '%s'는 WiFi 장치가 아닙니다." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "오류 'dev wifi' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "오류: 'dev' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "실행중" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI 하드웨어" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN 하드웨어" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"사용법: nmcli nm { 명령어 | help }\n" +"\n" +" 명령어 := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "잠듦" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "연결" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "오류: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "오류: 'nm status': %s; 허용되는 필드: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "네트워크 관리자 상태" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "사용" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "미사용" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "실행 중" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "실행 중이 아님" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "오류: '--fields' 값 '%s'은 올바르지 않습니다; 허용되는 필드: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi 사용중" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "오류: 잘못된 'wifi' 매개변수: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN 사용중" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "오류: 잘못된 'wwan' 매개변수: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "오류: 'mn' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"사용법: %s [옵션] 대상 { 명령어 | help }\n" +"\n" +"옵션\n" +" -t[erse] 간략한 출력\n" +" -p[retty] 보기좋은 출력\n" +" -m[ode] tabular|multiline 출력 모드 " +" -f[ields] <필드1,필드2,...>|all|common 출력 필드 지정\n" +" -e[scape] yes|no 값에서 컬럼 구분자를 이스케이프\n" +" -v[ersion] 프로그램 버전 정보 보여주기\n" +" -h[elp] 이 도움말 보여주기\n" +"\n" +"대상\n" +" nm 네트워크 관리자 상태\n" +" con 네트워크 관리자 연결\n" +" dev 네트워크 관리자가 관리하는 장치\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "대상 '%s'가 알려져 있지 않습니다. 'nmcli help'를 해 보십시오." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "오류: 옵션 '--terse'가 두번째로 설정되었습니다." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "오류: 옵션 '--terse'를 '--pretty'와 함께 사용할 수 없습니다." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "오류: 옵션 '--pretty'가 두번째로 설정되었습니다." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "오류: 옵션 '--pretty'를 '--terse'와 함께 사용할 수 없습니다." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "오류: '%s' 옵션에 인자가 없습니다." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "오류: '%s'는 올바른 인자가 아닙니다('%s' 옵션에 사용됨)." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "오류: '%s'옵션에 대해 필드가 없습니다." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 도구, 버전 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "오류: 옵션 '%s'는 알려져 있지 않습니다. 'nmcli -help'를 해 보십시오." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "시그널 %d를 받았습니다. 종료합니다..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "오류: NetworkManager에 연결할 수 없습니다." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "성공" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (16진 아시키 열쇠글)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-비트 열쇠글)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (알 수 없음)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (알 수 없음)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "아무, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "자동" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "설정 안됨" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "필드 '%s'는 혼자만 있어야만 합니다" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "잘못된 필드 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "옵션 '--terse'는 '--fields' 설정을 요구합니다" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "옵션 '--terse'는 '%s'가 아닌 구체적인 '--fields' 값을 요구합니다" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 키 파일에 끝 태그 '%s'가 없습니다." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM 비밀 키 파일처럼 보이지 않습니다." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM 파일 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "잘못된 형태의 PEM 파일: Proc-Type이 첫번째 태그가 아닙니다." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "잘못된 형태의 PEM 파일: 알려져 있지 않은 Proc-Type 태그 '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "잘못된 형태의 PEM 파일: DEK-Info가 두번째 태그가 아님." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "잘못된 형태의 PEM 파일: IV를 DEK-Info 태그에서 찾을 수 없음." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "잘못된 형태의 PEM 파일: DEK-Info 태그안에 잘못된 형태의 IV가 있음." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "잘못된 형태의 PEM 파일: 알려져 있지 않은 비밀 키 암호화 방법 '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "비밀 키를 해독할 수 없습니다." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 인증서 '%s'에 끝 태그 '%s'가 없습니다." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "인증서 해독에 실패했습니다." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "인증서 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "파일 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV의 길이는 짝수여야만 합니다." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV에 16진수 숫자가 아닌 문자가 있습니다." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "비밀 키 암호화 방식 '%s'가 알려져 있지 않습니다." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "비밀 키를 해독할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "비밀 키 유형을 결정할 수 없습니다." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "해독된 비밀 키를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "암호화 엔진을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 엔진을 초기화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "잘못된 IV 길이 (최소한 %zd바이트 이상이어야 함)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "해독된 키 버퍼를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "암호 해독 문맥을 초기화하는 데 실패했습니다: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "해독을 위한 대칭 키를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "해독을 위해 IV를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "비밀 키를 해독하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "비밀 키를 해독하는 데 실패했습니다: 예기치 못한 패딩 길이." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "비밀 키를 해독하는 데 실패했습니다." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "암호화를 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "암호화 문맥을 초기화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "암호화를 위한 대칭키를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "암호화를 위한 IV를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "데이터를 암호화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "인증서 정보를 초기화하는 중 오류가 발생했습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "인증서를 해독할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 복호기를 초기화할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 파일을 해독할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 파일을 검증할 수 없습니다: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "암호화 엔진을 초기화하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 문맥을 초기화하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "잘못된 IV 길이입니다(최소한 %d 이상이어야 함)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "해독용 암호 슬롯을 할당하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "해독을 위한 대칭키를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "해독을 위한 IV를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "해독 문맥을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "비밀 키를 해독하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "비밀 키를 해독하는 데 실패했습니다: 해독 데이터가 너무 큽니다." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "비밀 키의 해독을 마무리하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "암호화 암호 슬롯을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "암호화를 위한 대칭키를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "암호화를 위한 IV를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "암호화 문맥을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "암호화에 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "암호화 후 데이터 크기가 예상과 다릅니다." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "인증서를 복호화할 수 없습니다: %d." + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "암호를 UCS2로 변환할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 복호기를 초기화할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 파일을 복호화할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 파일을 검증할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "랜덤 데이터를 생성할 수 없습니다." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "암호화 키를 생성할 메모리가 부족합니다." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM 파일 생성을 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV를 PEM 파일에 쓰기 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "암호화된 키를 PEM 파일에 기록하기 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM 파일 데이터를 위한 메모리를 할당할 수 없습니다." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "넷링크 메시지를 처리하는 중 오류: %s" -#: ../src/nm-netlink-monitor.c:245 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "유선 이더넷 장치를 감시하는 넷링크 소켓을 만들 수 없습니다: %s" - -#: ../src/nm-netlink-monitor.c:255 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "유선 이더넷 장치를 감시하는 넷링크 소켓에 연결할 수 없습니다: %s" - -#: ../src/nm-netlink-monitor.c:263 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "유선 이더넷 장치를 감시하는 넷링크 그룹에 조인할 수 없습니다: %s" - -#: ../src/nm-netlink-monitor.c:271 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "유선 이더넷 장치를 감시하는 넷링크 링크 캐시를 만들 수 없습니다: %s" - -#: ../src/nm-netlink-monitor.c:471 +#: ../src/nm-netlink-monitor.c:214 msgid "error occurred while waiting for data on socket" msgstr "소켓에서 데이터를 기다리는 동안 오류가 발생했습니다" -#: ../src/NetworkManager.c:255 +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크에 연결할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "넷링크 핸들을 통한 암호정보 전달을 사용 할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크 핸들을 할당 할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크 링크 캐시를 만들 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "넷링크 그룹에 합류할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "넷링크 캐시를 갱신하는 중 오류가 발생했습니다: %s" + +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "잘못된 옵션. 올바른 옵션의 목록을 보려면 --help 옵션을 이용하십시오.\n" -msgid "Passphrase for wireless network %s" -msgstr "무선 네트워크 %s의 열쇠글" +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. 올바른 옵션의 목록을 보려면 --help 옵션을 이용하십시오.\n" -msgid "Connection to the wireless network '%s' failed." -msgstr "무선 네트워크 '%s'(으)로 연결 실패." - -msgid "Connection to the wired network failed." -msgstr "유선 네트워크 연결 실패." - -msgid "Error displaying connection information:" -msgstr "연결 정보 보이기 오류:" - -msgid "Could not find some required resources (the glade file)!" -msgstr "필요한 몇몇 파일(glade 파일)을 찾을 수 없습니다!" - -msgid "No active connections!" -msgstr "활성된 연결 없음!" - -msgid "%d Mb/s" -msgstr "%d Mb/s" - -msgid "Wired Ethernet (%s)" -msgstr "유선 이더넷 (%s)" - -msgid "Wireless Ethernet (%s)" -msgstr "무선 이더넷 (%s)" - -msgid "Unknown" -msgstr "알 수 없음" - -msgid "NetworkManager Applet" -msgstr "네트워크 관리자 애플릿" +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager가 생성함\n" +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format msgid "" -"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 "네트워크 장치와 연결을 관리하는 애플릿." - -msgid "translator-credits" -msgstr "차영호 , 2006" - -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 로그인 실패" - -msgid "Could not start the VPN connection '%s' due to a login failure." -msgstr "로그인을 실패해서 VPN 연결 '%s'(을)를 시작할 수 없습니다." - -msgid "VPN Start Failure" -msgstr "VPN 시작 실패" - -msgid "" -"Could not start the VPN connection '%s' due to a failure launching the VPN " -"program." -msgstr "VPN프로그램 실행을 실패해서 VPN 연결 '%s'(을)를 시작할 수 없습니다." - -msgid "VPN Connect Failure" -msgstr "VPN 연결 실패" - -msgid "Could not start the VPN connection '%s' due to a connection error." -msgstr "연결에 오류가 있어서 VPN 연결 '%s'(을)를 시작할 수 없습니다." - -msgid "VPN Configuration Error" -msgstr "VPN 설정 오류" - -msgid "The VPN connection '%s' was not correctly configured." -msgstr "VPN 연결 '%s'의 설정이 올바르지 않습니다." - -msgid "" -"Could not start the VPN connection '%s' because the VPN server did not " -"return an adequate network configuration." -msgstr "" -"VPN서버가 알맞는 네트워크 설정을 돌려주지 않아서 VPN 연결 '%s'(을)를 시작할 " -"수 없습니다." - -msgid "VPN Login Message" -msgstr "VPN 로그인 메세지" - -msgid "" -"The NetworkManager Applet could not find some required resources (the glade " -"file was not found)." -msgstr "" -"네트워크 관리자 애플릿이 필요한 몇몇 파일을 찾을 수 없습니다. (glade 파일을 " -"찾을 수 없습니다)." - -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "네트워크 장치 \"%s (%s)\"(이)가 무선랜 검색을 지원하지 않습니다." - -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "네트워크 장치 \"%s (%s)\"(이)가 연결 감지를 지원하지 않습니다." - -msgid "(unknown)" -msgstr "(알 수 없음)" - -msgid "Preparing device %s for the wired network..." -msgstr "유선 네트워크의 장치 %s 준비중..." - -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "무선 네트워크 '%2$s'의 장치 %1$s 준비중..." - -msgid "Configuring device %s for the wired network..." -msgstr "유선 네트워크의 장치 %s 설정중..." - -msgid "Attempting to join the wireless network '%s'..." -msgstr "무선 네트워크 '%s'에 참여 준비중..." - -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "무선 네트워크 '%s'의 네트워크 키 기다리는 중..." - -msgid "Requesting a network address from the wired network..." -msgstr "유선 네트워크에서 네트워크 주소 요청중..." - -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "무선 네트워크 '%s'에서 네트워크 주소 요청중..." - -msgid "Finishing connection to the wired network..." -msgstr "유선 네트워크 연결 끝내는 중..." - -msgid "Finishing connection to the wireless network '%s'..." -msgstr "무선 네트워크 '%s' 연결 끝내는 중..." - -msgid "NetworkManager is not running" -msgstr "네트워크 관리자가 실행 중이지 않습니다" - -msgid "Networking disabled" -msgstr "네트워크를 사용할 수 없습니다" - -msgid "No network connection" -msgstr "네트워크 연결 없음" - -msgid "Wired network connection" -msgstr "유선 네트워크 연결" - -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Ad-Hoc 무선 네트워크 연결됨" - -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "'%s'(으)로 무선 네트워크 연결 (%d%%)" - -msgid "VPN connection to '%s'" -msgstr "'%s'(으)로 VPN 연결" - -msgid "VPN connecting to '%s'" -msgstr "'%s'(으)로 VPN 연결중" - -msgid "_Connect to Other Wireless Network..." -msgstr "다른 무선 네트워크에 연결(_C)..." - -msgid "Create _New Wireless Network..." -msgstr "새 무선 네트워크 만들기(_N)..." - -msgid "_VPN Connections" -msgstr "VPN 연결(_V)" - -msgid "_Configure VPN..." -msgstr "VPN 설정하기(_C)..." - -msgid "_Disconnect VPN..." -msgstr "VPN 연결 끊기(_D)..." - -msgid "_Dial Up Connections" -msgstr "전화 연결(_D)" - -msgid "Connect to %s..." -msgstr "%s(으)로 연결..." - -msgid "Disconnect from %s..." -msgstr "%s에서 연결 끊기..." - -msgid "No network devices have been found" -msgstr "네트워크 장치를 찾을 수 없습니다" - -msgid "NetworkManager is not running..." -msgstr "네트워크 관리자가 실행중이지 않습니다..." - -msgid "Enable _Networking" -msgstr "네트워크 사용(_N)" - -msgid "Enable _Wireless" -msgstr "무선 네트워크 사용(_W)" - -msgid "Connection _Information" -msgstr "연결 정보(_I)" - -msgid "_Help" -msgstr "도움말(_H)" - -msgid "_About" -msgstr "정보(_A)" - -msgid "" -"The NetworkManager applet could not find some required resources. It cannot " -"continue.\n" -msgstr "" -"네트워크 관리자 애플릿이 필요한 몇몇 파일을 찾을 수 없습니다. 계속할 수 없습" -"니다.\n" - -msgid "Open System" -msgstr "열린 시스템" - -msgid "Shared Key" -msgstr "공유 키" - -msgid "Automatic (Default)" -msgstr "자동 (기본값)" - -msgid "AES-CCMP" -msgstr "AES-CCMP" - -msgid "TKIP" -msgstr "TKIP" - -msgid "Dynamic WEP" -msgstr "동적 WEP" - -msgid "None" -msgstr "없음" - -msgid "WEP 64/128-bit ASCII" -msgstr "WEP 40/128비트 ASCII" - -msgid "WEP 64/128-bit Hex" -msgstr "WEP 40/128비트 16진수" - -msgid "WEP 128-bit Passphrase" -msgstr "WEP 128비트 열쇠글" - -msgid "PEAP" -msgstr "PEAP" - -msgid "TLS" -msgstr "TLS" - -msgid "TTLS" -msgstr "TTLS" - -msgid "WPA2 Enterprise" -msgstr "기업용 WPA2" - -msgid "WPA Enterprise" -msgstr "기업용 WPA" - -msgid "WPA2 Personal" -msgstr "개인용 WPA2" - -msgid "WPA Personal" -msgstr "개인용 WPA" - -msgid "Orientation" -msgstr "방향" - -msgid "The orientation of the tray." -msgstr "트레이의 방향." - -msgid "Wired Network (%s)" -msgstr "유선 네트워크 (%s)" - -msgid "_Wired Network" -msgstr "유선 네트워크(_W)" - -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "무선 네트워크 (%s)" - -msgid "Wireless Network" -msgid_plural "Wireless Networks" -msgstr[0] "무선 네트워크" - -msgid " (invalid Unicode)" -msgstr " (잘못된 유니코드)" - -msgid "" -"By default, the wireless network's name is set to your computer's name, %s, " -"with no encryption enabled" -msgstr "" -"기본값으로 무선 네트워크의 이름은 컴퓨터의 이름 %s(으)로 설정되고 암호화가 설" -"정되지 않습니다" - -msgid "Create new wireless network" -msgstr "새 무선 네트워크 만들기" - -msgid "" -"Enter the name and security settings of the wireless network you wish to " -"create." -msgstr "만드려는 무선 네트워크의 이름과 보안 설정을 입력하십시오." - -msgid "Create New Wireless Network" -msgstr "새 무선 네트워크 만들기" - -msgid "Existing wireless network" -msgstr "있는 무선 네트워크" - -msgid "Enter the name of the wireless network to which you wish to connect." -msgstr "연결하려는 무선 네트워크의 이름을 입력하십시오." - -msgid "Connect to Other Wireless Network" -msgstr "다른 무선 네트워크에 연결" - -msgid "Error connecting to wireless network" -msgstr "무선 네트워크 연결 오류" - -msgid "" -"The requested wireless network requires security capabilities unsupported by " -"your hardware." -msgstr "무선 네트워크에서 하드웨어가 지원하지 않는 보안 기능을 필요로 합니다." - -msgid "Cannot start VPN connection '%s'" -msgstr "VPN 연결 '%s'(을)를 시작할 수 없습니다" - -msgid "" -"Could not find the authentication dialog for VPN connection type '%s'. " -"Contact your system administrator." -msgstr "" -"VPN 연결 형식 '%s'의 인증 대화상자를 찾을 수 없습니다.시스템 관리자에게 알려" -"주십시오." - -msgid "" -"There was a problem launching the authentication dialog for VPN connection " -"type '%s'. Contact your system administrator." -msgstr "" -"VPN 연결 형식 '%s'의 인증 대화상자를 시작하는데 문제가 생겼습니다.시스템 관리" -"자에게 알려주십시오." - -msgid " " -msgstr " " - -msgid "" -"Active Connection Information" -msgstr "활성화 된 연결 정보" - -msgid "" -"Passphrase Required by Wireless " -"Network\n" +"# Merged from %s\n" "\n" -"A passphrase or encryption key is required to access the wireless network '%" -"s'." msgstr "" -"열쇠글을 필요로 하는 무선 네트워크\n" +"# %s에서 병합됨\n" "\n" -"무선 네트워크 '%s'에 연결하려면 열쇠글이나 암호키가 있어야 합니다." -msgid "" -"Reduced Network Functionality\n" -"\n" -"%s It will not be completely functional." -msgstr "" -" 줄어든 네트워크 기능\n" -"\n" -"%s 모든 기능을 쓸 수 없습니다." - -msgid "" -"Wireless Network Login Confirmation\n" -"\n" -"You have chosen to log in to the wireless network '%s'. If you are sure " -"that this wireless network is secure, click the checkbox below and " -"NetworkManager will not require confirmation on subsequent log ins." -msgstr "" -"무선 네트워크 로그인 확인\n" -"\n" -"무선 네트워크 '%s'에 로그인을 선택했습니다. 무선 네트워크가 안전하다고생각되" -"면, 아래의 확인 상자를 눌러서 네트워크 매니져가 로그인 이후에확인을 하지 않도" -"록 하십시오." - -msgid "Anonymous Identity:" -msgstr "아무개 ID:" - -msgid "Authentication:" -msgstr "인증:" - -msgid "Broadcast Address:" -msgstr "Broadcast 주소:" - -msgid "CA Certificate File:" -msgstr "CA 인증서 파일:" - -msgid "C_onnect" -msgstr "연결(_O)" - -msgid "Client Certificate File:" -msgstr "클라이언트 인증서 파일:" - -msgid "Connection Information" -msgstr "연결 정보" - -msgid "Default Route:" -msgstr "기본 Route:" - -msgid "Destination Address:" -msgstr "목표 주소:" - -msgid "Driver:" -msgstr "드라이버:" - -msgid "EAP Method:" -msgstr "EAP 방식:" - -msgid "Hardware Address:" -msgstr "하드웨어 주소:" - -msgid "IP Address:" -msgstr "IP 주소:" - -msgid "Identity:" -msgstr "ID:" - -msgid "Interface:" -msgstr "인터페이스:" - -msgid "Key Type:" -msgstr "키 형식:" - -msgid "Key management:" -msgstr "키 관리:" - -msgid "Key:" -msgstr "키:" - -msgid "" -"None\n" -"WEP 128-bit Passphrase\n" -"WEP 64/128-bit Hex\n" -"WEP 64/128-bit ASCII\n" -msgstr "" -"없음\n" -"WEP 128비트 열쇠글\n" -"WEP 64/128비트 16진수\n" -"WEP 64/128비트 ASCII\n" - -msgid "" -"Open System\n" -"Shared Key" -msgstr "" -"열린 시스템\n" -"공유 키" - -msgid "Other Wireless Network..." -msgstr "다른 무선 네트워크..." - -msgid "Passphrase:" -msgstr "열쇠글:" - -msgid "Password:" -msgstr "열쇠글:" - -msgid "Primary DNS:" -msgstr "기본 DNS:" - -msgid "Private Key File:" -msgstr "개인키 파일:" - -msgid "Private Key Password:" -msgstr "개인키 열쇠글:" - -msgid "Secondary DNS:" -msgstr "보조 DNS:" - -msgid "Select the CA Certificate File" -msgstr "CA 인증서 파일을 선택하십시오" - -msgid "Select the Client Certificate File" -msgstr "클라이언트 인증서 파일을 선택하십시오" - -msgid "Select the Private Key File" -msgstr "개인키 파일을 선택하십시오" - -msgid "Show key" -msgstr "키 보이기" - -msgid "Show passphrase" -msgstr "열쇠글 보이기" - -msgid "Show password" -msgstr "열쇠글 보이기" - -msgid "Show passwords" -msgstr "열쇠글 보이기" - -msgid "Speed:" -msgstr "속도:" - -msgid "Subnet Mask:" -msgstr "서브넷 마스크:" - -msgid "Type:" -msgstr "형식:" - -msgid "User Name:" -msgstr "사용자 이름:" - -msgid "Wireless Network Key Required" -msgstr "무선 네트워크 키가 필요합니다" - -msgid "Wireless _adapter:" -msgstr "무선 아답터(_A):" - -msgid "_Always Trust this Wireless Network" -msgstr "이 무선 네트워크 항상 신뢰(_A)" - -msgid "_Don't remind me again" -msgstr "다시 묻지 않음(_D)" - -msgid "_Login to Network" -msgstr "네트워크에 로그인(_L)" - -msgid "_Network Name:" -msgstr "네트워크 이름(_N):" - -msgid "_Wireless Security:" -msgstr "무선 보안(_W):" - -msgid "Cannot add VPN connection" -msgstr "VPN 연결에 더할 수 없음" - -msgid "" -"No suitable VPN software was found on your system. Contact your system " -"administrator." -msgstr "" -"시스템에 알맞는 VPN 소프트웨어가 없습니다. 시스템 관리자에게 알리기 바립니다." - -msgid "Cannot import VPN connection" -msgstr "VPN 연결 가져올 수 없음" - -msgid "" -"Cannot find suitable software for VPN connection type '%s' to import the " -"file '%s'. Contact your system administrator." -msgstr "" -"파일 '%2$s'에서 VPN 연결 형식 '%1$s'(을)를 가져올 수 있는 적당한 소프트웨어" -"가 없습니다. 시스템 관리자에게 알리기 바랍니다." - -msgid "Error retrieving VPN connection '%s'" -msgstr "VPN 연결 '%s' 얻는데 오류" - -msgid "" -"Could not find the UI files for VPN connection type '%s'. Contact your " -"system administrator." -msgstr "" -"VPN 연결 형식 '%s'에 대한 UI 파일을 찾을 수 없습니다. 시스템 관리자에게 알리" -"기 바랍니다." - -msgid "Delete VPN connection \"%s\"?" -msgstr "VPN 연결 \"%s\"(을)를 지우겠습니까?" - -msgid "" -"All information about the VPN connection \"%s\" will be lost and you may " -"need your system administrator to provide information to create a new " -"connection." -msgstr "" -"VPN 연결 \"%s\"에 대한 모든 정보를 버립니다. 그리고 시스템 관리자에게 새 연결" -"에 대한 정보를 다시 얻어야 합니다." - -msgid "Unable to load" -msgstr "읽을 수 없음" - -msgid "Cannot find some needed resources (the glade file)!" -msgstr "필요한 몇몇 파일(glade 파일)을 찾을 수 없습니다!" - -msgid "Create VPN Connection" -msgstr "VPN 연결 만들기" - -msgid "Edit VPN Connection" -msgstr "VPN 연결 편집" - -msgid "Add a new VPN connection" -msgstr "VPN 연결 더하기" - -msgid "Delete the selected VPN connection" -msgstr "선택한 VPN 연결 지우기" - -msgid "E_xport" -msgstr "내보내기(_X)" - -msgid "Edit the selected VPN connection" -msgstr "선택한 VPN 연결을 고칩니다" - -msgid "Export the VPN settings to a file" -msgstr "VPN 설정을 파일로 저장합니다" - -msgid "Export the selected VPN connection to a file" -msgstr "선택한 VPN 연경을 파일로 저장합니다" - -msgid "Manage Virtual Private Network Connections" -msgstr "가상 사설 네트워크 연결 관리" - -msgid "VPN Connections" -msgstr "VPN 연결" - -msgid "40-bit WEP" -msgstr "40비트 WEP" - -msgid "104-bit WEP" -msgstr "104비트 WEP" - -msgid "WPA TKIP" -msgstr "WPA TKIP" - -msgid "WPA CCMP" -msgstr "WAP CCMP" - -msgid "WPA Automatic" -msgstr "WPA 자동" - -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" - -msgid "WPA2 CCMP" -msgstr "WAP2 CCMP" - -msgid "WPA2 Automatic" -msgstr "WPA2 자동" - -msgid "none" -msgstr "없음" - -msgid "operation took too long" -msgstr "동작이 너무 오래 걸립니다" - -msgid "received data from wrong type of sender" -msgstr "잘못된 형식의 전송자에게 받은 데이터" - -msgid "received data from unexpected sender" -msgstr "예상하지 않은 전송자에게 받은 데이터" - -msgid "too much data was sent over socket and some of it was lost" -msgstr "너무 많은 데이터가 보내졌고 일부는 잃어버렸습니다" - -msgid "You are now connected to the Ad-Hoc wireless network '%s'." -msgstr "Ad-Hoc 무선 네트워크 '%s'에 연결되었습니다." - -msgid "You are now connected to the wireless network '%s'." -msgstr "무선 네트워크 '%s'에 연결되었습니다." - -msgid "You are now connected to the wired network." -msgstr "유선 네트워크에 연결되었습니다." - -msgid "Connection Established" -msgstr "연결됨" - -msgid "Disconnected" -msgstr "연결 끊겼음" - -msgid "The network connection has been disconnected." -msgstr "네트워크 연결이 끊겼습니다." - -msgid "LEAP" -msgstr "LEAP" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "사용 가능한 DHCP 클라이언트를 찾을 수 없습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient'를 찾을 수 없습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd'를 찾을 수 있습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "지원하지 않는 DHCP 클라이언트 '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "알려지지 않은 로그 수준 '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "알려지지 않은 로그 영역 '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "주의: libc 주소 검색은 3개를 초과하는 네임서버를 지원하지 않을 수 있습니다." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "아래 열거된 네임서버를 인식하지 못할 수 있습니다." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "자동 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "시스템" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "보호된 WiFi 네트워크를 통한 연결 공유" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "열린 WiFi 네트워크를 통한 연결 공유" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "영구적인 시스템 호스트명을 변경합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "시스템 연결을 변경합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "시스템 정책이 시스템 설정을 변경하는 것을 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "시스템 정책이 호스트 이름을 영구히 변경하는 것을 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "시스템 정책이 보호된 WiFi 네트워크를 통한 연결 공유를 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "시스템 정책이 열린 WiFi 네트워크를 통한 연결 공유를 금지합니다" From 5c02ef2c340e94669798fad0478091c6a45add25 Mon Sep 17 00:00:00 2001 From: "li.org en team" Date: Thu, 13 May 2010 12:42:15 -0700 Subject: [PATCH 381/392] po: updated Malayalam translation (rh #589230) --- po/ml.po | 1323 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 820 insertions(+), 503 deletions(-) diff --git a/po/ml.po b/po/ml.po index d5728eafe3..6c1e92f7ce 100644 --- a/po/ml.po +++ b/po/ml.po @@ -1,3 +1,4 @@ +# translation of ml.po to # translation of NetworkManager.master_upstream.ml.po to # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. @@ -5,18 +6,87 @@ # msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master_upstream.ml\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-03-23 03:25+0000\n" -"PO-Revision-Date: 2010-03-23 17:04+0530\n" -"Last-Translator: Ani Peter | അനി പീറ്റര്‍\n" -"Language-Team: Swathantra Malayalam Computing | സ്വതന്ത്ര മലയാളം കമ്പ്യൂട്ടിങ് \n" +"Project-Id-Version: ml\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 15:31+0530\n" +"Last-Translator: \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -37,310 +107,514 @@ msgstr "" "]\n" " down id | uuid \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 "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "പേരു്" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "സിസ്റ്റം കണക്ഷനുകള്‍:\n" +msgid "Error: 'con list': %s" +msgstr "പിശക്: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "പിശക്: 'con list': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" -#: ../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:207 +msgid "Connection details" +msgstr "കണക്ഷന്‍ വിശദാംശങ്ങള്‍" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "സിസ്റ്റം" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ഉപയോക്താവു്" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ഒരിക്കലുമില്ല" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ഉവ്വു്" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ഇല്ല" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "സിസ്റ്റം കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "പിശക്: %s ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "പിശക്: %s - ഇത്തരം കണക്ഷന്‍ ലഭ്യമല്ല." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "സിസ്റ്റത്തിലുള്ള കണക്ഷനുകള്‍" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍" - -#: ../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:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "അപരിചിതമായ പരാമീറ്റര്‍: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, 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:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "പിശക്: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "ഇല്ല" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "പിശക്: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "പിശക്: 'con status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "സജീവമായ കണക്ഷനുകള്‍" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "സ്വതവേയുള്ള" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "സര്‍വീസ്" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "ഡിവൈസുകള്‍" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "ഡിവൈസ് '%s'-ല്‍ സജീവമായ കണക്ഷന്‍ ലഭ്യമല്ല" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "സജീവമായ കണക്ഷന്‍ അല്ലെങ്കില്‍ ഡിവൈസ് ലഭ്യമല്ല" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ഡിവൈസ് '%s' കണക്ഷനുമായി പൊരുത്തപ്പെടുന്നില്ല" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ഡിവൈസ് '%s'-ല്‍ സജീവമായ കണക്ഷന്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "സജീവമാക്കുന്നു" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "സജീവമാക്കിയിരിക്കുന്നു" -#: ../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:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "അപരിചിതം" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (തയ്യാറാകുക)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "വിപിഎന്‍ കണക്ട് ചെയ്തിരിക്കുന്നു" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "വിപിഎന്‍ കണക്ഷന്‍ പരാജയപ്പെട്ടു" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "വിപിഎന്‍ വിഛേദിച്ചിരിക്കുന്നു" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "അപരിചിതമായ കാരണം" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "ഒന്നുമില്ല" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "ഉപയോക്താവു് വിഛേദിച്ചിരിക്കുന്നു" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "അടിസ്ഥാന നെറ്റ്‌വര്‍ക്ക് കണക്ഷന്‍ തടസ്സപ്പെടുത്തിയിരിക്കുന്നു" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "വിപിഎന്‍ സര്‍വീസ് അപ്രതീക്ഷിതമായി നിര്‍ത്തിയിരിക്കുന്നു" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "വിപിഎന്‍ സര്‍വീസ് തെറ്റായ ക്രമീകരണം തിരികെ നല്‍കിയിരിക്കുന്നു" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "കണക്ഷനുള്ള ശ്രമം കഴിഞ്ഞിരിക്കുന്നു" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "വിപിഎന്‍ സര്‍വീസ് സമയത്തിനു് ആരംഭിച്ചില്ല" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "വിപിഎന്‍ സര്‍വീസ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "ശരിയായ വിപിഎന്‍ രഹസ്യങ്ങള്‍ ലഭ്യമല്ല" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "തെറ്റായ വിപിഎന്‍ രഹസ്യങ്ങള്‍" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "കണക്ഷന്‍ നീക്കം ചെയ്തിരിക്കുന്നു" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "അവസ്ഥ: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "കണക്ഷന്‍ സജീവമാക്കിയിരിക്കുന്നു\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "അവസ്ഥ: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "പിശക്: സമയപരിധി %d നിമിഷത്തിന്റെ കാലാവധി കഴിഞ്ഞിരിക്കുന്നു." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "പിശക്: '%s'-നുള്ള സജീവമായ കണക്ഷന്‍ ലഭ്യമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "സജീവമായ കണക്ഷന്റെ അവസ്ഥ: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "സജീവമായ കണക്ഷന്‍ പാഥ്: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "പിശക്: അപരിചിതമായ കണക്ഷന്‍: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "പിശഖ്: സമയപരിധിയുടെ മൂല്ല്യം '%s' തെറ്റാണു്." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "പിശക്: id അല്ലെങ്കില്‍ uuid വ്യക്തമാക്കേണ്ടതുണ്ടു്." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "മുന്നറിയിപ്പു്: കണക്ഷന്‍ സജീവമല്ല\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "പിശക്: 'con' കമാന്‍ഡ് '%s' ശരിയല്ല." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "പിശക്: D-Bus-ലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "പിശക്: സിസ്റ്റം സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കവാന്‍ സാധ്യമായില്ല." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "പിശക്: ഉപയോക്താവിനുള്ള സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമായില്ല." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "പിശക്: കണക്ഷനുകള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമല്ല: സജ്ജീകരണങ്ങള്‍ക്കുള്ള സര്‍വീസുകള്‍ പ്രവര്‍ത്തിക്കുന്നില്ല." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -350,359 +624,246 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" -"ഉപയോഗിക്കേണ്ട വിധം: nmcli dev { COMMAND | help }\n" +"Usage: nmcli dev { COMMAND | help }\n" "\n" " COMMAND := { status | list | disconnect | wifi }\n" "\n" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "കൈകാര്യം ചെയ്തിട്ടില്ലാത്തതു്" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "ലഭ്യമല്ലാത്തതു്" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "വിഛേദിച്ചിരിക്കുന്നു" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "കണക്ട് ചെയ്യുന്നു (തയ്യാറാക്കുക)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "കണക്ട് ചെയ്യുന്നു (ക്രമീകരിക്കുന്നു)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "കണക്ട് ചെയ്തിരിക്കുന്നു" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "കണക്ഷന്‍ പരാജയപ്പെട്ടു" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "അപരിചിതം" -#. 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:277 msgid "(none)" msgstr "(ഒന്നുമില്ല)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s:IP4 വിലാസം 0x%X വേര്‍തിരിക്കുന്നതില്‍ പിശക്" -#: ../cli/src/devices.c:238 -#, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, Freq %d MHz, Rate %d Mb/s, അളവു് %d" - -#: ../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 " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" - -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr "എന്റര്‍പ്രൈസ്" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "ഡിവൈസ്" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ഡ്രൈവര്‍" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(അപരിചിതം)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "അവസ്ഥ" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW വിലാസം" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" വിശേഷതകള്‍:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "കാരിയര്‍ ഡിറ്റെക്ട്" - -#: ../cli/src/devices.c:336 -#, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "വേഗത" - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" വയര്‍ലെസ്സ് വിശേഷതകള്‍\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP എന്‍ക്രിപ്ഷന്‍" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA എന്‍ക്രിപ്ഷന്‍" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 എന്‍ക്രിപ്ഷന്‍" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP സിഫര്‍" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP സിഫര്‍" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" വയര്‍ലെസ്സ് ആക്സെസ്സ് പോയിന്റുകള്‍ %s\n" - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = current AP)" - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" വയര്‍ഡ് വിശേഷതകള്‍\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "കാരിയര്‍" - -#: ../cli/src/devices.c:377 -msgid "on" -msgstr "ഓണ്‍" - -#: ../cli/src/devices.c:379 -msgid "off" -msgstr "ഓഫ്" - -#: ../cli/src/devices.c:387 -#, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 സജ്ജീകരണങ്ങള്‍:\n" - -#: ../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 "DNS" - -#: ../cli/src/devices.c:458 -msgid "Status of devices" -msgstr "ഡിവൈസുകളുടെ അവസ്ഥ" - -#: ../cli/src/devices.c:487 -#, c-format -msgid "Error: '%s' argument is missing." -msgstr "പിശക്: '%s' ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." - -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 -#, c-format -msgid "Error: Device '%s' not found." -msgstr "പിശക്: ഡിവൈസ് '%s' ലഭ്യമായില്ല." - -#: ../cli/src/devices.c:539 -#, c-format -msgid "Success: Device '%s' successfully disconnected." -msgstr "വിജയിച്ചു: ഡിവൈസ് '%s' വിജയകരമായി വിഛേദിച്ചിരിക്കുന്നു." - -#: ../cli/src/devices.c:564 -#, c-format -msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "പിശക്: ഡിവൈസ് '%s' (%s) വിഛേദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s" - -#: ../cli/src/devices.c:572 -#, c-format -msgid "Device state: %d (%s)\n" -msgstr "ഡിവൈസിന്റെ അവസ്ഥ: %d (%s)\n" - -#: ../cli/src/devices.c:636 -#, c-format -msgid "Error: iface has to be specified." -msgstr "പിശക്: iface നല്‍കേണ്ടതുണ്ടു്." - -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi പരിശോധന പട്ടിക" - -#: ../cli/src/devices.c:740 -#, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "പിശക്: '%s' ഡിവൈസ് ഒരു വൈഫൈ ഡിവൈസല്ല." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "ഡിവൈസ്:" - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "പിശക്: hwaddr വ്യക്തമാക്കേണ്ടതുണ്ടു്." - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "പിശക്: hwaddr '%s'-നുള്ള ആക്സെസ്സ് പോയിന്റ് ലഭ്യമല്ല." - -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:349 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:350 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "എപി പരാമീറ്ററുകള്‍" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്തിരിക്കുന്നു: " -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "ഫ്രീക്വന്‍സി:" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "മോഡ്:" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "എന്റര്‍പ്രൈസ്" -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "ആഡ്-ഹോക്" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "അഡ്-ഹോക്" -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:380 msgid "Infrastructure" msgstr "ഇന്‍ഫ്രാസ്ട്രക്ചര്‍" -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "ഏറ്റവും കൂടിയ ബിറ്റ്റേറ്റ്:" +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "പിശക്: 'dev list': %s" -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "അളവു്:" +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "പിശക്: 'dev list': %s, അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "ഫ്ലാഗുകള്‍:" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ഡിവൈസിന്റെ വിശദാംശങ്ങള്‍" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "സ്വകാര്യത" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(അപരിചിതം)" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA ഫ്ലാഗുകള്‍:" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "(അപരിചിതം)" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN ഫ്ലാഗുകള്‍:" +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:907 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ഓണ്‍" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ഓഫ്" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "പിശക്: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "പിശക്: 'dev status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ഡിവൈസുകളുടെ അവസ്ഥ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "പിശക്: '%s' ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "പിശക്: ഡിവൈസ് '%s' ലഭ്യമായില്ല." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "വിജയിച്ചു: ഡിവൈസ് '%s' വിജയകരമായി വിഛേദിച്ചിരിക്കുന്നു." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "പിശക്: ഡിവൈസ് '%s' (%s) വിഛേദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ഡിവൈസിന്റെ അവസ്ഥ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "പിശക്: iface നല്‍കേണ്ടതുണ്ടു്." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "പിശക്: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "പിശക്: 'dev wifi': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi പരിശോധന പട്ടിക" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "പിശക്: hwaddr '%s'-നുള്ള ആക്സെസ്സ് പോയിന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "പിശക്: '%s' ഡിവൈസ് ഒരു വൈഫൈ ഡിവൈസല്ല." + +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "പിശക്: 'dev wifi' കമാന്‍ഡ് '%s' ശരിയല്ല." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "പിശക്: 'dev' കമാന്‍ഡ് '%s' ശരിയല്ല." -#: ../cli/src/network-manager.c:46 +#: ../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" @@ -727,89 +888,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "asleep" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "കണക്ട് ചെയ്യുന്നു" -#: ../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 "enabled" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "പിശക്: '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 "disabled" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "പിശക്: 'nm status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "നെറ്റ്‌വര്‍ക്ക്മാനേജറിന്റെ അവസ്ഥ" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM പ്രവര്‍ത്തനത്തില്‍:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "enabled" -#: ../cli/src/network-manager.c: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 "disabled" + +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "പ്രവര്‍ത്തനത്തില്‍" -#: ../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 "NM അവസ്ഥ:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "പിശക്: '%s' എന്നു് '--fields'-നുള്ള മൂല്ല്യം അസാധുവാണു്; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM വയര്‍ലെസ്സ് ഹാര്‍ഡ്‌വെയര്‍:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi സജ്ജം" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM വയര്‍ലെസ്സ്:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN ഹാര്‍ഡ്‌വെയര്‍:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" - -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "പിശക്: തെറ്റായ 'wifi' പരാമീറ്റര്‍: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN സജ്ജം" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "പിശക്: തെറ്റായ 'wwan' പരാമീറ്റര്‍: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "പിശക്: 'nm' കമാന്‍ഡ് '%s' ശരിയല്ല." -#: ../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] |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" @@ -817,13 +980,17 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"ഉപയോഗിക്കേണ്ട വിധം: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"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] |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" @@ -831,35 +998,165 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "'%s' ഐഛികം അപരിചിതം, 'nmcli help' ശ്രമിക്കുക." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "പിശക്: '%s'വസ്തു അപരിചിതം, 'nmcli help' ശ്രമിക്കുക." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "പിശക്: '--terse' രണ്ടാമതും നല്‍കിയിരിക്കുന്നു." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Option '--terse' is mutually exclusive with '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "പിശക്: '--pretty' രണ്ടാമതും നല്‍കിയിരിക്കുന്നു." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Option '--pretty' is mutually exclusive with '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "പിശക്: '%s' ഐച്ഛികത്തിനുള്ള ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "പിശക്: '%s' ഐച്ഛികത്തിനുള്ള '%s' ശരിയായ ആര്‍ഗ്യുമെന്റല്ല." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "പിശക്: '%s' ഐച്ഛികങ്ങള്‍ക്കുള്ള ഫീള്‍ഡുകള്‍ ലഭ്യമല്ല." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli പ്രയോഗം, പതിപ്പു് %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "'%s' ഐഛികം അപരിചിതം, 'nmcli -help' ശ്രമിക്കുക." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "പിശക്: '%s' ഐഛികം അപരിചിതം, 'nmcli -help' ശ്രമിക്കുക." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "%d സിഗ്നല്‍ ലഭ്യമായി, അടച്ചു പൂട്ടുന്നു..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "പിശക്: നെറ്റ്‌വര്‍ക്ക്മാനേജറിലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "വിജയിച്ചു" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ബിറ്റ് പാസ്ഫ്രെയിസ്)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (അപരിചിതം)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (അപരിചിതം)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ഏതെങ്കിലും," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ഓട്ടോ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "സജ്ജമല്ല" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ഫീള്‍ഡ് '%s' മാത്രമായിരിക്കണം" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "തെറ്റായ ഫീള്‍ഡ് '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' ഐച്ഛികത്തിനു് '--fields' നല്‍കേണ്ടതുണ്ടു്" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' എന്ന ഐച്ഛികത്തിനു് പ്രത്യേക '--fields' ഐച്ഛികം ആവശ്യമുണ്ടു്, '%s' അല്ല" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1175,77 +1472,85 @@ msgstr "PKCS#12 ഫയല്‍ ഉറപ്പാക്കുവാന്‍ msgid "Could not generate random data." msgstr "വേഗത്തില്‍ ഡേറ്റാ തയ്യാറാക്കുവാന്‍ സാധ്യമായില്ല." -#: ../libnm-util/nm-utils.c:1802 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "എന്‍ക്രിപ്ഷന്‍ കീ തയ്യാറാക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." -#: ../libnm-util/nm-utils.c:1912 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ഫയല്‍ ഉണ്ടാക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ഫയലിലേക്ക് IV സൂക്ഷിക്കുന്നതിനാവശ്യമുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." -#: ../libnm-util/nm-utils.c:1936 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ഫയലിലേക്ക് എന്‍ക്രിപ്റ്റ് ചെയ്ത കീ സൂക്ഷിക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." -#: ../libnm-util/nm-utils.c:1955 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ഫയല്‍ ഡേറ്റായ്ക്കുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "നെറ്റ്ലിങ്ക് സന്ദേശം പ്രവര്‍ത്തിപ്പിക്കുമ്പോള്‍ പിശക്: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ലിിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "സോക്കറ്റില്‍ ഡേറ്റായ്ക്കായി കാത്തിരിക്കുമ്പോള്‍ പിശകുണ്ടായിരിക്കുന്നു" -#: ../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 "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്കുമായി കണക്ട് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഗ്രൂപ്പിലേക്ക് പങ്കു് ചേരുവാന്‍ സാധ്യമല്ല: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ലിിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ലിങ്ക് കാഷേ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s " -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "സോക്കറ്റില്‍ ഡേറ്റായ്ക്കായി കാത്തിരിക്കുമ്പോള്‍ പിശകുണ്ടായിരിക്കുന്നു" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "നെറ്റ്ലിങ്ക് ഗ്രൂപ്പില്‍ ചേരുവാന്‍ സാധ്യമല്ല: %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 "ലിങ്ക് കാഷേ പരിഷ്കരിക്കുന്നതില്‍ പിശക്: %s" -#: ../src/main.c:494 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "തെറ്റായ ഉപാധി. ശരിയായ കൂടുതല്‍ ഉപാധികള്‍ക്കായി ദയവായി --help ഉപയോഗിക്കുക.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ശരിയായ കൂടുതല്‍ ഉപാധികള്‍ക്കായി ദയവായി --help ഉപയോഗിക്കുക.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# തയ്യാറാക്കിയതു് NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -1254,26 +1559,38 @@ msgstr "" "# %s-ല്‍ നിന്നും കൂട്ടിചേര്‍ത്തിരിക്കുന്നു\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ഉപയോഗിക്കുവാന്‍ സാധിക്കുന്ന DHCP ക്ലയന്റ് ലഭ്യമായില്ല." -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "നെറ്റ്ലിങ്കിലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ലഭ്യമായില്ല." -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "നെറ്റ്ലിങ്ക് ഗ്രൂപ്പില്‍ ചേരുവാന്‍ സാധ്യമല്ല: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ലഭ്യമായില്ല." -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "പിന്തണലഭ്യമല്ലാത്ത DHCP ക്ലയന്റ് '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "അപരിചതമായ ലോഗ് ലവല്‍ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "അപരിചിതമായ ലോഗ് ഡൊമെയിന്‍ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "കുറിപ്പു്: libc റിസോള്‍വര്‍ 3 നെയിംസര്‍വറുകളില്‍ കൂടതല്‍ പിന്തുണയ്ക്കുന്നതല്ല." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "താഴെ പറഞ്ഞിരിക്കുന്ന നെയിംസര്‍വറുകള്‍ തിരിച്ചറിയപ്പെടുന്നവയല്ല." @@ -1282,7 +1599,7 @@ msgstr "താഴെ പറഞ്ഞിരിക്കുന്ന നെയി msgid "Auto %s" msgstr "ഓട്ടോ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "സിസ്റ്റം" From a12bc0b893dad98e3797f091728903fd18a0bfb3 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Giri Date: Thu, 13 May 2010 12:43:16 -0700 Subject: [PATCH 382/392] po: update Oriya translation (rh #589230) --- po/or.po | 1311 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1228 insertions(+), 83 deletions(-) diff --git a/po/or.po b/po/or.po index 5ab219e632..d9fa2b7198 100644 --- a/po/or.po +++ b/po/or.po @@ -1,22 +1,1165 @@ -# translation of NetworkManager.master.or.po to Oriya +# translation of or.po to Oriya # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Manoj Kumar Giri , 2008, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master.or\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2010-02-10 16:09+0530\n" +"Project-Id-Version: or\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 12:43+0530\n" "Last-Translator: Manoj Kumar Giri \n" -"Language-Team: Oriya \n" +"Language-Team: Oriya \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" "\n" +"\n" +"\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ତ୍ରୁଟି: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'con list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "ସଂଯୋଗ ବିବରଣୀ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ତନ୍ତ୍ର" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ଚାଳକ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "କଦାପି ନୁହଁ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ହଁ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ନାଁ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ଚାଳକ ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ତ୍ରୁଟି: %s ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ ଅଛି।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ତ୍ରୁଟି: %s - ଏପରି କୌଣସି ସଂଯୋଗ ନାହିଁ।" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ଅଜଣା ପ୍ରାଚଳ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ତ୍ରୁଟି: କୌଣସି ବୈଧ ପ୍ରାଚଳ ଉଲ୍ଲେଖ ହୋଇନାହିଁ।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ତ୍ରୁଟି: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ତ୍ରୁଟି: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'con status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "ସକ୍ରିୟ ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ଉପକରଣ '%s' ରେ କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ ନାହିଁ" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ କିମ୍ବା ଉପକରଣ ନାହିଁ" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "ଉପକରଣ '%s' ସଂଯୋଗ '%s' ସହିତ ସୁସଙ୍ଗତ ନୁହଁ" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ସଂଯୋଗ '%s' ପାଇଁ କୌଣସି ଉପକରଣ ମିଳିଲା ନାହିଁ" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "ସକ୍ରିୟ କରୁଅଛି" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "ସକ୍ରିୟ ହୋଇସାରିଛି" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "ଅଜଣା" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN ସଂଯୁକ୍ତ ହୋଇଛି" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ସଂଯୋଗ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "ଅଜଣା କାରଣ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "କିଛି ନୁହେଁ" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ଚାଳକଟି ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଥିଲା" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "ମୂଳ ନେଟୱର୍କ ସଂଯୋଗଟି ବାଧାପ୍ରାପ୍ତ ହୋଇଥିଲା" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ସର୍ଭିସ ଅପ୍ରତ୍ୟାଶିତ ଭାବରେ ବନ୍ଦ ହୋଇଯାଇଛି" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ସର୍ଭିସ ଅବୈଧ ସଂରଚନା ଫେରାଇଛି" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "ସଂଯୋଗ ସମୟ ସମାପ୍ତ ପାଇଁ ଚେଷ୍ଟାକରିଛି" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN ସର୍ଭିସ ଠିକ ସମୟରେ ଆରମ୍ଭ ହୋଇନଥିଲା" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN ସର୍ଭିସ ଆରମ୍ଭ ହେବାରେ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "କୌଣସି ବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟ ନାହିଁ" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "ଅବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "ସଂଯୋଗକୁ କଢ଼ାଯାଇଛି" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "ଅବସ୍ଥା: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "ସଂଯୋଗ ସକ୍ରିୟ ହୋଇଛି\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ଅବସ୍ଥା: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ %d ସେକଣ୍ଡ ବିତିଯାଇଛି।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ତ୍ରୁଟି: '%s' ପାଇଁ ସକ୍ରିୟ ସଂଯୋଗ ଧାରଣ କରିବାରେ ବିଫଳ ହୋଇଛି।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ସକ୍ରିୟ ସଂଯୋଗ ଅବସ୍ଥା: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ସକ୍ରିୟ ସଂଯୋଗ ପଥ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ତ୍ରୁଟି: ଅଜଣା ସଂଯୋଗ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ ମୂଲ୍ୟ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ତ୍ରୁଟି: id କିମ୍ବା uuid କୁ ଉଲ୍ଲେଖ କରିବା ଉଚିତ।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ଚେତାବନୀ: ସଂଯୋଗ ସକ୍ରିୟ ନୁହଁ\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'con' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ତ୍ରୁଟି: D-Bus ସହିତ ସଂଯୁକ୍ତ ହୋଇପାରିଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ତ୍ରୁଟି: ତନ୍ତ୍ର ସଂରଚନା ପାଇଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ତ୍ରୁଟି: ଚାଳକ ସଂରଚନା ପାଇଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ଧାରଣ କରିପାରିବେ ନାହିଁ: ବିନ୍ୟାସ ସର୍ଭିସଗୁଡ଼ିକ ଚାଲୁନାହିଁ।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "ଅପରିଚାଳିତ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ଅନୁପଲବ୍ଧ" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ବିନ୍ୟାସ କରୁଅଛି)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "ସଂଯୋଗ ସ୍ଥାପିତ ହେଲା" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "ସଂଯୋଗ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "ଅଜଣା" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(କିଛି ନାହିଁ)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ଠିକଣା 0x%X କୁ ପରିବର୍ତ୍ତନ କରିବାରେ ତ୍ରୁଟି" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ସଂଗୁପ୍ତ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ବାଣିଜ୍ୟିକ" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "ଏଡ-ହୋକ" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ଅବସଂରଚନା" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ତ୍ରୁଟି: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ଉପକରଣ ବିବରଣୀ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ଅଜଣା)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ଅଜଣା)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ଚାଲୁ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ବନ୍ଦ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ତ୍ରୁଟି: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ଉପକରଣର ସ୍ଥିତି" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ତ୍ରୁଟି: '%s' ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ମିଳିଲା ନାହିଁ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ସଫଳ: ଉପକରଣ '%s' ସଫଳତାର ସହିତ ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' (%s) ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ବିଫଳ ହୋଇଛି: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ଉପକରଣ ସ୍ଥିତି: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ତ୍ରୁଟି: iface କୁ ଉଲ୍ଲେଖ କରାଯିବା ଉଚିତ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ତ୍ରୁଟି: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev wifi': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi କ୍ରମବୀକ୍ଷଣ ତାଲିକା" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ତ୍ରୁଟି: hwaddr '%s' ସହିତ ଅଭିଗମ୍ୟତା ବିନ୍ଦୁ ମିଳିଲା ନାହିଁ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ଟି ଗୋଟିଏ WiFi ଉପକରଣ ନୁହଁ।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'dev wifi' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'dev' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "ଶୁପ୍ତ" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "ସଂଯୋଗ କରୁଅଛି" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ତ୍ରୁଟି: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'nm status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager ସ୍ଥିତି" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ସକ୍ରିୟ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "ନିଷ୍କ୍ରିୟ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ଚାଲୁଅଛି" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ଚାଲୁନାହିଁ" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ତ୍ରୁଟି: '--fields' ମୂଲ୍ୟ '%s' ଏଠାରେ ବୈଧ ନୁହଁ; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi ସକ୍ରିୟ ଅଛି" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ତ୍ରୁଟି: ଅବୈଧ 'wifi' ପ୍ରାଚଳ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ସକ୍ରିୟ ଅଛି" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ତ୍ରୁଟି: ଅବୈଧ 'wwan' ପ୍ରାଚଳ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'nm' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ତ୍ରୁଟି: ବସ୍ତୁ '%s' ଟି ଅଜଣା ଅଟେ, 'nmcli help' କୁ ଚେଷ୍ଟା କରନ୍ତୁ।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--terse' କୁ ଦ୍ୱିତୀୟ ଥର ପାଇଁ ଉଲ୍ଲେଖ କରାଯାଇଛି।" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--terse' ଏବଂ '--pretty' ପରସ୍ପର ଠାରୁ ପୃଥକ।" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--pretty' କୁ ଦ୍ୱିତୀୟ ଥର ପାଇଁ ଉଲ୍ଲେଖ କରାଯାଇଛି।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--pretty' ଏବଂ '--terse' ପରସ୍ପର ଠାରୁ ପୃଥକ।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ତ୍ରୁଟି: '%s' ବିକଳ୍ପ ପାଇଁ ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ ଅଛି।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ତ୍ରୁଟି: '%s' ଟି '%s' ପାଇଁ ଗୋଟିଏ ବୈଧ ସ୍ୱତନ୍ତ୍ରଚର ନୁହଁ।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ତ୍ରୁଟି: '%s' ବିକଳ୍ପ ପାଇଁ ସ୍ଥାନ ଅନୁପସ୍ଥିତ।" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ସାଧନ, ସଂସ୍କରଣ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '%s' ଟି ଅଜଣା, 'nmcli -help' କୁ ଚେଷ୍ଟାକରନ୍ତୁ।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "ସଂକେତ %d କୁ ଧରିଅଛି, ବନ୍ଦ କରୁଅଛି..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ତ୍ରୁଟି: NetworkManager ସହିତ ସଂଯୋଗ ସ୍ଥାପନ କରିପାରିଲା ନାହିଁ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "ସଫଳତା" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ବିଟ ପ୍ରବେଶ ସଂକେତ ବାକ୍ୟାଂଶ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ଅଜଣା)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ଅଜଣା)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ଯେକୌଣସି, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ସ୍ୱୟଂଚାଳିତ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ସେଟ ହୋଇନାହିଁ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "କ୍ଷେତ୍ର '%s' ଏକୁଟିଆ ଥିବା ଉଚିତ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ଅବୈଧ କ୍ଷେତ୍ର '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "ବିକଳ୍ପ '--terse' '--fields' କୁ ଉଲ୍ଲେଖ କରିବା ଆବଶ୍ୟକ କରିଥାଏ" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "ବିକଳ୍ପ '--terse' ନିର୍ଦ୍ଦିଷ୍ଟ '--fields' ବିକଳ୍ପ ମୂଲ୍ୟଗୁଡ଼ିକୁ ଆବଶ୍ୟକ କରିଥାଏ , '%s' କୁ ନୁହଁ" #: ../libnm-util/crypto.c:120 #, c-format @@ -105,7 +1248,7 @@ msgstr "IV ଷୋହଳମିକ ସଂଖ୍ୟା ଧାରଣ କରିନଥ #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁଞ୍ଜି '%s' ଅଜଣା ଥିଲା." @@ -164,43 +1307,38 @@ msgstr "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବ msgid "Failed to decrypt the private key: %s / %s." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." -#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#: ../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 "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅପ୍ରତ୍ୟାଶିତ ପ୍ୟାଡିଙ୍ଗ ଲମ୍ବ।" -#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ." -#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "ସଂଗୁପ୍ତ କରିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "ବିକୋଡ଼ନ କୁଞ୍ଜି ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "ବିକୋଡ଼ନ ପାଇଁ ସମମିତ କି ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %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 "ତଥ୍ୟକୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." @@ -229,7 +1367,7 @@ msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତ କରିହେବ ନ msgid "Couldn't verify PKCS#12 file: %s" msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲା ନାହିଁ: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "କ୍ରିପ୍ଟ ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %d." @@ -271,7 +1409,6 @@ msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରି #: ../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 "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅବସଂକେତ ତଥ୍ୟଟି ଅତ୍ୟଧିକ ବଡ଼।" @@ -280,145 +1417,144 @@ msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରି msgid "Failed to finalize decryption of the private key: %d." msgstr "ବ୍ୟକ୍ତିଗତ କିର ଅବସଂକେତନକୁ ନିଶ୍ଚୟ କରିବାରେ ବିଫଳ: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../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 "ଅବସଂକେତନ କୁଞ୍ଜି ସ୍ଥାନକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" -#: ../libnm-util/crypto_nss.c:371 +#: ../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 "ଅବସଂକେତନ ପାଇଁ ସମମିତ କିକୁ ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "ଅବସଂକେତନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "ଅବସଂକେତନ ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "ଅବସଂକେତ କରିବାରେ ବିଫଳ: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "ସଂଗୁପ୍ତ କରିବା ପରେ ଅପ୍ରତ୍ୟଶିତ ପରିମାଣର ତଥ୍ୟ।" -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "ପ୍ରମାଣପତ୍ରକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "ପ୍ରବେଶସଙ୍କେତକୁ UCS2ରେ ପରିବର୍ତ୍ତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "PKCS#12 ଅବସଂକେତକକୁ ଆରମ୍ଭ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲାନାହିଁ: %d" -#: ../libnm-util/crypto_nss.c:556 -#| msgid "Could not decode private key." +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "ମନଇଚ୍ଛା ତଥ୍ୟକୁ ଅବସଂକେତ କରିହେଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1925 #, c-format -#| msgid "Not enough memory to decrypt private key." msgid "Not enough memory to make encryption key." msgstr "ବିକୋଡ଼ନ କି କୁ ନିର୍ମାଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ମୃତି ସ୍ଥାନ ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1633 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ଫାଇଲ ନିର୍ମାଣ ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ଫାଇଲରେ IV ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ଫାଇଲରେ ସଂଗୁପ୍ତ କି ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:2078 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "netlink ସନ୍ଦେଶ ପଠାଇବାରେ ତ୍ରୁଟି: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ସକେଟରେ ତଥ୍ୟ ପାଇଁ ଅପେକ୍ଷା କରିବା ସମୟରେ ତ୍ରୁଟି" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ନିୟନ୍ତ୍ରଣ ଅଧିକାର ପଠାଇବାକୁ ସକ୍ରିୟ କରିବାରେ ଅସମର୍ଥ: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink କ୍ୟାଶେ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "ସକେଟରେ ତଥ୍ୟ ପାଇଁ ଅପେକ୍ଷା କରିବା ସମୟରେ ତ୍ରୁଟି" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାରେ ତ୍ରୁଟି: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --help ବ୍ୟବହାର କରନ୍ତୁ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager ଦ୍ୱାରା ନିର୍ମିତ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -427,38 +1563,47 @@ msgstr "" "# %s ରୁ ମିଶ୍ରିତ\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 -#, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" -msgid "unable to allocate netlink handle: %s" -msgstr "netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "କୌଣସି ଉପଯୋଗୀ DHCP କ୍ଲାଏଣ୍ଟ ମିଳିଲା ନାହିଁ।" -#: ../src/ip6-manager/nm-netlink-listener.c:210 -#, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" -msgid "unable to connect to netlink: %s" -msgstr "netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ମିଳି ପାରିଲା।" -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" -msgid "unable to join netlink group: %s" -msgstr "netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ମିଳିପାରିଲା।" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ଅସମର୍ଥିତ DHCP କ୍ଲାଏଣ୍ଟ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "ଅଜ୍ଞାତ ଲଗ ସ୍ତର '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "ଅଜ୍ଞାତ ଲଗ ଡମେନ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "ସ୍ୱୟଂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "ତନ୍ତ୍ର" From af22de2eca270eb9afdd941f761486996a06bf35 Mon Sep 17 00:00:00 2001 From: Jaswinder Singh Date: Thu, 13 May 2010 12:44:27 -0700 Subject: [PATCH 383/392] po: updated Punjabi translation (rh #589230) --- po/pa.po | 1527 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 973 insertions(+), 554 deletions(-) diff --git a/po/pa.po b/po/pa.po index 052406ebb4..90b36c5aee 100644 --- a/po/pa.po +++ b/po/pa.po @@ -4,15 +4,15 @@ # # Amanpreet Singh Alam , 2004. # Amanpreet Singh Alam , 2005. -# A S Alam , 2007, 2010. +# A S Alam , 2007. +# Jaswinder Singh , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." -"cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-03-24 03:26+0000\n" -"PO-Revision-Date: 2010-04-03 14:08+0530\n" -"Last-Translator: A S Alam \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:40+0530\n" +"Last-Translator: Jaswinder Singh \n" "Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +21,76 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -42,323 +111,514 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -#| msgid "VPN Connections" -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 "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "ਨਾਂ" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -#| msgid "VPN Connections" -msgid "System connections:\n" -msgstr "ਸਿਸਟਮ ਕੁਨੈਕਸ਼ਨ:\n" +msgid "Error: 'con list': %s" +msgstr "Error: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -#| msgid "VPN Connections" -msgid "User connections:\n" -msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; allowed fields: %s" -#: ../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:207 +msgid "Connection details" +msgstr "ਕੁਨੈਕਸ਼ਨ ਵੇਰਵਾ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ਸਿਸਟਮ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ਯੂਜ਼ਰ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ਕਦੇ ਨਹੀਂ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ਹਾਂ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ਨਹੀਂ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ਸਿਸਟਮ ਕੁਨੈਕਸ਼ਨ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "ਗਲਤੀ: %s ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "ਗਲਤੀ: %s - ਇੰਝ ਦਾ ਕੋਈ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "ਸਿਸਟਮ-ਲਈ ਕੁਨੈਕਸ਼ਨ" - -#: ../cli/src/connections.c:205 -#| msgid "VPN Connections" -msgid "User connections" -msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ" - -#: ../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:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "ਅਣਜਾਣ ਪੈਰਾਮੀਟਰ: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, 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:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ਗਲਤੀ: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -#| msgid "none" -msgid "no" -msgstr "ਨਹੀਂ" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Error: 'con status': %s" -#: ../cli/src/connections.c:297 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Error: 'con status': %s; allowed fields: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "ਡਿਫਾਲਟ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "ਸਰਵਿਸ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "ਜੰਤਰ" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "ਜੰਤਰ '%s' ਉੱਤੇ ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਜਾਂ ਜੰਤਰ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "device '%s' not compatible with connection '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ਕੁਨੈਕਸ਼ਨ '%s' ਲਈ ਕੋਈ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "ਚਾਲੂ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "ਚਾਲੂ ਕੀਤਾ" -#: ../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:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "ਅਣਜਾਣ" -#: ../cli/src/connections.c:744 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN ਕੁਨੈਕਸ਼ਨ (ਤਿਆਰੀ)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ)" -#: ../cli/src/connections.c:748 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../cli/src/connections.c:752 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN ਕੁਨੈਕਟ ਹੈ" -#: ../cli/src/connections.c:754 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੋਇਆ" -#: ../cli/src/connections.c:756 -#| msgid "VPN Connections" +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN ਡਿਸ-ਕੁਨੈਕਟ" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "ਅਣਜਾਣ ਕਾਰਨ" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "ਕੋਈ ਨਹੀਂ" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "ਯੂਜ਼ਰ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "ਬੇਸ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ 'ਚ ਰੁਕਾਵਟ" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN ਸਰਵਿਸ ਅਚਾਨਕ ਰੁਕ ਗਈ" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN ਸਰਵਿਸ ਨੇ ਅਢੁੱਕਵੀਂ ਸੰਰਚਨਾ ਵਾਪਸ ਕੀਤੀ" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "ਕੁਨੈਕਸ਼ਨ ਕੋਸ਼ਿਸ਼ ਦੌਰਾਨ ਸਮਾਂ ਸਮਾਪਤ ਹੋ ਗਿਆ" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN ਸਰਵਿਸ ਸਮੇਂ 'ਚ ਸ਼ੁਰੂ ਨਹੀਂ ਹੋਈ" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN ਸਰਵਿਸ ਸ਼ੁਰੂ ਹੋਣ ਲਈ ਫੇਲ੍ਹ ਹੋਈ" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "ਕੋਈ ਢੁੱਕਵਾਂ VPN ਭੇਦ ਨਹੀਂ" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "ਅਢੁੱਕਵਾਂ VPN ਭੇਦ" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "ਕੁਨੈਕਸ਼ਨ ਹਟਾਇਆ ਗਿਆ" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "ਹਾਲਤ: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕੀਤਾ\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "ਗਲਤ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "ਹਾਲਤ: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s।" -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ %d ਸਕਿੰਟ ਖਤਮ ਹੋਏ।" -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format -#| msgid "Error retrieving VPN connection '%s'" msgid "Error: Obtaining active connection for '%s' failed." msgstr "ਗਲਤੀ: '%s' ਲਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਹਾਲਤ: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਪਾਥ: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format -#| msgid "Error retrieving VPN connection '%s'" msgid "Error: Unknown connection: %s." msgstr "ਗਲਤੀ: ਅਣਜਾਣ ਕੁਨੈਕਸ਼ਨ: %s।" -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ ਮੁੱਲ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ ਹੈ।" -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ਗਲਤੀ: id ਜਾਂ uuid ਨਹੀਂ ਦਿੱਤਾ।" -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ: %s।" -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਮਿਲਿਆ।" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "ਚੇਤਾਵਨੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਨਹੀਂ ਹੈ\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ਗਲਤੀ: 'con' ਕਮਾਂਡ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ।" -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "ਗਲਤੀ: ਸਿਸਟਮ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "ਗਲਤੀ: ਯੂਜ਼ਰ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਲਿਆ ਜਾ ਸਕਦਾ: ਸਿਸਟਮ ਸਰਵਿਸ ਨਹੀਂ ਚੱਲ ਰਹੀ ਹੈ।" +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -368,7 +628,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "ਵਰਤੋਂ: nmcli dev { COMMAND | help }\n" @@ -378,354 +638,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "ਬਿਨ-ਪਰਬੰਧ" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "ਅਣ-ਉਪਲੱਬਧ" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਕੀਤਾ" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਤਿਆਰੀ)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਸੰਰਚਨਾ ਜਾਰੀ)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "ਕੁਨੈਕਟ ਹੋਇਆ" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੈ" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "ਅਣਜਾਣ" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 -#| msgid "none" +#: ../cli/src/devices.c:277 msgid "(none)" msgstr "(ਕੋਈ ਨਹੀਂ)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ਐਡਰੈੱਸ 0x%X ਬਦਲਣ ਦੌਰਾਨ ਗਲਤੀ" -#: ../cli/src/devices.c:238 -#, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, ਫਰੀਕਿਊਂਸੀ %d MHz, ਦਰ %d Mb/s, ਤਾਕਤ %d" - -#: ../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 " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" - -#: ../cli/src/devices.c:260 -#| msgid "WPA Enterprise" -msgid " Enterprise" -msgstr " ਇੰਟਰਪਰਾਈਸ" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "ਜੰਤਰ" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ਡਰਾਇਵਰ" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(ਅਣਜਾਣ)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "ਹਾਲਤ" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW ਐਡਰੈੱਸ" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" ਸਮਰੱਥਾ:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "ਕੈਰੀਅਰ ਖੋਜ" - -#: ../cli/src/devices.c:336 -#, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "ਸਪੀਡ" - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" ਬੇਤਾਰ ਵਿਸ਼ੇਸ਼ਤਾ\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP ਇੰਕ੍ਰਿਪਸ਼ਨ" - -#: ../cli/src/devices.c:355 -#| msgid "WPA Enterprise" -msgid "WPA Encryption" -msgstr "WPA ਇੰਕ੍ਰਿਪਸ਼ਨ" - -#: ../cli/src/devices.c:357 -#| msgid "WPA2 Enterprise" -msgid "WPA2 Encryption" -msgstr "WPA2 ਇੰਕ੍ਰਿਪਸ਼ਨ" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP ਸਿਫਰ" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP ਸੀਫਰ" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" ਬੇਤਾਰ ਅਸੈੱਸ ਪੁਆਇੰਟ %s\n" - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = ਮੌਜੂਦਾ AP)" - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" ਤਾਰ ਨਾਲ ਵਿਸ਼ੇਸ਼ਤਾ\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "ਕੈਰੀਅਰ" - -#: ../cli/src/devices.c:377 -#| msgid "none" -msgid "on" -msgstr "ਚਾਲੂ" - -#: ../cli/src/devices.c:379 -msgid "off" -msgstr "ਬੰਦ" - -#: ../cli/src/devices.c:387 -#, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 ਵਿਸ਼ੇਸ਼ਤਾ:\n" - -#: ../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 "DNS" - -#: ../cli/src/devices.c:458 -msgid "Status of devices" -msgstr "ਜੰਤਰਾਂ ਦੀ ਹਾਲਤ" - -#: ../cli/src/devices.c:487 -#, c-format -msgid "Error: '%s' argument is missing." -msgstr "ਗਲਤੀ: '%s' ਆਰਗੂਮੈਂਟ ਗੁੰਮ ਹੈ।" - -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 -#, c-format -msgid "Error: Device '%s' not found." -msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਨਹੀਂ ਲੱਭਿਆ।" - -#: ../cli/src/devices.c:539 -#, c-format -msgid "Success: Device '%s' successfully disconnected." -msgstr "ਸਫ਼ਲ: ਜੰਤਰ '%s' ਠੀਕ ਤਰ੍ਹਾਂ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ।" - -#: ../cli/src/devices.c:564 -#, c-format -msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' (%s) ਡਿਸ-ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ: %s" - -#: ../cli/src/devices.c:572 -#, c-format -msgid "Device state: %d (%s)\n" -msgstr "ਜੰਤਰ ਹਾਲਤ: %d (%s)\n" - -#: ../cli/src/devices.c:636 -#, c-format -msgid "Error: iface has to be specified." -msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" - -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "ਵਾਈਫਾਈ ਸਕੈਨ ਲਿਸਟ" - -#: ../cli/src/devices.c:740 -#, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਵਾਈ-ਫਾਈ ਜੰਤਰ ਨਹੀਂ ਹੈ।" - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "ਜੰਤਰ:" - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "ਗਲਤੀ: hwaddr ਦੇਣ ਦੀ ਲੋੜ ਹੈ।" - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "ਗਲਤੀ: hwaddr '%s' ਵਾਲਾ ਅਸੈੱਸ ਪੁਆਇੰਟ ਨਹੀਂ ਲੱਭਿਆ।" - -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:349 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:350 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP ਪੈਰਾਮੀਟਰ" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ਇੰਕ੍ਰਿਪਟ ਕੀਤਾ: " -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "ਫਰੀਕਿਊਨਸੀ:" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "ਮੋਡ:" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "ਐਡ-ਹਾਕ" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:380 msgid "Infrastructure" msgstr "ਇੰਫਰਾਸਟੱਕਚਰ" -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "ਵੱਧੋ-ਵੱਧ ਬਿੱਟਰੇਟ:" +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Error: 'dev list': %s" -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "ਤਾਕਤ:" +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Error: 'dev list': %s; allowed fields: %s" -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "ਫਲੈਗ:" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ਜੰਤਰ ਵੇਰਵਾ" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "ਪਰਾਈਵੇਸੀ" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ਅਣਜਾਣ)" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA ਫਲੈਗ:" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ਅਣਜਾਣ)" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN ਫਲੈਗ:" +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:907 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ਚਾਲੂ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ਬੰਦ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Error: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Error: 'dev status': %s; allowed fields: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ਜੰਤਰਾਂ ਦੀ ਹਾਲਤ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ਗਲਤੀ: '%s' ਆਰਗੂਮੈਂਟ ਗੁੰਮ ਹੈ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ਸਫ਼ਲ: ਜੰਤਰ '%s' ਠੀਕ ਤਰ੍ਹਾਂ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' (%s) ਡਿਸ-ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ਜੰਤਰ ਹਾਲਤ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Error: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; allowed fields: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ਵਾਈਫਾਈ ਸਕੈਨ ਲਿਸਟ" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ਗਲਤੀ: hwaddr '%s' ਵਾਲਾ ਅਸੈੱਸ ਪੁਆਇੰਟ ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਵਾਈ-ਫਾਈ ਜੰਤਰ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ਗਲਤੀ: 'dev wifi' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ਗਲਤੀ: 'dev' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" -#: ../cli/src/network-manager.c:46 +#: ../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" @@ -750,90 +892,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "asleep" -#: ../cli/src/network-manager.c:69 -#| msgid "VPN Connections" +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../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 "Error: '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 "Error: 'nm status': %s; allowed fields: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਹਾਲਤ" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM ਚੱਲ ਰਿਹਾ ਹੈ:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ਚਾਲੂ ਹੈ" -#: ../cli/src/network-manager.c: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 "ਬੰਦ ਹੈ" + +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" -#: ../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 "NM ਹਾਲਤ:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Error: '--fields' value '%s' is not valid here; allowed fields: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM ਬੇਤਾਰ ਹਾਰਡਵੇਅਰ:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi enabled" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM ਬੇਤਾਰ:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN ਹਾਰਡਵੇਅਰ:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" - -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wifi' ਪੈਰਾਮੀਟਰ: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN enabled" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wwan' ਪੈਰਾਮੀਟਰ: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "ਗਲਤੀ: 'nm' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" -#: ../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] |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" @@ -844,10 +987,14 @@ msgstr "" "ਵਰਤੋਂ: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -855,39 +1002,169 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "ਆਬਜੈਕਟ '%s' ਅਣਜਾਣ ਹੈ, 'nmcli help' ਵਰਤ ਕੇ ਵੇਖੋ।" +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Error: Object '%s' is unknown, try 'nmcli help'." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Error: Option '--terse' is specified the second time." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Option '--terse' is mutually exclusive with '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Error: Option '--pretty' is specified the second time." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Option '--pretty' is mutually exclusive with '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ਗਲਤੀ: '%s' ਚੋਣ ਲਈ ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Error: '%s' is not valid argument for '%s' option." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Error: fields for '%s' options are missing." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli ਟੂਲ, ਵਰਜਨ %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "ਚੋਣ '%s' ਅਣਜਾਣੀ ਹੈ 'nmcli -help' ਵਰਤ ਕੇ ਵੇਖੋ।" +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ਗਲਤੀ: ਚੋਣ '%s' ਅਣਜਾਣੀ ਹੈ 'nmcli -help' ਵਰਤ ਕੇ ਵੇਖੋ।" -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "%d ਸਿਗਨਲ ਮਿਲਿਆ, ਬੰਦ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "ਗਲਤੀ: ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "ਸਫ਼ਲ" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit ਗੁਪਤਕੋਡ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ਅਣਜਾਣ)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ਅਣਜਾਣ)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ਕੋਈ ਵੀ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ਆਟੋ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ਸੈੱਟ ਨਹੀਂ ਹੈ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ਖੇਤਰ '%s' ਇਕੱਲਾ ਹੋਵੇਗਾ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ਗਲਤ ਖੇਤਰ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' requires specifying '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' requires specific '--fields' option values , not '%s'" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "PEM ਕੁੰਜੀ ਫਾਇਲ ਵਿੱਚ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" +msgstr "PEM ਕੁੰਜੀ ਫਾਇਲ ਦਾ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" #: ../libnm-util/crypto.c:130 #, c-format @@ -1199,87 +1476,85 @@ msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" msgid "Could not generate random data." msgstr "ਰਲਵਾਂ ਡਾਟਾ ਤਿਆਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" -#: ../libnm-util/nm-utils.c:1802 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਕੁੰਜੀ ਬਣਾਉਣ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" -#: ../libnm-util/nm-utils.c:1912 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ਫਾਇਲ ਬਣਾਉਣ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ IV ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:1936 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ ਇੰਕ੍ਰਿਪਟ ਕੀਤੀ ਕੁੰਜੀ ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:1955 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ਫਾਇਲ ਡਾਟੇ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "ਨੈੱਟਲਿੰਕ ਸੁਨੇਹੇ ਉੱਤੇ ਕਾਰਵਾਈ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -#| msgid "" -#| "unable to create netlink socket for monitoring wired ethernet devices - %s" -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" - -#: ../src/nm-netlink-monitor.c:270 -#, c-format -#| msgid "" -#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" -#| "s" -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਨਾਲ ਕੁਨੈਕਟ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" - -#: ../src/nm-netlink-monitor.c:278 -#, c-format -#| msgid "" -#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" -#| "s" -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" - -#: ../src/nm-netlink-monitor.c:286 -#, c-format -#| msgid "" -#| "unable to create netlink socket for monitoring wired ethernet devices - %s" -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਲਿੰਕ ਕੈਸ਼ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" - -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 +#: ../src/nm-netlink-monitor.c:214 msgid "error occurred while waiting for data on socket" msgstr "ਸਾਕਟ ਉੱਤੇ ਡਾਟੇ ਦੀ ਉਡੀਕ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ" -#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਨਾਲ ਕੁਨੈਕਟ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ਹੈੱਡਲ ਕਰੀਡੈਂਸ਼ਲ ਪਾਸਿੰਗ ਯੋਯਗ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਲਿੰਕ ਕੈਸ਼ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਣਸਮਰੱਥ:: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "ਲਿੰਕ ਕੈਸ਼ ਅੱਪਡੇਟ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" -#: ../src/main.c:494 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ਗਲਤ ਚੋਣ। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਦੀ ਲਿਸਟ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "#ਨੈੱਟਵਰਕ ਮੈਨੇਜਰ ਵਲੋਂ ਬਣਾਈ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -1305,26 +1580,21 @@ msgstr "'dhcpcd' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" msgid "unsupported DHCP client '%s'" msgstr "ਗੈਰਸਹਾਇਕ DHCP ਕਲਾਇਟ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "netlink ਹੈੱਡਲ ਦੇਣ ਲਈ ਅਸਮਰੱਥ: %s" +msgid "Unknown log level '%s'" +msgstr "ਅਣਜਾਣ ਲਾਗ ਲੈਵਲ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "unable to connect to netlink: %s" -msgstr "netlink ਨਾਲ ਕੁਨੈਕਟ ਹੋਣ ਲਈ ਅਸਮਰੱਥ: %s" +msgid "Unknown log domain '%s'" +msgstr "ਅਣਜਾਣ ਲਾਗ ਡੋਮੇਨ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:307 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਣਸਮਰੱਥ:: %s" - -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" @@ -1333,9 +1603,9 @@ msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ msgid "Auto %s" msgstr "ਆਟੋ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" -msgstr "ਸਿਸਟਮ" +msgstr "IPL ਲੀਨਕਸ (Linux) ਸਿਸਟਮ।" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" @@ -1363,14 +1633,172 @@ msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸ #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ " -"ਹੈ" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#~ msgid "Type" +#~ msgstr "ਕਿਸਮ" + +#~ msgid "Name" +#~ msgstr "ਨਾਂ" + +#~ msgid "User connections:\n" +#~ msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ:\n" + +#~ msgid "System-wide connections" +#~ msgstr "ਸਿਸਟਮ-ਲਈ ਕੁਨੈਕਸ਼ਨ" + +#~ msgid "Default" +#~ msgstr "ਡਿਫਾਲਟ" + +#~ msgid "Service" +#~ msgstr "ਸਰਵਿਸ" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ਫਰੀਕਿਊਂਸੀ %d MHz, ਦਰ %d Mb/s, ਤਾਕਤ %d" + +#~ msgid "Device" +#~ msgstr "ਜੰਤਰ" + +#~ msgid "Driver" +#~ msgstr "ਡਰਾਇਵਰ" + +#~ msgid "State" +#~ msgstr "ਹਾਲਤ" + +#~ msgid "HW Address" +#~ msgstr "HW ਐਡਰੈੱਸ" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ਸਮਰੱਥਾ:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "ਕੈਰੀਅਰ ਖੋਜ" + +#~ msgid "Speed" +#~ msgstr "ਸਪੀਡ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ਬੇਤਾਰ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP ਸਿਫਰ" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP ਸੀਫਰ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " ਬੇਤਾਰ ਅਸੈੱਸ ਪੁਆਇੰਟ %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = current AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ਤਾਰ ਨਾਲ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#~ msgid "Carrier" +#~ msgstr "ਕੈਰੀਅਰ" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 ਵਿਸ਼ੇਸ਼ਤਾ:\n" + +#~ msgid "Address" +#~ msgstr "ਐਡਰੈੱਸ" + +#~ msgid "Prefix" +#~ msgstr "ਪ੍ਰੀ-ਫਿਕਸ" + +#~ msgid "Gateway" +#~ msgstr "ਗੇਟਵੇ" + +#~ msgid "Device:" +#~ msgstr "ਜੰਤਰ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ਗਲਤੀ: hwaddr ਦੇਣ ਦੀ ਲੋੜ ਹੈ।" + +#~ msgid "AP parameters" +#~ msgstr "AP ਪੈਰਾਮੀਟਰ" + +#~ msgid "Frequency:" +#~ msgstr "ਫਰੀਕਿਊਨਸੀ:" + +#~ msgid "Mode:" +#~ msgstr "ਮੋਡ:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "ਵੱਧੋ-ਵੱਧ ਬਿੱਟਰੇਟ:" + +#~ msgid "Strength:" +#~ msgstr "ਤਾਕਤ:" + +#~ msgid "Flags:" +#~ msgstr "ਫਲੈਗ:" + +#~ msgid "privacy" +#~ msgstr "ਪਰਾਈਵੇਸੀ" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ਫਲੈਗ:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ਫਲੈਗ:" + +#~ msgid "NM running:" +#~ msgstr "NM ਚੱਲ ਰਿਹਾ ਹੈ:" + +#~ msgid "NM state:" +#~ msgstr "NM ਹਾਲਤ:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM ਬੇਤਾਰ ਹਾਰਡਵੇਅਰ:" + +#~ msgid "NM wireless:" +#~ msgstr "NM ਬੇਤਾਰ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN ਹਾਰਡਵੇਅਰ:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlink ਨਾਲ ਕੁਨੈਕਟ ਹੋਣ ਲਈ ਅਸਮਰੱਥ: %s" #~ msgid "Cannot add VPN connection" #~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਜੋੜਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ ਹੈ" @@ -1447,12 +1875,6 @@ msgstr "" #~ msgid "104-bit WEP" #~ msgstr "104-ਬਿੱਟ WEP" -#~ msgid "WPA TKIP" -#~ msgstr "WPA TKIP" - -#~ msgid "WPA CCMP" -#~ msgstr "WPA CCMP" - #~ msgid "WPA Automatic" #~ msgstr "WPA ਆਟੋਮੈਟਿਕ" @@ -1476,6 +1898,3 @@ msgstr "" #~ msgid "too much data was sent over socket and some of it was lost" #~ msgstr "ਸਾਕਟ ਉੱਤੇ ਬਹੁਤ ਵੱਧ ਡਾਟਾ ਭੇਜਿਆ ਗਿਆ ਅਤੇ ਇਸ 'ਚੋਂ ਕੁਝ ਗੁੰਮ ਹੋ ਗਿਆ" - -#~ msgid "LEAP" -#~ msgstr "LEAP" From 83a882d61d50197a8ae7742dde9f994ba71092e2 Mon Sep 17 00:00:00 2001 From: Glaucia Cintra Date: Thu, 13 May 2010 12:45:47 -0700 Subject: [PATCH 384/392] po: updated Portuguese translation (rh #589230) --- po/pt_BR.po | 1508 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1419 insertions(+), 89 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 33e0a1eea3..a347564bec 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1,96 +1,1174 @@ +# translation of pt_BR.po to Portuguese # Brazilian Portuguese translation of NetworkManager. -# Copyright (C) 2004-2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2008, 2010 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. -# Raphael Higino , 2004-2007 +# +# Raphael Higino , 2004-2007. # Luiz Armesto , 2007. # Henrique P. Machado , 2008. # Og Maciel , 2008. # Fabrício Godoy , 2008. -# +# Glaucia Cintra , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2008-11-13 21:19+0000\n" -"PO-Revision-Date: 2008-12-04 17:34-0300\n" -"Last-Translator: Henrique P Machado \n" -"Language-Team: Brazilian Portuguese \n" +"Project-Id-Version: pt_BR\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 14:38+1000\n" +"Last-Translator: Glaucia Cintra \n" +"Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:195 -#: ../src/nm-netlink-monitor.c:476 -#, c-format -msgid "error processing netlink message: %s" -msgstr "erro ao processar mensagem do netlink: %s" +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOME" -#: ../src/nm-netlink-monitor.c:252 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "não foi possível alocar o manipulador do netlink para monitoração de status do link: %s" +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" -#: ../src/nm-netlink-monitor.c:262 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "não foi possível conectar ao netlink para monitoração de status do link: %s" +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DISPOSITIVOS" -#: ../src/nm-netlink-monitor.c:270 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "não foi possível associar-se ao grupo do netlink para monitoração de status do link: %s" +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ESCOPO" -#: ../src/nm-netlink-monitor.c:278 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "não foi possível alocar o cache de link do netlink para monitoração de status do link: %s" +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "PADRÃO" -#: ../src/nm-netlink-monitor.c:441 -#, c-format -msgid "error updating link cache: %s" -msgstr "erro ao atualizar o cache de link: %s" +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "SERVIÇO-DBUS" -#: ../src/nm-netlink-monitor.c:499 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "ocorreu um erro ao esperar pelos dados da conexão" +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "ESPECIFICAÇÕES DO OBJETO" -#: ../src/NetworkManager.c:252 -#, c-format -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n" +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 -msgid "# Created by NetworkManager\n" -msgstr "# Criado pelo NetworkManager\n" +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPO" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "CARIMBO DE DATA E HORA" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "CARIMBO DE DATA E HORA REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "CONEXÃO AUTOMÁTICA" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "SOMENTE LEITURA" + +#: ../cli/src/connections.c:157 #, c-format msgid "" -"# Merged from %s\n" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Erro: lista 'con': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Erro: 'con list': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Detalhes de Conexões" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "usuário" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "nunca" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "sim" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "não" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Conexões de sistema" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Conexões de usuário" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Erro: argumento %s está faltando" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Erro: %s - não existe tal conexão" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parâmetro desconhecido: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Erro: não existe um parâmetro válido especificado" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Erro: %s" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Erro: status 'con':%s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Erro: status 'con':%s, campos permitidos: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Conexões ativas" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nenhuma conexão ativa no dispositivo '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "nenhuma conexão ativa ou dispositivo" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "dispositivo '%s' não compatível com a conexão '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nenhum dispositivo encontrado para a conexão '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "ativando" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "ativado" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "desconhecido" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Conectando com o VPN (preparar)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Conectando ao VPN (autenticação necessária)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Conectando ao VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Conectando ao VPN (obtendo configuração do IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN conectado" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Falha da conexão ao VPN" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN desconectado" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "razão desconhecida" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "nenhuma" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "o usuário foi desconectado" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "a conexão de rede base foi interrompida" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "o serviço VPN parou inesperadamente" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "O serviço VPN retornou configurações inválidas" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "a tentativa de conexão expirou o tempo limite" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "o serviço VPN não iniciou em tempo" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "o serviço VPN falhou ao iniciar" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "Segredos do VPN não válidos" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "Segredos do VPN inválidos" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "a conexão foi removida" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "stado: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Conexão ativada\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Erro: Ativação da conexão falhou." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "estado: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Erro: Ativação de conexão falhou: %s" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Erro: o Timeout%d de segundos expirou" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Erro: Ativação de conexão falhou: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Erro: Obtenção de conexão ativa para '%s' falhou." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Estado de conexão ativa: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Caminho de conexão ativa: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Erro: Conexão desconhecida: %s" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Erro: valor timeout '%s' não é válido." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Erro: id ou uuid deve ser especificada." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Erro: Não foi encontrado nenhum dispositivo adequado: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Erro: Não foi encontrado nenhum dispositivo adequado." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Aviso: Conexão não ativa\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Erro: 'con' comando '%s' não é válido." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Erro: Nâo foi possível conectar ao D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Erro: Não foi possível obter configurações de sistema" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Erro: Não foi possível obter configurações de usuário." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Erro: Não foi possível obter conexões: serviços de configuração não estão " +"funcionando." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DISPOSITIVO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ESTADO" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPACIDADES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPRIEDADES DO WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPRIEDADES CABEADAS" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "CONFIGURAÇÕES DO IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "DNS DO IP4" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "DETECTOR DE CARREGADOR" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VELOCIDADE" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARREGADOR" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ENDEREÇO" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIXO" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODO" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "TAXA" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SINAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SEGURANÇA" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "SINALIZADOR DO WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "SINALIZADOR DO RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ATIVO" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" -"# Mesclado de %s\n" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "NOTA: o resolvedor da libc não tem suporte a mais do que 3 servidores de nomes." +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "Não gerenciado" -#: ../src/named-manager/nm-named-manager.c:258 -msgid "The nameservers listed below may not be recognized." -msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "indisponível" -#: ../system-settings/src/main.c:376 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "disconectado" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "conectando (preparar)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "conectando (configurando)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "conectando (é necessário uma autenticação)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "conectando (obtendo configuração do IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "conectado" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "conexão falhou" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "desconhecido" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(nenhum)" + +#: ../cli/src/devices.c:302 #, c-format -msgid "Auto %s" -msgstr "Auto %s" +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: erro ao converter endereço IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Criptografado:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infraestrutura" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Erro: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Erro: 'dev list': %s, campos permitidos '%s'" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Detalhes do Dispositivos" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(desconhecido)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "desconhecido)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ligado" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "desligado" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Erro: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Erro: 'dev status': %s; campos permitidos: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Estado dos dispositivos" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Erro: argumento '%s' está faltando" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Erro: Dispositivo '%s' não foi encontrado." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Sucesso: Dispositivo '%s' foi desconectado com sucesso." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Erro: Desconexão do Dispositivo '%s' (%s) falhou: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Estado do Dispositivo: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Erro: iface precisa ser especificado." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Erro: dev wifi '%s' " + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Erro: 'dev wifi': %s;campos permitidos: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Lista de scan do WiFi " + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Erro: Ponto de aceso com o hwaddr '%s' não foi encontrado." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erro: Dispositivo '%s' não é um dispositivo WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erro: comando dev wifi '%s' não é válido" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erro: comando 'dev' '%s' não é válido" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EXECUTANDO" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "HARDWARE DO WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "HARDWARE DO WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "modo de espera" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "conectando" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Erro: 'nm status': %s" + +#: ../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:134 +msgid "NetworkManager status" +msgstr "status do 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 "ativado" + +#: ../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 "desativado" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "executando:" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "não está executando:" + +#: ../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: valor do '--fields' '%s' não é válido aqui; campos permitidos: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi ativado" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Erro: parâmetro do 'wifi' inválido: '%s'" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ativado" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Erro: parâmetro 'wwan' inválido: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Erro: comando 'nm' '%s' não é válido." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Erro: Objeto '%s' é desconhecido, tente o 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Erro: Opção '--terse' está especificada uma segunda vez" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Erro: Opção '--terse'é mutualmente exclusivo com o '--pretty'" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Erro: Opção '--pretty' está especificado uma segunda vez" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Erro: Opção '--pretty'é mutualmente exclusivo com o '--terse'" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Erro: argumento está faltando para a opção %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' não é um argumento válido para a opção '%s'" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Erro: campos para as opções '%s' estão faltando" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "ferramenta nmcli, versão %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Erro: Opção '%s' é desconhecida, tente 'nmcli help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Obtenção de sinal %d, fechando..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Erro: Não foi possível conectar ao NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Sucesso" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (desconhecido)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (desconhecido)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "qualquer um" + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "não definido" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "campo '%s' precisa estar sozinho" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo inválido '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opção '--terse' requer a especificação de '..fields' " + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opção '--terse' requer que especifique os valores da opção '--fields', e não '%s'" #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "A chave do arquivo PEM não tinha a marca de finalização \"%s\"." +msgstr "A chave do arquivo PEM não tinha a marca de finalização '%s'." #: ../libnm-util/crypto.c:130 #, c-format @@ -172,9 +1250,9 @@ msgstr "Memória insuficiente para armazenar o IV." msgid "IV contains non-hexadecimal digits." msgstr "IV contém dígitos não-hexadecimais." -#: ../libnm-util/crypto.c:382 -#: ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "A cifra da chave privada \"%s\" era desconhecida." @@ -194,72 +1272,106 @@ msgstr "Não foi possível determinar o tipo da chave privada." msgid "Not enough memory to store decrypted private key." msgstr "Memória insuficiente para armazenar a chave privada de descriptografia." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Falha ao inicializar o motor de criptografia." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Falha ao inicializar o motor MD5: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 -#: ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Comprimento IV inválido (deve ter ao menos %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Memória insuficiente para o buffer da chave descriptografada." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Falha ao inicializar o contexto da cifra de descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Falha ao definir chave simétrica para descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Falha ao definir IV para descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Falha ao descriptografar a chave privada: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Falha ao descriptografar a chave privada: comprimento da proteção inesperado." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Falha ao descriptografar a chave privada." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Não foi possível alocar memória para criptografia." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Falha ao inicializar o contexto da cifra de descriptografia: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Falha ao definir chave simétrica para descriptografia: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Falha ao definir IV para descriptografia: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Falha ao descriptografar a chave privada: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Erro ao inicializar os dados do certificado: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Não foi possível decodificar o certificado: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Não foi possível inicializar o decodificador PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Não foi possível decodificar o arquivo PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Não foi possível verificar o arquivo PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Falha ao inicializar o motor de criptografia: %d." @@ -269,61 +1381,279 @@ msgstr "Falha ao inicializar o motor de criptografia: %d." msgid "Failed to initialize the MD5 context: %d." msgstr "Falha ao inicializar o contexto MD5: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Comprimento IV inválido (deve ter ao menos %d)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Falha ao inicializar o espaço de cifra de descriptografia." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Falha ao definir chave simétrica para descriptografia." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Falha ao definir IV para descriptografia." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Falha ao inicializar o contexto de descriptografia." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Falha ao descriptografar a chave privada: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Falha ao descriptografar a chave privada: dados descriptografados muito " +"grandes." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Falha ao finalizar a descriptografia da chave privada: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Falha ao inicializar o espaço de cifra de criptografia. " + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Falha ao definir chave simétrica para criptografia." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Falha ao definir IV para criptografia." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Falha ao inicializar o contexto de criptografia." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Falha ao criptografar: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantia inesperada de dados após criptografia." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Não foi possível decodificar o certificado: %d" -#: ../libnm-util/crypto_nss.c:317 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Não foi possível converter senha para o formato UCS2: %d" -#: ../libnm-util/crypto_nss.c:345 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Não foi possível inicializar o decodificador PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:354 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Não foi possível decodificar o arquivo PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:363 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Não foi possível verificar o arquivo PKCS#12: %d" -#~ msgid "Not enough memory to create private key decryption key." -#~ msgstr "Memória insuficiente para descriptografar a chave privada." +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Não foi possível gerar dados aleatórios." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Memória insuficiente para criptografar a chave." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Não foi possível alocar memória criar arquivo PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Não foi possível alocar memória para gravar IV no arquivo PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Não foi possível alocar memória para gravar chave criptografada no arquivo " +"PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nâo foi possível alocar memória para daods de arquivo PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "erro ao processar mensagem do netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ocorreu um erro ao esperar pelos dados da conexão" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "não foi possível conectar ao netlink para monitoração de status do link: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "não foi possível ativar o netlink para manipular a passagem da credencial: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"não foi possível alocar o manipulador do netlink para monitoração de status " +"do link: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"não foi possível alocar o cache de link do netlink para monitoração de " +"status do link: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "não foi possível associar-se ao grupo do netlink : %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "erro ao atualizar o cache de link: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Por favor, use --help para ver uma lista de opções válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Criado pelo NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Mesclado de %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "Não foi encontrado nenhum cliente DHCP usável." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' não pôde ser encontrado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "Não foi possível encontrar 'dhcpcd'" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Cliente DHCP sem suporte '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nível de log desconhecido '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Domínio de log desconhecido '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTA: o resolvedor da libc não tem suporte a mais do que 3 servidores de " +"nomes." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Compartilhamento de conexão via rede WiFi protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Compartilhamento de conexão via rede de WiFi aberta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar hostname do sistema persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar conexões de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Política de sistema evita modificação de configuração de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Política de sistema evita modificação de hostname de sistema persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Política de Sistema evita compartilhamento de conexões via rede de WiFi " +"protegida." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Política de Sistema evita compartilhamento de conexões via rede de WiFi " +"aberta" From 89c677b67a434c1329bc6a10fb790f55e5fc27bc Mon Sep 17 00:00:00 2001 From: Yulia Date: Thu, 13 May 2010 12:46:20 -0700 Subject: [PATCH 385/392] po: updated Russian translation (rh #589230) --- po/ru.po | 1448 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1384 insertions(+), 64 deletions(-) diff --git a/po/ru.po b/po/ru.po index 60e3e9e2ac..d9df5d3f03 100644 --- a/po/ru.po +++ b/po/ru.po @@ -4,31 +4,1170 @@ # # Leonid Kanter , 2006, 2007. # Артём Попов , 2009. +# Yulia , 2010. msgid "" msgstr "" "Project-Id-Version: ru\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-12 16:33+0600\n" -"PO-Revision-Date: 2009-02-12 16:33+0600\n" -"Last-Translator: Артём Попов \n" -"Language-Team: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 14:56+1000\n" +"Last-Translator: Yulia \n" +"Language-Team: Russian\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Launchpad-Export-Date: 2009-02-12 11:00+0000\n" -"X-Generator: Launchpad (build Unknown)\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "ИМЯ" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "УСТРОЙСТВА" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ОБЛАСТЬ" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "ПО УМОЛЧАНИЮ" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "СЛУЖБА DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "ТИП" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "ВРЕМЕННАЯ МЕТКА" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "ДЕЙСТВ. ВРЕМЕННАЯ МЕТКА" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "АВТОПОДКЛЮЧЕНИЕ" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "ТОЛЬКО ДЛЯ ЧТЕНИЯ" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Применение: nmcli con { КОМАНДА | help }\n" +" КОМАНДА := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Ошибка: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Ошибка: 'con list': %s; разрешённые поля: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Сведения о соединении" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "система" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "пользователь" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "никогда" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "да" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "нет" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Соединения систем" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Соединения пользователя" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Ошибка: отсутствует аргумент %s" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Ошибка: нет подключения %s" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Неизвестный параметр: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Ошибка: не указан допустимый параметр." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Ошибка: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Ошибка: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Ошибка: 'con status': %s; разрешённые поля: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Активные соединения" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "нет активных соединений на устройстве «%s»" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "нет активного соединения или устройства" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "устройство «%s» несовместимо с соединением «%s»" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "не найдено устройство для соединения «%s»" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "активация" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "активно" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "неизвестно" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Подключение VPN (подготовка)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Подключение VPN (требуется аутентификация)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Подключение VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Подключение VPN (получение конфигурации IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN подключен" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Сбой подключения VPN" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN отключен" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "неизвестная причина" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "нет" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "пользователь был отключен" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "основное соединение с сетью было разорвано" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "служба VPN внезапно прекратила работу" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "служба VPN вернула недопустимую конфигурацию" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "время ожидания соединения истекло" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "служба VPN не была запущена вовремя" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "не удалось запустить службу VPN" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "нет верных секретов VPN" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "неверные секреты VPN" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "соединение удалено" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "статус: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Соединение активно\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Ошибка: сбой активации соединения." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "статус: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Ошибка: сбой активации соединения: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Ошибка: превышено время ожидания: %d сек." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Ошибка: сбой активации соединения: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Ошибка: не удалось установить активное соединение для «%s»" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Статус активного соединения: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Путь активного соединения: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Ошибка: неизвестное соединение: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Ошибка: недопустимое значение таймаута: «%s»" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Ошибка: необходимо указать ID или UUID." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Ошибка: подходящее устройство не найдено: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Ошибка: подходящее устройство не найдено." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Предупреждение: соединение не активно\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Ошибка: недопустимая команда «con»: «%s»" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Ошибка: не удалось подключиться к D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Ошибка: не удалось получить системные настройки." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Ошибка: не удалось получить настройки пользователя." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Ошибка: не удалось получить соединения, не выполняются службы настройки." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "УСТРОЙСТВО" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "СТАТУС" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "ОБЩИЕ" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "ВОЗМОЖНОСТИ" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "СВОЙСТВА WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "ТОЧКА" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "СВОЙСТВА ПРОВОДНОГО СОЕДИНЕНИЯ" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "НАСТРОЙКИ IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "ДРАЙВЕР" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "ОПРЕД.НЕСУЩУЮ" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "СКОРОСТЬ" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "НЕСУЩАЯ" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "АДРЕС" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "ПРЕФИКС" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ШЛЮЗ" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "РЕЖИМ" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "ЧАСТОТА" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "СКОРОСТЬ" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "СИГНАЛ" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "ЗАЩИТА" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "ФЛАГИ WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "ФЛАГИ RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "АКТИВЕН" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Применение: nmcli dev { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [ waddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "без управления" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "недоступен" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "отключен" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "подключается (подготовка)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "подключается (конфигурация)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "подключается (требуется аутентификация)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "подключается (получение настроек IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "подключен" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "сбой соединения" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Неизвестно" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(нет)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: ошибка преобразования адреса IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u МГц" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u МБ/с" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Зашифровано: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Инфраструктура" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Ошибка: «dev list»: %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Ошибка: «dev list»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Сведения об устройстве" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(неизвестно)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "неизвестно)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Мб/c" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "вкл" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "выкл" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Ошибка: «dev status»: %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Ошибка: «dev status»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Статус устройств" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Ошибка: отсутствует аргумент «%s»" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Ошибка: не найдено устройство «%s»." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Выполнено: устройство «%s» подключено." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Ошибка: не удалось отключить устройство «%s» (%s): %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Статус устройства: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Ошибка: необходимо указать интерфейс." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Ошибка: «dev wifi»: «%s»" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Ошибка: «dev wifi»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Список проверки WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Ошибка: точка доступа с адресом «%s» не найдена." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Ошибка: «%s» не является устройством WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Ошибка: неверная команда «dev wifi»: «%s»" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Ошибка: неверная команда «dev»: «%s»" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "ВЫПОЛНЯЕТСЯ" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "ОБОРУДОВАНИЕ WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "ОБОРУДОВАНИЕ WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Применение: nmcli nm { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "спящий" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "подключается" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Ошибка: «nm status»: %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Ошибка: «nm status»: %s; разрешённые поля: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Статус NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "включен" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "отключен" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "выполняется" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "не выполняется" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Ошибка: недопустимое значение «--fields»: «%s»; разрешённые поля: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi включен" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Ошибка: недопустимый параметр «wifi»: «%s»" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN включен" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Ошибка: недопустимый параметр «wwan»: «%s»" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Ошибка: недопустимая команда «nm»: «%s»." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Применение: %s [ПАРАМЕТРЫ] ОБЪЕКТ { КОМАНДА | help }\n" +"\n" +"ПАРАМЕТРЫ\n" +" -t[erse] сжатый вывод\n" +" -p[retty] отформатированный вывод\n" +" -m[ode] tabular|multiline режим вывода\n" +" -f[ields] <поле1,поле2,...>|all|common вывод выбранных полей\n" +" -e[scape] yes|no отделять разделитель столбцов в значениях специальными символами\n" +" -v[ersion] показать версию программы\n" +" -h[elp] показать эту справку\n" +"\n" +"ОБЪЕКТ\n" +" nm статус NetworkManager\n" +" con соединения NetworkManager\n" +" dev устройства под управлением NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Ошибка: неизвестный объект «%s». Попробуйте выполнить «nmcli help»." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Ошибка: параметр «--terse» указан дважды." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Ошибка: параметры «--terse» и «--pretty» взаимоисключаемы." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Ошибка: параметр «--pretty» указан дважды." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Ошибка: параметры «--pretty» и «--terse» взаимоисключаемы." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Ошибка: отсутствует аргумент параметра «%s»." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Ошибка: недопустимый аргумент «%s» для параметра «%s»." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Ошибка: отсутствуют поля для параметров «%s»." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "утилита nmcli, версия %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Ошибка: неизвестный параметр «%s». Попробуйте выполнить «nmcli -help»." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Получен сигнал %d. Завершение работы..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Ошибка: не удалось подключиться к NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Успешно" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (16-теричный ASCII-ключ)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-битная парольная фраза)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (неизвестно)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (неизвестно)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "любой, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 МГц, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 МГц, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 МГц, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 МГц, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 МГц, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 МГц, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 МГц, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 МГц, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 МГц, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 МГц, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "авто" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "не задано" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "поле «%s» должно быть единственным" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "недопустимое поле «%s»" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Параметр «--terse» требует указания «--fields»" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Параметр «--terse» требует определённых значений «--fields», но не «%s»" #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "Файл ключа PEM не имеет тега окончания «%s»." +msgstr "Файл ключа PEM не содержит завершающий тег «%s»." #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Файл не определяется как файл личного ключа PEM." +msgstr "Возможно, это не файл личного ключа PEM." #: ../libnm-util/crypto.c:138 #, c-format @@ -105,8 +1244,9 @@ msgstr "Недостаточно памяти для загрузки ВИ." msgid "IV contains non-hexadecimal digits." msgstr "ВИ включает нешестнадцатеричные цифры." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Неизвестный шифр личного ключа «%s»." @@ -126,71 +1266,106 @@ msgstr "Не удаётся определить тип личного ключ msgid "Not enough memory to store decrypted private key." msgstr "Недостаточно памяти для загрузки расшифрованного личного ключа." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Не удалось инициализировать криптографический модуль." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Не удалось инициализировать модуль MD5: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Недопустимая длина ВИ (минимально %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Недостаточно памяти для буфера расшифрованного ключа." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Не удалось инициализировать контекст шифра декодирования: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Не удалось создать симметричный ключ для расшифровки: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Не удалось создать ВИ для расшифровки: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Не удалось создать ВИ для расшифровки: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Не удалось расшифровать личный ключ: непредвиденная длина заполнения." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Не удалось расшифровать личный ключ." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Не удалось выделить память для шифрования" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Не удалось инициализировать контекст кода шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Не удалось создать симметричный ключ для шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Не удалось создать ВИ для шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Не удалось зашифровать данные: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Ошибка инициализации данных сертификата: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Не удалось расшифровать сертификат: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Не удалось инициализировать декодер PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Не удалось расшифровать файл PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Не удалось проверить файл PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Не удалось инициализировать криптографический модуль: %d." @@ -200,112 +1375,190 @@ msgstr "Не удалось инициализировать криптогра msgid "Failed to initialize the MD5 context: %d." msgstr "Не удалось инициализировать контекст MD5: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Недопустимая длина ВИ (минимально %d)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Не удалось инициализировать слот шифра декодирования." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Не удалось задать симметричный ключ расшифровки." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Не удалось задать ВИ расшифровки." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Не удалось инициализировать контекст расшифровки." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Не удалось расшифровать личный ключ: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Не удалось расшифровать личный ключ: слишком большой объем расшифрованных " +"данных." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Не удалось завершить расшифровку личного ключа: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Не удалось инициализировать слот шифра декодирования." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Не удалось задать симметричный ключ для шифрования." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Не удалось задать ВИ расшифровки." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Не удалось инициализировать контекст шифрования." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Не удалось зашифровать: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Непредвиденный объём данных после шифрования." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Не удалось расшифровать сертификат: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Не удалось преобразовать пароль в UCS2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Не удалось инициализировать декодер PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Не удалось расшифровать файл PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Не удалось проверить файл PKCS#12: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Ошибка при генерации случайных данных." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Недостаточно памяти для создания ключа шифрования." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Не удалось выделить память для создания файла PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Не удалось выделить память для записи ВИ в файл PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Не удалось выделить память для записи зашифрованного ключа в файл PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Не удалось выделить память для данных файла PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "ошибка обработки сообщения netlink: %s" -#: ../src/nm-netlink-monitor.c:251 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "произошла ошибка при ожидании данных из сокета" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "не удаётся подключиться к netlink для отслеживания статуса соединения: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "не удаётся включить проверку данных авторизации netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "не удаётся создать идентификатор netlink для отслеживания статуса " "соединения: %s" -#: ../src/nm-netlink-monitor.c:261 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"не удаётся подключиться к netlink для отслеживания статуса соединения: %s" - -#: ../src/nm-netlink-monitor.c:269 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "" -"не удаётся войти в группу netlink для отслеживания статуса соединения: %s" - -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "" -"не удаётся выделить кэш netlink для отслеживания статуса соединения: %s" +msgstr "не удаётся выделить кэш netlink для отслеживания статуса соединения: %s" -#: ../src/nm-netlink-monitor.c:418 +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "не удалось войти в группу netlink: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "ошибка обновления кэша соединения: %s" -#: ../src/nm-netlink-monitor.c:484 -msgid "error occurred while waiting for data on socket" -msgstr "произошла ошибка при ожидании данных из сокета" - -#: ../src/NetworkManager.c:293 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Неверный параметр. Используйте --help для вывода списка возможных " "параметров.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Используйте --help для вывода списка допустимых параметров.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Создано NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:100 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -314,18 +1567,85 @@ msgstr "" "# Совмещено с %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "не найден клиент DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' не найден." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' не найден." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "клиент DHCP '%s' не поддерживается" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Неизвестный уровень журналирования «%s»" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Неизвестный домен журналирования «%s»" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ВНИМАНИЕ: преобразователь имён glibc не поддерживает более трёх серверов " "имён." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Нижеперечисленные сервера могут быть пропущены." -#: ../system-settings/src/main.c:381 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Авто %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Система" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Совместное использование соединений в закрытой сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Совместное использование соединений в открытой сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Изменить постоянное имя узла компьютера" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Изменить соединения системы" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Системная политика запрещает изменение системных настроек" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Системная политика запрещает изменение постоянного имени узла компьютера" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Системная политика запрещает совместное использование соединений в закрытой " +"сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Системная политика запрещает совместное использование соединений в закрытой " +"сети WiFi" + From 15b4d1569d58392d3e11723f6e5b1586c6897c43 Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Thu, 13 May 2010 12:46:58 -0700 Subject: [PATCH 386/392] po: updated Telugu translation (rh #589230) --- po/te.po | 1290 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 787 insertions(+), 503 deletions(-) diff --git a/po/te.po b/po/te.po index 4d9101b69d..54c6fed65e 100644 --- a/po/te.po +++ b/po/te.po @@ -7,23 +7,91 @@ msgid "" msgstr "" "Project-Id-Version: te\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-21 03:24+0000\n" -"PO-Revision-Date: 2010-04-21 18:32+0530\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-06 19:30+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" "\n" "\n" "\n" "\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -44,310 +112,514 @@ msgstr "" "]\n" " down id | uuid \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 "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "నామము" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "సిస్టమ్ అనుసంధానములు:\n" +msgid "Error: 'con list': %s" +msgstr "దోషము: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "వినియోగదారి అనుసంధానములు:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "దోషము: 'con list': %s; అనుమతించబడు క్షేత్రములు: %s" -#: ../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:207 +msgid "Connection details" +msgstr "అనుసంధానము వివరములు" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "సిస్టమ్" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "వినియోగదారి" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ఎప్పటికికాదు" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "అవును" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "కాదు" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "సిస్టమ్ అనుసంధానములు" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "వినియోగదారి అనుసంధానములు" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "దోషము: %s ఆర్గుమెంట్ తప్పిపోయినది." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "దోషము: %s - అటువంటి అనుసంధానము లేదు." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "సిస్టమ్-వ్యాప్త అనుసంధానములు" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "వినియోగదారి అనుసంధానములు" - -#: ../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:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "తెలియని పారామితి: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, 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:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "దోషము: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "కాదు" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "దోషము: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "దోషము: 'con status': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "క్రియాశీల అనుసంధానములు" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "అప్రమేయ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "సేవ" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "పరికరములు" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "పరికరము '%s' పైన యెటువంటి క్రియాశీల అనుసంధానము లేదు" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "ఎటువంటి క్రియాశీల అనుసంధానము లేదా పరికరము లేదు" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "పరికరము '%s' అనుసంధానము '%s'తో సారూప్యమైనది కాదు" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "అనుసంధానము '%s' కొరకు యే పరికరము కనుగొనబడలేదు" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "క్రియాశీలపరచుచున్నది" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "క్రియాశీలపరచబడింది" -#: ../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:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "తెలియని" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN అనుసంధానమౌచున్నది (సిద్దపరచు)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN అనుసంధానమౌచున్నది" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN అనుసంధానమైంది" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN అనుసంధానము విఫలమైంది" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN అననుసంధానమైంది" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "తెలియని కారణము" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "ఏదీకాదు" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "వినియోగదారి అననుసంధానింప బడినారు" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "ఆధార నెట్వర్కు అనుసంధానము ఆటంకపరచబడింది" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN సేవ అనుకోకుండా ఆపివేయబడింది" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN సేవ చెల్లని ఆకృతీకరణను తిప్పియిచ్చినది" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "అనుసంధానపు ప్రయత్నం సమయం మించిపోయినది" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN సేవ సమయం లోపల ప్రారంభించబడలేదు" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN సేవ ప్రారంభమగుటకు విఫలమైంది" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "ఏ విలువైన VPN రహస్యాలు లేవు" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "చెల్లని VPN రహస్యాలు" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "అనుసంధానము తీసివేయబడింది" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "స్థితి: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "అనుసంధానము క్రియాశీలపరచబడింది\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "స్థితి: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "దోషము: కాలపరిమితి %d సె మించినది." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "దోషము: '%s' కొరకు క్రియాశీల అనుసంధానమును పొందుటలో విఫలమైంది." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "క్రియాశీల అనుసంధానము స్థితి: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "క్రియాశీల అనుసంధానము పాత్: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "దోషము: తెలియని దోషము: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "దోషము: కాలముగింపు విలువ '%s' చెల్లనిది." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "దోషము: id లేదా uuid తెలుపవలసి వుంది." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "దోషము: ఎటువంటి సూటయ్యే పరికరము కనబడలేదు: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "దోషము: ఏ సూటగు పరికరము కనబడలేదు." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" -msgstr "హెచ్చరిక: అనుసంధానము క్రియాశీలంగా లేదు\n" +msgstr "దహెచ్చరిక: అనుసంధానము క్రియాశీలంగా లేదు\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "దోషము: 'con' ఆదేశము '%s' చెల్లునది కాదు." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "దోషము: D-Busకు అనుసంధానము కాలేకపోయినది." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "దోషము: సిస్టమ్ అమరికలను పొందలేక పోయింది." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "దోషము: వినియోగదారి అమరికలను పొందలేక పోయింది." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "దోషము: అనుసంధానములను పొందలేదు: అమరికల సేవలు నడుచుటలేదు." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -357,7 +629,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Usage: nmcli dev { COMMAND | help }\n" @@ -367,349 +639,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "నిర్వహించని" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "అందుబాటులోలేని" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "అననుసంధానమైన" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "అనుసంధానమౌచున్నది (సిద్దపడుతోంది)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "అనుసంధానమౌచున్నది (ఆకృతీకరించబడుతోంది)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "అనుసంధానమైంది" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "అనుసంధానము విఫలమైంది" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "తెలియని" -#. 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:277 msgid "(none)" msgstr "(ఏదీకాదు)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 చిరునామా 0x%X మార్చుటలో దోషము" -#: ../cli/src/devices.c:238 -#, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, పౌనఃపున్యం(ఫ్రీక్వెన్సీ) %d MHz, రేటు %d Mb/s, బలం(స్ట్రెన్త్) %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", ఎన్క్రిప్టెడ్: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" - -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr "ఎంటర్‌ప్రైజ్" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "పరికరము" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "డ్రైవర్" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(తెలియని)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "స్థితి" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW చిరునామా" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" సామర్ధ్యములు:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "కారియర్ గుర్తించబడింది" - -#: ../cli/src/devices.c:336 -#, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "వేగము" - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" వైర్‌లెస్ లక్షణములు\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP ఎన్క్రిప్షన్" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA ఎన్క్రిప్షన్" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 ఎన్క్రిప్షన్" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP సైఫర్" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP సైఫర్" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" వైర్‌లెస్ యాక్సిస్ పాయింట్స్ %s\n" - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = current AP)" - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" వైర్డు లక్షణములు\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "కారియర్" - -#: ../cli/src/devices.c:377 -msgid "on" -msgstr "ఆన్" - -#: ../cli/src/devices.c:379 -msgid "off" -msgstr "ఆఫ్" - -#: ../cli/src/devices.c:387 -#, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 అమరికలు:\n" - -#: ../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 "DNS" - -#: ../cli/src/devices.c:458 -msgid "Status of devices" -msgstr "పరికరముల యొక్క స్థితి" - -#: ../cli/src/devices.c:487 -#, c-format -msgid "Error: '%s' argument is missing." -msgstr "దోషము: '%s' ఆర్గుమెంట్ తప్పిపోయినది." - -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 -#, c-format -msgid "Error: Device '%s' not found." -msgstr "దోషము: పరికరము '%s' కనబడలేదు." - -#: ../cli/src/devices.c:539 -#, c-format -msgid "Success: Device '%s' successfully disconnected." -msgstr "సఫలమైంది: పరికరము '%s' సఫలవంతంగా అననుసంధానించబడింది." - -#: ../cli/src/devices.c:564 -#, c-format -msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "దోషము: పరికరము '%s' (%s) అననుసంధానము విఫలమైంది: %s" - -#: ../cli/src/devices.c:572 -#, c-format -msgid "Device state: %d (%s)\n" -msgstr "పరికరము స్థితి: %d (%s)\n" - -#: ../cli/src/devices.c:636 -#, c-format -msgid "Error: iface has to be specified." -msgstr "దోషము: iface తెలుపవలసి వుంది." - -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi స్కాన్ జాబితా" - -#: ../cli/src/devices.c:740 -#, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "దోషము: పరికరము '%s' అనునది WiFi పరికరము కాదు." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "పరికరము:" - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "దోషము: hwaddr తెలుపవలసి వుంది." - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "దోషము: హార్డువేర్‌చిరునామా '%s'తో యాక్సెస్ పాయింట్ కనబడలేదు." - -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:349 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:350 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP పారామితులు" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ఎన్క్రిప్టెడ్: " -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "పౌనఃపున్యము:" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "రీతి:" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ఎంటర్‌ప్రైజ్ " -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:380 msgid "Infrastructure" msgstr "అవస్థాపన(ఇన్ఫ్రాస్ట్రక్చర్)" -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "గరిష్ట బిట్‌రేట్:" +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "దోషము: 'dev list': %s" -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "బలం:" +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "దోషము: 'dev list': %s; అనుమతించబడు క్షేత్రములు: %s" -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "ఫ్లాగ్స్:" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "పరికరము వివరములు" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "గోప్యత" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(తెలియని)" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA ఫ్లాగ్స్:" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "తెలియని)" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN ఫ్లాగ్స్:" +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:907 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ఆన్" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ఆఫ్" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "దోషము: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "దోషము: 'dev status': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "పరికరముల యొక్క స్థితి" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "దోషము: '%s' ఆర్గుమెంట్ తప్పిపోయినది." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "దోషము: పరికరము '%s' కనబడలేదు." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "సఫలమైంది: పరికరము '%s' సఫలవంతంగా అననుసంధానించబడింది." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "దోషము: పరికరము '%s' (%s) అననుసంధానము విఫలమైంది: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "పరికరము స్థితి: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "దోషము: iface తెలుపవలసి వుంది." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "దోషము: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "దోషము: 'dev wifi': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi స్కాన్ జాబితా" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "దోషము: హార్డువేర్‌చిరునామా '%s'తో యాక్సెస్ పాయింట్ కనబడలేదు." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "దోషము: పరికరము '%s' అనునది WiFi పరికరము కాదు." + +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "దోషము: 'dev wifi' ఆదేశము '%s' చెల్లనిది." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "దోషము: 'dev' ఆదేశము '%s' చెల్లనిది." -#: ../cli/src/network-manager.c:46 +#: ../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" @@ -734,89 +893,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "స్థబ్దుగా(asleep)" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "అనుసంధానమౌచున్నది" -#: ../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 "దోషము: '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 "దోషము: 'nm status': %s; allowed fields: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "నెట్వర్కునిర్వాహిక స్థితి" -#: ../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 "చేతనమైంది" -#: ../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 "అచేతనమైంది" + +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "నడుచుచున్నది" -#: ../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:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "దోషము: '--fields' విలువ '%s' యిక్కడ చెల్లునది కాదు; అనుమతించబడు క్షేత్రములు: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "నెని వైర్‌లెస్ హార్డువేరు:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi చేతనమైంది" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "నెని వైర్‌లెస్:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "నెని WWAN హార్డువేర్:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" - -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "దోషము: చెల్లని 'wifi' పారామితి: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN చేతనమైంది" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "దోషము: చెల్లని 'wwan' పారామితి: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "దోషము: 'nm' ఆదేశము '%s' చెల్లనిది." -#: ../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] |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" @@ -827,10 +988,14 @@ msgstr "" "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] |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" @@ -838,35 +1003,165 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "ఆబ్జక్టు '%s' తెలియనిది, 'nmcli help' ప్రయత్నించండి." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "దోషము: ఆబ్జక్టు '%s' తెలియనిది, 'nmcli help' ప్రయత్నించు." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "దోషము: ఐచ్చికము '--terse' రెండవ సమయాన్ని తెలిపినది." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "దోషము: ఐచ్చికము '--terse' అనునది '--pretty'తో పరస్పరం విభేదించుచున్నది." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "దోషము: ఐచ్చికము '--pretty' రెండవసారి తెలుపబడింది." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "దోషము: ఐచ్చికము '--pretty' అనునది '--terse'తో పరస్పరం విభేదించుచున్నది." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "దోషము: '%s' ఐచ్చికము కొరకు తప్పిపోయిన ఆర్గుమెంట్." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "దోషము: '%s' అనునది '%s' ఐచ్చికము కొరకు చెల్లునటువంటి ఆర్గుమెంట్ కాదు." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "దోషము: '%s' ఐచ్చికముల కొరకు క్షేత్రములు అనునవి తప్పిపోవుచున్నవి." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli సాధనము, వర్షన్ %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "ఐచ్చికము '%s' తెలియనిది, 'nmcli -help' ప్రయత్నించండి." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "దోషము: ఐచ్చికము '%s' తెలియనిది, 'nmcli -help' ప్రయత్నించుము." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "సిగ్నల్ %d వచ్చింది, మూసివేయుచున్నది..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "దోషము: నెట్వర్కునిర్వాహికకు అనుసంధానము కాలేకపోయింది." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "సఫలంమైంది" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (తెలియని)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (తెలియని)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ఏదైనా, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "స్వయంచాలక" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "అమర్చ లేదు" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "క్షేత్రము '%s' వొంటరిగా వుండాలి" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "క్షేత్రము '%s' చెల్లనిది" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "ఐచ్చికము '--terse' కు '--fields' తెలుపుట అవసరము" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "ఐచ్చికము '--terse' కు ప్రత్యేకించి '--fields' ఐచ్చికము విలువలు అవసరము , '%s' కాదు" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1182,73 +1477,76 @@ msgstr "PKCS#12 ఫైలు నిర్దారించలేక పోయ msgid "Could not generate random data." msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." -#: ../libnm-util/nm-utils.c:1818 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." -#: ../libnm-util/nm-utils.c:1928 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "మెమొరీను PEM ఫైలు సృష్టీకరణ కొరకు కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1940 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1952 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." -#: ../libnm-util/nm-utils.c:1971 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 -#: ../src/nm-netlink-monitor.c:581 -#: ../src/ip6-manager/nm-netlink-listener.c:351 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "నెట్‌లింక్ సందేశమును ప్రోసెసింగ్ చేయుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:259 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకుకు అనుసంధానము కాలేకపోయింది: %s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు సమూహమును కలుపలేక పోయింది:%s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "నెట్‌లింక్ హాండిల్ క్రెడెన్షియల్ పాసింగ్ చేతము చేయలేదు: %s" -#: ../src/nm-netlink-monitor.c:285 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు క్యాచీని కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:493 -#: ../src/ip6-manager/nm-netlink-listener.c:381 -msgid "error occurred while waiting for data on socket" -msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" -#: ../src/main.c:498 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" -#: ../src/main.c:558 +#: ../src/main.c:562 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. చెల్లునటువంటి ఐచ్చికముల జాబితా చూచుటకు దయచేసి --help వుపయోగించుము.\n" @@ -1283,21 +1581,6 @@ msgstr "'dhcpcd' కనుగొనబడ గలదు." msgid "unsupported DHCP client '%s'" msgstr "మద్దతీయని DHCP క్లైంట్ '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:199 -#, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "నెట్‌లింక్ సంభాలికను కేటాయించలేక పోయింది: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:209 -#, c-format -msgid "unable to connect to netlink: %s" -msgstr "నెట్‌లింక్‌కు అనుసంధానము కాలేకపోయింది: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:306 -#, c-format -msgid "unable to join netlink group: %s" -msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" - #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" @@ -1308,11 +1591,11 @@ msgstr "తెలియని లాగ్ స్థాయి '%s'" msgid "Unknown log domain '%s'" msgstr "తెలియని లాగ్ డొమైన్ '%s'" -#: ../src/named-manager/nm-named-manager.c:314 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:316 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." @@ -1321,7 +1604,7 @@ msgstr "క్రిందన జాబితాచేసివున్న న msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3229 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "సిస్టమ్" @@ -1356,3 +1639,4 @@ 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 నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + From f0938011f8c867a3e536e951b40688adcf6616ed Mon Sep 17 00:00:00 2001 From: Leah Liu Date: Thu, 13 May 2010 12:49:55 -0700 Subject: [PATCH 387/392] po: updated Chinese translation (rh #589230) --- po/zh_CN.po | 2048 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 1347 insertions(+), 701 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index cf10ebec79..d1e17ae850 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1,21 +1,1160 @@ +# translation of zh_CN.po to Wei Liu # Simplified Chinese translation to NetworkManager -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. +# # Funda Wang , 2004. # Aron Xu , 2009. -# +# Leah Liu , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager\n" +"Project-Id-Version: zh_CN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-09-06 21:44+0800\n" -"PO-Revision-Date: 2009-09-06 22:25+0800\n" -"Last-Translator: Aron Xu \n" -"Language-Team: Simplified Chinese \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 19:25+1000\n" +"Last-Translator: Leah Liu \n" +"Language-Team: Wei Liu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "名称" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "设备" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "范围" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "默认" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS 服务" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC 对象" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "类型" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "时间戳" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "真实时间戳" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "自动连接" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "只读" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"用法:nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "错误:'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "错误:'con list': %s;允许的字段:%s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "连接详情" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "系统" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "用户" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "从不" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "是" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "否" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "系统连接" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "用户连接" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "错误:缺少 %s 参数。" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "错误:%s - 没有这个连接。" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "未知参数:%s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "错误:没有指定有效参数。" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "错误:%s。" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "错误:'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "错误:'con status': %s;允许的字段:%s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "活跃连接" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "设备 '%s' 中没有活跃连接" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "没有活跃连接或者设备" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "设备 '%s' 不兼容连接 '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "没有找到可用于连接 '%s' 的设备" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "激活中" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "激活的" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "未知" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 连接(准备)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 连接中(需要验证)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 连接中" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 连接中(获取 IP 配置)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VNP 连接" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 连接失败" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "断开 VPN 连接" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "未知原因" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "无" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "断开连接的用户" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "基点网络连接中断" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 服务意外停止" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 服务返回无效配置" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "连接尝试超时" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 连接没有按时启动" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 服务启动失败" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "没有有效 VPN secret" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "无效 VPN secret" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "连接被删除" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "状态:%s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "连接被激活\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "错误:激活连接失败。" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "状态:%s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "错误:激活连接失败:%s。" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "错误:超时 %d 秒过期。" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "错误:激活连接失败:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "错误:获取 '%s' 的活跃连接失败。" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "活跃连接状态:%s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "活跃连接路径:%s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "错误:未知连接:%s" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "错误:超时值 '%s' 无效。" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "错误:必须指定 id 或者 uuid。" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "错误:没有找到合适的设备:%s。" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "错误:没有找到合适的设备。" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告:连接没有激活\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "错误:'con' 命令 '%s' 无效。" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "错误:无法连接到 D-Bus。" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "错误:无法获得系统设置。" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "错误:无法获得用户设置。" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "错误:无法获得连接:设定服务没有运行。" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "设备" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "状态" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "常规" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "功能" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI 属性" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "有线连接属性" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 设置" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "驱动程序" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "硬盘" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "容器探测" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "速度" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "容器" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "地址" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "前缀" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "网关" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "型号" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "频率" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "信号" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "安全性" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-标志" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-标志" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "活跃" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"用法:nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "未管理的" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "不可用的" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "断开连接" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "连接中(准备)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "连接中(配置中)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "连接中(需要验证)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "连接中(获得 IP 配置)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "连接的" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "连接失败" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "未知" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(无)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:转换 IP4 地址 0x%X 出错" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "加密的:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "企业级" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "基础构架" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "错误:'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "错误:'dev list': %s;允许的字段:%s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "设备详情" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(未知)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "未知)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "开" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "关" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "错误:'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "错误:'dev status': %s;允许的字段:%s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "设备状态" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "错误:缺少 '%s' 参数。" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "错误:没有找到设备 '%s'。" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功:成功断开设备 '%s'。" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "错误:断开设备 '%s'(%s)失败:%s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "设备状态:%d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "错误:没有指定 iface。" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "错误:'dev wifi':%s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "错误:'dev wifi': %s;允许的字段:%s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi 扫描列表" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "错误:没有找到使用 hwaddr '%s' 的访问点。" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "错误:设备 '%s' 不是 WiFi 设备。" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "错误:'dev wifi' 命令 '%s' 无效。" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "错误:'dev' 命令 '%s' 无效。" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "运行中" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI 硬件" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN 硬件" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "连接中" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "错误:'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "错误:'nm status': %s;允许的字段:%s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "网络管理器状态" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "启用的" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "禁用的" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "运行中" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "没有运行" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "错误:'--fields' 值 '%s' 在此无效;允许的字段:%s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "启用 WiFi" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "错误:无效 'wifi' 参数:'%s'。" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "启用 WWAN" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "错误:无效 'wwan' 参数:'%s'。" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "错误:'nm' 命令 '%s' 无效。" + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"用法:%s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "错误:对象 '%s' 未知,尝试 'nmcli help'。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "错误:第二此指定选项 '--terse'。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "错误:选项 '--terse' 与 '--pretty' 相互排斥。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "错误:第二次指定选项 '--pretty'。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "错误:选项 '--pretty' 与 '--terse' 相互排斥。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "错误:'%s' 选项缺少参数。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "错误:'%s' 不是 '%s' 选项的有效参数。" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "错误:缺少 '%s' 选项字段。" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 工具,版本 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "错误:选项 '%s' 未知,尝试 'nmcli -help'。" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "捕获信号 %d,关闭中......" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "错误:无法连接到网络管理器。" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "成功" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d(104/128 位密码短语)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d(未知)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0(未知)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "任意," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz," + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz," + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz," + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz," + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz," + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz," + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz," + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz," + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz," + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz," + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz," + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自动" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "未设置" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "字段 '%s' 必须是单独的" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "无效字段 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "选项 '--terse' 要求指定 '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "选项 '--terse' 需要特定 '--fields' 选项值,不是 '%s'" #: ../libnm-util/crypto.c:120 #, c-format @@ -60,7 +1199,7 @@ msgstr "错误的 PEM 文件格式:DEK-Info 标签中的初始向量格式无 #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "" +msgstr "对 PEM 文件进行操作:未知专用密钥 '%s'。" #: ../libnm-util/crypto.c:222 #, c-format @@ -90,7 +1229,7 @@ msgstr "没有足够的空间储存文件数据。" #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "" +msgstr "IV 长度必须是偶数字节。" #: ../libnm-util/crypto.c:333 #, c-format @@ -102,11 +1241,12 @@ msgstr "没有足够的空间储存初始向量。" msgid "IV contains non-hexadecimal digits." msgstr "初始向量中包含非十六进制数字。" -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../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 "" +msgstr "未知专用密钥密码 '%s'。" #: ../libnm-util/crypto.c:391 #, c-format @@ -123,72 +1263,106 @@ msgstr "无法确定私钥类型。" msgid "Not enough memory to store decrypted private key." msgstr "没有足够的空间储存解密后的私钥。" -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "初始化加密引擎失败。" -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "初始化 MD5 引擎失败:%s / %s。" -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "无效 IV 长度(必须至少为 %zd)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "没有足够的空间作为已解密密钥缓冲。" -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "" +msgstr "初始化解密计算内容失败:%s / %s。" -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "" +msgstr "为解密设定对称密钥失败:%s / %s。" -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "为解密设置初始向量失败:%s / %s。" -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "解密私钥失败:%s / %s" -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "解密私钥失败:意外的填充长度。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "解密私钥失败。" -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "无法为加密分配内存。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "初始化加密计算内容失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "为加密设置对称密钥失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "为加密设置 IV 失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "加密数据失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "初始化证书数据出错:%s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "无法解码证书:%s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "无法初始化 PKCS#12 解码器:%s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "无法解码 PKCS#12 文件:%s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "无法校验 PKCS#12 文件:%s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "初始化加密引擎失败:%d。" @@ -198,100 +1372,184 @@ msgstr "初始化加密引擎失败:%d。" msgid "Failed to initialize the MD5 context: %d." msgstr "初始化 MD5 环境失败:%d。" -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 #, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "" +msgid "Invalid IV length (must be at least %d)." +msgstr "无效 IV 长度(必须至少 %d)。" #: ../libnm-util/crypto_nss.c:196 #, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "" +msgid "Failed to initialize the decryption cipher slot." +msgstr "初始化解密计算插槽失败。" #: ../libnm-util/crypto_nss.c:206 #, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "为解密设置对称密钥失败。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format msgid "Failed to set IV for decryption." msgstr "为解密设置初始向量失败。" -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "初始化解密环境失败。" -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "解密私钥失败:%d。" -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "解密私钥失败:解密数据太大。" + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "结束解密私钥失败:%d。" -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "初始化加密计算插槽失败。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "为加密设置对称密钥失败。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "为加密设置 IV 失败。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "初始化加密内容失败。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "加密失败:%d。" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "加密后意外的数据量。" + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "无法解码证书:%d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "无法将密码转换为 USC2 方式:%d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "无法初始化 PKCS#12 解码器:%d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "无法解码 PKCS#12 文件:%d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "无法校验 PKCS#12 文件:%d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "无法生成随机数据。" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "没有足够的空间生成加密密钥。" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "无法为创建 PEM 文件分配内存。" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "无法为在 PEM 文件中写入 IV 分配内存。" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "无法为在 PEM 文件中写入加密密钥分配内存。" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "无法为 PEM 文件数据分配内存。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "处理网路信息出错:%s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "无法为监视连接状态分配网路句柄:%s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "等候套接字上的数据时发生了错误" -#: ../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 "无法为监视连接状态连接到网路:%s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "无法为监视连接状态加入网路组:%s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "无法启用网络链接句柄证书通过:%s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "无法为监视连接状态分配网路句柄:%s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "无法为监视连接状态分配网路连接:%s" -#: ../src/nm-netlink-monitor.c:494 -msgid "error occurred while waiting for data on socket" -msgstr "等候套接字上的数据时发生了错误" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "无法加入网络链接组群:%s" -#: ../src/NetworkManager.c:330 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "更新链接缓存出错:%s" + +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "无效选项。请使用 --help 查看有效选项列表。\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s。请使用 --help 查看有效选项列表。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# 由 NetworkManger 创建\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -300,20 +1558,47 @@ msgstr "" "# 合并自 %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "找到无法使用的 DHCP 客户端。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "找到 'dhclient'。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "找到 'dhcpcd'。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "不支持的 DHCP 客户端 '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "未知日志等级 '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "未知日志域 '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注意:libc 解析器可能不支持超过三个名字服务器。" -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "以下列出的名字服务器可能无法被识别。" -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "自动 %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "系统" @@ -349,642 +1634,3 @@ msgstr "系统策略阻止使用受保护的 WiFi 网络共享连接" msgid "System policy prevents sharing connections via an open WiFi network" msgstr "系统策略组织使用公开 WiFi 网络共享连接" -#~ msgid "Passphrase for wireless network %s" -#~ msgstr "无线网络 %s 的密码句" - -#~ msgid "Connection to the wireless network '%s' failed." -#~ msgstr "到无线网络“%s”的连接失败。" - -#~ msgid "Connection to the wired network failed." -#~ msgstr "连接到有线网络失败。" - -#~ msgid "Error displaying connection information:" -#~ msgstr "显示连接信息出错:" - -#~ msgid "Could not find some required resources (the glade file)!" -#~ msgstr "序找不到所需的资源(glade 文件未找到)!" - -#~ msgid "Wired Ethernet (%s)" -#~ msgstr "有线以太网(%s)" - -#~ msgid "Wireless Ethernet (%s)" -#~ msgstr "无线以太网(%s)" - -#~ msgid "NetworkManager Applet" -#~ msgstr "网络管理器小程序" - -#~ msgid "Copyright © 2004-2005 Red Hat, Inc." -#~ msgstr "版权 (C) 2004-2005 Red Hat, Inc." - -#~ msgid "" -#~ "Notification area applet for managing your network devices and " -#~ "connections." -#~ msgstr "管理您网络设备和连接的通知区域小程序" - -#~ msgid "translator-credits" -#~ msgstr "Funda Wang " - -#~ msgid "VPN Login Failure" -#~ msgstr "VPN 登录失败" - -#~ msgid "Could not start the VPN connection '%s' due to a login failure." -#~ msgstr "无法启动 VPN 连接“%s”,原因是登录失败。" - -#~ msgid "VPN Start Failure" -#~ msgstr "VPN 启动失败" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' due to a failure launching the " -#~ "VPN program." -#~ msgstr "无法启动 VPN 连接“%s”,原因是调用 VPN 程序失败。" - -#~ msgid "VPN Connect Failure" -#~ msgstr "VPN 连接失败" - -#~ msgid "Could not start the VPN connection '%s' due to a connection error." -#~ msgstr "无法启动 VPN 连接“%s”,原因是连接出错。" - -#~ msgid "VPN Configuration Error" -#~ msgstr "VPN 配置错误" - -#~ msgid "The VPN connection '%s' was not correctly configured." -#~ msgstr "VPN 连接“%s”未正确配置。" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' because the VPN server did not " -#~ "return an adequate network configuration." -#~ msgstr "无法启动 VPN 连接“%s”,原因是 VPN 服务器未返回足够的网络配置。" - -#~ msgid "VPN Login Message" -#~ msgstr "VPN 登录消息" - -#~ msgid "" -#~ "The NetworkManager Applet could not find some required resources (the " -#~ "glade file was not found)." -#~ msgstr "网络管理器小程序找不到所需的资源(glade 文件未找到)。" - -#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." -#~ msgstr "网络设备“%s(%s)”不支持无线扫描。" - -#~ msgid "The network device \"%s (%s)\" does not support link detection." -#~ msgstr "网络设备“%s(%s)”不支持链接检测。" - -#~ msgid "Preparing device %s for the wired network..." -#~ msgstr "正在为有线网络准备设备 %s..." - -#~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "正在为无线网络“%2$s”准备设备 %1$s..." - -#~ msgid "Configuring device %s for the wired network..." -#~ msgstr "正在为有线网络配置设备 %s..." - -#~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "正在试图加入无线网络“%s”..." - -#~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "正在等待无线网络“%s”的网络密钥..." - -#~ msgid "Requesting a network address from the wired network..." -#~ msgstr "正在从有线网络请求网络地址..." - -#~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "正在从无线网络“%s”请求网络地址..." - -#~ msgid "Finishing connection to the wired network..." -#~ msgstr "正在完成到有线网络的连接..." - -#~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "正在完成到无线网络“%s”的连接..." - -#~ msgid "NetworkManager is not running" -#~ msgstr "网络管理器未运行" - -#~ msgid "Networking disabled" -#~ msgstr "网络已禁用" - -#~ msgid "No network connection" -#~ msgstr "没有网络连接" - -#~ msgid "Wired network connection" -#~ msgstr "有线网络连接" - -#~ msgid "Connected to an Ad-Hoc wireless network" -#~ msgstr "已连接到 Ad-Hoc 无线网络" - -#~ msgid "Wireless network connection to '%s' (%d%%)" -#~ msgstr "到“%s”的无线网络连接(%d%%)" - -#~ msgid "VPN connection to '%s'" -#~ msgstr "到“%s”的 VPN 连接" - -#~ msgid "VPN connecting to '%s'" -#~ msgstr "连接到“%s”的 VPN" - -#~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "连接到其它无线网络(_C)..." - -#~ msgid "Create _New Wireless Network..." -#~ msgstr "创建新的无线网络(_N)..." - -#~ msgid "_VPN Connections" -#~ msgstr "_VPN 连接" - -#~ msgid "_Configure VPN..." -#~ msgstr "配置 VPN(_C)..." - -#~ msgid "_Disconnect VPN..." -#~ msgstr "断开 VPN(_D)..." - -#~ msgid "_Dial Up Connections" -#~ msgstr "拨号连接(_D)" - -#~ msgid "Connect to %s..." -#~ msgstr "正在连接到 %s..." - -#~ msgid "Disconnect from %s..." -#~ msgstr "正在从 %s 断开..." - -#~ msgid "No network devices have been found" -#~ msgstr "没有发现网络设备" - -#~ msgid "NetworkManager is not running..." -#~ msgstr "网络管理器未运行..." - -#~ msgid "Enable _Networking" -#~ msgstr "启用联网(_N)" - -#~ msgid "Enable _Wireless" -#~ msgstr "启用无线(_W)" - -#~ msgid "Connection _Information" -#~ msgstr "连接信息(_I)" - -#~ msgid "_Help" -#~ msgstr "帮助(_H)" - -#~ msgid "_About" -#~ msgstr "关于(_A)" - -#~ msgid "" -#~ "The NetworkManager applet could not find some required resources. It " -#~ "cannot continue.\n" -#~ msgstr "网络管理器小程序找不到所需的资源。无法继续。\n" - -#~ msgid "Shared Key" -#~ msgstr "共享密钥" - -#~ msgid "Automatic (Default)" -#~ msgstr "自动(默认)" - -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" - -#~ msgid "TKIP" -#~ msgstr "TKIP" - -#~ msgid "Dynamic WEP" -#~ msgstr "动态 WEP" - -#~ msgid "None" -#~ msgstr "无" - -#~ msgid "WEP 64/128-bit ASCII" -#~ msgstr "WEP 64/128 位 ASCII" - -#~ msgid "WEP 64/128-bit Hex" -#~ msgstr "WEP 64/128 位十六进制" - -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "WEP 128 位密码句" - -#~ msgid "PEAP" -#~ msgstr "PEAP" - -#~ msgid "TLS" -#~ msgstr "TLS" - -#~ msgid "TTLS" -#~ msgstr "TTLS" - -#~ msgid "WPA2 Enterprise" -#~ msgstr "WPA2 企业" - -#~ msgid "WPA Enterprise" -#~ msgstr "WPA 企业" - -#~ msgid "WPA2 Personal" -#~ msgstr "WPA2 个人" - -#~ msgid "WPA Personal" -#~ msgstr "WPA 个人" - -#~ msgid "Orientation" -#~ msgstr "方向" - -#~ msgid "The orientation of the tray." -#~ msgstr "托盘方向。" - -#~ msgid "Wired Network (%s)" -#~ msgstr "有线网络(%s)" - -#~ msgid "_Wired Network" -#~ msgstr "有线网络(_W)" - -#~ msgid "Wireless Network (%s)" -#~ msgid_plural "Wireless Networks (%s)" -#~ msgstr[0] "无线网络(%s)" - -#~ msgid "Wireless Network" -#~ msgid_plural "Wireless Networks" -#~ msgstr[0] "无线网络" - -#~ msgid " (invalid Unicode)" -#~ msgstr " (无效的 Unicode)" - -#~ msgid "" -#~ "By default, the wireless network's name is set to your computer's name, %" -#~ "s, with no encryption enabled" -#~ msgstr "" -#~ "默认情况下,无线网络的名称会设定为您的计算机名称,%s,如果没有加密的话" - -#~ msgid "Create new wireless network" -#~ msgstr "创建新的无线网络" - -#~ msgid "" -#~ "Enter the name and security settings of the wireless network you wish to " -#~ "create." -#~ msgstr "输入您想要创建的无线网络的名称和安全设置。" - -#~ msgid "Create New Wireless Network" -#~ msgstr "创建新的无线网络" - -#~ msgid "Existing wireless network" -#~ msgstr "现有无线网络" - -#~ msgid "Enter the name of the wireless network to which you wish to connect." -#~ msgstr "输入您想要连接的无线网络的名称。" - -#~ msgid "Connect to Other Wireless Network" -#~ msgstr "连接到其它无线网络" - -#~ msgid "Error connecting to wireless network" -#~ msgstr "连接到无线网络出错" - -#~ msgid "" -#~ "The requested wireless network requires security capabilities unsupported " -#~ "by your hardware." -#~ msgstr "您的硬件不支持请求的无线网络所需的安全特性。" - -#~ msgid "Cannot start VPN connection '%s'" -#~ msgstr "无法启动 VPN 连接“%s”" - -#~ msgid "" -#~ "Could not find the authentication dialog for VPN connection type '%s'. " -#~ "Contact your system administrator." -#~ msgstr "找不到 VPN 连接类型“%s”的身份验证对话。请联系您的系统管理员。" - -#~ msgid "" -#~ "There was a problem launching the authentication dialog for VPN " -#~ "connection type '%s'. Contact your system administrator." -#~ msgstr "调用 VPN 连接类型“%s”的身份验证对话有问题。请联系您的系统管理员。" - -#~ msgid " " -#~ msgstr " " - -#~ msgid "" -#~ "Active Connection Information" -#~ msgstr "活动连接信息" - -#~ msgid "" -#~ "Passphrase Required by Wireless " -#~ "Network\n" -#~ "\n" -#~ "A passphrase or encryption key is required to access the wireless network " -#~ "'%s'." -#~ msgstr "" -#~ "无线网络需要密码句\n" -#~ "\n" -#~ "要访问无线网络“%s”,需要提供密码句或加密密钥。" - -#~ msgid "" -#~ "Reduced Network Functionality\n" -#~ "\n" -#~ "%s It will not be completely functional." -#~ msgstr "" -#~ "削减的网络功能\n" -#~ "\n" -#~ "%s 该网络无法完整工作。" - -#~ msgid "" -#~ "Wireless Network Login " -#~ "Confirmation\n" -#~ "\n" -#~ "You have chosen to log in to the wireless network '%s'. If you are sure " -#~ "that this wireless network is secure, click the checkbox below and " -#~ "NetworkManager will not require confirmation on subsequent log ins." -#~ msgstr "" -#~ "无线网络登录确认\n" -#~ "\n" -#~ "您选择登录到无线网络“%s”。如果您确定此无线网络是安全的,请选中下面的复选" -#~ "框,网络管理器在以后登录时将不会请求确认。" - -#~ msgid "Anonymous Identity:" -#~ msgstr "匿名身份:" - -#~ msgid "Authentication:" -#~ msgstr "认证:" - -#~ msgid "Broadcast Address:" -#~ msgstr "广播地址:" - -#~ msgid "CA Certificate File:" -#~ msgstr "CA 证书文件:" - -#~ msgid "C_onnect" -#~ msgstr "连接(_O)" - -#~ msgid "Client Certificate File:" -#~ msgstr "客户端证书文件:" - -#~ msgid "Connection Information" -#~ msgstr "连接信息" - -#~ msgid "Default Route:" -#~ msgstr "默认路由:" - -#~ msgid "Destination Address:" -#~ msgstr "目的地址:" - -#~ msgid "Driver:" -#~ msgstr "驱动程序:" - -#~ msgid "EAP Method:" -#~ msgstr "EAP 方法:" - -#~ msgid "Hardware Address:" -#~ msgstr "硬件地址:" - -#~ msgid "IP Address:" -#~ msgstr "IP 地址:" - -#~ msgid "Identity:" -#~ msgstr "身份:" - -#~ msgid "Interface:" -#~ msgstr "接口:" - -#~ msgid "Key Type:" -#~ msgstr "密钥类型:" - -#~ msgid "Key:" -#~ msgstr "密钥:" - -#~ msgid "" -#~ "None\n" -#~ "WEP 128-bit Passphrase\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" -#~ msgstr "" -#~ "无\n" -#~ "WEP 128 位密码句\n" -#~ "WEP 64/128 位十六进制\n" -#~ "WEP 64/128 位 ASCII\n" - -#~ msgid "" -#~ "Open System\n" -#~ "Shared Key" -#~ msgstr "" -#~ "开放式系统\n" -#~ "共享密钥" - -#~ msgid "Other Wireless Network..." -#~ msgstr "其它无线网络..." - -#~ msgid "Passphrase:" -#~ msgstr "密码句:" - -#~ msgid "Password:" -#~ msgstr "密码:" - -#~ msgid "Primary DNS:" -#~ msgstr "主 DNS:" - -#~ msgid "Private Key File:" -#~ msgstr "私钥文件:" - -#~ msgid "Private Key Password:" -#~ msgstr "私用密钥密码:" - -#~ msgid "Secondary DNS:" -#~ msgstr "辅 DNS:" - -#~ msgid "Select the CA Certificate File" -#~ msgstr "选择 CA 证书文件" - -#~ msgid "Select the Client Certificate File" -#~ msgstr "选择客户端证书文件" - -#~ msgid "Select the Private Key File" -#~ msgstr "选择私钥文件" - -#~ msgid "Show key" -#~ msgstr "显示密钥" - -#~ msgid "Show passphrase" -#~ msgstr "显示密码句" - -#~ msgid "Show password" -#~ msgstr "显示密码" - -#~ msgid "Show passwords" -#~ msgstr "显示密码" - -#~ msgid "Speed:" -#~ msgstr "速度:" - -#~ msgid "Subnet Mask:" -#~ msgstr "子网掩码:" - -#~ msgid "Type:" -#~ msgstr "类型:" - -#~ msgid "User Name:" -#~ msgstr "用户名:" - -#~ msgid "Wireless Network Key Required" -#~ msgstr "需要无线网络密钥" - -#~ msgid "Wireless _adapter:" -#~ msgstr "无线适配器(_A):" - -#~ msgid "_Always Trust this Wireless Network" -#~ msgstr "总是信任此无线网络(_A)" - -#~ msgid "_Don't remind me again" -#~ msgstr "以后不再提醒(_D)" - -#~ msgid "_Login to Network" -#~ msgstr "登录到网络(_L)" - -#~ msgid "_Network Name:" -#~ msgstr "网络名称(_N):" - -#~ msgid "_Wireless Security:" -#~ msgstr "无线安全性(_W):" - -#~ msgid "Cannot add VPN connection" -#~ msgstr "无法添加 VPN 连接" - -#~ msgid "" -#~ "No suitable VPN software was found on your system. Contact your system " -#~ "administrator." -#~ msgstr "您的系统上未找到合适的 VPN 软件。请联系您的系统管理员。" - -#~ msgid "Cannot import VPN connection" -#~ msgstr "无法导入 VPN 连接" - -#~ msgid "" -#~ "Cannot find suitable software for VPN connection type '%s' to import the " -#~ "file '%s'. Contact your system administrator." -#~ msgstr "" -#~ "找不到合适的软件来导入 VPN 连接类型“%s”的文件“%s”。请联系您的系统管理员。" - -#~ msgid "Error retrieving VPN connection '%s'" -#~ msgstr "获取 VPN 连接“%s”出错" - -#~ msgid "" -#~ "Could not find the UI files for VPN connection type '%s'. Contact your " -#~ "system administrator." -#~ msgstr "找不到 VPN 连接类型“%s”的用户界面文件。请联系您的系统管理员。" - -#~ msgid "Delete VPN connection \"%s\"?" -#~ msgstr "删除 VPN 连接“%s”吗?" - -#~ msgid "" -#~ "All information about the VPN connection \"%s\" will be lost and you may " -#~ "need your system administrator to provide information to create a new " -#~ "connection." -#~ msgstr "" -#~ "关于 VPN 连接“%s”的全部信息都将丢失。要创建新连接的话,您就必须请求您的系" -#~ "统管理员提供相应信息。" - -#~ msgid "Unable to load" -#~ msgstr "无法装入" - -#~ msgid "Cannot find some needed resources (the glade file)!" -#~ msgstr "找不到所需的资源(glade 文件)!" - -#~ msgid "Edit VPN Connection" -#~ msgstr "编辑 VPN 连接" - -#~ msgid "Add a new VPN connection" -#~ msgstr "添加新的 VPN 连接" - -#~ msgid "Choose which type of VPN connection you wish to create." -#~ msgstr "选择您想要创建的 VPN 连接类型。" - -#~ msgid "Connect to:" -#~ msgstr "连接到:" - -#~ msgid "Create VPN Connection" -#~ msgstr "创建 VPN 连接" - -#~ msgid "Create VPN Connection - 1 of 2" -#~ msgstr "创建 VPN 连接 - 第一步,共两步" - -#~ msgid "Create VPN Connection - 2 of 2" -#~ msgstr "创建 VPN 连接 - 第二步,共两步" - -#~ msgid "Delete the selected VPN connection" -#~ msgstr "删除选中的 VPN 连接" - -#~ msgid "E_xport" -#~ msgstr "导出(_X)" - -#~ msgid "Edit the selected VPN connection" -#~ msgstr "编辑选中的 VPN 连接" - -#~ msgid "Export the VPN settings to a file" -#~ msgstr "将 VPN 设置导出到文件" - -#~ msgid "Export the selected VPN connection to a file" -#~ msgstr "将选中的 VPN 连接导出到文件" - -#~ msgid "Finish Creating VPN Connection" -#~ msgstr "创建 VPN 连接完成" - -#~ msgid "Manage Virtual Private Network Connections" -#~ msgstr "管理虚拟私网连接" - -#~ msgid "" -#~ "This assistant will guide you through the creation of a connection to a " -#~ "Virtual Private Network (VPN).\n" -#~ "\n" -#~ "It will require some information, such as IP addresses and secrets. " -#~ "Please see your system administrator to obtain this information." -#~ msgstr "" -#~ "此助手将指引您创建到虚拟私网(VPN)的连接。\n" -#~ "\n" -#~ "此向导需要您提供的某些信息,比如 IP 地址和机密问题,您可能需要求助系统管理" -#~ "员才能知晓。" - -#~ msgid "VPN Connections" -#~ msgstr "VPN 连接" - -#~ msgid "40-bit WEP" -#~ msgstr "40 位 WEP" - -#~ msgid "104-bit WEP" -#~ msgstr "104 位 WEP" - -#~ msgid "WPA TKIP" -#~ msgstr "WPA TKIP" - -#~ msgid "WPA CCMP" -#~ msgstr "WPA CCMP" - -#~ msgid "WPA Automatic" -#~ msgstr "WPA 自动" - -#~ msgid "WPA2 TKIP" -#~ msgstr "WPA2 TKIP" - -#~ msgid "WPA2 CCMP" -#~ msgstr "WPA2 CCMP" - -#~ msgid "WPA2 Automatic" -#~ msgstr "WPA2 自动" - -#~ msgid "none" -#~ msgstr "无" - -#~ msgid "operation took too long" -#~ msgstr "操作时间太长" - -#~ msgid "received data from wrong type of sender" -#~ msgstr "从错误的发送者类型收到数据" - -#~ msgid "received data from unexpected sender" -#~ msgstr "从未知的发送者收到数据" - -#~ msgid "too much data was sent over socket and some of it was lost" -#~ msgstr "向套接字发送的数据太多,其中有些已经丢失" - -#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." -#~ msgstr "您现在已连接到 Ad-Hoc 无线网络“%s”。" - -#~ msgid "You are now connected to the wireless network '%s'." -#~ msgstr "您现在已连接到无线网络“%s”。" - -#~ msgid "You are now connected to the wired network." -#~ msgstr "您现在已连接到有线网络。" - -#~ msgid "Connection Established" -#~ msgstr "连接已建立" - -#~ msgid "Disconnected" -#~ msgstr "已断开连接" - -#~ msgid "The network connection has been disconnected." -#~ msgstr "网络连接现已断开。" From 42eb1f38ccc9da422a5590781f3fa49a85869068 Mon Sep 17 00:00:00 2001 From: Terry Chuang Date: Thu, 13 May 2010 12:50:43 -0700 Subject: [PATCH 388/392] po: updated Traditional Chinese translation (rh #589230) --- po/zh_TW.po | 2544 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 1591 insertions(+), 953 deletions(-) diff --git a/po/zh_TW.po b/po/zh_TW.po index 835875aa5e..4357e26699 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1,41 +1,1561 @@ +# translation of zh_TW.po to Traditional Chinese # Traditional Chinese translation of Network Manager. -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005, 2010 Free Software Foundation, Inc. +# # Woodman Tuen , 2005. # Chao-Hsiung Liao , 2008. -# +# Chester Cheng , 2010. +# Chester Cheng , 2010. +# Terry Chuang , 2010. +# Terry Chuang , 2010. msgid "" msgstr "" -"Project-Id-Version: Network Manager 0.7.0\n" +"Project-Id-Version: zh_TW\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-21 20:14+0800\n" -"PO-Revision-Date: 2008-08-21 15:37+0800\n" -"Last-Translator: Chao-Hsiung Liao \n" -"Language-Team: Chinese/Traditional \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:59+1000\n" +"Last-Translator: Terry Chuang \n" +"Language-Team: Traditional Chinese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "錯誤:'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "錯誤:'con list': %s; 允許的欄位為:%s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "連線詳情" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "系統" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "使用者" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "永不" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "是" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "否" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "系統連線" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "使用者連線" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "錯誤:沒有 %s 參數。" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "錯誤:%s - 此連線不存在。" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "不明的參數:%s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "錯誤:未指定合於規定的參數。" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "錯誤:%s。" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "錯誤:'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "錯誤:'con status': %s; 允許的欄位為:%s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "使用中的連線" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "裝置「%s」沒有使用中的連線" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "沒有使用中的連線或裝置" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "裝置 '%s' 和連線 '%s' 不相容" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "連線「%s」沒有找到任何裝置" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "啟用中" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "已啟用" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "不明" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 連線(準備)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 連線(需要身份認證)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 連線" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 連線(取得 IP 配置)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN 已連線" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 連線失敗" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN 已離線" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "原因不明" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "none" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "該使用者已經斷線" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "基礎的網路連線已經中斷" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 服務無預期停止" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 服務傳回無效的配置" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "嚐試連線已經逾時" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 服務並沒有按時開始" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 服務無法開始" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "VPN 密碼不正確" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "VPN 密碼不正確" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "連線已移除" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "狀態:%s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "連線已啟動\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "錯誤:啟動連線失敗。" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "狀態:%s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "錯誤:啟動連線失敗:%s。" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "錯誤:逾時 %d 秒。" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "錯誤:啟動連線失敗:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "錯誤:為「%s」取得啟用中的連線失敗。" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "啟用中連線的狀態:%s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "啟用中連線的路徑:%s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "錯誤:不明的連線:%s。" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "錯誤:逾時值「%s」不合乎規定。" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "錯誤:未指定 id 或 uuid。" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "錯誤:找不到適用的裝置:%s。" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "錯誤:找不到適用的裝置。" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告:連線並未啟用\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "錯誤:「con」指令「%s」不合乎規定。" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "錯誤:無法連到 D-Bus。" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "錯誤:無法取得系統設定。" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "錯誤:無法取得使用者設定。" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "錯誤:無法取得連線:設定服務並未執行。" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "不受管理的" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "無法使用" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "離線" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "連線中(準備)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "連線中(配置中)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "連線中(需要身份認證)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "連線中(正在取得 IP 配置)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "已連線" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "連線失敗" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "不明" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(none)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:轉換 IP4 位址 0x%x 時發生錯誤" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "已加密:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "企業版 " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "點對點" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "基礎建設" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "錯誤:'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "錯誤:'dev list': %s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "裝置詳細資訊" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(不明)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "不明)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "開" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "關" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "錯誤:'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "錯誤:'dev status':%s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "裝置的狀態" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "錯誤:找不到「%s」參數。" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "錯誤:找不到「%s」裝置。" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功:裝置「%s」已經成功地斷線。" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "錯誤:裝置「%s」(%s)斷線失敗:%s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "裝置狀態:%d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "錯誤:必須指定 iface。" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "錯誤:'dev wifi':%s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "錯誤:'dev wifi':%s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi 掃描清單" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "錯誤:找不到擁有 hwaddr「%s」的存取點。" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "錯誤:「%s」不是 WiFi 裝置。" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "錯誤:「dev wifi」指令「%s」不合乎規定。" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "錯誤:「dev」指令「%s」不合乎規定。" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI-HARDWARE" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "連線中" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "錯誤:'nm status':%s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "錯誤:'nm status':%s; 允許的欄位為:%s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager 狀態" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "已啟用" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "已停用" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "執行中" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "非執行中" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "錯誤:'--fields' 值 '%s' 在此無效; 允許的欄位為:%s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi 已啟用" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "錯誤:不合乎規定的「wifi」參數:%s。" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN 已啟用" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "錯誤:不合乎規定的「wwan」參數:%s。" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "錯誤:「nm」指令「%s」不合乎規定。" + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "錯誤:物件 '%s' 不明,請嘗試 'nmcli help'。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "錯誤:選項 '--terse' 已指定了第二次。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "錯誤:選項 '--terse' 和 '--pretty' 是互斥的。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "錯誤:選項 '--pretty' 已指定了第二次。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "錯誤:選項 '--pretty' 和 '--terse' 是互斥的。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "錯誤:'%s' 選項的引數遺失。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "錯誤:'%s' 不是 '%s' 選項的有效引數。" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "錯誤:找不到 '%s' 選項的欄位。" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 工具,版本 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "錯誤:選項 '%s' 不明,請嚐試 'nmcli -help'。" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "捕捉到訊號 %d,關閉..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "錯誤:無法連上 NetworkManager。" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "成功" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d(十六進位的 ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d(104/128 位元密碼)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d(不明)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0(不明)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "任何," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自動" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "不設置" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "欄位 '%s' 必須是單獨的" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "無效的欄位 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "選項 '--terse' 需指定 '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "選項 '--terse' 需要特定的 '--fields' 選項值,而不是 '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 金鑰檔案沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "看起來不像是 PEM 私密金鑰檔案。" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "沒有足夠的記憶體可儲存 PEM 檔案資料。" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "格式不良的 PEM 檔案:Proc-Type 不是第一個標籤。" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "格式不良的 PEM 檔案:不明的 Proc-Type 標籤「%s」" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 不是第二個標籤。" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:在 DEK-Info 標籤中找不到 IV。" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 標籤中的 IV 格式是無效的。" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "格式不良的 PEM 檔案:不明的私密金鑰加密器「%s」。" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "無法解碼私密金鑰。" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 憑證「%s」沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "解碼憑證失敗。" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "沒有足夠的記憶體可儲存憑證資料。" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "沒有足夠的記憶體可儲存檔案資料。" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV 的長度必須為偶數位元組。" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "沒有足夠的記憶體可儲存 IV。" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV 包含非十六進位的數字。" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "私密金鑰加密器「%s」不明。" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "沒有足夠的記憶體可解密私密金鑰。" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "無法決定私密金鑰的類型。" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "沒有足夠的記憶體可儲存解密的私密金鑰。" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "初始化 crypto 引擎失敗。" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "初始化 MD5 引擎失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "不合乎規定的 IV 長度(必須至少是 %zd)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "沒有足夠的記憶體供作解密金鑰緩衝區。" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "初始化解密用的加密器失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "設定解密用的對稱式金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "設定解密用的 IV 失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "解密私密金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "解密私密金鑰失敗:無預期的填空長度。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "解密私密金鑰失敗。" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "無法分配記憶體,以供加密。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "初始化加密用的加密器失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "設定加密用的對稱式金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "設定加密用的 IV 失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "加密私密金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "初始化憑證資料時發生錯誤:%s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "無法解碼憑證:%s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "無法啟動 PKCS#12 解碼程式:%s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "無法解碼 PKCS#12 檔案:%s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "無法驗證 PKCS# 12 檔案:%s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "初始化 crypto 引擎失敗: %d。" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "初始化 MD5 本文失敗:%d。" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "不合於規定的 IV 長度(必須至少是 %d)。" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "初始化解密用的加密器插槽失敗。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "設定解密用的對稱式金鑰失敗。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "設定解密用的 IV 失敗。" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "初始化解密上下文失敗。" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "解密私密金鑰失敗:%d。" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "解密私密金鑰失敗:解密的資料太龐大。" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "結束私密金鑰的解密失敗:%d。" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "初始化加密用的加密器插槽失敗。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "設定加密用的對稱式金鑰失敗。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "設定加密用的 IV 失敗。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "初始化加密本文失敗。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "加密失敗:%d。" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "加密後無預期的資料量。" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "無法解碼憑證:%d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "無法將密碼轉為 UCS2:%d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "無法初始化 PKCS#12 解碼程式:%d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "無法解碼 PKCS#12 檔案:%d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "無法驗證 PKCS#12 檔案:%d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "無法產生隨機資料。" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "沒有足夠的記憶體建立加密金鑰。" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "無法分配記憶體,以建立 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "無法分配記憶體,好將 IV 寫入 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "無法分配記憶體,將加密金鑰寫入 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "無法分配記憶體給 PEM 檔案資料。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "處理 netlink 訊息時發生錯誤:%s" -#: ../src/nm-netlink-monitor.c:439 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "等待 socket 上的資料時發生錯誤" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "無法連結 netlink 以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "無法啟用 netlink handle credential passing:%s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "無法配置 netlink 處理器以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "無法配置 netlink 連線快取以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "無法加入 netlink 群組:%s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "更新連線快取時發生錯誤:%s" -#: ../src/NetworkManager.c:250 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "無效的選項。請使用 --help 來查看有效選項的清單。\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s。請使用 --help 來查看有效選項的清單。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Created by NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -44,961 +1564,79 @@ msgstr "" "# Merged from %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:257 -msgid "NOTE: the glibc resolver does not support more than 3 nameservers." -msgstr "注意:glibc 解析器不支援 3 個以上的名稱伺服器。" +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "找不到可重複使用的 DHCP 用戶端。" -#: ../src/named-manager/nm-named-manager.c:259 +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "找不到「dhclient」。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "找不到「dhcpcd」。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "不支援的 DHCP 用戶端「%s」" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "不明日誌層級「%s」" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "不明日誌網域「%s」" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "注意:libc 解析器不支援 3 個以上的名稱伺服器。" + +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "下面列出的名稱伺服器可能不會被辨識。" -#: ../system-settings/src/main.c:365 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "自動 %s" -#: ../libnm-util/crypto.c:125 -#, c-format -msgid "PEM key file had no end tag '%s'." -msgstr "PEM 金鑰檔案沒有結束標籤「%s」。" +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "系統" -#: ../libnm-util/crypto.c:135 -#, c-format -msgid "Doesn't look like a PEM private key file." -msgstr "看起來不像是 PEM 私密金鑰檔案。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "透過受保護的 WiFi 網路共享連線" -#: ../libnm-util/crypto.c:143 -#, c-format -msgid "Not enough memory to store PEM file data." -msgstr "沒有足夠的記憶體可儲存 PEM 檔案資料。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "透過開放的 WiFi 網路共享連線" -#: ../libnm-util/crypto.c:159 -#, c-format -msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "格式不良的 PEM 檔案:Proc-Type 不是第一個標籤。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "修改永久系統的主機名稱" -#: ../libnm-util/crypto.c:167 -#, c-format -msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "格式不良的 PEM 檔案:未知的 Proc-Type 標籤「%s」" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "修改系統連線" -#: ../libnm-util/crypto.c:177 -#, c-format -msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "格式不良的 PEM 檔案:DEK-Info 不是第二個標籤。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "系統政策讓您無法修改系統設定" -#: ../libnm-util/crypto.c:188 -#, c-format -msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "格式不良的 PEM 檔案:在 DEK-Info 標籤中找不到 IV。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "系統政策讓您無法修改永久的系統主機名稱" -#: ../libnm-util/crypto.c:195 -#, c-format -msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "格式不良的 PEM 檔案:DEK-Info 標籤中的 IV 格式是無效的。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "系統政策讓您無法透過受保護的 WiFi 網路共享連結" -#: ../libnm-util/crypto.c:208 -#, c-format -msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "格式不良的 PEM 檔案:未知的私密金鑰加密器「%s」。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "系統政策讓您無法透過開放的 WiFi 網路共享連線" -#: ../libnm-util/crypto.c:227 -#, c-format -msgid "Could not decode private key." -msgstr "無法解碼私密金鑰。" - -#: ../libnm-util/crypto.c:271 -#, c-format -msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "PEM 憑證「%s」沒有結束標籤「%s」。" - -#: ../libnm-util/crypto.c:281 -#, c-format -msgid "Failed to decode certificate." -msgstr "解碼憑證失敗。" - -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 -#, c-format -msgid "Not enough memory to store certificate data." -msgstr "沒有足夠的記憶體可儲存憑證資料。" - -#: ../libnm-util/crypto.c:328 -#, c-format -msgid "IV must be an even number of bytes in length." -msgstr "IV 的長度必須為偶數位元組。" - -#: ../libnm-util/crypto.c:337 -#, c-format -msgid "Not enough memory to store the IV." -msgstr "沒有足夠的記憶體可儲存 IV。" - -#: ../libnm-util/crypto.c:348 -#, c-format -msgid "IV contains non-hexadecimal digits." -msgstr "IV 包含非十六進位的數字。" - -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 -#: ../libnm-util/crypto_nss.c:136 -#, c-format -msgid "Private key cipher '%s' was unknown." -msgstr "私密金鑰加密器「%s」不明。" - -#: ../libnm-util/crypto.c:395 -#, c-format -msgid "Not enough memory to create private key decryption key." -msgstr "沒有足夠的記憶體可建立私密金鑰的解密鑰匙。" - -#: ../libnm-util/crypto.c:513 -#, c-format -msgid "Not enough memory to store decrypted private key." -msgstr "沒有足夠的記憶體可儲存解密的私密金鑰。" - -#: ../libnm-util/crypto_gnutls.c:73 -#, c-format -msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "初始化 MD5 引擎失敗: %s / %s。" - -#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 -#, c-format -msgid "Not enough memory for decrypted key buffer." -msgstr "沒有足夠的記憶體供作解密金鑰緩衝區。" - -#: ../libnm-util/crypto_gnutls.c:143 -#, c-format -msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "初始化解密用的加密器失敗: %s / %s。" - -#: ../libnm-util/crypto_gnutls.c:152 -#, c-format -msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "設定解密用的對稱式金鑰失敗: %s / %s。" - -#: ../libnm-util/crypto_gnutls.c:161 -#, c-format -msgid "Failed to set IV for decryption: %s / %s." -msgstr "設定解密用的 IV 失敗: %s / %s。" - -#: ../libnm-util/crypto_gnutls.c:170 -#, c-format -msgid "Failed to decrypt the private key: %s / %s." -msgstr "解密私密金鑰失敗: %s / %s。" - -#: ../libnm-util/crypto_gnutls.c:208 -#, c-format -msgid "Error initializing certificate data: %s" -msgstr "初始化憑證資料時發生錯誤:%s" - -#: ../libnm-util/crypto_gnutls.c:220 -#, c-format -msgid "Couldn't decode certificate: %s" -msgstr "無法解碼憑證:%s" - -#: ../libnm-util/crypto_nss.c:78 -#, c-format -msgid "Failed to initialize the MD5 context: %d." -msgstr "初始化 MD5 失敗:%d。" - -#: ../libnm-util/crypto_nss.c:153 -#, c-format -msgid "Failed to initialize the decryption cipher slot." -msgstr "初始化解密用的加密器插槽失敗。" - -#: ../libnm-util/crypto_nss.c:163 -#, c-format -msgid "Failed to set symmetric key for decryption." -msgstr "設定解密用的對稱式金鑰失敗。" - -#: ../libnm-util/crypto_nss.c:173 -#, c-format -msgid "Failed to set IV for decryption." -msgstr "設定解密用的 IV 失敗。" - -#: ../libnm-util/crypto_nss.c:181 -#, c-format -msgid "Failed to initialize the decryption context." -msgstr "初始化解密上下文失敗。" - -#: ../libnm-util/crypto_nss.c:194 -#, c-format -msgid "Failed to decrypt the private key: %d." -msgstr "解密私密金鑰失敗:%d。" - -#: ../libnm-util/crypto_nss.c:206 -#, c-format -msgid "Failed to finalize decryption of the private key: %d." -msgstr "結束私密金鑰的解密失敗:%d。" - -#: ../libnm-util/crypto_nss.c:250 -#, c-format -msgid "Couldn't decode certificate: %d" -msgstr "無法解碼憑證:%d" - -#: ../src/nm-netlink-monitor.c:250 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "無法配置 netlink 處理器以監控連線狀態:%s" - -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "無法連結 netlink 以監控連線狀態:%s" - -#: ../src/nm-netlink-monitor.c:268 -#, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "無法加入 netlink 群組以監控連線狀態:%s" - -#: ../src/nm-netlink-monitor.c:276 -#, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "無法配置 netlink 連線快取以監控連線狀態:%s" - -#: ../src/nm-netlink-monitor.c:497 -#, c-format -msgid "error occurred while waiting for data on socket" -msgstr "等待 socket 上的資料時發生錯誤" - -#~ msgid "Passphrase for wireless network %s" -#~ msgstr "無線網路 %s 的通行碼" - -#~ msgid "Connection to the wireless network '%s' failed." -#~ msgstr "連接無線網路‘%s’失敗。" - -#~ msgid "Connection to the wired network failed." -#~ msgstr "連接有線網路失敗。" - -#~ msgid "Error displaying connection information:" -#~ msgstr "顯示連線資訊時發生錯誤:" - -#~ msgid "Could not find some required resources (the glade file)!" -#~ msgstr "無法找到一些需要的資源(glade 檔)!" - -#~ msgid "No active connections!" -#~ msgstr "沒有使用中的連線" - -#~ msgid "%d Mb/s" -#~ msgstr "%d Mb/s" - -#~ msgid "Wired Ethernet (%s)" -#~ msgstr "有線乙太網路 (%s)" - -#~ msgid "Wireless Ethernet (%s)" -#~ msgstr "有線乙太網路 (%s)" - -#~ msgid "Unknown" -#~ msgstr "不明" - -#~ msgid "NetworkManager Applet" -#~ msgstr "NetworkManager 面板程式" - -#~ msgid "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "版權所有 (C) 2004-2006 Red Hat, Inc.\n" -#~ "版權所有 (C) 2005-2006 Novell, Inc." - -#~ msgid "" -#~ "Notification area applet for managing your network devices and " -#~ "connections." -#~ msgstr "管理網路裝置與連線的通知區面板程式。" - -#~ msgid "translator-credits" -#~ msgstr "" -#~ "如對翻譯有任何意見,請送一封電子郵件給\n" -#~ "以下地址,GNOME 翻譯團隊會盡快回覆您:\n" -#~ "community@linuxhall.org\n" -#~ "\n" -#~ "Woodman Tuen , 2005." - -#~ msgid "" -#~ "Copyright © 2004-2005 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "版權所有 (C) 2004-2005 Red Hat, Inc.\n" -#~ "版權所有 (C) 2005-2006 Novell, Inc." - -#~ msgid "VPN Login Failure" -#~ msgstr "VPN 登入失敗" - -#~ msgid "Could not start the VPN connection '%s' due to a login failure." -#~ msgstr "因為登入失敗所以無法執行 VPN 連線‘%s’。" - -#~ msgid "VPN Start Failure" -#~ msgstr "VPN 啟動失敗" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' due to a failure launching the " -#~ "VPN program." -#~ msgstr "因為執行 VPN 程式失敗所以無法建立 VPN 連線‘%s’。" - -#~ msgid "VPN Connect Failure" -#~ msgstr "VPN 連線失敗" - -#~ msgid "Could not start the VPN connection '%s' due to a connection error." -#~ msgstr "因為連線錯誤,所以無法啟動 VPN 連線‘%s’。" - -#~ msgid "VPN Configuration Error" -#~ msgstr "VPN 組態發生錯誤" - -#~ msgid "The VPN connection '%s' was not correctly configured." -#~ msgstr "VPN 連線‘%s’沒有設定正確。" - -#~ msgid "" -#~ "Could not start the VPN connection '%s' because the VPN server did not " -#~ "return an adequate network configuration." -#~ msgstr "因為 VPN 伺服器沒有傳回足夠的網路組態所以無法建立 VPN 連線‘%s’。" - -#~ msgid "VPN Login Message" -#~ msgstr "VPN 登入訊息" - -#~ msgid "" -#~ "The NetworkManager Applet could not find some required resources (the " -#~ "glade file was not found)." -#~ msgstr "NetworkManager 面板程式無法找到一些需要的資源(找不到 glade 檔)" - -#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." -#~ msgstr "網路裝置“%s (%s)”不支援無線網路掃描。" - -#~ msgid "The network device \"%s (%s)\" does not support link detection." -#~ msgstr "網路裝置“%s (%s)”不支援連接偵測" - -#~ msgid "(unknown)" -#~ msgstr "(未知)" - -#~ msgid "Preparing device %s for the wired network..." -#~ msgstr "裝置 %s 正準備連接有線網路..." - -#~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "裝置 %s 正準備連接無線網路‘%s’..." - -#~ msgid "Configuring device %s for the wired network..." -#~ msgstr "設定有線網路裝置 %s ..." - -#~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "正在嘗試加入無線網路‘%s’..." - -#~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "正在等待無線網路‘%s’的網路金鑰..." - -#~ msgid "Requesting a network address from the wired network..." -#~ msgstr "正要求有線網路提供網路位址..." - -#~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "正要求無線網路‘%s’提供網路位址..." - -#~ msgid "Finishing connection to the wired network..." -#~ msgstr "連接有線網路完成..." - -#~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "連接無線網路‘%s’完成..." - -#~ msgid "NetworkManager is not running" -#~ msgstr "NetworkManager 沒有執行" - -#~ msgid "Networking disabled" -#~ msgstr "網路功能停用" - -#~ msgid "No network connection" -#~ msgstr "沒有網路連接" - -#~ msgid "Wired network connection" -#~ msgstr "有線網路連接" - -#~ msgid "Connected to an Ad-Hoc wireless network" -#~ msgstr "連接到 Ad-Hoc 點對點式無線網路" - -#~ msgid "Wireless network connection to '%s' (%d%%)" -#~ msgstr "無線網路連接到‘%s’ (%d%%)" - -#~ msgid "VPN connection to '%s'" -#~ msgstr "VPN 連線連接到‘%s’" - -#~ msgid "VPN connecting to '%s'" -#~ msgstr "VPN 連線至‘%s’" - -#~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "連接到其它的無線網路(_C)..." - -#~ msgid "Create _New Wireless Network..." -#~ msgstr "建立新的無線網路(_N)..." - -#~ msgid "_VPN Connections" -#~ msgstr "_VPN 連線" - -#~ msgid "_Configure VPN..." -#~ msgstr "設定 VP_N..." - -#~ msgid "_Disconnect VPN..." -#~ msgstr "與 V_PN 斷線..." - -#~ msgid "_Dial Up Connections" -#~ msgstr "播接連線(_D)" - -#~ msgid "Connect to %s..." -#~ msgstr "連線到 %s..." - -#~ msgid "Disconnect from %s..." -#~ msgstr "與 %s 斷線..." - -#~ msgid "No network devices have been found" -#~ msgstr "找不到任何網路裝置" - -#~ msgid "NetworkManager is not running..." -#~ msgstr "NetworkManager 沒有執行...." - -#~ msgid "Enable _Networking" -#~ msgstr "啟用網路功能(_N)" - -#~ msgid "Enable _Wireless" -#~ msgstr "啟用無線網路(_W)" - -#~ msgid "Connection _Information" -#~ msgstr "連線資訊(_I)" - -#~ msgid "_Help" -#~ msgstr "求助(_H)" - -#~ msgid "_About" -#~ msgstr "關於(_A)" - -#~ msgid "" -#~ "The NetworkManager applet could not find some required resources. It " -#~ "cannot continue.\n" -#~ msgstr "NetworkManager 面板程式無法找到一些需要的資源。它無法繼續。\n" - -#~ msgid "Open System" -#~ msgstr "開放系統" - -#~ msgid "Shared Key" -#~ msgstr "分享金鑰" - -#~ msgid "Automatic (Default)" -#~ msgstr "自動(預設值)" - -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" - -#~ msgid "TKIP" -#~ msgstr "TKIP" - -#~ msgid "Dynamic WEP" -#~ msgstr "動態 WEP" - -#~ msgid "None" -#~ msgstr "None" - -#~ msgid "WEP 64/128-bit ASCII" -#~ msgstr "WEP 64/128-bit ASCII" - -#~ msgid "WEP 64/128-bit Hex" -#~ msgstr "WEP 64/128-bit Hex" - -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "WEP 128-bit 密語" - -#~ msgid "PEAP" -#~ msgstr "PEAP" - -#~ msgid "TLS" -#~ msgstr "TLS" - -#~ msgid "TTLS" -#~ msgstr "TTLS" - -#~ msgid "WPA2 Enterprise" -#~ msgstr "WPA2 企業版" - -#~ msgid "WPA Enterprise" -#~ msgstr "WPA 企業版" - -#~ msgid "WPA2 Personal" -#~ msgstr "WPA2 個人版" - -#~ msgid "WPA Personal" -#~ msgstr "WPA 個人版" - -#~ msgid "Orientation" -#~ msgstr "方向" - -#~ msgid "The orientation of the tray." -#~ msgstr "面板的方向" - -#~ msgid "Wired Network (%s)" -#~ msgstr "有線網路 (%s)" - -#~ msgid "_Wired Network" -#~ msgstr "有線網路(_W)" - -#~ msgid "Wireless Network (%s)" -#~ msgid_plural "Wireless Networks (%s)" -#~ msgstr[0] "無線網路 (%s)" - -#~ msgid "Wireless Network" -#~ msgid_plural "Wireless Networks" -#~ msgstr[0] "無線網路" - -#~ msgid " (invalid Unicode)" -#~ msgstr "(無效的統一碼)" - -#~ msgid "" -#~ "By default, the wireless network's name is set to your computer's name, %" -#~ "s, with no encryption enabled" -#~ msgstr "預設上無線網路的名稱是設為您的電腦名稱,%s,並不使用加密" - -#~ msgid "Create new wireless network" -#~ msgstr "建立新的無線網路" - -#~ msgid "" -#~ "Enter the name and security settings of the wireless network you wish to " -#~ "create." -#~ msgstr "輸入您要建立的無線網路的名稱及安全設定。" - -#~ msgid "Create New Wireless Network" -#~ msgstr "建立一個新的無線網路" - -#~ msgid "Existing wireless network" -#~ msgstr "現有的無線網路" - -#~ msgid "Enter the name of the wireless network to which you wish to connect." -#~ msgstr "輸入您要連接的無線網路的名稱。" - -#~ msgid "Connect to Other Wireless Network" -#~ msgstr "連接到其它的無線網路" - -#~ msgid "Error connecting to wireless network" -#~ msgstr "連接到無線網路發生錯誤" - -#~ msgid "" -#~ "The requested wireless network requires security capabilities unsupported " -#~ "by your hardware." -#~ msgstr "您的硬體不支援該無線網路所需的安全性機能。" - -#~ msgid "Cannot start VPN connection '%s'" -#~ msgstr "無法執行 VPN 連線‘%s’" - -#~ msgid "" -#~ "Could not find the authentication dialog for VPN connection type '%s'. " -#~ "Contact your system administrator." -#~ msgstr "找不到 VPN 連線類型‘%s’的驗證對話盒。請連絡您的系統管理者。" - -#~ msgid "" -#~ "There was a problem launching the authentication dialog for VPN " -#~ "connection type '%s'. Contact your system administrator." -#~ msgstr "執行 VPN 連線類型‘%s’的驗證對話盒時發生問題。請連絡您的系統管理者。" - -#~ msgid " " -#~ msgstr " " - -#~ msgid "" -#~ "Active Connection Information" -#~ msgstr "使用中的連線資訊:" - -#~ msgid "" -#~ "Passphrase Required by Wireless " -#~ "Network\n" -#~ "\n" -#~ "A passphrase or encryption key is required to access the wireless network " -#~ "'%s'." -#~ msgstr "" -#~ "無線網路通行碼請求\n" -#~ "\n" -#~ "需要一個通行碼或是密鑰來存取無線網路‘%s’" - -#~ msgid "" -#~ "Reduced Network Functionality\n" -#~ "\n" -#~ "%s It will not be completely functional." -#~ msgstr "" -#~ "簡化的網路功能\n" -#~ "\n" -#~ "%s 它並不能完整的作用。" - -#~ msgid "" -#~ "Wireless Network Login " -#~ "Confirmation\n" -#~ "\n" -#~ "You have chosen to log in to the wireless network '%s'. If you are sure " -#~ "that this wireless network is secure, click the checkbox below and " -#~ "NetworkManager will not require confirmation on subsequent log ins." -#~ msgstr "" -#~ "無線網路登入確認\n" -#~ "\n" -#~ "您已經選擇登入無線網路‘%s’。如果確定此無線網路是安全的,按下下面的核取方" -#~ "塊,NetworkManager 在接下來的登入就不會再要求確認。" - -#~ msgid "Anonymous Identity:" -#~ msgstr "匿名身分:" - -#~ msgid "Authentication:" -#~ msgstr "驗證方式:" - -#~ msgid "Broadcast Address:" -#~ msgstr "廣播位址:" - -#~ msgid "CA Certificate File:" -#~ msgstr "CA 憑證檔案:" - -#~ msgid "C_onnect" -#~ msgstr "連線(_O)" - -#~ msgid "Client Certificate File:" -#~ msgstr "客戶端憑證檔案:" - -#~ msgid "Connection Information" -#~ msgstr "連線資訊" - -#~ msgid "Default Route:" -#~ msgstr "預設路由:" - -#~ msgid "Destination Address:" -#~ msgstr "目的地位址:" - -#~ msgid "Driver:" -#~ msgstr "驅動程式:" - -#~ msgid "EAP Method:" -#~ msgstr "EAP 方法:" - -#~ msgid "Hardware Address:" -#~ msgstr "硬體位址:" - -#~ msgid "IP Address:" -#~ msgstr "IP 位址:" - -#~ msgid "Identity:" -#~ msgstr "身分:" - -#~ msgid "Interface:" -#~ msgstr "介面:" - -#~ msgid "Key Type:" -#~ msgstr "金鑰類型:" - -#~ msgid "Key management:" -#~ msgstr "金鑰管理:" - -#~ msgid "Key:" -#~ msgstr "金鑰:" - -#~ msgid "" -#~ "None\n" -#~ "WEP 128-bit Passphrase\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" -#~ msgstr "" -#~ "無\n" -#~ "WEP 128-bit 密語\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" - -#~ msgid "" -#~ "Open System\n" -#~ "Shared Key" -#~ msgstr "" -#~ "開放系統\n" -#~ "分享金鑰" - -#~ msgid "Other Wireless Network..." -#~ msgstr "其它無線網路..." - -#~ msgid "Passphrase:" -#~ msgstr "通行碼:" - -#~ msgid "Password:" -#~ msgstr "密碼:" - -#~ msgid "Primary DNS:" -#~ msgstr "主要 DNS:" - -#~ msgid "Private Key File:" -#~ msgstr "私密金鑰檔案:" - -#~ msgid "Private Key Password:" -#~ msgstr "私密金鑰密碼 :" - -#~ msgid "Secondary DNS:" -#~ msgstr "次要 DNS:" - -#~ msgid "Select the CA Certificate File" -#~ msgstr "選擇 CA 憑證檔案" - -#~ msgid "Select the Client Certificate File" -#~ msgstr "選擇客戶端憑證檔案" - -#~ msgid "Select the Private Key File" -#~ msgstr "選擇私密金鑰檔案" - -#~ msgid "Show key" -#~ msgstr "顯示金鑰" - -#~ msgid "Show passphrase" -#~ msgstr "顯示密語" - -#~ msgid "Show password" -#~ msgstr "顯示密碼" - -#~ msgid "Show passwords" -#~ msgstr "顯示密碼" - -#~ msgid "Speed:" -#~ msgstr "連線速度:" - -#~ msgid "Subnet Mask:" -#~ msgstr "子網路遮罩:" - -#~ msgid "Type:" -#~ msgstr "Type:" - -#~ msgid "User Name:" -#~ msgstr "使用者名稱:" - -#~ msgid "Wireless Network Key Required" -#~ msgstr "需要無線網路金鑰" - -#~ msgid "Wireless _adapter:" -#~ msgstr "無線網絡卡(_A):" - -#~ msgid "_Always Trust this Wireless Network" -#~ msgstr "總是信任這無線網路(_A)" - -#~ msgid "_Don't remind me again" -#~ msgstr "不要再提醒我(_D)" - -#~ msgid "_Fallback on this Network" -#~ msgstr "退出此網路(_F)" - -#~ msgid "_Login to Network" -#~ msgstr "登入網路(_L)" - -#~ msgid "_Network Name:" -#~ msgstr "網路名稱(_N):" - -#~ msgid "_Wireless Security:" -#~ msgstr "無線安全性(_W):" - -#~ msgid "Cannot add VPN connection" -#~ msgstr "無法加入 VPN 連線" - -#~ msgid "" -#~ "No suitable VPN software was found on your system. Contact your system " -#~ "administrator." -#~ msgstr "在您的系統上找不到合適的 VPN 軟體。請連絡您的系統管理者。" - -#~ msgid "Cannot import VPN connection" -#~ msgstr "無法匯入 VPN 網路連線" - -#~ msgid "" -#~ "Cannot find suitable software for VPN connection type '%s' to import the " -#~ "file '%s'. Contact your system administrator." -#~ msgstr "" -#~ "找不到適合 VPN 連線類型‘%s’的軟體來匯入檔案‘%s’。請連絡您的系統管理者。" - -#~ msgid "Error retrieving VPN connection '%s'" -#~ msgstr "接收 VPN 連線‘%s’時發生錯誤" - -#~ msgid "" -#~ "Could not find the UI files for VPN connection type '%s'. Contact your " -#~ "system administrator." -#~ msgstr "找不到 VPN 連線類型‘%s’的 UI 檔案。請連絡您的系統管理者。" - -#~ msgid "Delete VPN connection \"%s\"?" -#~ msgstr "刪除 VPN 連線“%s”?" - -#~ msgid "" -#~ "All information about the VPN connection \"%s\" will be lost and you may " -#~ "need your system administrator to provide information to create a new " -#~ "connection." -#~ msgstr "" -#~ "所有 VPN 連線‘%s’的相關資訊都會消失,而您需要請系統管理者提供建立新連線的" -#~ "資訊。" - -#~ msgid "Unable to load" -#~ msgstr "無法載入" - -#~ msgid "Cannot find some needed resources (the glade file)!" -#~ msgstr "無法找到一些需要的資源( glade 檔)!" - -#~ msgid "Create VPN Connection" -#~ msgstr "建立 VPN 連線" - -#~ msgid "Edit VPN Connection" -#~ msgstr "編輯 VPN 連線" - -#~ msgid "Add a new VPN connection" -#~ msgstr "加入新的 VPN 連線" - -#~ msgid "Delete the selected VPN connection" -#~ msgstr "刪除選擇的 VPN 連線" - -#~ msgid "E_xport" -#~ msgstr "匯出(_X)" - -#~ msgid "Edit the selected VPN connection" -#~ msgstr "編輯已選的 VPN 連線" - -#~ msgid "Export the VPN settings to a file" -#~ msgstr "匯出 VPN 設定至檔案" - -#~ msgid "Export the selected VPN connection to a file" -#~ msgstr "匯出選擇的 VPN 連線至檔案" - -#~ msgid "Manage Virtual Private Network Connections" -#~ msgstr "管理虛擬私有網路連線" - -#~ msgid "VPN Connections" -#~ msgstr "VPN 連線" - -#~ msgid "40-bit WEP" -#~ msgstr "40-bit WEP" - -#~ msgid "104-bit WEP" -#~ msgstr "104-bit WEP" - -#~ msgid "WPA TKIP" -#~ msgstr "WPA TKIP" - -#~ msgid "WPA CCMP" -#~ msgstr "WPA CCMP" - -#~ msgid "WPA Automatic" -#~ msgstr "WPA 自動" - -#~ msgid "WPA2 TKIP" -#~ msgstr "WPA2 TKIP" - -#~ msgid "WPA2 CCMP" -#~ msgstr "WPA2 CCMP" - -#~ msgid "WPA2 Automatic" -#~ msgstr "WPA 自動" - -#~ msgid "none" -#~ msgstr "none" - -#~ msgid "operation took too long" -#~ msgstr "操作時間太久" - -#~ msgid "received data from wrong type of sender" -#~ msgstr "從傳送者接收錯誤類型的資料" - -#~ msgid "received data from unexpected sender" -#~ msgstr "從傳送者接收未預期類型的資料" - -#~ msgid "too much data was sent over socket and some of it was lost" -#~ msgstr "透過 socket 傳送太多資料以致其中有些遺失了" - -#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." -#~ msgstr "您目前連接到 Ad-Hoc 點對點式無線網路‘%s’。" - -#~ msgid "You are now connected to the wireless network '%s'." -#~ msgstr "您目前連接到無線網路‘%s’。" - -#~ msgid "You are now connected to the wired network." -#~ msgstr "您目前連接到有線網路‘%s’。" - -#~ msgid "Connection Established" -#~ msgstr "連線已建立" - -#~ msgid "Disconnected" -#~ msgstr "Disconnected" - -#~ msgid "The network connection has been disconnected." -#~ msgstr "該網路連線已經斷線。" - -#~ msgid "LEAP" -#~ msgstr "LEAP" - -#~ msgid "Failed to get information about the interface!" -#~ msgstr "無法取得網路介面的訊資!" - -#~ msgid "VPN Error" -#~ msgstr "VPN 錯誤" - -#~ msgid "" -#~ "VPN Login Message\n" -#~ "\n" -#~ "VPN connection '%s' said:\n" -#~ "\n" -#~ "\"%s\"" -#~ msgstr "" -#~ "VPN 登入訊息\n" -#~ "\n" -#~ "VPN 連線‘%s’說:\n" -#~ "\n" -#~ "\"%s\"" - -#~ msgid "_Stop All Wireless Devices" -#~ msgstr "停止所有無線網路裝置(_S)" - -#~ msgid "_Start All Wireless Devices" -#~ msgstr "開始執行所有無線網路裝置(_S)" - -#, fuzzy -#~ msgid "_Wireless Network Discovery" -#~ msgstr "無線網路 (%s)" - -#~ msgid "Always Search" -#~ msgstr "總是搜尋" - -#~ msgid "Search Only When Disconnected" -#~ msgstr "在斷線時才搜尋" - -#~ msgid "Never Search" -#~ msgstr "永不搜尋" - -#~ msgid "Stop All Wireless Devices" -#~ msgstr "停止所有無線網路裝置" - -#, fuzzy -#~ msgid "ASCII Key:" -#~ msgstr "Acii 格式金鑰:" - -#~ msgid "" -#~ "128-bit Passphrase (WEP)\n" -#~ "Ascii Key (WEP)\n" -#~ "Hex Key (WEP)" -#~ msgstr "" -#~ "128位元通行碼 (WEP)\n" -#~ "Acii 格式金鑰 (WEP)\n" -#~ "Hex 格式金鑰 (WEP)" - -#~ msgid "" -#~ "128-bit passphrase (WEP)\n" -#~ "Ascii key (WEP)\n" -#~ "Hex key (WEP)" -#~ msgstr "" -#~ "128位元通行碼 (WEP)\n" -#~ "Acii 格式金鑰 (WEP)\n" -#~ "Hex 格式金鑰 (WEP)" - -#~ msgid "Key type:" -#~ msgstr "金鑰類型:" - -#~ msgid "Wireless _network:" -#~ msgstr "無線網路(_N):" - -#~ msgid "_OK" -#~ msgstr "確定(_O)" - -#~ msgid "Create VPN Connection - 1 of 2" -#~ msgstr "建立 VPN 連線 - 第一步" - -#~ msgid "Create VPN Connection - 2 of 2" -#~ msgstr "建立 VPN 連線 - 第二步" - -#~ msgid "Finish create VPN Connection" -#~ msgstr "建立 VPN 連線完成" - -#~ msgid "%s" -#~ msgstr "%s" - -#~ msgid "Modify Wireless Networks" -#~ msgstr "修改無線網路" - -#~ msgid "*" -#~ msgstr "*" - -#~ msgid "You must log in to access the private network %s" -#~ msgstr "您需要登入來存取私有網路 %s" From 0b8ee13ee0ae6b6a344473e674849c05aca3ca08 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 14 May 2010 09:48:46 -0700 Subject: [PATCH 389/392] ip6: pad RDNSS server expiry slightly to avoid hiccups (rh #590202) Pad the DNS server expiry somewhat to give a bit of slack in cases where one RA gets lost or something (which can happen on unreliable links like wifi where certain types of frames are not retransmitted). --- src/ip6-manager/nm-ip6-manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index ba6be259f8..f6f6127ce7 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -627,7 +627,12 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) rdnss_opt = (struct nd_opt_rdnss *) opt; - server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime); + /* Pad the DNS server expiry somewhat to give a bit of slack in cases + * where one RA gets lost or something (which can happen on unreliable + * links like wifi where certain types of frames are not retransmitted). + */ + server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime) + 10; + for (addr = (struct in6_addr *) (rdnss_opt + 1); nd_opt_len >= 2; addr++, nd_opt_len -= 2) { char buf[INET6_ADDRSTRLEN + 1]; From 5110fa7811cc8d68d2a61601e04e4fb4e9edc31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 18 May 2010 10:14:59 +0200 Subject: [PATCH 390/392] libnm-{util|glib}: fix headers to be C++ compatible - C_BEGIN_DECLS/C_END_DECLS (rh #592783) --- libnm-glib/nm-settings-interface.h | 3 +++ libnm-glib/nm-settings-system-interface.h | 4 ++++ libnm-glib/nm-types.h | 4 ++++ libnm-util/nm-utils.h | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h index 70a47abe94..dc7bd0eb82 100644 --- a/libnm-glib/nm-settings-interface.h +++ b/libnm-glib/nm-settings-interface.h @@ -28,6 +28,8 @@ #include "NetworkManager.h" #include "nm-settings-connection-interface.h" +G_BEGIN_DECLS + typedef enum { NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION = 0, NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION, @@ -101,5 +103,6 @@ gboolean nm_settings_interface_add_connection (NMSettingsInterface *settings, NMSettingsAddConnectionFunc callback, gpointer user_data); +G_END_DECLS #endif /* NM_SETTINGS_INTERFACE_H */ diff --git a/libnm-glib/nm-settings-system-interface.h b/libnm-glib/nm-settings-system-interface.h index ebe835762d..d016556123 100644 --- a/libnm-glib/nm-settings-system-interface.h +++ b/libnm-glib/nm-settings-system-interface.h @@ -27,6 +27,8 @@ #include "NetworkManager.h" +G_BEGIN_DECLS + typedef enum { NM_SETTINGS_SYSTEM_PERMISSION_NONE = 0x0, NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY = 0x1, @@ -101,4 +103,6 @@ gboolean nm_settings_system_interface_get_permissions (NMSettingsSystemInterface NMSettingsSystemGetPermissionsFunc callback, gpointer user_data); +G_END_DECLS + #endif /* NM_SETTINGS_SYSTEM_INTERFACE_H */ diff --git a/libnm-glib/nm-types.h b/libnm-glib/nm-types.h index eb3461f7d7..cb1bf872ea 100644 --- a/libnm-glib/nm-types.h +++ b/libnm-glib/nm-types.h @@ -26,6 +26,8 @@ #include #include +G_BEGIN_DECLS + #define NM_TYPE_SSID (nm_ssid_get_type ()) GType nm_ssid_get_type (void) G_GNUC_CONST; @@ -47,4 +49,6 @@ GType nm_ip6_address_array_get_type (void) G_GNUC_CONST; #define NM_TYPE_IP6_ROUTE_OBJECT_ARRAY (nm_ip6_route_object_array_get_type ()) GType nm_ip6_route_object_array_get_type (void) G_GNUC_CONST; +G_END_DECLS + #endif /* NM_TYPES_H */ diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h index 8308a233ac..68501d53fb 100644 --- a/libnm-util/nm-utils.h +++ b/libnm-util/nm-utils.h @@ -31,6 +31,8 @@ #include "nm-connection.h" +G_BEGIN_DECLS + /*********************************************************/ /* The API defined here is _NOT_ guaranteed in any way!! */ /*********************************************************/ @@ -211,4 +213,6 @@ GByteArray *nm_utils_rsa_key_encrypt (const GByteArray *data, char **out_password, GError **error); +G_END_DECLS + #endif /* NM_UTILS_H */ From 16cda9fae1a7e706616924b6dbe15b7e81f52bab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 18 May 2010 16:43:30 -0700 Subject: [PATCH 391/392] libnm-glib: fix VPN plugin builds for C++ Yes, this breaks source compat. Simple rename though. --- libnm-glib/nm-vpn-plugin-ui-interface.c | 10 +++++----- libnm-glib/nm-vpn-plugin-ui-interface.h | 11 ++++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.c b/libnm-glib/nm-vpn-plugin-ui-interface.c index ca3b738a9b..f4b844c8d9 100644 --- a/libnm-glib/nm-vpn-plugin-ui-interface.c +++ b/libnm-glib/nm-vpn-plugin-ui-interface.c @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -113,8 +113,8 @@ nm_vpn_plugin_ui_interface_import (NMVpnPluginUiInterface *iface, g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), NULL); if (nm_vpn_plugin_ui_interface_get_capabilities (iface) & NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT) { - g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import != NULL, NULL); - return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import (iface, path, error); + g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import_from_file != NULL, NULL); + return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import_from_file (iface, path, error); } return NULL; } @@ -128,8 +128,8 @@ nm_vpn_plugin_ui_interface_export (NMVpnPluginUiInterface *iface, g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), FALSE); if (nm_vpn_plugin_ui_interface_get_capabilities (iface) & NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT) { - g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export != NULL, FALSE); - return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export (iface, path, connection, error); + g_return_val_if_fail (NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export_to_file != NULL, FALSE); + return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export_to_file (iface, path, connection, error); } return FALSE; } diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.h b/libnm-glib/nm-vpn-plugin-ui-interface.h index 44348c12ef..2ab13f0017 100644 --- a/libnm-glib/nm-vpn-plugin-ui-interface.h +++ b/libnm-glib/nm-vpn-plugin-ui-interface.h @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -91,14 +91,19 @@ struct _NMVpnPluginUiInterface { * additional information. Note that 'error' can be NULL, in which case no * additional error information should be provided. */ - NMConnection * (*import) (NMVpnPluginUiInterface *iface, const char *path, GError **error); + NMConnection * (*import_from_file) (NMVpnPluginUiInterface *iface, + const char *path, + GError **error); /* Export the given connection to the specified path. Return TRUE on success. * On error, return FALSE and set 'error' with additional error information. * Note that 'error' can be NULL, in which case no additional error information * should be provided. */ - gboolean (*export) (NMVpnPluginUiInterface *iface, const char *path, NMConnection *connection, GError **error); + gboolean (*export_to_file) (NMVpnPluginUiInterface *iface, + const char *path, + NMConnection *connection, + GError **error); /* For a given connection, return a suggested file name. Returned value should * be NULL or a suggested file name allocated via g_malloc/g_new/etc to be freed From 87ac1bd5f57d46c5035b2ed922eabb1506cac5fa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 18 May 2010 16:47:43 -0700 Subject: [PATCH 392/392] vpn: s/tundev/ip_iface --- src/vpn-manager/nm-vpn-connection.c | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 91c7754265..eee181ef01 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -78,7 +78,7 @@ typedef struct { guint ipconfig_timeout; NMIP4Config *ip4_config; guint32 ip4_internal_gw; - char *tundev; + char *ip_iface; char *banner; struct rtnl_route *gw_route; @@ -166,7 +166,7 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, nm_utils_call_dispatcher ("vpn-up", priv->connection, priv->parent_dev, - priv->tundev); + priv->ip_iface); break; case NM_VPN_CONNECTION_STATE_FAILED: case NM_VPN_CONNECTION_STATE_DISCONNECTED: @@ -174,7 +174,7 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, nm_utils_call_dispatcher ("vpn-down", priv->connection, priv->parent_dev, - priv->tundev); + priv->ip_iface); } break; default: @@ -343,7 +343,7 @@ ip_address_to_string (guint32 numeric) static void print_vpn_config (NMIP4Config *config, guint32 internal_gw, - const char *tundev, + const char *ip_iface, const char *banner) { NMIP4Address *addr; @@ -357,7 +357,7 @@ print_vpn_config (NMIP4Config *config, nm_log_info (LOGD_VPN, "VPN Gateway: %s", ip_address_to_string (nm_ip4_address_get_gateway (addr))); if (internal_gw) nm_log_info (LOGD_VPN, "Internal Gateway: %s", ip_address_to_string (internal_gw)); - nm_log_info (LOGD_VPN, "Tunnel Device: %s", tundev); + nm_log_info (LOGD_VPN, "Tunnel Device: %s", ip_iface); nm_log_info (LOGD_VPN, "Internal IP4 Address: %s", ip_address_to_string (nm_ip4_address_get_address (addr))); nm_log_info (LOGD_VPN, "Internal IP4 Prefix: %d", nm_ip4_address_get_prefix (addr)); nm_log_info (LOGD_VPN, "Internal IP4 Point-to-Point Address: %s", @@ -418,7 +418,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV); if (val) - priv->tundev = g_strdup (g_value_get_string (val)); + priv->ip_iface = g_strdup (g_value_get_string (val)); else { nm_log_err (LOGD_VPN, "invalid or missing tunnel device received!"); goto error; @@ -520,15 +520,15 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, g_slist_free (routes); } - print_vpn_config (config, priv->ip4_internal_gw, priv->tundev, priv->banner); + print_vpn_config (config, priv->ip4_internal_gw, priv->ip_iface, priv->banner); /* Merge in user overrides from the NMConnection's IPv4 setting */ s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (priv->connection, NM_TYPE_SETTING_IP4_CONFIG)); nm_utils_merge_ip4_config (config, s_ip4); - nm_system_device_set_up_down_with_iface (priv->tundev, TRUE, NULL); + nm_system_device_set_up_down_with_iface (priv->ip_iface, TRUE, NULL); - if (nm_system_apply_ip4_config (priv->tundev, config, 0, NM_IP4_COMPARE_FLAG_ALL)) { + if (nm_system_apply_ip4_config (priv->ip_iface, config, 0, NM_IP4_COMPARE_FLAG_ALL)) { NMNamedManager *named_mgr; /* Add any explicit route to the VPN gateway through the parent device */ @@ -536,7 +536,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, /* Add the VPN to DNS */ named_mgr = nm_named_manager_get (); - nm_named_manager_add_ip4_config (named_mgr, priv->tundev, config, NM_NAMED_IP_CONFIG_TYPE_VPN); + nm_named_manager_add_ip4_config (named_mgr, priv->ip_iface, config, NM_NAMED_IP_CONFIG_TYPE_VPN); g_object_unref (named_mgr); priv->ip4_config = config; @@ -728,7 +728,7 @@ nm_vpn_connection_get_ip_iface (NMVPNConnection *connection) { g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); - return NM_VPN_CONNECTION_GET_PRIVATE (connection)->tundev; + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->ip_iface; } NMDevice * @@ -876,11 +876,11 @@ vpn_cleanup (NMVPNConnection *connection) { NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); - if (priv->tundev) { - nm_system_device_set_up_down_with_iface (priv->tundev, FALSE, NULL); + if (priv->ip_iface) { + nm_system_device_set_up_down_with_iface (priv->ip_iface, FALSE, NULL); /* FIXME: use AF_UNSPEC here when we have IPv6 support */ - nm_system_device_flush_routes_with_iface (priv->tundev, AF_INET); - nm_system_device_flush_addresses_with_iface (priv->tundev); + nm_system_device_flush_routes_with_iface (priv->ip_iface, AF_INET); + nm_system_device_flush_addresses_with_iface (priv->ip_iface); } if (priv->ip4_config) { @@ -889,7 +889,7 @@ vpn_cleanup (NMVPNConnection *connection) /* Remove attributes of the VPN's IP4 Config */ named_mgr = nm_named_manager_get (); - nm_named_manager_remove_ip4_config (named_mgr, priv->tundev, priv->ip4_config); + nm_named_manager_remove_ip4_config (named_mgr, priv->ip_iface, priv->ip4_config); g_object_unref (named_mgr); /* Remove any previously added VPN gateway host route */ @@ -918,9 +918,9 @@ vpn_cleanup (NMVPNConnection *connection) priv->banner = NULL; } - if (priv->tundev) { - g_free (priv->tundev); - priv->tundev = NULL; + if (priv->ip_iface) { + g_free (priv->ip_iface); + priv->ip_iface = NULL; } /* Clear out connection secrets to ensure that the settings service @@ -1024,7 +1024,7 @@ finalize (GObject *object) NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); g_free (priv->banner); - g_free (priv->tundev); + g_free (priv->ip_iface); g_free (priv->ac_path); G_OBJECT_CLASS (nm_vpn_connection_parent_class)->finalize (object);