diff options
author | Dan Williams <dcbw@redhat.com> | 2008-08-07 13:41:04 +0000 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2008-08-07 13:41:04 +0000 |
commit | 2dbd644fe924345aae6edf74278ba428ad0a478a (patch) | |
tree | 924d331123eff1b00f5e2c69bf35c4357d65e9dc | |
parent | 6d7474e565046b360e2b7ff1b84b6b1b30c71caa (diff) | |
download | NetworkManager-modem-manager.tar.gz |
Merge from trunk r3901modem-manager
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/modem-manager@3902 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
58 files changed, 2457 insertions, 1705 deletions
@@ -1,3 +1,169 @@ +2008-08-06 Dan Williams <dcbw@redhat.com> + + * libnm-glib/nm-ip4-config.c + libnm-glib/nm-ip4-config.h + - Add 'routes' property + + * libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-vpn.h + - Remove 'routes' property + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - 'ignore-dhcp-dns' renamed to 'ignore-auto-dns' + - Add 'ignore-auto-routes' property + - 'routes' exposed over D-Bus is now an array of array of uint (4) to + accomodate route metrics + - 'routes' exposed in C is now a list of NMSettingIP4Route structures + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - Add helpers for marshalling IP4 routes + + * src/NetworkManagerUtils.c + - (nm_utils_merge_ip4_config): handle property renames and new route + structure + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route, nm_system_device_set_from_ip4_config, + nm_system_vpn_device_set_from_ip4_config): respect route metrics + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): handle new route structure + + * system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-fedora/writer.c + - Handle routes separately from addresses now that routes have a different + format + + * introspection/nm-ip4-config.xml + src/nm-ip4-config.c + src/nm-ip4-config.h + - Rename internal routing functions + - 'static-routes' renamed to 'routes' + +2008-08-04 Dan Williams <dcbw@redhat.com> + + Patch from Sjoerd Simons <sjoerd.simons@collabora.co.uk> + + * src/NetworkManager.c + src/nm-manager.c + src/nm-manager.h + - More explicitly make the NMManager a singleton + +2008-08-04 Dan Williams <dcbw@redhat.com> + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_verify): return error on missing 'connection' setting + (found by Sjoerd Simons) + +2008-08-04 Dan Williams <dcbw@redhat.com> + + Handle multiple concurrent PPP connections. + + * src/ppp-manager/nm-ppp-manager.c + src/ppp-manager/nm-ppp-manager.h + - (constructor): only PPP Manager request bus name once; each + NMPPPManager object gets a unique object path + - (nm_ppp_manager_class_init, get_property, set_property, + nm_ppp_manager_new, nm_ppp_manager_start): pass parent interface in + at construct time + - (impl_ppp_manager_need_secrets, impl_ppp_manager_set_state): don't + remove timeout until PPP manager gets an IP4 config + - (create_pppd_cmd_line): pass dbus object path as 'ipparam' so that + the plugin can call back to this specific PPP manager instance + + * src/nm-device-ethernet.c + src/nm-serial-device.c + - Pass parent device in nm_ppp_manager_new() + + * src/nm-gsm-device.c + src/nm-cdma-device.c + - (device_state_changed): don't close serial device on NEED_AUTH + state changed, that's not a failure case like the rest are + + * src/ppp-manager/nm-pppd-plugin.c + - (nm_ip_up): always use index 0 into the ipcp options, because NM always + binds one interface to any pppd process, thus the correct index + is always 0; send PHASE_DEAD on error to alert NM immediately of + problems; try harder to get a peer address in spite of pppd + - (plugin_init): use 'ipparam' as the object path back to our specific + PPP manager instance + +2008-08-04 Dan Williams <dcbw@redhat.com> + + * src/ppp-manager/nm-ppp-manager.c + - (impl_ppp_manager_need_secrets): rework to handle secrets better; + since the GSM and CDMA settings now implement need_secrets, we can + rely on them to do the right thing. Where secrets are not required, + just pass empty strings back to the pppd plugin. + - (nm_ppp_manager_update_secrets): leak fix; don't need to dup the strings + - (impl_ppp_manager_set_ip4_config): clear the secrets tries counter + on successful IP4 config receipt + +2008-08-04 Dan Williams <dcbw@redhat.com> + + * libnm-util/nm-setting-cdma.c + libnm-util/nm-setting-gsm.c + - (verify): validate username & password if they exist + - (need_secrets): if username given, require a password too + +2008-08-04 Dan Williams <dcbw@redhat.com> + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + - (create_dm_cmd_line): really don't listen on lo, despite what the + manpage says about --listen-address without --interface + (bgo #546033) + +2008-08-01 Dan Williams <dcbw@redhat.com> + + * libnm-glib/nm-device.c + - (proxy_get_string): util function for querying a HAL property + - (get_ancestor_device): split out from get_product_and_vendor() + - (get_product_and_vendor): simplify; get more accurate pid & vid info + from PCI devices by querying subsys properties + - (nm_device_update_description): simplify + +2008-08-01 Dan Williams <dcbw@redhat.com> + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Make IPv4 methods reflect their usage; 'dhcp' -> 'auto' and + 'autoip' -> 'link-local'. VPN & PPP connections can also have IPv4 + settings, and they don't necessarily use DHCP. + + * src/NetworkManagerPolicy.c + src/nm-device.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + - Fixup for method changes + +2008-07-31 Dan Williams <dcbw@redhat.com> + + * src/nm-activation-request.c + src/vpn-manager/nm-vpn-connection.c + - Correct GetSecrets D-Bus pending call usage; the GetSecrets call + itself should be attached to the activation request or the VPN + connection, not the NMConnection object, since the call is not + expected to live as long as the NMConnection itself + +2008-07-31 Dan Williams <dcbw@redhat.com> + + * src/nm-device-wifi.c + - (real_act_stage2_config): fix issue where association would continue + even though secrets were needed; 'goto out' was in wrong scope and + result of handle_auth_or_fail() should have been dumped directly to + 'ret' to ensure that the association was postponed until secrets + are available + +2008-07-31 Dan Williams <dcbw@redhat.com> + + * system-settings/plugins/ifcfg-fedora/plugin.c + system-settings/plugins/ifcfg-fedora/reader.c + - Don't ignore unmanaged devices if their ifcfg file doesn't make a + valid NM connection + 2008-07-29 Dan Williams <dcbw@redhat.com> * src/nm-gsm-device.c diff --git a/introspection/nm-ip4-config.xml b/introspection/nm-ip4-config.xml index 8ac92a9a1f..a4eea8163c 100644 --- a/introspection/nm-ip4-config.xml +++ b/introspection/nm-ip4-config.xml @@ -3,7 +3,7 @@ <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> <interface name="org.freedesktop.NetworkManager.IP4Config"> <property name="Addresses" type="aau" access="read"> - <tp:docstring>Tuples of IPv4 address/prefix/gateway. The gateway is optional, if not given should be 0.</tp:docstring> + <tp:docstring>Tuples of IPv4 address/prefix/gateway.</tp:docstring> </property> <property name="Hostname" type="s" access="read"> <tp:docstring>The hostname associated with this IPv4 address. FIXME: what about multiple hostnames?</tp:docstring> @@ -20,6 +20,9 @@ <property name="NisServers" type="au" access="read"> <tp:docstring>The NIS servers associated with this address.</tp:docstring> </property> + <property name="Routes" type="aau" access="read"> + <tp:docstring>Tuples of IPv4 route/prefix/next-hop/metric.</tp:docstring> + </property> </interface> </node> diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 7bda96f66b..24ca876cfd 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -547,19 +547,14 @@ nm_device_get_state (NMDevice *device) } static char * -get_product_and_vendor (NMDevice *device, - DBusGConnection *connection, - const char *udi, - gboolean want_origdev, - gboolean warn, - char **product, - char **vendor) +get_ancestor_device (NMDevice *device, + DBusGConnection *connection, + const char *udi, + gboolean want_origdev) { DBusGProxy *proxy; GError *err = NULL; char *parent = NULL; - char *tmp_product = NULL; - char *tmp_vendor = NULL; g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (udi != NULL, NULL); @@ -568,28 +563,6 @@ get_product_and_vendor (NMDevice *device, if (!proxy) return NULL; - if (!dbus_g_proxy_call (proxy, "GetPropertyString", &err, - G_TYPE_STRING, "info.product", - G_TYPE_INVALID, - G_TYPE_STRING, &tmp_product, - G_TYPE_INVALID)) { - if (warn) - g_warning ("Error getting device %s product from HAL: %s", udi, err->message); - g_error_free (err); - err = NULL; - } - - if (!dbus_g_proxy_call (proxy, "GetPropertyString", &err, - G_TYPE_STRING, "info.vendor", - G_TYPE_INVALID, - G_TYPE_STRING, &tmp_vendor, - G_TYPE_INVALID)) { - if (warn) - g_warning ("Error getting device %s vendor from HAL: %s", udi, err->message); - g_error_free (err); - err = NULL; - } - if (want_origdev) { gboolean serial = FALSE; @@ -628,7 +601,79 @@ get_product_and_vendor (NMDevice *device, } } - if (parent && tmp_product && tmp_vendor) { + g_object_unref (proxy); + return parent; +} + +static char * +proxy_get_string (DBusGProxy *proxy, + const char *property, + gboolean warn) +{ + GError *error = NULL; + char *result = NULL; + + g_return_val_if_fail (proxy != NULL, NULL); + g_return_val_if_fail (property != NULL, NULL); + + if (dbus_g_proxy_call (proxy, "GetPropertyString", &error, + G_TYPE_STRING, property, G_TYPE_INVALID, + G_TYPE_STRING, &result, G_TYPE_INVALID)) + return result; + + if (warn) { + g_warning ("Error getting HAL property '%s' from device '%s': %s", + property, dbus_g_proxy_get_path (proxy), + error ? error->message : "unknown"); + } + g_error_free (error); + return NULL; +} + +static gboolean +get_product_and_vendor (DBusGConnection *connection, + const char *udi, + char **product, + char **vendor) +{ + DBusGProxy *proxy; + char *tmp_product = NULL; + char *tmp_vendor = NULL; + char *subsys = NULL; + gboolean product_fallback = TRUE, vendor_fallback = TRUE; + gboolean warn = FALSE; + + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (udi != NULL, FALSE); + + g_return_val_if_fail (product != NULL, FALSE); + g_return_val_if_fail (*product == NULL, FALSE); + + g_return_val_if_fail (vendor != NULL, FALSE); + g_return_val_if_fail (*vendor == NULL, FALSE); + + proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.Hal", udi, "org.freedesktop.Hal.Device"); + if (!proxy) + return FALSE; + + subsys = proxy_get_string (proxy, "info.subsystem", warn); + if (subsys && !strcmp (subsys, "pci")) { + tmp_product = proxy_get_string (proxy, "pci.subsys_product", warn); + if (tmp_product) + product_fallback = FALSE; + + tmp_vendor = proxy_get_string (proxy, "pci.subsys_vendor", warn); + if (tmp_vendor) + vendor_fallback = FALSE; + } + g_free (subsys); + + if (product_fallback) + tmp_product = proxy_get_string (proxy, "info.product", warn); + if (vendor_fallback) + tmp_vendor = proxy_get_string (proxy, "info.vendor", warn); + + if (tmp_product && tmp_vendor) { *product = tmp_product; *vendor = tmp_vendor; } else { @@ -637,7 +682,7 @@ get_product_and_vendor (NMDevice *device, } g_object_unref (proxy); - return parent; + return (*product && *vendor) ? TRUE : FALSE; } static void @@ -647,7 +692,7 @@ nm_device_update_description (NMDevice *device) DBusGConnection *connection; const char *udi; char *orig_dev_udi = NULL; - char *pd_parent_udi = NULL; + char *parent_udi = NULL; g_return_if_fail (NM_IS_DEVICE (device)); priv = NM_DEVICE_GET_PRIVATE (device); @@ -662,37 +707,18 @@ nm_device_update_description (NMDevice *device) /* First, get the udi of the originating device */ udi = nm_device_get_udi (device); - orig_dev_udi = get_product_and_vendor (device, connection, udi, TRUE, FALSE, - &priv->product, &priv->vendor); - - /* Ignore product and vendor for the Network Interface */ - if (priv->product || priv->vendor) { - g_free (priv->product); - priv->product = NULL; - g_free (priv->vendor); - priv->vendor = NULL; - } + orig_dev_udi = get_ancestor_device (device, connection, udi, TRUE); /* Get product and vendor off the originating device if possible */ - pd_parent_udi = get_product_and_vendor (device, - connection, - orig_dev_udi, - FALSE, - FALSE, - &priv->product, - &priv->vendor); - g_free (orig_dev_udi); - - /* If one of the product/vendor isn't found on the originating device, try the - * parent of the originating device. - */ - if (!priv->product || !priv->vendor) { - char *ignore; - ignore = get_product_and_vendor (device, connection, pd_parent_udi, - FALSE, TRUE, &priv->product, &priv->vendor); - g_free (ignore); + if (!get_product_and_vendor (connection, orig_dev_udi, &priv->product, &priv->vendor)) { + /* Try the parent of the originating device */ + parent_udi = get_ancestor_device (device, connection, orig_dev_udi, FALSE); + if (parent_udi) + get_product_and_vendor (connection, parent_udi, &priv->product, &priv->vendor); + g_free (parent_udi); } - g_free (pd_parent_udi); + + g_free (orig_dev_udi); nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_VENDOR); nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT); diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c index 6eb2c522c9..1382378d35 100644 --- a/libnm-glib/nm-ip4-config.c +++ b/libnm-glib/nm-ip4-config.c @@ -19,6 +19,7 @@ typedef struct { GPtrArray *domains; char *nis_domain; GArray *nis_servers; + GSList *routes; } NMIP4ConfigPrivate; enum { @@ -29,6 +30,7 @@ enum { PROP_DOMAINS, PROP_NIS_DOMAIN, PROP_NIS_SERVERS, + PROP_ROUTES, LAST_PROP }; @@ -76,6 +78,21 @@ demarshal_domains (NMObject *object, GParamSpec *pspec, GValue *value, gpointer return TRUE; } +static gboolean +demarshal_ip4_routes_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + g_slist_free (priv->routes); + priv->routes = NULL; + + priv->routes = nm_utils_ip4_routes_from_gvalue (value); + nm_object_queue_notify (object, NM_IP4_CONFIG_ROUTES); + + return TRUE; +} + static void register_for_property_changed (NMIP4Config *config) { @@ -87,6 +104,7 @@ register_for_property_changed (NMIP4Config *config) { NM_IP4_CONFIG_DOMAINS, demarshal_domains, &priv->domains }, { NM_IP4_CONFIG_NIS_DOMAIN, nm_object_demarshal_generic, &priv->nis_domain }, { NM_IP4_CONFIG_NIS_SERVERS, demarshal_ip4_array, &priv->nis_servers }, + { NM_IP4_CONFIG_ROUTES, demarshal_ip4_routes_array, &priv->routes }, { NULL }, }; @@ -131,6 +149,9 @@ finalize (GObject *object) g_slist_foreach (priv->addresses, (GFunc) g_free, NULL); g_slist_free (priv->addresses); + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + g_slist_free (priv->routes); + g_free (priv->hostname); g_free (priv->nis_domain); if (priv->nameservers) @@ -174,6 +195,9 @@ get_property (GObject *object, case PROP_NIS_SERVERS: g_value_set_boxed (value, nm_ip4_config_get_nis_servers (self)); break; + case PROP_ROUTES: + nm_utils_ip4_routes_to_gvalue (priv->routes, value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -239,6 +263,13 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) "NIS servers", NM_TYPE_UINT_ARRAY, G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_ROUTES, + g_param_spec_pointer (NM_IP4_CONFIG_ROUTES, + "Routes", + "Routes", + G_PARAM_READABLE)); } GObject * @@ -366,7 +397,7 @@ nm_ip4_config_get_nis_domain (NMIP4Config *config) return priv->nis_domain; } -GArray * +const GArray * nm_ip4_config_get_nis_servers (NMIP4Config *config) { NMIP4ConfigPrivate *priv; @@ -392,3 +423,29 @@ nm_ip4_config_get_nis_servers (NMIP4Config *config) return priv->nis_servers; } + +const GSList * +nm_ip4_config_get_routes (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->routes) + return priv->routes; + + if (!nm_object_get_property (NM_OBJECT (config), + "org.freedesktop.DBus.Properties", + "Routes", + &value)) { + return NULL; + } + + demarshal_ip4_routes_array (NM_OBJECT (config), NULL, &value, &priv->routes); + g_value_unset (&value); + + return priv->routes; +} + diff --git a/libnm-glib/nm-ip4-config.h b/libnm-glib/nm-ip4-config.h index 18fdeb825a..79de2f8496 100644 --- a/libnm-glib/nm-ip4-config.h +++ b/libnm-glib/nm-ip4-config.h @@ -29,6 +29,7 @@ typedef struct { #define NM_IP4_CONFIG_DOMAINS "domains" #define NM_IP4_CONFIG_NIS_DOMAIN "nis-domain" #define NM_IP4_CONFIG_NIS_SERVERS "nis-servers" +#define NM_IP4_CONFIG_ROUTES "routes" GType nm_ip4_config_get_type (void); @@ -39,7 +40,8 @@ const char * nm_ip4_config_get_hostname (NMIP4Config *config); const GArray * nm_ip4_config_get_nameservers (NMIP4Config *config); const GPtrArray *nm_ip4_config_get_domains (NMIP4Config *config); const char * nm_ip4_config_get_nis_domain (NMIP4Config *config); -GArray * nm_ip4_config_get_nis_servers (NMIP4Config *config); +const GArray * nm_ip4_config_get_nis_servers (NMIP4Config *config); +const GSList * nm_ip4_config_get_routes (NMIP4Config *config); G_END_DECLS diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index 870fea5177..f8e7a71d62 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -45,6 +45,37 @@ #include "nm-setting-gsm.h" #include "nm-setting-cdma.h" +GQuark +nm_connection_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-connection-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_connection_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_CONNECTION_ERROR_UNKNOWN, "UnknownError"), + /* The required 'connection' setting was not found. */ + ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, "ConnectionSettingNotFound"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMConnectionError", values); + } + return etype; +} + typedef struct { GHashTable *settings; @@ -430,7 +461,7 @@ gboolean nm_connection_verify (NMConnection *connection, GError **error) { NMConnectionPrivate *priv; - NMSetting *connection_setting; + NMSetting *s_con; VerifySettingsInfo info; g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); @@ -440,9 +471,12 @@ nm_connection_verify (NMConnection *connection, GError **error) priv = NM_CONNECTION_GET_PRIVATE (connection); /* First, make sure there's at least 'connection' setting */ - connection_setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); - if (!connection_setting) { - g_warning ("'connection' setting not present."); + s_con = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (!s_con) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, + "connection setting not found"); return FALSE; } diff --git a/libnm-util/nm-connection.h b/libnm-util/nm-connection.h index 24e6d700b4..27229356ba 100644 --- a/libnm-util/nm-connection.h +++ b/libnm-util/nm-connection.h @@ -45,6 +45,18 @@ typedef enum { NM_CONNECTION_SCOPE_USER } NMConnectionScope; +typedef enum +{ + NM_CONNECTION_ERROR_UNKNOWN = 0, + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND +} NMConnectionError; + +#define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ()) +GType nm_connection_error_get_type (void); + +#define NM_CONNECTION_ERROR nm_connection_error_quark () +GQuark nm_connection_error_quark (void); + #define NM_CONNECTION_SCOPE "scope" #define NM_CONNECTION_PATH "path" diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c index 3ca41bedb1..5955963c7c 100644 --- a/libnm-util/nm-setting-cdma.c +++ b/libnm-util/nm-setting-cdma.c @@ -117,9 +117,42 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (self->username && !strlen (self->username)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_USERNAME); + return FALSE; + } + + if (self->password && !strlen (self->password)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_PASSWORD); + return FALSE; + } + return TRUE; } +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingCdma *self = NM_SETTING_CDMA (setting); + GPtrArray *secrets = NULL; + + if (self->password) + return NULL; + + if (self->username) { + secrets = g_ptr_array_sized_new (1); + g_ptr_array_add (secrets, NM_SETTING_CDMA_PASSWORD); + } + + return secrets; +} + static void nm_setting_cdma_init (NMSettingCdma *setting) { @@ -196,6 +229,7 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *setting_class) object_class->get_property = get_property; object_class->finalize = finalize; parent_class->verify = verify; + parent_class->need_secrets = need_secrets; /* Properties */ g_object_class_install_property diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 97bc3ea2ca..b65fa65a22 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -133,9 +133,42 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (self->username && !strlen (self->username)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_USERNAME); + return FALSE; + } + + if (self->password && !strlen (self->password)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_USERNAME); + return FALSE; + } + return TRUE; } +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingGsm *self = NM_SETTING_GSM (setting); + GPtrArray *secrets = NULL; + + if (self->password) + return NULL; + + if (self->username) { + secrets = g_ptr_array_sized_new (1); + g_ptr_array_add (secrets, NM_SETTING_GSM_PASSWORD); + } + + return secrets; +} + static void nm_setting_gsm_init (NMSettingGsm *setting) { @@ -256,6 +289,7 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) object_class->get_property = get_property; object_class->finalize = finalize; parent_class->verify = verify; + parent_class->need_secrets = need_secrets; /* Properties */ g_object_class_install_property diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index d452c46ecc..2e3873d509 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -76,7 +76,8 @@ enum { PROP_DNS_SEARCH, PROP_ADDRESSES, PROP_ROUTES, - PROP_IGNORE_DHCP_DNS, + PROP_IGNORE_AUTO_ROUTES, + PROP_IGNORE_AUTO_DNS, PROP_DHCP_CLIENT_ID, PROP_DHCP_HOSTNAME, @@ -112,7 +113,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP4_CONFIG_ADDRESSES); return FALSE; } - } else if ( !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP) + } else if ( !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL) || !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { if (self->dns && self->dns->len) { g_set_error (error, @@ -137,7 +138,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP4_CONFIG_ADDRESSES); return FALSE; } - } else if (!strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) { + } else if (!strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { /* nothing to do */ } else { g_set_error (error, @@ -186,9 +187,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) /* Validate routes */ for (iter = self->routes, i = 0; iter; iter = g_slist_next (iter), i++) { - NMSettingIP4Address *addr = (NMSettingIP4Address *) iter->data; + NMSettingIP4Route *route = (NMSettingIP4Route *) iter->data; - if (!addr->address) { + if (!route->address) { g_set_error (error, NM_SETTING_IP4_CONFIG_ERROR, NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, @@ -196,7 +197,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (!addr->prefix || addr->prefix > 32) { + if (!route->prefix || route->prefix > 32) { g_set_error (error, NM_SETTING_IP4_CONFIG_ERROR, NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, @@ -258,10 +259,13 @@ set_property (GObject *object, guint prop_id, break; case PROP_ROUTES: nm_utils_slist_free (setting->routes, g_free); - setting->routes = nm_utils_ip4_addresses_from_gvalue (value); + setting->routes = nm_utils_ip4_routes_from_gvalue (value); break; - case PROP_IGNORE_DHCP_DNS: - setting->ignore_dhcp_dns = g_value_get_boolean (value); + case PROP_IGNORE_AUTO_ROUTES: + setting->ignore_auto_routes = g_value_get_boolean (value); + break; + case PROP_IGNORE_AUTO_DNS: + setting->ignore_auto_dns = g_value_get_boolean (value); break; case PROP_DHCP_CLIENT_ID: g_free (setting->dhcp_client_id); @@ -297,10 +301,13 @@ get_property (GObject *object, guint prop_id, nm_utils_ip4_addresses_to_gvalue (setting->addresses, value); break; case PROP_ROUTES: - nm_utils_ip4_addresses_to_gvalue (setting->routes, value); + nm_utils_ip4_routes_to_gvalue (setting->routes, value); + break; + case PROP_IGNORE_AUTO_ROUTES: + g_value_set_boolean (value, setting->ignore_auto_routes); break; - case PROP_IGNORE_DHCP_DNS: - g_value_set_boolean (value, setting->ignore_dhcp_dns); + case PROP_IGNORE_AUTO_DNS: + g_value_set_boolean (value, setting->ignore_auto_dns); break; case PROP_DHCP_CLIENT_ID: g_value_set_string (value, setting->dhcp_client_id); @@ -363,15 +370,23 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) (object_class, PROP_ROUTES, nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES, "Routes", - "List of NMSettingIP4Addresses", + "List of NMSettingIP4Routes", DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); g_object_class_install_property - (object_class, PROP_IGNORE_DHCP_DNS, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_DHCP_DNS, - "Ignore DHCP DNS", - "Ignore DHCP DNS", + (object_class, PROP_IGNORE_AUTO_ROUTES, + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, + "Ignore automatic routes", + "Ignore automatic routes", + FALSE, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + g_object_class_install_property + (object_class, PROP_IGNORE_AUTO_DNS, + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, + "Ignore automatic DNS", + "Ignore automatic DNS", FALSE, 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 173c9ef55c..119b09c147 100644 --- a/libnm-util/nm-setting-ip4-config.h +++ b/libnm-util/nm-setting-ip4-config.h @@ -53,19 +53,20 @@ GType nm_setting_ip4_config_error_get_type (void); #define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark () GQuark nm_setting_ip4_config_error_quark (void); -#define NM_SETTING_IP4_CONFIG_METHOD "method" -#define NM_SETTING_IP4_CONFIG_DNS "dns" -#define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search" -#define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses" -#define NM_SETTING_IP4_CONFIG_ROUTES "routes" -#define NM_SETTING_IP4_CONFIG_IGNORE_DHCP_DNS "ignore-dhcp-dns" -#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" -#define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname" - -#define NM_SETTING_IP4_CONFIG_METHOD_DHCP "dhcp" -#define NM_SETTING_IP4_CONFIG_METHOD_AUTOIP "autoip" -#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual" -#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared" +#define NM_SETTING_IP4_CONFIG_METHOD "method" +#define NM_SETTING_IP4_CONFIG_DNS "dns" +#define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search" +#define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses" +#define NM_SETTING_IP4_CONFIG_ROUTES "routes" +#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" +#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" +#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" +#define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname" + +#define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto" +#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local" +#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual" +#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared" typedef struct { guint32 address; /* network byte order */ @@ -74,14 +75,22 @@ typedef struct { } NMSettingIP4Address; typedef struct { + guint32 address; /* network byte order */ + guint32 prefix; + guint32 next_hop; /* network byte order */ + guint32 metric; /* lower metric == more preferred */ +} NMSettingIP4Route; + +typedef struct { NMSetting parent; char *method; GArray *dns; /* array of guint32; elements in network byte order */ GSList *dns_search; /* list of strings */ GSList *addresses; /* array of NMSettingIP4Address */ - GSList *routes; /* array of NMSettingIP4Address */ - gboolean ignore_dhcp_dns; + GSList *routes; /* array of NMSettingIP4Route */ + gboolean ignore_auto_routes; + gboolean ignore_auto_dns; char *dhcp_client_id; char *dhcp_hostname; } NMSettingIP4Config; diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index 4c4b54d4da..9a8258b847 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -70,7 +70,6 @@ enum { PROP_0, PROP_SERVICE_TYPE, PROP_USER_NAME, - PROP_ROUTES, LAST_PROP }; @@ -127,7 +126,6 @@ finalize (GObject *object) g_free (self->service_type); g_free (self->user_name); - nm_utils_slist_free (self->routes, g_free); G_OBJECT_CLASS (nm_setting_vpn_parent_class)->finalize (object); } @@ -147,10 +145,6 @@ set_property (GObject *object, guint prop_id, g_free (setting->user_name); setting->user_name = g_value_dup_string (value); break; - case PROP_ROUTES: - nm_utils_slist_free (setting->routes, g_free); - setting->routes = g_value_dup_boxed (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -170,9 +164,6 @@ get_property (GObject *object, guint prop_id, case PROP_USER_NAME: g_value_set_string (value, setting->user_name); break; - case PROP_ROUTES: - g_value_set_boxed (value, setting->routes); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -207,12 +198,4 @@ nm_setting_vpn_class_init (NMSettingVPNClass *setting_class) "User name", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); - - g_object_class_install_property - (object_class, PROP_ROUTES, - nm_param_spec_specialized (NM_SETTING_VPN_ROUTES, - "Routes", - "Routes", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); } diff --git a/libnm-util/nm-setting-vpn.h b/libnm-util/nm-setting-vpn.h index 7048ce96f9..a52627ae9f 100644 --- a/libnm-util/nm-setting-vpn.h +++ b/libnm-util/nm-setting-vpn.h @@ -54,14 +54,12 @@ GQuark nm_setting_vpn_error_quark (void); #define NM_SETTING_VPN_SERVICE_TYPE "service-type" #define NM_SETTING_VPN_USER_NAME "user-name" -#define NM_SETTING_VPN_ROUTES "routes" typedef struct { NMSetting parent; char *service_type; char *user_name; - GSList *routes; } NMSettingVPN; typedef struct { diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 0f9ba3d948..3171660b05 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -859,6 +859,58 @@ nm_utils_ip4_addresses_to_gvalue (GSList *list, GValue *value) g_value_take_boxed (value, addresses); } +GSList * +nm_utils_ip4_routes_from_gvalue (const GValue *value) +{ + GPtrArray *routes; + int i; + GSList *list = NULL; + + routes = (GPtrArray *) g_value_get_boxed (value); + for (i = 0; routes && (i < routes->len); i++) { + GArray *array = (GArray *) g_ptr_array_index (routes, i); + NMSettingIP4Route *route; + + if (array->len != 4) { + nm_warning ("Ignoring invalid IP4 route"); + continue; + } + + route = g_malloc0 (sizeof (NMSettingIP4Route)); + route->address = g_array_index (array, guint32, 0); + route->prefix = g_array_index (array, guint32, 1); + route->next_hop = g_array_index (array, guint32, 2); + route->metric = g_array_index (array, guint32, 3); + list = g_slist_prepend (list, route); + } + + return g_slist_reverse (list); +} + +void +nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *routes; + GSList *iter; + + routes = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + NMSettingIP4Route *route = (NMSettingIP4Route *) iter->data; + GArray *array; + + array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + + g_array_append_val (array, route->address); + g_array_append_val (array, route->prefix); + g_array_append_val (array, route->next_hop); + g_array_append_val (array, route->metric); + g_ptr_array_add (routes, array); + } + + g_value_take_boxed (value, routes); +} + /* * nm_utils_ip4_netmask_to_prefix * diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h index e573ac4442..394988fab6 100644 --- a/libnm-util/nm-utils.h +++ b/libnm-util/nm-utils.h @@ -187,6 +187,9 @@ gboolean nm_utils_security_valid (NMUtilsSecurityType type, GSList *nm_utils_ip4_addresses_from_gvalue (const GValue *value); void nm_utils_ip4_addresses_to_gvalue (GSList *list, GValue *value); +GSList *nm_utils_ip4_routes_from_gvalue (const GValue *value); +void nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value); + guint32 nm_utils_ip4_netmask_to_prefix (guint32 ip4_netmask); guint32 nm_utils_ip4_prefix_to_netmask (guint32 ip4_prefix); diff --git a/po/ChangeLog b/po/ChangeLog index 1ce3e096bc..402adaf3aa 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,13 @@ +2008-08-02 Alexander Shopov <ash@contact.bg> + + * bg.po: Updated Bulgarian translation by + Alexander Shopov <ash@contact.bg> + +2008-08-01 Og Maciel <ogmaciel@gnome.org> + + * pt_BR.po: Updated Brazilian Portuguese translation by + Henrique P Machado <zehrique@gmail.com> + 2008-07-31 Djihed Afifi <djihed@gmail.com> * ar.po: Updated Arabic Translation by Djihed Afifi. @@ -1,14 +1,14 @@ # Bulgarian translation of NetworkManager po-file -# Copyright (C) 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. -# Alexander Shopov <ash@contact.bg>, 2005, 2007. +# Alexander Shopov <ash@contact.bg>, 2005, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: NetworkManager HEAD\n" +"Project-Id-Version: NetworkManager trunk\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-07-27 23:54+0300\n" -"PO-Revision-Date: 2007-02-02 05:46+0200\n" +"POT-Creation-Date: 2008-08-02 08:52+0300\n" +"PO-Revision-Date: 2008-08-01 07:30+0300\n" "Last-Translator: Alexander Shopov <ash@contact.bg>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" "MIME-Version: 1.0\n" @@ -19,35 +19,35 @@ msgstr "" #: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:471 #, c-format msgid "error processing netlink message: %s" -msgstr "" +msgstr "грешка при обработката на следното съобщение от мрежовия слой: %s" #: ../src/nm-netlink-monitor.c:250 -#, fuzzy, c-format +#, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" -"неуспешно създаване на мрежово гнездо за наблюдение на устройства за кабелен " -"Етернет - %s" +"не може да се зададе модул в мрежовия слой за наблюдение на състоянието на " +"връзката — %s" #: ../src/nm-netlink-monitor.c:260 -#, fuzzy, c-format +#, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" -"неуспешно свързване към мрежовото гнездо за наблюдение на устройства за " -"кабелен Етернет - %s" +"не може да се осъществи връзка с мрежовия слой за наблюдение на състоянието " +"на връзката — %s" #: ../src/nm-netlink-monitor.c:268 -#, fuzzy, c-format +#, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" -"неуспешно свързване към мрежовото гнездо за наблюдение на устройства за " -"кабелен Етернет - %s" +"не може да се осъществи присъединяване към групата на мрежовия слой за " +"наблюдение на състоянието на връзката — %s" #: ../src/nm-netlink-monitor.c:276 -#, fuzzy, c-format +#, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" -"неуспешно създаване на мрежово гнездо за наблюдение на устройства за кабелен " -"Етернет - %s" +"не може да се зададе временна памет в мрежовия слой за наблюдение на " +"състоянието на връзката — %s" #: ../src/nm-netlink-monitor.c:494 #, c-format @@ -57,11 +57,11 @@ msgstr "грешка при изчакване за данни през гнез #: ../src/NetworkManager.c:250 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "" +msgstr "Неправилна опция. Ползвайте --help, за да видите списъка с опции.\n" #: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 msgid "# Created by NetworkManager\n" -msgstr "" +msgstr "# Създаден от NetworkManager\n" #: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 #, c-format @@ -69,195 +69,207 @@ msgid "" "# Merged from %s\n" "\n" msgstr "" +"# Слят от %s\n" +"\n" #: ../src/named-manager/nm-named-manager.c:117 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." -msgstr "" +msgstr "БЕЛЕЖКА: стандартно glibc поддържа максимум 3 сървъра за имена." #: ../src/named-manager/nm-named-manager.c:119 msgid "The nameservers listed below may not be recognized." -msgstr "" +msgstr "Сървърите за имена отдолу могат да не бъдат разпознати." #: ../system-settings/src/main.c:365 #, c-format msgid "Auto %s" -msgstr "" +msgstr "Автоматично %s" #: ../libnm-util/crypto.c:125 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "" +msgstr "Крайният етикет „%s“ липсва в сертификат във формат PEM." #: ../libnm-util/crypto.c:135 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "" +msgstr "Това не изглежда да е сертификат във формат PEM с частен ключ." #: ../libnm-util/crypto.c:143 #, c-format msgid "Not enough memory to store PEM file data." msgstr "" +"Няма достатъчно памет за запазването на данните от сертификата във формат " +"PEM." #: ../libnm-util/crypto.c:159 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." msgstr "" +"Неправилен сертификат във формат PEM: първият етикет не беше „Proc-Type“." #: ../libnm-util/crypto.c:167 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." msgstr "" +"Неправилен сертификат във формат PEM: непознат етикет „Proc-Type“ — „%s“." #: ../libnm-util/crypto.c:177 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." msgstr "" +"Неправилен сертификат във формат PEM: вторият етикет не беше „DEK-Info“." #: ../libnm-util/crypto.c:188 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." msgstr "" +"Неправилен сертификат във формат PEM: липсва първоначален вектор в етикета " +"„DEK-Info“." #: ../libnm-util/crypto.c:195 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." msgstr "" +"Неправилен сертификат във формат PEM: неправилен първоначален вектор в " +"етикета „DEK-Info“." #: ../libnm-util/crypto.c:208 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "" +"Неправилен сертификат във формат PEM: непознат шифър за частен ключ „%s“." #: ../libnm-util/crypto.c:227 #, c-format msgid "Could not decode private key." -msgstr "" +msgstr "Частният ключ не може да бъде декодиран." #: ../libnm-util/crypto.c:271 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "" +msgstr "Крайният етикет „1$%s“ липсва в сертификата във формат PEM — „2$%s“." #: ../libnm-util/crypto.c:281 #, c-format msgid "Failed to decode certificate." -msgstr "" +msgstr "Сертификатът не може да бъде декодиран." #: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 #, c-format msgid "Not enough memory to store certificate data." -msgstr "" +msgstr "Няма памет за запазването на данните от сертификат." #: ../libnm-util/crypto.c:328 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "" +msgstr "Началният вектор трябва да е четен брой байта на дължина." #: ../libnm-util/crypto.c:337 #, c-format msgid "Not enough memory to store the IV." -msgstr "" +msgstr "Няма достатъчно памет за запазването на началния вектор." #: ../libnm-util/crypto.c:348 #, c-format msgid "IV contains non-hexadecimal digits." -msgstr "" +msgstr "Началният вектор съдържа низ, който не е шестнайсетично число." #: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 #: ../libnm-util/crypto_nss.c:136 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "" +msgstr "Шифърът за частен ключ „%s“ е непознат." #: ../libnm-util/crypto.c:395 #, c-format msgid "Not enough memory to create private key decryption key." -msgstr "" +msgstr "Няма достатъчно памет за създаването на частен ключ за дешифриране." #: ../libnm-util/crypto.c:513 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "" +msgstr "Няма достатъчно памет за запазването на частен ключ за дешифриране." #: ../libnm-util/crypto_gnutls.c:73 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "" +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 "" +msgstr "Няма достатъчно памет за буфера за дешифриране." #: ../libnm-util/crypto_gnutls.c:143 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "" +msgstr "Контекстът за дешифриране не може да бъде инициализиран: %s / %s." #: ../libnm-util/crypto_gnutls.c:152 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "" +msgstr "Симетричният ключ за дешифриране не може да бъде зададен: %s / %s." #: ../libnm-util/crypto_gnutls.c:161 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "" +msgstr "Началният вектор за дешифриране не може да бъде зададен: %s / %s." #: ../libnm-util/crypto_gnutls.c:170 #, c-format msgid "Failed to decrypt the private key: %s / %s." -msgstr "" +msgstr "Частният ключ не може да бъде дешифриран: %s / %s." #: ../libnm-util/crypto_gnutls.c:208 #, c-format msgid "Error initializing certificate data: %s" -msgstr "" +msgstr "Грешка при инициализиране на данните от сертификата: %s" #: ../libnm-util/crypto_gnutls.c:220 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "" +msgstr "Сертификатът не може да бъде декодиран: %s" #: ../libnm-util/crypto_nss.c:78 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "" +msgstr "Контекстът за MD5 не може да бъде инициализиран: %d." #: ../libnm-util/crypto_nss.c:153 #, c-format msgid "Failed to initialize the decryption cipher slot." -msgstr "" +msgstr "Буферът за шифъра за дешифриране не може да бъде инициализиран." #: ../libnm-util/crypto_nss.c:163 #, c-format msgid "Failed to set symmetric key for decryption." -msgstr "" +msgstr "Симетричният ключ за дешифриране не може да бъде зададен." #: ../libnm-util/crypto_nss.c:173 #, c-format msgid "Failed to set IV for decryption." -msgstr "" +msgstr "Началният вектор за дешифриране не може да бъде зададен." #: ../libnm-util/crypto_nss.c:181 #, c-format msgid "Failed to initialize the decryption context." -msgstr "" +msgstr "Контекстът за дешифриране не може да бъде инициализиран." #: ../libnm-util/crypto_nss.c:194 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "" +msgstr "Частният ключ не може да бъде дешифриран: %d." #: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "" +msgstr "Дешифрирането на частния ключ не може да приключи: %d." #: ../libnm-util/crypto_nss.c:250 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "" +msgstr "Сертификатът не може да бъде дешифриран: %d" #~ msgid "Passphrase for wireless network %s" #~ msgstr "Парола за безжичната мрежа %s" @@ -296,8 +308,8 @@ msgstr "" #~ "Copyright © 2004-2006 Red Hat, Inc.\n" #~ "Copyright © 2005-2006 Novell, Inc." #~ msgstr "" -#~ "Авторски права © 2004-2006 Red Hat, Inc.\n" -#~ "Авторски права © 2004-2006 Novell, Inc." +#~ "Авторски права © 2004—2006 Red Hat, Inc.\n" +#~ "Авторски права © 2004—2006 Novell, Inc." #~ msgid "" #~ "Notification area applet for managing your network devices and " @@ -318,8 +330,8 @@ msgstr "" #~ "Copyright © 2004-2005 Red Hat, Inc.\n" #~ "Copyright © 2005-2006 Novell, Inc." #~ msgstr "" -#~ "Авторски права © 2004-2005 Red Hat, Inc.\n" -#~ "Авторски права © 2005-2006 Novell, Inc." +#~ "Авторски права © 2004—2005 Red Hat, Inc.\n" +#~ "Авторски права © 2005—2006 Novell, Inc." #~ msgid "VPN Login Failure" #~ msgstr "Грешка при идентификация пред ВЧМ" @@ -378,31 +390,31 @@ msgstr "" #~ msgstr "(не се знае)" #~ msgid "Preparing device %s for the wired network..." -#~ msgstr "Подготвяне на устройството „%s“ за кабелната мрежа..." +#~ msgstr "Подготвяне на устройството „%s“ за кабелната мрежа…" #~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "Подготвяне на устройството „%s“ за безжичната мрежа „%s“..." +#~ msgstr "Подготвяне на устройството „%s“ за безжичната мрежа „%s“…" #~ msgid "Configuring device %s for the wired network..." -#~ msgstr "Настройване на устройството „%s“ за кабелната мрежа..." +#~ msgstr "Настройване на устройството „%s“ за кабелната мрежа…" #~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "Опит за свързване към безжичната мрежа „%s“..." +#~ msgstr "Опит за свързване към безжичната мрежа „%s“…" #~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "Изчакване за мрежовия ключ за безжичната мрежа „%s“..." +#~ msgstr "Изчакване за мрежовия ключ за безжичната мрежа „%s“…" #~ msgid "Requesting a network address from the wired network..." -#~ msgstr "Запитване на кабелната мрежа за адрес..." +#~ msgstr "Запитване на кабелната мрежа за адрес…" #~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "Запитване на безжичната мрежа „%s“ за адрес..." +#~ msgstr "Запитване на безжичната мрежа „%s“ за адрес…" #~ msgid "Finishing connection to the wired network..." -#~ msgstr "Завършване на връзката към кабелната мрежа..." +#~ msgstr "Завършване на връзката към кабелната мрежа…" #~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "Завършване на връзката към безжичната мрежа „%s“..." +#~ msgstr "Завършване на връзката към безжичната мрежа „%s“…" #~ msgid "NetworkManager is not running" #~ msgstr "NetworkManager не е включен" @@ -429,34 +441,34 @@ msgstr "" #~ msgstr "Свързване по ВЧМ към „%s“" #~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "_Свързване към други безжични мрежи..." +#~ msgstr "_Свързване към други безжични мрежи…" #~ msgid "Create _New Wireless Network..." -#~ msgstr "Създаване на _нова безжична мрежа..." +#~ msgstr "Създаване на _нова безжична мрежа…" #~ msgid "_VPN Connections" #~ msgstr "_Връзки по ВЧМ" #~ msgid "_Configure VPN..." -#~ msgstr "_Настройване на ВЧМ..." +#~ msgstr "_Настройване на ВЧМ…" #~ msgid "_Disconnect VPN..." -#~ msgstr "_Прекъсване на ВЧМ..." +#~ msgstr "_Прекъсване на ВЧМ…" #~ msgid "_Dial Up Connections" #~ msgstr "_Връзки по телефонна линия" #~ msgid "Connect to %s..." -#~ msgstr "Свързване към %s..." +#~ msgstr "Свързване към %s…" #~ msgid "Disconnect from %s..." -#~ msgstr "Прекъсване на връзката към %s..." +#~ msgstr "Прекъсване на връзката към %s…" #~ msgid "No network devices have been found" #~ msgstr "Не са открити мрежови устройства" #~ msgid "NetworkManager is not running..." -#~ msgstr "NetworkManager не е включен..." +#~ msgstr "NetworkManager не е включен…" #~ msgid "Enable _Networking" #~ msgstr "_Включване на мрежата" @@ -656,7 +668,7 @@ msgstr "" #~ "безжична мрежа</span>\n" #~ "\n" #~ "Избрали сте да се свържете към безжичната мрежа „%s“. Ако сте уверени, че " -#~ "тя е сигурна и можете да й се доверите, задайте настройката отдолу и " +#~ "тя е сигурна и можете да ѝ се доверите, задайте настройката отдолу и " #~ "NetworkManager няма да ви иска потвърждения при следващи влизания." #~ msgid "Anonymous Identity:" @@ -732,7 +744,7 @@ msgstr "" #~ "Споделен ключ" #~ msgid "Other Wireless Network..." -#~ msgstr "Друга безжична мрежа..." +#~ msgstr "Друга безжична мрежа…" #~ msgid "Passphrase:" #~ msgstr "Парола:" diff --git a/po/pt_BR.po b/po/pt_BR.po index ef7820d461..5bbad0b0e7 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -10,9 +10,9 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-05-29 09:18-0300\n" -"PO-Revision-Date: 2008-05-28 08:56-0400\n" -"Last-Translator: Og Maciel <ogmaciel@gnome.org>\n" +"POT-Creation-Date: 2008-08-01 18:12-0400\n" +"PO-Revision-Date: 2008-08-01 18:41-0300\n" +"Last-Translator: Henrique P Machado <zehrique@gmail.com>\n" "Language-Team: Brazilian Portuguese <gnome-l10n-br@listas.cipsga.org.br>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -56,201 +56,214 @@ msgstr "" msgid "error occurred while waiting for data on socket" msgstr "ocorreu um erro ao esperar por dados no socket" -#: ../src/NetworkManager.c:254 +#: ../src/NetworkManager.c:250 #, 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/named-manager/nm-named-manager.c:218 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +msgid "# Created by NetworkManager\n" +msgstr "# Criado pelo NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Combinado de %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:117 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "" "NOTA: o resolvedor da glibc não suporta mais que 3 servidores de nomes." -#: ../src/named-manager/nm-named-manager.c:220 +#: ../src/named-manager/nm-named-manager.c:119 msgid "The nameservers listed below may not be recognized." msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." -#: ../system-settings/src/main.c:348 +#: ../system-settings/src/main.c:365 #, c-format msgid "Auto %s" msgstr "Auto %s" -#: ../libnm-util/crypto.c:123 +#: ../libnm-util/crypto.c:125 #, c-format msgid "PEM key file had no end tag '%s'." msgstr "A Chave do arquivo PEM não tinha a etiqueta \"%s\"." -#: ../libnm-util/crypto.c:133 +#: ../libnm-util/crypto.c:135 #, c-format msgid "Doesn't look like a PEM private key file." msgstr "Não se parece com um arquivo de chave privada PEM." -#: ../libnm-util/crypto.c:141 +#: ../libnm-util/crypto.c:143 #, c-format msgid "Not enough memory to store PEM file data." msgstr "Memória insuficiente para armazenar os dados do arquivo PEM." -#: ../libnm-util/crypto.c:157 +#: ../libnm-util/crypto.c:159 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." msgstr "Arquivo PEM mal-formado: Proc-Type não era a primera etiqueta." -#: ../libnm-util/crypto.c:165 +#: ../libnm-util/crypto.c:167 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." msgstr "Arquivo PEM mal-formado: etiqueta Proc-Type desconhecida: \"%s\"." -#: ../libnm-util/crypto.c:175 +#: ../libnm-util/crypto.c:177 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." msgstr "Arquivo PEM mal-formado: DEK-Info não era a segunda etiqueta." -#: ../libnm-util/crypto.c:186 +#: ../libnm-util/crypto.c:188 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." msgstr "Arquivo PEM mal-formado: nenhum IV encontrado na etiqueta DEK-Info." -#: ../libnm-util/crypto.c:193 +#: ../libnm-util/crypto.c:195 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." msgstr "Arquivo PEM mal-formado: formato inválido do IV na etiqueta DEK-Info." -#: ../libnm-util/crypto.c:206 +#: ../libnm-util/crypto.c:208 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "Arquivo PEM mal-formado: cifra desconhecida da chave privada \"%s\"." -#: ../libnm-util/crypto.c:225 +#: ../libnm-util/crypto.c:227 #, c-format msgid "Could not decode private key." msgstr "Não foi possível decodificar chave privada." -#: ../libnm-util/crypto.c:269 +#: ../libnm-util/crypto.c:271 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." msgstr "Certificado PEM \"%s\" não tinha a etiqueta de finalização \"%s\"." -#: ../libnm-util/crypto.c:279 +#: ../libnm-util/crypto.c:281 #, c-format msgid "Failed to decode certificate." msgstr "Falha ao decodificar o certificado." -#: ../libnm-util/crypto.c:288 ../libnm-util/crypto.c:296 +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 #, c-format msgid "Not enough memory to store certificate data." msgstr "Memória insuficiente para armazenar os dados do certificado." -#: ../libnm-util/crypto.c:326 +#: ../libnm-util/crypto.c:328 #, c-format msgid "IV must be an even number of bytes in length." msgstr "IV deve ter um número par de bytes no comprimento." -#: ../libnm-util/crypto.c:335 +#: ../libnm-util/crypto.c:337 #, c-format msgid "Not enough memory to store the IV." msgstr "Memória insuficiente para armazenar o IV." -#: ../libnm-util/crypto.c:346 +#: ../libnm-util/crypto.c:348 #, c-format msgid "IV contains non-hexadecimal digits." msgstr "IV contém dígitos não-hexadecimais." -#: ../libnm-util/crypto.c:384 ../libnm-util/crypto_gnutls.c:125 -#: ../libnm-util/crypto_nss.c:134 +#: ../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 "Cifra da chave privada \"%s\" não foi reconhecida." -#: ../libnm-util/crypto.c:393 +#: ../libnm-util/crypto.c:395 #, c-format msgid "Not enough memory to create private key decryption key." msgstr "" "Memória insuficiente para criar chave privada de descriptografia privada." -#: ../libnm-util/crypto.c:511 +#: ../libnm-util/crypto.c:513 #, c-format msgid "Not enough memory to store decrypted private key." msgstr "" "Memória insuficiente para armazenar a chave de descriptografia privada." -#: ../libnm-util/crypto_gnutls.c:72 +#: ../libnm-util/crypto_gnutls.c:73 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Falhou ao inicializar o motor MD5: %s / %s." -#: ../libnm-util/crypto_gnutls.c:134 ../libnm-util/crypto_nss.c:143 +#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Memória insuficiente para o buffer de descriptografia." -#: ../libnm-util/crypto_gnutls.c:142 +#: ../libnm-util/crypto_gnutls.c:143 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Falhou ao inicializar o contexto da cifra de descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:151 +#: ../libnm-util/crypto_gnutls.c:152 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Falhou ao atribuir chave simétrica para descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:161 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Falhou ao atribuir IV para descriptografia: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:170 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Falhou ao descriptografar a chave privada: %s / %s." -#: ../libnm-util/crypto_gnutls.c:207 +#: ../libnm-util/crypto_gnutls.c:208 #, c-format msgid "Error initializing certificate data: %s" msgstr "Erro ao inicializar od dados do certificado: %s" -#: ../libnm-util/crypto_gnutls.c:219 +#: ../libnm-util/crypto_gnutls.c:220 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Não pôde decodificar o certificado: %s" -#: ../libnm-util/crypto_nss.c:76 +#: ../libnm-util/crypto_nss.c:78 #, c-format msgid "Failed to initialize the MD5 context: %d." msgstr "Falha ao inicializar o contexto MD5: %d." -#: ../libnm-util/crypto_nss.c:151 +#: ../libnm-util/crypto_nss.c:153 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Falha ao inicializar o slot de cifra de descriptografia." -#: ../libnm-util/crypto_nss.c:161 +#: ../libnm-util/crypto_nss.c:163 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Falha ao atribuir chave simétrica para descriptografia." -#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:173 #, c-format msgid "Failed to set IV for decryption." msgstr "Falha ao atribuir IV para descriptografia." -#: ../libnm-util/crypto_nss.c:179 +#: ../libnm-util/crypto_nss.c:181 #, c-format msgid "Failed to initialize the decryption context." msgstr "Falha ao inicializar o contexto de descriptografia." -#: ../libnm-util/crypto_nss.c:192 +#: ../libnm-util/crypto_nss.c:194 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Falha ao descriptografar a chave privada: %d." -#: ../libnm-util/crypto_nss.c:204 +#: ../libnm-util/crypto_nss.c:206 #, 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:248 +#: ../libnm-util/crypto_nss.c:250 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Não foi possível decodificar o certificado: %d" diff --git a/src/NetworkManager.c b/src/NetworkManager.c index f6651de16c..9468c94ba0 100644 --- a/src/NetworkManager.c +++ b/src/NetworkManager.c @@ -303,7 +303,7 @@ main (int argc, char *argv[]) goto done; } - manager = nm_manager_new (); + manager = nm_manager_get (); if (manager == NULL) { nm_error ("Failed to initialize the network manager."); goto done; diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 1a6608e3a1..17b5041400 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -147,7 +147,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) /* Never set the default route through an IPv4LL-addressed device */ s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) + if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) continue; /* Make sure at least one of this device's IP addresses has a gateway */ diff --git a/src/NetworkManagerSystem.c b/src/NetworkManagerSystem.c index 8aa885c0f2..bf6b11d792 100644 --- a/src/NetworkManagerSystem.c +++ b/src/NetworkManagerSystem.c @@ -107,6 +107,7 @@ nm_system_device_set_ip4_route (const char *iface, guint32 ip4_dest, guint32 ip4_prefix, guint32 ip4_gateway, + guint32 metric, int mss) { struct nl_handle *nlh; @@ -148,6 +149,10 @@ nm_system_device_set_ip4_route (const char *iface, } } + /* Metric */ + if (metric) + rtnl_route_set_prio (route, metric); + /* Add the route */ err = rtnl_route_add (nlh, route, 0); if (err == -ESRCH && ip4_gateway) { @@ -284,14 +289,15 @@ nm_system_device_set_from_ip4_config (const char *iface, sleep (1); - len = nm_ip4_config_get_num_static_routes (config); + len = nm_ip4_config_get_num_routes (config); for (i = 0; i < len; i++) { - const NMSettingIP4Address *route = nm_ip4_config_get_static_route (config, i); + const NMSettingIP4Route *route = nm_ip4_config_get_route (config, i); nm_system_device_set_ip4_route (iface, config, route->address, route->prefix, - route->gateway, + route->next_hop, + route->metric, nm_ip4_config_get_mss (config)); } @@ -344,7 +350,7 @@ nm_system_vpn_device_set_from_ip4_config (NMDevice *active_device, } nm_system_device_set_ip4_route (nm_device_get_ip_iface (active_device), - ad_config, vpn_gw, 32, ad_gw, + ad_config, vpn_gw, 32, ad_gw, 0, nm_ip4_config_get_mss (config)); } } @@ -362,14 +368,15 @@ nm_system_vpn_device_set_from_ip4_config (NMDevice *active_device, nm_system_device_set_mtu (iface, nm_ip4_config_get_mtu (config)); /* Set routes */ - num = nm_ip4_config_get_num_static_routes (config); + num = nm_ip4_config_get_num_routes (config); for (i = 0; i < num; i++) { - const NMSettingIP4Address *route = nm_ip4_config_get_static_route (config, i); + const NMSettingIP4Route *route = nm_ip4_config_get_route (config, i); nm_system_device_set_ip4_route (iface, config, route->address, route->prefix, - route->gateway, + route->next_hop, + route->metric, nm_ip4_config_get_mss (config)); } diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index a4a56448eb..66fe990795 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -278,11 +278,14 @@ nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting) if (!setting) return; /* Defaults are just fine */ - if (setting->ignore_dhcp_dns) { + if (setting->ignore_auto_dns) { nm_ip4_config_reset_nameservers (ip4_config); nm_ip4_config_reset_searches (ip4_config); } + if (setting->ignore_auto_routes) + nm_ip4_config_reset_routes (ip4_config); + if (setting->dns) { int i, j; @@ -344,25 +347,27 @@ nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting) nm_ip4_config_add_address (ip4_config, setting_addr); } - /* IPv4 static routes */ + /* IPv4 routes */ for (iter = setting->routes; iter; iter = g_slist_next (iter)) { - NMSettingIP4Address *setting_route = (NMSettingIP4Address *) iter->data; + NMSettingIP4Route *setting_route = (NMSettingIP4Route *) iter->data; guint32 i, num; - num = nm_ip4_config_get_num_static_routes (ip4_config); + num = nm_ip4_config_get_num_routes (ip4_config); for (i = 0; i < num; i++) { - const NMSettingIP4Address *cfg_route; - - cfg_route = nm_ip4_config_get_static_route (ip4_config, i); - /* Dupe, override with user-specified address */ - if (cfg_route->address == setting_route->address) { - nm_ip4_config_replace_static_route (ip4_config, i, setting_route); + const NMSettingIP4Route *cfg_route; + + cfg_route = nm_ip4_config_get_route (ip4_config, i); + /* Dupe, override with user-specified route */ + if ( (cfg_route->address == setting_route->address) + && (cfg_route->prefix == setting_route->prefix) + && (cfg_route->next_hop == setting_route->next_hop)) { + nm_ip4_config_replace_route (ip4_config, i, setting_route); break; } } if (i == num) - nm_ip4_config_add_static_route (ip4_config, setting_route); + nm_ip4_config_add_route (ip4_config, setting_route); } } diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 4846bf1044..94c4a65c61 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -829,6 +829,7 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, char **s; for (s = searches; *s; s += 2) { + NMSettingIP4Route *route; struct in_addr rt_addr; struct in_addr rt_route; @@ -843,13 +844,12 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, // FIXME: ensure the IP addresse and route are sane - addr = g_malloc0 (sizeof (NMSettingIP4Address)); - addr->address = (guint32) rt_addr.s_addr; - addr->prefix = 32; /* 255.255.255.255 */ - addr->gateway = (guint32) rt_route.s_addr; + route = g_malloc0 (sizeof (NMSettingIP4Route)); + route->address = (guint32) rt_addr.s_addr; + route->prefix = 32; /* 255.255.255.255 */ + route->next_hop = (guint32) rt_route.s_addr; - nm_ip4_config_take_static_route (ip4_config, addr); - addr = NULL; + nm_ip4_config_take_route (ip4_config, route); nm_info (" static route %s gw %s", *s, *(s + 1)); } } else { diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c index e064a7e6c7..7ae4ef2224 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.c +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c @@ -255,6 +255,7 @@ create_dm_cmd_line (const char *iface, nm_cmd_line_add_string (cmd, "--keep-in-foreground"); nm_cmd_line_add_string (cmd, "--bind-interfaces"); nm_cmd_line_add_string (cmd, "--no-poll"); + nm_cmd_line_add_string (cmd, "--except-interface=lo"); s = g_string_new ("--listen-address="); addr.s_addr = tmp->address; diff --git a/src/modem-manager/nm-modem-device.c b/src/modem-manager/nm-modem-device.c index 21056ec2d6..7cfe142d78 100644 --- a/src/modem-manager/nm-modem-device.c +++ b/src/modem-manager/nm-modem-device.c @@ -338,12 +338,9 @@ real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) req = nm_device_get_act_request (device); g_assert (req); - priv->ppp_manager = nm_ppp_manager_new (); + priv->ppp_manager = nm_ppp_manager_new (nm_device_get_iface (device)); - if (nm_ppp_manager_start (priv->ppp_manager, - nm_device_get_iface (device), - req, - &err)) { + if (nm_ppp_manager_start (priv->ppp_manager, req, &err)) { g_signal_connect (priv->ppp_manager, "state-changed", G_CALLBACK (ppp_state_changed), device); diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c index 2c9a912dbc..03aac5bf4d 100644 --- a/src/modem-manager/nm-modem-manager.c +++ b/src/modem-manager/nm-modem-manager.c @@ -114,9 +114,9 @@ create_modem (NMModemManager *manager, const char *path) { NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (manager); NMModemDevice *modem; - char *data_device; - char *driver; - uint modem_type; + char *data_device = NULL; + char *driver = NULL; + uint modem_type = MM_MODEM_TYPE_UNKNOWN; if (g_hash_table_lookup (priv->modems, path)) { nm_warning ("Modem with path %s already exists, ignoring", path); @@ -127,6 +127,21 @@ create_modem (NMModemManager *manager, const char *path) &data_device, &driver, &modem_type)) return; + if (modem_type == MM_MODEM_TYPE_UNKNOWN) { + nm_warning ("Modem with path %s has unknown type, ignoring", path); + return; + } + + if (!driver || !strlen (driver)) { + nm_warning ("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); + return; + } + modem = nm_modem_device_new (path, data_device, driver, diff --git a/src/modem-manager/nm-modem-types.h b/src/modem-manager/nm-modem-types.h index 14467caa73..b41ff4b2f3 100644 --- a/src/modem-manager/nm-modem-types.h +++ b/src/modem-manager/nm-modem-types.h @@ -8,8 +8,9 @@ #define MM_DBUS_INTERFACE "org.freedesktop.ModemManager" #define MM_DBUS_INTERFACE_MODEM "org.freedesktop.ModemManager.Modem" -#define MM_MODEM_TYPE_GSM 1 -#define MM_MODEM_TYPE_CDMA 2 +#define MM_MODEM_TYPE_UNKNOWN 0 +#define MM_MODEM_TYPE_GSM 1 +#define MM_MODEM_TYPE_CDMA 2 #define MM_MODEM_ERROR_GENERAL MM_DBUS_INTERFACE_MODEM ".GeneralError" #define MM_MODEM_ERROR_PIN_NEEDED MM_DBUS_INTERFACE_MODEM ".PINNeeded" diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c index 36c4fc07f4..4df9f887e9 100644 --- a/src/nm-activation-request.c +++ b/src/nm-activation-request.c @@ -35,8 +35,6 @@ #include "nm-manager.h" /* FIXME! */ -#define CONNECTION_GET_SECRETS_CALL_TAG "get-secrets-call" - G_DEFINE_TYPE (NMActRequest, nm_act_request, G_TYPE_OBJECT) #define NM_ACT_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACT_REQUEST, NMActRequestPrivate)) @@ -53,7 +51,11 @@ static guint signals[LAST_SIGNAL] = { 0 }; typedef struct { + gboolean disposed; + NMConnection *connection; + DBusGProxyCall *secrets_call; + char *specific_object; NMDevice *device; gboolean user_requested; @@ -168,32 +170,44 @@ nm_act_request_init (NMActRequest *req) } static void +cleanup_secrets_dbus_call (NMActRequest *self) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (self); + DBusGProxy *proxy; + + g_return_if_fail (priv->connection != NULL); + g_return_if_fail (NM_IS_CONNECTION (priv->connection)); + + proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); + g_assert (proxy); + + if (priv->secrets_call) { + dbus_g_proxy_cancel_call (proxy, priv->secrets_call); + priv->secrets_call = NULL; + } +} + +static void dispose (GObject *object) { NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object); - DBusGProxy *proxy; - DBusGProxyCall *call; - if (!priv->connection) - goto out; + if (priv->disposed) { + G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + g_assert (priv->connection); g_signal_handlers_disconnect_by_func (G_OBJECT (priv->device), G_CALLBACK (device_state_changed), NM_ACT_REQUEST (object)); - proxy = g_object_get_data (G_OBJECT (priv->connection), - NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); - call = g_object_get_data (G_OBJECT (priv->connection), - CONNECTION_GET_SECRETS_CALL_TAG); - - if (proxy && call) - dbus_g_proxy_cancel_call (proxy, call); + cleanup_secrets_dbus_call (NM_ACT_REQUEST (object)); - g_object_set_data (G_OBJECT (priv->connection), - CONNECTION_GET_SECRETS_CALL_TAG, NULL); g_object_unref (priv->connection); -out: G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object); } @@ -443,7 +457,9 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) g_return_if_fail (info->setting_name); priv = NM_ACT_REQUEST_GET_PRIVATE (info->req); - g_object_set_data (G_OBJECT (priv->connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL); + + g_return_if_fail (call == priv->secrets_call); + priv->secrets_call = NULL; if (!dbus_g_proxy_end_call (proxy, call, &err, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, @@ -498,40 +514,31 @@ out: } gboolean -nm_act_request_request_connection_secrets (NMActRequest *req, +nm_act_request_request_connection_secrets (NMActRequest *self, const char *setting_name, gboolean request_new, RequestSecretsCaller caller, const char *hint1, const char *hint2) { - DBusGProxy *proxy; - DBusGProxyCall *call; + DBusGProxy *secrets_proxy; GetSecretsInfo *info = NULL; NMActRequestPrivate *priv = NULL; GPtrArray *hints = NULL; - g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (self), FALSE); g_return_val_if_fail (setting_name != NULL, FALSE); - priv = NM_ACT_REQUEST_GET_PRIVATE (req); - proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); - if (!DBUS_IS_G_PROXY (proxy)) { - nm_warning ("Couldn't get dbus proxy for connection."); - goto error; - } + priv = NM_ACT_REQUEST_GET_PRIVATE (self); + + cleanup_secrets_dbus_call (self); info = g_malloc0 (sizeof (GetSecretsInfo)); - if (!info) { - nm_warning ("Not enough memory to get secrets"); - goto error; - } + g_return_val_if_fail (info != NULL, FALSE); + info->req = self; + info->caller = caller; info->setting_name = g_strdup (setting_name); - if (!info->setting_name) { - nm_warning ("Not enough memory to get secrets"); - goto error; - } /* Empty for now */ hints = g_ptr_array_sized_new (2); @@ -541,29 +548,30 @@ nm_act_request_request_connection_secrets (NMActRequest *req, if (hint2) g_ptr_array_add (hints, g_strdup (hint2)); - info->req = req; - info->caller = caller; - call = dbus_g_proxy_begin_call_with_timeout (proxy, "GetSecrets", - get_secrets_cb, - info, - free_get_secrets_info, - G_MAXINT32, - G_TYPE_STRING, setting_name, - DBUS_TYPE_G_ARRAY_OF_STRING, hints, - G_TYPE_BOOLEAN, request_new, - G_TYPE_INVALID); + secrets_proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); + g_assert (secrets_proxy); + + priv->secrets_call = dbus_g_proxy_begin_call_with_timeout (secrets_proxy, "GetSecrets", + get_secrets_cb, + info, + free_get_secrets_info, + G_MAXINT32, + G_TYPE_STRING, setting_name, + DBUS_TYPE_G_ARRAY_OF_STRING, hints, + G_TYPE_BOOLEAN, request_new, + G_TYPE_INVALID); g_ptr_array_free (hints, TRUE); - if (!call) { - nm_warning ("Could not call GetSecrets"); + if (!priv->secrets_call) { + nm_warning ("Could not call get secrets"); goto error; } - g_object_set_data (G_OBJECT (priv->connection), CONNECTION_GET_SECRETS_CALL_TAG, call); return TRUE; error: if (info) free_get_secrets_info (info); + cleanup_secrets_dbus_call (self); return FALSE; } diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index d1df23ea03..a07f9573c2 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1178,11 +1178,8 @@ pppoe_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) req = nm_device_get_act_request (NM_DEVICE (self)); g_assert (req); - priv->ppp_manager = nm_ppp_manager_new (); - if (nm_ppp_manager_start (priv->ppp_manager, - nm_device_get_iface (NM_DEVICE (self)), - req, - &err)) { + priv->ppp_manager = nm_ppp_manager_new (nm_device_get_iface (NM_DEVICE (self))); + if (nm_ppp_manager_start (priv->ppp_manager, req, &err)) { g_signal_connect (priv->ppp_manager, "state-changed", G_CALLBACK (ppp_state_changed), self); diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 413fe33b88..744c3b0d7d 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2770,6 +2770,7 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) NMConnection * connection; NMSettingConnection * s_connection; const char * setting_name; + NMSettingWireless * s_wireless; g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); @@ -2787,33 +2788,31 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) s_connection = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); g_assert (s_connection); + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_assert (s_wireless); + /* If we need secrets, get them */ setting_name = nm_connection_need_secrets (connection, NULL); if (setting_name) { - NMActStageReturn auth_ret; - nm_info ("Activation (%s/wireless): access point '%s' has security," " but secrets are required.", iface, s_connection->id); - auth_ret = handle_auth_or_fail (self, req, FALSE); - if (auth_ret == NM_ACT_STAGE_RETURN_FAILURE) { + ret = handle_auth_or_fail (self, req, FALSE); + if (ret == NM_ACT_STAGE_RETURN_FAILURE) *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; - goto out; - } - } else { - NMSettingWireless *s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, - NM_TYPE_SETTING_WIRELESS); + goto out; + } - if (s_wireless->security) { - nm_info ("Activation (%s/wireless): connection '%s' has security" - ", and secrets exist. No new secrets needed.", - iface, s_connection->id); - } else { - nm_info ("Activation (%s/wireless): connection '%s' requires no " - "security. No secrets needed.", - iface, s_connection->id); - } + /* have secrets, or no secrets required */ + if (s_wireless->security) { + nm_info ("Activation (%s/wireless): connection '%s' has security" + ", and secrets exist. No new secrets needed.", + iface, s_connection->id); + } else { + nm_info ("Activation (%s/wireless): connection '%s' requires no " + "security. No secrets needed.", + iface, s_connection->id); } config = build_supplicant_config (self, connection, ap); @@ -3417,7 +3416,8 @@ nm_device_wifi_set_enabled (NMDeviceWifi *self, gboolean enabled) return; if (enabled) { - g_warn_if_fail (state == NM_DEVICE_STATE_UNAVAILABLE); + if (state != NM_DEVICE_STATE_UNAVAILABLE); + nm_warning ("not in expected unavailable state!"); if (!nm_device_hw_bring_up (NM_DEVICE (self), TRUE)) { /* The device sucks, or HAL was lying to us about the killswitch state */ diff --git a/src/nm-device.c b/src/nm-device.c index ea0910c539..a97986cd08 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -649,7 +649,7 @@ nm_device_handle_autoip4_event (NMDevice *self, /* Ignore if the connection isn't an AutoIP connection */ s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - if (!s_ip4 || !s_ip4->method || strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) + if (!s_ip4 || !s_ip4->method || strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) return; iface = nm_device_get_iface (self); @@ -828,7 +828,7 @@ real_act_stage3_ip_config_start (NMDevice *self, NMDeviceStateReason *reason) NM_TYPE_SETTING_IP4_CONFIG); /* If we did not receive IP4 configuration information, default to DHCP */ - if (!s_ip4 || !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) { + if (!s_ip4 || !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); gboolean success; @@ -850,7 +850,7 @@ real_act_stage3_ip_config_start (NMDevice *self, NMDeviceStateReason *reason) *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; ret = NM_ACT_STAGE_RETURN_FAILURE; } - } else if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) { + } else if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) { GError *error = NULL; /* Start avahi-autoipd */ @@ -1026,7 +1026,7 @@ real_act_stage4_get_ip4_config (NMDevice *self, g_assert (s_ip4); g_assert (s_ip4->method); - if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) { + if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) { *config = aipd_get_ip4_config (self, reason); } else if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { *config = nm_ip4_config_new (); diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 40acfc364a..0bf780b894 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -58,7 +58,7 @@ typedef struct { gchar *hostname; gchar *nis_domain; GArray *nis_servers; - GSList *static_routes; + GSList *routes; } NMIP4ConfigPrivate; @@ -70,7 +70,7 @@ enum { PROP_DOMAINS, PROP_NIS_DOMAIN, PROP_NIS_SERVERS, - PROP_STATIC_ROUTES, + PROP_ROUTES, LAST_PROP }; @@ -133,13 +133,13 @@ NMIP4Config *nm_ip4_config_copy (NMIP4Config *src_config) for (i = 0; i < len; i++) nm_ip4_config_add_nis_server (dst_config, nm_ip4_config_get_nis_server (src_config, i)); - for (iter = src_priv->static_routes; iter; iter = g_slist_next (iter)) { - NMSettingIP4Address *src_addr = (NMSettingIP4Address *) iter->data; - NMSettingIP4Address *dst_addr; + for (iter = src_priv->routes; iter; iter = g_slist_next (iter)) { + NMSettingIP4Route *src_route = (NMSettingIP4Route *) iter->data; + NMSettingIP4Route *dst_route; - dst_addr = g_malloc0 (sizeof (NMSettingIP4Address)); - memcpy (dst_addr, src_addr, sizeof (NMSettingIP4Address)); - nm_ip4_config_take_static_route (dst_config, dst_addr); + dst_route = g_malloc0 (sizeof (NMSettingIP4Route)); + memcpy (dst_route, src_route, sizeof (NMSettingIP4Route)); + nm_ip4_config_take_route (dst_config, dst_route); } return dst_config; @@ -310,38 +310,38 @@ const char *nm_ip4_config_get_nis_domain (NMIP4Config *config) } void -nm_ip4_config_take_static_route (NMIP4Config *config, - NMSettingIP4Address *address) +nm_ip4_config_take_route (NMIP4Config *config, + NMSettingIP4Route *route) { NMIP4ConfigPrivate *priv; g_return_if_fail (NM_IS_IP4_CONFIG (config)); - g_return_if_fail (address != NULL); + g_return_if_fail (route != NULL); priv = NM_IP4_CONFIG_GET_PRIVATE (config); - priv->static_routes = g_slist_append (priv->static_routes, address); + priv->routes = g_slist_append (priv->routes, route); } void -nm_ip4_config_add_static_route (NMIP4Config *config, - NMSettingIP4Address *address) +nm_ip4_config_add_route (NMIP4Config *config, + NMSettingIP4Route *route) { NMIP4ConfigPrivate *priv; - NMSettingIP4Address *copy; + NMSettingIP4Route *copy; g_return_if_fail (NM_IS_IP4_CONFIG (config)); - g_return_if_fail (address != NULL); + g_return_if_fail (route != NULL); priv = NM_IP4_CONFIG_GET_PRIVATE (config); - copy = g_malloc0 (sizeof (NMSettingIP4Address)); - memcpy (copy, address, sizeof (NMSettingIP4Address)); - priv->static_routes = g_slist_append (priv->static_routes, copy); + copy = g_malloc0 (sizeof (NMSettingIP4Route)); + memcpy (copy, route, sizeof (NMSettingIP4Route)); + priv->routes = g_slist_append (priv->routes, copy); } void -nm_ip4_config_replace_static_route (NMIP4Config *config, +nm_ip4_config_replace_route (NMIP4Config *config, guint i, - NMSettingIP4Address *new_address) + NMSettingIP4Route *new_route) { NMIP4ConfigPrivate *priv; GSList *old; @@ -349,28 +349,38 @@ nm_ip4_config_replace_static_route (NMIP4Config *config, g_return_if_fail (NM_IS_IP4_CONFIG (config)); priv = NM_IP4_CONFIG_GET_PRIVATE (config); - old = g_slist_nth (priv->static_routes, i); + old = g_slist_nth (priv->routes, i); g_return_if_fail (old != NULL); g_free (old->data); - old->data = new_address; + old->data = new_route; } -const NMSettingIP4Address * -nm_ip4_config_get_static_route (NMIP4Config *config, guint i) +const NMSettingIP4Route * +nm_ip4_config_get_route (NMIP4Config *config, guint i) { g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); - return (const NMSettingIP4Address *) g_slist_nth_data (NM_IP4_CONFIG_GET_PRIVATE (config)->static_routes, i); + return (const NMSettingIP4Route *) g_slist_nth_data (NM_IP4_CONFIG_GET_PRIVATE (config)->routes, i); } -guint32 nm_ip4_config_get_num_static_routes (NMIP4Config *config) +guint32 nm_ip4_config_get_num_routes (NMIP4Config *config) { g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); - return g_slist_length (NM_IP4_CONFIG_GET_PRIVATE (config)->static_routes); + return g_slist_length (NM_IP4_CONFIG_GET_PRIVATE (config)->routes); } +void nm_ip4_config_reset_routes (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + priv->routes = NULL; +} void nm_ip4_config_add_domain (NMIP4Config *config, const char *domain) { @@ -572,7 +582,7 @@ finalize (GObject *object) g_ptr_array_free (priv->domains, TRUE); g_ptr_array_free (priv->searches, TRUE); g_array_free (priv->nis_servers, TRUE); - nm_utils_slist_free (priv->static_routes, g_free); + nm_utils_slist_free (priv->routes, g_free); } static void @@ -629,8 +639,8 @@ get_property (GObject *object, guint prop_id, case PROP_NIS_SERVERS: g_value_set_boxed (value, priv->nis_servers); break; - case PROP_STATIC_ROUTES: - ip4_addresses_to_gvalue (priv->static_routes, value); + case PROP_ROUTES: + ip4_addresses_to_gvalue (priv->routes, value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -694,10 +704,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) G_PARAM_READABLE)); g_object_class_install_property - (object_class, PROP_STATIC_ROUTES, - g_param_spec_boxed (NM_IP4_CONFIG_STATIC_ROUTES, - "Static routes", - "Static routes", + (object_class, PROP_ROUTES, + g_param_spec_boxed (NM_IP4_CONFIG_ROUTES, + "Routes", + "Routes", DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, G_PARAM_READABLE)); diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index e071dd8e96..00f0f1620d 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -50,7 +50,7 @@ typedef struct { #define NM_IP4_CONFIG_DOMAINS "domains" #define NM_IP4_CONFIG_NIS_DOMAIN "nis-domain" #define NM_IP4_CONFIG_NIS_SERVERS "nis-servers" -#define NM_IP4_CONFIG_STATIC_ROUTES "static-routes" +#define NM_IP4_CONFIG_ROUTES "routes" GType nm_ip4_config_get_type (void); @@ -76,11 +76,12 @@ void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis_server); guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i); guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config); -void nm_ip4_config_take_static_route (NMIP4Config *config, NMSettingIP4Address *address); -void nm_ip4_config_add_static_route (NMIP4Config *config, NMSettingIP4Address *address); -void nm_ip4_config_replace_static_route (NMIP4Config *config, guint32 i, NMSettingIP4Address *new_address); -const NMSettingIP4Address * nm_ip4_config_get_static_route (NMIP4Config *config, guint32 i); -guint32 nm_ip4_config_get_num_static_routes (NMIP4Config *config); +void nm_ip4_config_take_route (NMIP4Config *config, NMSettingIP4Route *route); +void nm_ip4_config_add_route (NMIP4Config *config, NMSettingIP4Route *route); +void nm_ip4_config_replace_route (NMIP4Config *config, guint32 i, NMSettingIP4Route *new_route); +const NMSettingIP4Route * nm_ip4_config_get_route (NMIP4Config *config, guint32 i); +guint32 nm_ip4_config_get_num_routes (NMIP4Config *config); +void nm_ip4_config_reset_routes (NMIP4Config *config); void nm_ip4_config_set_hostname (NMIP4Config *config, const char *hostname); const char * nm_ip4_config_get_hostname (NMIP4Config *config); diff --git a/src/nm-manager.c b/src/nm-manager.c index 5f51adbd8a..f804f3139f 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1405,49 +1405,54 @@ deferred_sync_devices (gpointer user_data) } NMManager * -nm_manager_new (void) +nm_manager_get (void) { - GObject *object; + static NMManager *singleton = NULL; NMManagerPrivate *priv; - object = g_object_new (NM_TYPE_MANAGER, NULL); - priv = NM_MANAGER_GET_PRIVATE (object); + if (singleton) + return g_object_ref (singleton); + + singleton = (NMManager *) g_object_new (NM_TYPE_MANAGER, NULL); + g_assert (singleton); + + priv = NM_MANAGER_GET_PRIVATE (singleton); dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (priv->dbus_mgr), NM_DBUS_PATH, - object); + G_OBJECT (singleton)); g_signal_connect (priv->dbus_mgr, "name-owner-changed", G_CALLBACK (nm_manager_name_owner_changed), - NM_MANAGER (object)); + singleton); - g_idle_add ((GSourceFunc) initial_get_connections, NM_MANAGER (object)); + g_idle_add ((GSourceFunc) initial_get_connections, singleton); priv->hal_mgr = nm_hal_manager_new (); - priv->sync_devices_id = g_idle_add (deferred_sync_devices, object); + priv->sync_devices_id = g_idle_add (deferred_sync_devices, singleton); g_signal_connect (priv->hal_mgr, "udi-added", G_CALLBACK (hal_manager_udi_added_cb), - NM_MANAGER (object)); + singleton); g_signal_connect (priv->hal_mgr, "udi-removed", G_CALLBACK (hal_manager_udi_removed_cb), - NM_MANAGER (object)); + singleton); g_signal_connect (priv->hal_mgr, "rfkill-changed", G_CALLBACK (hal_manager_rfkill_changed_cb), - NM_MANAGER (object)); + singleton); g_signal_connect (priv->hal_mgr, "hal-reappeared", G_CALLBACK (hal_manager_hal_reappeared_cb), - NM_MANAGER (object)); + singleton); - return NM_MANAGER (object); + return singleton; } static void diff --git a/src/nm-manager.h b/src/nm-manager.h index fb53bdd597..fd744325fc 100644 --- a/src/nm-manager.h +++ b/src/nm-manager.h @@ -52,7 +52,7 @@ typedef struct { GType nm_manager_get_type (void); -NMManager *nm_manager_new (void); +NMManager *nm_manager_get (void); /* Device handling */ diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 7a9881235a..4209748d70 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -19,6 +19,7 @@ #endif #include <linux/if_ppp.h> +#include "NetworkManager.h" #include "nm-ppp-manager.h" #include "nm-setting-connection.h" #include "nm-setting-ppp.h" @@ -43,12 +44,15 @@ static gboolean impl_ppp_manager_set_ip4_config (NMPPPManager *manager, #include "nm-ppp-manager-glue.h" #define NM_PPPD_PLUGIN PLUGINDIR "/nm-pppd-plugin.so" -#define NM_PPP_WAIT_PPPD 10000 /* 10 seconds */ +#define NM_PPP_WAIT_PPPD 15000 /* 10 seconds */ #define PPP_MANAGER_SECRET_TRIES "ppp-manager-secret-tries" typedef struct { GPid pid; NMDBusManager *dbus_manager; + char *dbus_path; + + char *parent_iface; NMActRequest *act_req; DBusGMethodInvocation *pending_secrets_context; @@ -57,7 +61,7 @@ typedef struct { guint32 ppp_timeout_handler; /* Monitoring */ - char *iface; + char *ip_iface; int monitor_fd; guint monitor_id; } NMPPPManagerPrivate; @@ -76,6 +80,12 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; +enum { + PROP_0, + PROP_PARENT_IFACE, + LAST_PROP +}; + typedef enum { NM_PPP_MANAGER_ERROR_UNKOWN } NMPPPManagerError; @@ -104,9 +114,8 @@ constructor (GType type, GObject *object; NMPPPManagerPrivate *priv; DBusGConnection *connection; - DBusGProxy *proxy; - guint request_name_result; - GError *err = NULL; + static gboolean name_requested = FALSE; + static guint32 counter = 0; object = G_OBJECT_CLASS (nm_ppp_manager_parent_class)->constructor (type, n_construct_params, @@ -116,28 +125,48 @@ constructor (GType type, priv = NM_PPP_MANAGER_GET_PRIVATE (object); priv->dbus_manager = nm_dbus_manager_get (); + if (!priv->dbus_manager) { + g_object_unref (object); + return NULL; + } connection = nm_dbus_manager_get_connection (priv->dbus_manager); - proxy = dbus_g_proxy_new_for_name (connection, - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); + /* Only need to request bus name the first time */ + if (!name_requested) { + DBusGProxy *proxy; + gboolean success; + guint request_name_result; + GError *err = NULL; + + proxy = dbus_g_proxy_new_for_name (connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + success = dbus_g_proxy_call (proxy, "RequestName", &err, + G_TYPE_STRING, NM_DBUS_SERVICE_PPP, + G_TYPE_UINT, 0, + G_TYPE_INVALID, + G_TYPE_UINT, &request_name_result, + G_TYPE_INVALID); + g_object_unref (proxy); + + if (!success) { + nm_warning ("Failed to acquire PPP manager service: %s", err->message); + g_object_unref (object); + return NULL; + } - if (dbus_g_proxy_call (proxy, "RequestName", &err, - G_TYPE_STRING, NM_DBUS_SERVICE_PPP, - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID)) - dbus_g_connection_register_g_object (connection, NM_DBUS_PATH_PPP, object); + name_requested = TRUE; + } - g_object_unref (proxy); + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/PPP/%d", counter++); + dbus_g_connection_register_g_object (connection, priv->dbus_path, object); return object; } static void -finalize (GObject *object) +dispose (GObject *object) { NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); @@ -146,21 +175,75 @@ finalize (GObject *object) g_object_unref (priv->act_req); g_object_unref (priv->dbus_manager); + G_OBJECT_CLASS (nm_ppp_manager_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + g_free (priv->ip_iface); + g_free (priv->parent_iface); + G_OBJECT_CLASS (nm_ppp_manager_parent_class)->finalize (object); } static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PARENT_IFACE: + if (priv->parent_iface) + g_free (priv->parent_iface); + priv->parent_iface = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PARENT_IFACE: + g_value_set_string (value, priv->parent_iface); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void nm_ppp_manager_class_init (NMPPPManagerClass *manager_class) { GObjectClass *object_class = G_OBJECT_CLASS (manager_class); g_type_class_add_private (manager_class, sizeof (NMPPPManagerPrivate)); - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (manager_class), - &dbus_glib_nm_ppp_manager_object_info); - object_class->constructor = constructor; + object_class->dispose = dispose; object_class->finalize = finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_PARENT_IFACE, + g_param_spec_string (NM_PPP_MANAGER_PARENT_IFACE, + "ParentIface", + "Parent interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /* signals */ signals[STATE_CHANGED] = @@ -193,12 +276,19 @@ nm_ppp_manager_class_init (NMPPPManagerClass *manager_class) nm_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (manager_class), + &dbus_glib_nm_ppp_manager_object_info); } NMPPPManager * -nm_ppp_manager_new (void) +nm_ppp_manager_new (const char *iface) { - return (NMPPPManager *) g_object_new (NM_TYPE_PPP_MANAGER, NULL); + g_return_val_if_fail (iface != NULL, NULL); + + return (NMPPPManager *) g_object_new (NM_TYPE_PPP_MANAGER, + NM_PPP_MANAGER_PARENT_IFACE, iface, + NULL); } /*******************************************/ @@ -213,7 +303,7 @@ monitor_cb (gpointer user_data) memset (&req, 0, sizeof (req)); req.stats_ptr = (caddr_t) &req.stats; - strncpy (req.ifr__name, priv->iface, sizeof (req.ifr__name)); + 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 @@ -225,15 +315,14 @@ monitor_cb (gpointer user_data) } static void -monitor_stats (NMPPPManager *manager, const char *iface) +monitor_stats (NMPPPManager *manager) { NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); priv->monitor_fd = socket (AF_INET, SOCK_DGRAM, 0); - if (priv->monitor_fd > 0) { - priv->iface = g_strdup (iface); + if (priv->monitor_fd > 0) priv->monitor_id = g_timeout_add (5000, monitor_cb, manager); - } else + else nm_warning ("Could not open pppd monitor: %s", strerror (errno)); } @@ -257,12 +346,10 @@ impl_ppp_manager_need_secrets (NMPPPManager *manager, NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); NMConnection *connection; NMSettingConnection *s_con; - NMSetting *setting; const char *setting_name; guint32 tries; - char *hint1 = NULL; - - remove_timeout_handler (manager); + GPtrArray *hints = NULL; + const char *hint1 = NULL, *hint2 = NULL; connection = nm_act_request_get_connection (priv->act_req); @@ -271,54 +358,73 @@ impl_ppp_manager_need_secrets (NMPPPManager *manager, g_assert (s_con->type); nm_connection_clear_secrets (connection); - setting_name = nm_connection_need_secrets (connection, NULL); - if (setting_name) { - setting = nm_connection_get_setting_by_name (connection, setting_name); - } else { - /* Always ask for secrets unless the connection's type setting doesn't - * even exist (which shouldn't happen). Empty username and password are - * valid, but we need to tell the pppd plugin that this is valid by - * sending back blank secrets. - */ + setting_name = nm_connection_need_secrets (connection, &hints); + if (!setting_name) { + NMSetting *setting; + setting = nm_connection_get_setting_by_name (connection, s_con->type); - if (!setting) { + if (setting) { + const char *username = NULL; + const char *password = NULL; + + /* FIXME: push this down to the settings and keep PPP manager generic */ + if (NM_IS_SETTING_PPPOE (setting)) { + username = NM_SETTING_PPPOE (setting)->username; + password = NM_SETTING_PPPOE (setting)->password; + } else if (NM_IS_SETTING_GSM (setting)) { + username = NM_SETTING_GSM (setting)->username; + password = NM_SETTING_GSM (setting)->password; + } else if (NM_IS_SETTING_CDMA (setting)) { + username = NM_SETTING_CDMA (setting)->username; + password = NM_SETTING_CDMA (setting)->password; + } + + /* If secrets are not required, send the existing username and password + * back to the PPP plugin immediately. + */ + priv->pending_secrets_context = context; + nm_ppp_manager_update_secrets (manager, + NULL, /* FIXME: pass device name */ + username ? username : "", + password ? password : "", + NULL); + } else { GError *err = NULL; g_set_error (&err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN, "Missing type-specific setting; no secrets could be found."); nm_warning ("%s", err->message); dbus_g_method_return_error (context, err); - return; } - setting_name = nm_setting_get_name (setting); + return; } - /* FIXME: figure out some way of pushing this down to the settings - * themselves and keeping the PPP Manager generic. - */ - if (NM_IS_SETTING_PPPOE (setting)) - hint1 = NM_SETTING_PPPOE_PASSWORD; - else if (NM_IS_SETTING_GSM (setting)) - hint1 = NM_SETTING_GSM_PASSWORD; - else if (NM_IS_SETTING_CDMA (setting)) - hint1 = NM_SETTING_CDMA_PASSWORD; + /* Extract hints */ + if (hints) { + if (hints->len > 0) + hint1 = g_ptr_array_index (hints, 0); + if (hints->len > 1) + hint2 = g_ptr_array_index (hints, 1); + } tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES)); nm_act_request_request_connection_secrets (priv->act_req, setting_name, - tries == 0 ? TRUE : FALSE, + tries ? TRUE : FALSE, SECRETS_CALLER_PPP, hint1, - NULL); + hint2); g_object_set_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES, GUINT_TO_POINTER (++tries)); priv->pending_secrets_context = context; + + if (hints) + g_ptr_array_free (hints, TRUE); } static gboolean impl_ppp_manager_set_state (NMPPPManager *manager, guint32 state, GError **err) { - remove_timeout_handler (manager); g_signal_emit (manager, signals[STATE_CHANGED], 0, state); return TRUE; @@ -329,10 +435,11 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager, GHashTable *config_hash, GError **err) { + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + NMConnection *connection; NMIP4Config *config; NMSettingIP4Address *addr; GValue *val; - const char *iface; int i; nm_info ("PPP manager(IP Config Get) reply received."); @@ -374,16 +481,21 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager, } val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_INTERFACE); - if (val) - iface = g_value_get_string (val); - else { + if (!val || !G_VALUE_HOLDS_STRING (val)) { nm_warning ("No interface"); goto out; } + priv->ip_iface = g_value_dup_string (val); - g_signal_emit (manager, signals[IP4_CONFIG], 0, iface, config); + /* Got successful IP4 config; obviously the secrets worked */ + connection = nm_act_request_get_connection (priv->act_req); + g_assert (connection); + g_object_set_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES, NULL); - monitor_stats (manager, iface); + /* Push the IP4 config up to the device */ + g_signal_emit (manager, signals[IP4_CONFIG], 0, priv->ip_iface, config); + + monitor_stats (manager); out: g_object_unref (config); @@ -582,11 +694,12 @@ pppd_timed_out (gpointer data) } static NMCmdLine * -create_pppd_cmd_line (NMSettingPPP *setting, - NMSettingPPPOE *pppoe, - const char *device, - GError **err) +create_pppd_cmd_line (NMPPPManager *self, + NMSettingPPP *setting, + NMSettingPPPOE *pppoe, + GError **err) { + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (self); const char *ppp_binary; NMCmdLine *cmd; @@ -610,7 +723,7 @@ create_pppd_cmd_line (NMSettingPPP *setting, nm_cmd_line_add_string (cmd, "plugin"); nm_cmd_line_add_string (cmd, "rp-pppoe.so"); - dev_str = g_strdup_printf ("nic-%s", device); + dev_str = g_strdup_printf ("nic-%s", priv->parent_iface); nm_cmd_line_add_string (cmd, dev_str); g_free (dev_str); @@ -622,7 +735,7 @@ create_pppd_cmd_line (NMSettingPPP *setting, nm_cmd_line_add_string (cmd, "user"); nm_cmd_line_add_string (cmd, pppoe->username); } else { - nm_cmd_line_add_string (cmd, device); + nm_cmd_line_add_string (cmd, priv->parent_iface); /* Don't send some random address as the local address */ nm_cmd_line_add_string (cmd, "noipdefault"); } @@ -680,6 +793,9 @@ create_pppd_cmd_line (NMSettingPPP *setting, nm_cmd_line_add_int (cmd, setting->lcp_echo_interval); } + nm_cmd_line_add_string (cmd, "ipparam"); + nm_cmd_line_add_string (cmd, priv->dbus_path); + nm_cmd_line_add_string (cmd, "plugin"); nm_cmd_line_add_string (cmd, NM_PPPD_PLUGIN); @@ -726,10 +842,7 @@ pppoe_fill_defaults (NMSettingPPP *setting) } gboolean -nm_ppp_manager_start (NMPPPManager *manager, - const char *device, - NMActRequest *req, - GError **err) +nm_ppp_manager_start (NMPPPManager *manager, NMActRequest *req, GError **err) { NMPPPManagerPrivate *priv; NMConnection *connection; @@ -739,7 +852,6 @@ nm_ppp_manager_start (NMPPPManager *manager, char *cmd_str; g_return_val_if_fail (NM_IS_PPP_MANAGER (manager), FALSE); - g_return_val_if_fail (device != NULL, FALSE); g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); connection = nm_act_request_get_connection (req); @@ -750,7 +862,7 @@ nm_ppp_manager_start (NMPPPManager *manager, if (pppoe_setting) pppoe_fill_defaults (ppp_setting); - ppp_cmd = create_pppd_cmd_line (ppp_setting, pppoe_setting, device, err); + ppp_cmd = create_pppd_cmd_line (manager, ppp_setting, pppoe_setting, err); if (!ppp_cmd) return FALSE; @@ -820,10 +932,7 @@ nm_ppp_manager_update_secrets (NMPPPManager *manager, the plugin would need to link against libnm-util just to parse this. So instead, let's just send what it needs */ - /* FIXME: Do we have to strdup the values here? */ - dbus_g_method_return (priv->pending_secrets_context, - g_strdup (username), - g_strdup (password)); + dbus_g_method_return (priv->pending_secrets_context, username, password); } priv->pending_secrets_context = NULL; } @@ -863,8 +972,6 @@ nm_ppp_manager_stop (NMPPPManager *manager) priv->monitor_fd = 0; } - g_free (priv->iface); - if (priv->ppp_timeout_handler) { g_source_remove (priv->ppp_timeout_handler); priv->ppp_timeout_handler = 0; diff --git a/src/ppp-manager/nm-ppp-manager.h b/src/ppp-manager/nm-ppp-manager.h index ac6543d88c..4e0e576e40 100644 --- a/src/ppp-manager/nm-ppp-manager.h +++ b/src/ppp-manager/nm-ppp-manager.h @@ -19,6 +19,8 @@ #define NM_IS_PPP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_PPP_MANAGER)) #define NM_PPP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_PPP_MANAGER, NMPPPManagerClass)) +#define NM_PPP_MANAGER_PARENT_IFACE "parent-iface" + typedef struct { GObject parent; } NMPPPManager; @@ -34,12 +36,9 @@ typedef struct { GType nm_ppp_manager_get_type (void); -NMPPPManager *nm_ppp_manager_new (void); +NMPPPManager *nm_ppp_manager_new (const char *iface); -gboolean nm_ppp_manager_start (NMPPPManager *manager, - const char *device, - NMActRequest *req, - GError **err); +gboolean nm_ppp_manager_start (NMPPPManager *manager, NMActRequest *req, GError **err); void nm_ppp_manager_update_secrets (NMPPPManager *manager, const char *device, diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c index 8b9878d9ab..1f0595f46a 100644 --- a/src/ppp-manager/nm-pppd-plugin.c +++ b/src/ppp-manager/nm-pppd-plugin.c @@ -91,9 +91,8 @@ nm_phasechange (void *data, int arg) if (ppp_status != NM_PPP_STATUS_UNKNOWN) { dbus_g_proxy_call_no_reply (proxy, "SetState", - G_TYPE_UINT, ppp_status, - G_TYPE_INVALID, - G_TYPE_INVALID); + G_TYPE_UINT, ppp_status, G_TYPE_INVALID, + G_TYPE_INVALID); } } @@ -133,16 +132,18 @@ value_destroy (gpointer data) static void nm_ip_up (void *data, int arg) { - ipcp_options opts = ipcp_gotoptions[ifunit]; - ipcp_options peer_opts = ipcp_hisoptions[ifunit]; + ipcp_options opts = ipcp_gotoptions[0]; + ipcp_options peer_opts = ipcp_hisoptions[0]; GHashTable *hash; GArray *array; GValue *val; + guint32 pppd_made_up_address = htonl (0x0a404040 + ifunit); g_return_if_fail (DBUS_IS_G_PROXY (proxy)); if (!opts.ouraddr) { - g_warning ("Didn't receive an internal IP from pppd"); + g_warning ("Didn't receive an internal IP from pppd!"); + nm_phasechange (NULL, PHASE_DEAD); return; } @@ -155,12 +156,20 @@ nm_ip_up (void *data, int arg) g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_ADDRESS, uint_to_gvalue (opts.ouraddr)); - if (opts.hisaddr) { + /* Prefer the peer options remote address first, _unless_ pppd made the + * address up, at which point prefer the local options remote address, + * and if that's not right, use the made-up address as a last resort. + */ + if (peer_opts.hisaddr && (peer_opts.hisaddr != pppd_made_up_address)) { g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, - uint_to_gvalue (opts.hisaddr)); - } else if (peer_opts.hisaddr) { + uint_to_gvalue (peer_opts.hisaddr)); + } else if (opts.hisaddr) { g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, - uint_to_gvalue (peer_opts.hisaddr)); + uint_to_gvalue (opts.hisaddr)); + } else if (peer_opts.hisaddr == pppd_made_up_address) { + /* As a last resort, use the made-up address */ + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (peer_opts.hisaddr)); } g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_PREFIX, uint_to_gvalue (32)); @@ -289,10 +298,13 @@ plugin_init (void) return -1; } + /* NM passes in the object path of the corresponding PPPManager + * object as the 'ipparam' argument to pppd. + */ proxy = dbus_g_proxy_new_for_name (bus, - NM_DBUS_SERVICE_PPP, - NM_DBUS_PATH_PPP, - NM_DBUS_INTERFACE_PPP); + NM_DBUS_SERVICE_PPP, + ipparam, + NM_DBUS_INTERFACE_PPP); dbus_g_connection_unref (bus); diff --git a/src/ppp-manager/nm-pppd-plugin.h b/src/ppp-manager/nm-pppd-plugin.h index 9899641406..d4e7f2ce67 100644 --- a/src/ppp-manager/nm-pppd-plugin.h +++ b/src/ppp-manager/nm-pppd-plugin.h @@ -1,5 +1,4 @@ #define NM_DBUS_SERVICE_PPP "org.freedesktop.NetworkManager.PPP" -#define NM_DBUS_PATH_PPP "/org/freedesktop/NetworkManager/PPP" #define NM_DBUS_INTERFACE_PPP "org.freedesktop.NetworkManager.PPP" #define NM_PPP_IP4_CONFIG_INTERFACE "interface" diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 9bd11ea3d8..be32ead556 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -48,8 +48,6 @@ #include "nm-dbus-glib-types.h" #include "NetworkManagerUtils.h" -#define CONNECTION_GET_SECRETS_CALL_TAG "get-secrets-call" - #include "nm-vpn-connection-glue.h" G_DEFINE_TYPE (NMVPNConnection, nm_vpn_connection, G_TYPE_OBJECT) @@ -58,6 +56,8 @@ typedef struct { gboolean disposed; NMConnection *connection; + DBusGProxyCall *secrets_call; + NMActRequest *act_request; NMDevice *parent_dev; char *ac_path; @@ -299,13 +299,15 @@ print_vpn_config (NMIP4Config *config, ip_address_to_string (nm_ip4_config_get_ptp_address (config))); nm_info ("Maximum Segment Size (MSS): %d", nm_ip4_config_get_mss (config)); - num = nm_ip4_config_get_num_static_routes (config); + num = nm_ip4_config_get_num_routes (config); for (i = 0; i < num; i++) { - addr = nm_ip4_config_get_static_route (config, i); - nm_info ("Static Route: %s/%d Gateway: %s", - ip_address_to_string (addr->address), - addr->prefix, - ip_address_to_string (addr->gateway)); + const NMSettingIP4Route *route; + + route = nm_ip4_config_get_route (config, i); + nm_info ("Static Route: %s/%d Next Hop: %s", + ip_address_to_string (route->address), + route->prefix, + ip_address_to_string (route->next_hop)); } num = nm_ip4_config_get_num_nameservers (config); @@ -322,57 +324,6 @@ print_vpn_config (NMIP4Config *config, } static void -merge_vpn_routes (NMVPNConnection *connection, NMIP4Config *config) -{ - NMSettingVPN *setting; - GSList *iter; - - setting = NM_SETTING_VPN (nm_connection_get_setting (NM_VPN_CONNECTION_GET_PRIVATE (connection)->connection, - NM_TYPE_SETTING_VPN)); - - /* FIXME: Shouldn't the routes from user (NMSettingVPN) be inserted in the beginning - instead of appending to the end? - */ - - for (iter = setting->routes; iter; iter = iter->next) { - struct in_addr tmp; - char *p, *route; - long int prefix = 32; - - route = g_strdup ((char *) iter->data); - p = strchr (route, '/'); - if (!p || !(*(p + 1))) { - nm_warning ("Ignoring invalid route '%s'", route); - goto next; - } - - errno = 0; - prefix = strtol (p + 1, NULL, 10); - if (errno || prefix <= 0 || prefix > 32) { - nm_warning ("Ignoring invalid route '%s'", route); - goto next; - } - - /* don't pass the prefix to inet_pton() */ - *p = '\0'; - if (inet_pton (AF_INET, route, &tmp) > 0) { - NMSettingIP4Address *addr; - - addr = g_new0 (NMSettingIP4Address, 1); - addr->address = tmp.s_addr; - addr->prefix = (guint32) prefix; - addr->gateway = 0; - - nm_ip4_config_take_static_route (config, addr); - } else - nm_warning ("Ignoring invalid route '%s'", route); - -next: - g_free (route); - } -} - -static void nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, GHashTable *config_hash, gpointer user_data) @@ -463,9 +414,9 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, GSList *routes; GSList *iter; - routes = nm_utils_ip4_addresses_from_gvalue (val); + routes = nm_utils_ip4_routes_from_gvalue (val); for (iter = routes; iter; iter = iter->next) - nm_ip4_config_take_static_route (config, (NMSettingIP4Address *) iter->data); + nm_ip4_config_take_route (config, (NMSettingIP4Route *) iter->data); g_slist_free (routes); } @@ -478,7 +429,6 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, /* 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); - merge_vpn_routes (connection, config); if (nm_system_vpn_device_set_from_ip4_config (priv->parent_dev, priv->tundev, priv->ip4_config)) { nm_info ("VPN connection '%s' (IP Config Get) complete.", @@ -672,27 +622,21 @@ nm_vpn_connection_disconnect (NMVPNConnection *connection, /******************************************************************************/ static void -clear_need_auth (NMVPNConnection *vpn_connection) +cleanup_secrets_dbus_call (NMVPNConnection *self) { - NMVPNConnectionPrivate *priv; + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self); DBusGProxy *proxy; - DBusGProxyCall *call; - g_return_if_fail (vpn_connection != NULL); - - priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn_connection); - g_assert (priv->connection); + g_return_if_fail (priv->connection != NULL); + g_return_if_fail (NM_IS_CONNECTION (priv->connection)); proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); - if (!proxy || !DBUS_IS_G_PROXY (proxy)) - return; + g_assert (proxy); - call = g_object_get_data (G_OBJECT (vpn_connection), CONNECTION_GET_SECRETS_CALL_TAG); - if (!call) - return; - - dbus_g_proxy_cancel_call (proxy, call); - g_object_set_data (G_OBJECT (vpn_connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL); + if (priv->secrets_call) { + dbus_g_proxy_cancel_call (proxy, priv->secrets_call); + priv->secrets_call = NULL; + } } typedef struct GetSecretsInfo { @@ -737,7 +681,7 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) priv = NM_VPN_CONNECTION_GET_PRIVATE (info->vpn_connection); - g_object_set_data (G_OBJECT (info->vpn_connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL); + priv->secrets_call = NULL; if (!dbus_g_proxy_end_call (proxy, call, &err, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, @@ -770,7 +714,6 @@ get_connection_secrets (NMVPNConnection *vpn_connection, NMVPNConnectionPrivate *priv; DBusGProxy *secrets_proxy; GetSecretsInfo *info = NULL; - DBusGProxyCall *call; GPtrArray *hints; g_return_val_if_fail (vpn_connection != NULL, FALSE); @@ -780,48 +723,39 @@ get_connection_secrets (NMVPNConnection *vpn_connection, priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn_connection); g_assert (priv->connection); - secrets_proxy = g_object_get_data (G_OBJECT (priv->connection), - NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); - g_return_val_if_fail (secrets_proxy && DBUS_IS_G_PROXY (secrets_proxy), FALSE); + secrets_proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG); + g_assert (secrets_proxy); info = g_slice_new0 (GetSecretsInfo); g_return_val_if_fail (info != NULL, FALSE); info->setting_name = g_strdup (setting_name); - if (!info->setting_name) { - nm_warning ("Not enough memory to get secrets"); - goto error; - } - info->vpn_connection = g_object_ref (vpn_connection); /* Empty for now... */ hints = g_ptr_array_new (); /* use ..._with_timeout to give the user time to enter secrets */ - call = dbus_g_proxy_begin_call_with_timeout (secrets_proxy, "GetSecrets", - get_secrets_cb, - info, - free_get_secrets_info, - G_MAXINT32, - G_TYPE_STRING, setting_name, - DBUS_TYPE_G_ARRAY_OF_STRING, hints, - G_TYPE_BOOLEAN, request_new, - G_TYPE_INVALID); + priv->secrets_call = dbus_g_proxy_begin_call_with_timeout (secrets_proxy, "GetSecrets", + get_secrets_cb, + info, + free_get_secrets_info, + G_MAXINT32, + G_TYPE_STRING, setting_name, + DBUS_TYPE_G_ARRAY_OF_STRING, hints, + G_TYPE_BOOLEAN, request_new, + G_TYPE_INVALID); g_ptr_array_free (hints, TRUE); - if (!call) { + if (!priv->secrets_call) { nm_warning ("Could not call GetSecrets"); goto error; } - - g_object_set_data (G_OBJECT (vpn_connection), - CONNECTION_GET_SECRETS_CALL_TAG, - call); return TRUE; error: if (info) free_get_secrets_info (info); + cleanup_secrets_dbus_call (vpn_connection); return FALSE; } @@ -833,9 +767,7 @@ connection_need_secrets_cb (DBusGProxy *proxy, { NMVPNConnection *vpn_connection = NM_VPN_CONNECTION (user_data); - g_object_set_data (G_OBJECT (vpn_connection), - CONNECTION_GET_SECRETS_CALL_TAG, - NULL); + cleanup_secrets_dbus_call (vpn_connection); if (error) { g_warning ("%s.%d: NeedSecrets failed: %s %s", @@ -876,7 +808,7 @@ connection_vpn_state_changed (NMVPNConnection *connection, { NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); - clear_need_auth (connection); + cleanup_secrets_dbus_call (connection); switch (state) { case NM_VPN_CONNECTION_STATE_NEED_AUTH: @@ -962,6 +894,8 @@ dispose (GObject *object) } priv->disposed = TRUE; + cleanup_secrets_dbus_call (NM_VPN_CONNECTION (object)); + if (priv->parent_dev) { if (priv->device_monitor) g_signal_handler_disconnect (priv->parent_dev, priv->device_monitor); diff --git a/system-settings/plugins/ifcfg-fedora/common.h b/system-settings/plugins/ifcfg-fedora/common.h index 2c1f9c92c1..2980ed3ee5 100644 --- a/system-settings/plugins/ifcfg-fedora/common.h +++ b/system-settings/plugins/ifcfg-fedora/common.h @@ -28,6 +28,9 @@ #define ORIG_TAG ".orig" #define REJ_TAG ".rej" +#define IFCFG_PLUGIN_NAME "ifcfg-fedora" +#define IFCFG_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." + #include <glib.h> GQuark ifcfg_plugin_error_quark (void); diff --git a/system-settings/plugins/ifcfg-fedora/plugin.c b/system-settings/plugins/ifcfg-fedora/plugin.c index 701aba79c2..dc6de9aa22 100644 --- a/system-settings/plugins/ifcfg-fedora/plugin.c +++ b/system-settings/plugins/ifcfg-fedora/plugin.c @@ -45,9 +45,6 @@ #include "nm-system-config-interface.h" #include "nm-ifcfg-connection.h" -#define IFCFG_PLUGIN_NAME "ifcfg-fedora" -#define IFCFG_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." - #define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts/" static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); diff --git a/system-settings/plugins/ifcfg-fedora/reader.c b/system-settings/plugins/ifcfg-fedora/reader.c index 43cbc79997..0f926cce14 100644 --- a/system-settings/plugins/ifcfg-fedora/reader.c +++ b/system-settings/plugins/ifcfg-fedora/reader.c @@ -51,6 +51,7 @@ #include "shvar.h" #include "reader.h" +#include "nm-system-config-interface.h" #define TYPE_ETHERNET "Ethernet" #define TYPE_WIRELESS "Wireless" @@ -168,12 +169,12 @@ make_ip4_setting (shvarFile *ifcfg, GError **error) value = svGetValue (ifcfg, "BOOTPROTO"); if (value && (!g_ascii_strcasecmp (value, "bootp") || !g_ascii_strcasecmp (value, "dhcp"))) - method = NM_SETTING_IP4_CONFIG_METHOD_DHCP; + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; if (value && !g_ascii_strcasecmp (value, "autoip")) { g_free (value); s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); - s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTOIP); + s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL); return NM_SETTING (s_ip4); } @@ -237,10 +238,10 @@ make_ip4_setting (shvarFile *ifcfg, GError **error) /* Yay, let's make an IP4 config */ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); s_ip4->method = g_strdup (method); - s_ip4->ignore_dhcp_dns = !svTrueValue (ifcfg, "PEERDNS", 1); + s_ip4->ignore_auto_dns = !svTrueValue (ifcfg, "PEERDNS", 1); /* DHCP hostname for 'send host-name' option */ - if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) { + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { value = svGetValue (ifcfg, "DHCP_HOSTNAME"); if (value && strlen (value)) s_ip4->dhcp_hostname = g_strdup (value); @@ -604,6 +605,7 @@ error: static NMSetting * make_wireless_setting (shvarFile *ifcfg, NMSetting *security, + gboolean unmanaged, GError **error) { NMSettingWireless *s_wireless; @@ -611,6 +613,11 @@ make_wireless_setting (shvarFile *ifcfg, s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + if (!read_mac_address (ifcfg, &s_wireless->mac_address, error)) { + g_object_unref (s_wireless); + return NULL; + } + value = svGetValue (ifcfg, "ESSID"); if (value) { gsize len = strlen (value); @@ -627,41 +634,41 @@ make_wireless_setting (shvarFile *ifcfg, g_byte_array_append (s_wireless->ssid, (const guint8 *) value, len); g_free (value); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, "Missing SSID"); - goto error; + /* Only fail on lack of SSID if device is managed */ + if (!unmanaged) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, "Missing SSID"); + goto error; + } } - value = svGetValue (ifcfg, "MODE"); - if (value) { - char *lcase; + if (!unmanaged) { + value = svGetValue (ifcfg, "MODE"); + if (value) { + char *lcase; - lcase = g_ascii_strdown (value, -1); - g_free (value); + lcase = g_ascii_strdown (value, -1); + g_free (value); - if (!strcmp (lcase, "ad-hoc")) { - s_wireless->mode = g_strdup ("adhoc"); - } else if (!strcmp (lcase, "managed")) { - s_wireless->mode = g_strdup ("infrastructure"); - } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Invalid mode '%s' (not ad-hoc or managed)", - lcase); + if (!strcmp (lcase, "ad-hoc")) { + s_wireless->mode = g_strdup ("adhoc"); + } else if (!strcmp (lcase, "managed")) { + s_wireless->mode = g_strdup ("infrastructure"); + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid mode '%s' (not ad-hoc or managed)", + lcase); + g_free (lcase); + goto error; + } g_free (lcase); - goto error; } - g_free (lcase); - } - if (security) - s_wireless->security = g_strdup (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + if (security) + s_wireless->security = g_strdup (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); - if (!read_mac_address (ifcfg, &s_wireless->mac_address, error)) { - g_object_unref (s_wireless); - s_wireless = NULL; + // FIXME: channel/freq, other L2 parameters like RTS } - // FIXME: channel/freq, other L2 parameters like RTS - return NM_SETTING (s_wireless); error: @@ -671,12 +678,15 @@ error: } static NMConnection * -wireless_connection_from_ifcfg (const char *file, shvarFile *ifcfg, GError **error) +wireless_connection_from_ifcfg (const char *file, + shvarFile *ifcfg, + gboolean unmanaged, + GError **error) { NMConnection *connection = NULL; NMSetting *con_setting = NULL; NMSetting *wireless_setting = NULL; - NMSettingWireless *tmp; + NMSettingWireless *s_wireless; NMSetting *security_setting = NULL; char *printable_ssid = NULL; @@ -694,49 +704,53 @@ wireless_connection_from_ifcfg (const char *file, shvarFile *ifcfg, GError **err /* Wireless security */ security_setting = make_wireless_security_setting (ifcfg, file, error); - if (*error) - goto error; + if (*error) { + g_object_unref (connection); + return NULL; + } if (security_setting) nm_connection_add_setting (connection, security_setting); /* Wireless */ - wireless_setting = make_wireless_setting (ifcfg, security_setting, error); - if (!wireless_setting) - goto error; - + wireless_setting = make_wireless_setting (ifcfg, security_setting, unmanaged, error); + if (!wireless_setting) { + g_object_unref (connection); + return NULL; + } nm_connection_add_setting (connection, wireless_setting); - tmp = NM_SETTING_WIRELESS (wireless_setting); - printable_ssid = nm_utils_ssid_to_utf8 ((const char *) tmp->ssid->data, - (guint32) tmp->ssid->len); + s_wireless = (NMSettingWireless *) wireless_setting; + if (s_wireless && s_wireless->ssid) { + printable_ssid = nm_utils_ssid_to_utf8 ((const char *) s_wireless->ssid->data, + (guint32) s_wireless->ssid->len); + } else + printable_ssid = g_strdup_printf ("unmanaged"); con_setting = make_connection_setting (file, ifcfg, NM_SETTING_WIRELESS_SETTING_NAME, printable_ssid); + g_free (printable_ssid); if (!con_setting) { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Failed to create connection setting."); - goto error; + g_object_unref (connection); + return NULL; } nm_connection_add_setting (connection, con_setting); - if (!nm_connection_verify (connection, error)) - goto error; + /* Don't verify if unmanaged since we may not have an SSID or whatever */ + if (!unmanaged) { + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + return NULL; + } + } return connection; - -error: - g_free (printable_ssid); - g_object_unref (connection); - if (con_setting) - g_object_unref (con_setting); - if (wireless_setting) - g_object_unref (wireless_setting); - return NULL; } static NMSetting * -make_wired_setting (shvarFile *ifcfg, GError **error) +make_wired_setting (shvarFile *ifcfg, gboolean unmanaged, GError **error) { NMSettingWired *s_wired; char *value; @@ -750,10 +764,8 @@ make_wired_setting (shvarFile *ifcfg, GError **error) if (mtu >= 0 && mtu < 65536) s_wired->mtu = mtu; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Invalid MTU '%s'", value); - g_object_unref (s_wired); - s_wired = NULL; + /* Shouldn't be fatal... */ + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " warning: invalid MTU '%s'", value); } g_free (value); } @@ -767,7 +779,10 @@ make_wired_setting (shvarFile *ifcfg, GError **error) } static NMConnection * -wired_connection_from_ifcfg (const char *file, shvarFile *ifcfg, GError **error) +wired_connection_from_ifcfg (const char *file, + shvarFile *ifcfg, + gboolean unmanaged, + GError **error) { NMConnection *connection = NULL; NMSetting *con_setting = NULL; @@ -787,28 +802,24 @@ wired_connection_from_ifcfg (const char *file, shvarFile *ifcfg, GError **error) if (!con_setting) { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Failed to create connection setting."); - goto error; + g_object_unref (connection); + return NULL; } nm_connection_add_setting (connection, con_setting); - wired_setting = make_wired_setting (ifcfg, error); - if (!wired_setting) - goto error; - + wired_setting = make_wired_setting (ifcfg, unmanaged, error); + if (!wired_setting) { + g_object_unref (connection); + return NULL; + } nm_connection_add_setting (connection, wired_setting); - if (!nm_connection_verify (connection, error)) - goto error; + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + return NULL; + } return connection; - -error: - g_object_unref (connection); - if (con_setting) - g_object_unref (con_setting); - if (wired_setting) - g_object_unref (wired_setting); - return NULL; } static gboolean @@ -933,9 +944,9 @@ connection_from_file (const char *filename, } if (!strcmp (type, TYPE_ETHERNET)) - connection = wired_connection_from_ifcfg (filename, parsed, error); + connection = wired_connection_from_ifcfg (filename, parsed, *ignored, error); else if (!strcmp (type, TYPE_WIRELESS)) - connection = wireless_connection_from_ifcfg (filename, parsed, error); + connection = wireless_connection_from_ifcfg (filename, parsed, *ignored, error); else { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Unknown connection type '%s'", type); @@ -943,7 +954,8 @@ connection_from_file (const char *filename, g_free (type); - if (!connection) + /* Don't bother reading the connection fully if it's unmanaged */ + if (!connection || *ignored) goto done; s_ip4 = make_ip4_setting (parsed, error); diff --git a/system-settings/plugins/ifcfg-suse/parser.c b/system-settings/plugins/ifcfg-suse/parser.c index 1f1ee4b4bf..66deec4de8 100644 --- a/system-settings/plugins/ifcfg-suse/parser.c +++ b/system-settings/plugins/ifcfg-suse/parser.c @@ -108,11 +108,11 @@ make_ip4_setting (shvarFile *ifcfg) str = svGetValue (ifcfg, "BOOTPROTO"); if (str) { if (!g_ascii_strcasecmp (str, "bootp") || !g_ascii_strcasecmp (str, "dhcp")) - s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_DHCP); + s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTO); else if (!g_ascii_strcasecmp (str, "static")) s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_MANUAL); else if (!g_ascii_strcasecmp (str, "autoip")) - s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTOIP); + s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL); g_free (str); } diff --git a/system-settings/plugins/keyfile/reader.c b/system-settings/plugins/keyfile/reader.c index ef6c7ee598..14b974ea7c 100644 --- a/system-settings/plugins/keyfile/reader.c +++ b/system-settings/plugins/keyfile/reader.c @@ -61,6 +61,22 @@ read_array_of_uint (GKeyFile *file, return TRUE; } +static gboolean +get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *out) +{ + long tmp; + + errno = 0; + tmp = strtol (str, NULL, 10); + if (errno || (tmp < 0) || (tmp > max_val)) { + g_warning ("%s: ignoring invalid IPv4 %s item '%s'", __func__, key_name, str); + return FALSE; + } + + *out = (guint32) tmp; + return TRUE; +} + static void free_one_address (gpointer data, gpointer user_data) { @@ -69,8 +85,8 @@ free_one_address (gpointer data, gpointer user_data) static GPtrArray * read_addresses (GKeyFile *file, - const char *setting_name, - const char *key) + const char *setting_name, + const char *key) { GPtrArray *addresses; int i = 0; @@ -105,18 +121,14 @@ read_addresses (GKeyFile *file, struct in_addr addr; if (j == 1) { - /* prefix */ - long tmp_prefix; - guint32 prefix; + guint32 prefix = 0; - errno = 0; - tmp_prefix = strtol (*iter, NULL, 10); - if (errno || (tmp_prefix < 0) || (tmp_prefix > 32)) { - g_warning ("%s: ignoring invalid IPv4 %s prefix '%s'", __func__, key_name, *iter); + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { g_array_free (address, TRUE); goto next; } - prefix = (guint32) tmp_prefix; + g_array_append_val (address, prefix); } else { /* address and gateway */ @@ -148,32 +160,132 @@ next: return addresses; } +static void +free_one_route (gpointer data, gpointer user_data) +{ + g_array_free ((GArray *) data, TRUE); +} + +static GPtrArray * +read_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp, **iter; + char *key_name; + gsize length = 0; + int ret; + GArray *route; + int j; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 4) { + g_warning ("%s: ignoring invalid IPv4 route item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IP addresses */ + route = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); + for (iter = tmp, j = 0; *iter; iter++, j++) { + struct in_addr addr; + + if (j == 1) { + guint32 prefix = 0; + + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, prefix); + } else if (j == 3) { + guint32 metric = 0; + + /* prefix */ + if (!get_one_int (*iter, G_MAXUINT32, key_name, &metric)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, metric); + } else { + /* address and next hop */ + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); + g_array_free (route, TRUE); + goto next; + } + g_array_append_val (route, addr.s_addr); + } + } + g_ptr_array_add (routes, route); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + static gboolean read_array_of_array_of_uint (GKeyFile *file, NMSetting *setting, const char *key) { - GPtrArray *addresses; + gboolean success = FALSE; /* Only handle IPv4 addresses and routes for now */ - if ( !NM_IS_SETTING_IP4_CONFIG (setting) || - (strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES) && - strcmp (key, NM_SETTING_IP4_CONFIG_ROUTES))) - return FALSE; + if (!NM_IS_SETTING_IP4_CONFIG (setting)) + return FALSE; - addresses = read_addresses (file, setting->name, key); + if (!strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) { + GPtrArray *addresses; - /* Work around for previous syntax */ - if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) - addresses = read_addresses (file, setting->name, "address"); + addresses = read_addresses (file, setting->name, key); - if (addresses) { - g_object_set (setting, key, addresses, NULL); - g_ptr_array_foreach (addresses, free_one_address, NULL); - g_ptr_array_free (addresses, TRUE); + /* Work around for previous syntax */ + if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) + addresses = read_addresses (file, setting->name, "address"); + + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_address, NULL); + g_ptr_array_free (addresses, TRUE); + } + success = TRUE; + } else if (!strcmp (key, NM_SETTING_IP4_CONFIG_ROUTES)) { + GPtrArray *routes; + + routes = read_routes (file, setting->name, key); + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_route, NULL); + g_ptr_array_free (routes, TRUE); + } + success = TRUE; } - return TRUE; + return success; } static void diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index 4174b42e8c..eb5508d5b8 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -62,6 +62,61 @@ write_array_of_uint (GKeyFile *file, return TRUE; } +static void +write_ip4_values (GKeyFile *file, + const char *setting_name, + const char *key, + GPtrArray *array, + guint32 tuple_len, + guint32 addr1_pos, + guint32 addr2_pos) +{ + char **list = NULL; + int i, j; + + list = g_malloc (tuple_len); + + for (i = 0, j = 0; i < array->len; i++, j++) { + GArray *tuple = g_ptr_array_index (array, i); + gboolean success = TRUE; + char *key_name; + int k; + + memset (list, 0, tuple_len); + + for (k = 0; k < tuple_len; k++) { + if (k == addr1_pos || k == addr2_pos) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + /* IP addresses */ + addr.s_addr = g_array_index (tuple, guint32, k); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + success = FALSE; + break; + } else { + list[k] = g_strdup (buf); + } + } else { + /* prefix, metric */ + list[k] = g_strdup_printf ("%d", g_array_index (tuple, guint32, k)); + } + } + + if (success) { + key_name = g_strdup_printf ("%s%d", key, j + 1); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, tuple_len); + g_free (key_name); + } + + for (k = 0; k < tuple_len; k++) + g_free (list[k]); + } + g_free (list); +} + static gboolean write_array_of_array_of_uint (GKeyFile *file, NMSetting *setting, @@ -69,58 +124,19 @@ write_array_of_array_of_uint (GKeyFile *file, const GValue *value) { GPtrArray *array; - int i, j; /* Only handle IPv4 addresses and routes for now */ - if ( !NM_IS_SETTING_IP4_CONFIG (setting) || - (strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES) && - strcmp (key, NM_SETTING_IP4_CONFIG_ROUTES))) - return FALSE; + if (!NM_IS_SETTING_IP4_CONFIG (setting)) + return FALSE; array = (GPtrArray *) g_value_get_boxed (value); if (!array || !array->len) return TRUE; - for (i = 0, j = 0; i < array->len; i++, j++) { - GArray *tuple = g_ptr_array_index (array, i); - char buf[INET_ADDRSTRLEN + 1]; - struct in_addr addr; - char *list[3] = { NULL, NULL, NULL }; - char *key_name; - - /* Address */ - addr.s_addr = g_array_index (tuple, guint32, 0); - if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); - list[0] = NULL; - } else { - list[0] = g_strdup (buf); - } - - /* Prefix */ - list[1] = g_strdup_printf ("%d", g_array_index (tuple, guint32, 1)); - - /* Gateway */ - addr.s_addr = g_array_index (tuple, guint32, 2); - if (addr.s_addr) { - if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); - list[2] = NULL; - } else { - list[2] = g_strdup (buf); - } - } - - key_name = g_strdup_printf ("%s%d", key, j + 1); - g_key_file_set_string_list (file, setting->name, key_name, (const char **) list, list[2] ? 3 : 2); - g_free (key_name); - - g_free (list[0]); - g_free (list[1]); - g_free (list[2]); - } + if (!strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) + write_ip4_values (file, setting->name, key, array, 3, 0, 2); + else if (!strcmp (key, NM_SETTING_IP4_CONFIG_ROUTES)) + write_ip4_values (file, setting->name, key, array, 4, 0, 2); return TRUE; } diff --git a/vpn-daemons/openvpn/ChangeLog b/vpn-daemons/openvpn/ChangeLog index 1bd8667255..9bc3bcd1e7 100644 --- a/vpn-daemons/openvpn/ChangeLog +++ b/vpn-daemons/openvpn/ChangeLog @@ -1,3 +1,8 @@ +2008-08-06 Dan Williams <dcbw@redhat.com> + + * src/nm-openvpn-service-openvpn-helper.c + - (get_routes): handle route metrics + 2008-07-28 Dan Williams <dcbw@redhat.com> * properties/auth-helpers.c diff --git a/vpn-daemons/openvpn/po/ChangeLog b/vpn-daemons/openvpn/po/ChangeLog index ccd6b70212..b18880402e 100644 --- a/vpn-daemons/openvpn/po/ChangeLog +++ b/vpn-daemons/openvpn/po/ChangeLog @@ -1,3 +1,8 @@ +2008-08-02 Alexander Shopov <ash@contact.bg> + + * bg.po: Updated Bulgarian translation by + Alexander Shopov <ash@contact.bg> + 2008-07-31 Djihed Afifi <djihed@gmail.com> * ar.po: Updated Arabic Translation by Djihed Afifi. diff --git a/vpn-daemons/openvpn/po/bg.po b/vpn-daemons/openvpn/po/bg.po index f9fc385821..a07fb9d38a 100644 --- a/vpn-daemons/openvpn/po/bg.po +++ b/vpn-daemons/openvpn/po/bg.po @@ -1,14 +1,14 @@ # Bulgarian translation of NetworkManager-openvpn po-file -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager-openvpn package. -# Alexander Shopov <ash@contact.bg>, 2007. +# Alexander Shopov <ash@contact.bg>, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: NetworkManager-openvpn\n" +"Project-Id-Version: NetworkManager-openvpn trunk\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:19+0200\n" -"PO-Revision-Date: 2007-03-07 01:23+0200\n" +"POT-Creation-Date: 2008-08-02 08:55+0300\n" +"PO-Revision-Date: 2008-08-01 07:31+0300\n" "Last-Translator: Alexander Shopov <ash@contact.bg>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" "MIME-Version: 1.0\n" @@ -48,421 +48,443 @@ msgstr "_Запомняне на паролата за тази сесия" msgid "_Save password in keyring" msgstr "Запазване на паролата в клю_чодържателя" -#: ../auth-dialog/main.c:214 +#: ../auth-dialog/main.c:187 #, c-format msgid "You need to authenticate to access the Virtual Private Network '%s'." msgstr "Трябва да се идентифицирате, за да ползвате ВЧМ „%s“." -#: ../auth-dialog/main.c:215 +#: ../auth-dialog/main.c:188 msgid "Authenticate VPN" msgstr "Идентифициране пред ВЧМ" -#: ../auth-dialog/main.c:227 +#: ../auth-dialog/main.c:201 msgid "Certificate pass_word:" msgstr "Парола за _сертификата:" -#: ../auth-dialog/main.c:252 +#: ../auth-dialog/main.c:216 msgid "Certificate password:" msgstr "Парола за сертификата:" -#: ../nm-openvpn.desktop.in.h:1 -msgid "Add, Remove, and Edit VPN Connections" -msgstr "Добавяне, изтриване и редактиране на връзки към ВЧМ" +#: ../properties/auth-helpers.c:68 +msgid "Choose a Certificate Authority certificate..." +msgstr "Изберете сертификата на сертифициращата организация…" -#: ../nm-openvpn.desktop.in.h:2 -msgid "VPN Connection Manager (OpenVPN)" -msgstr "Управление на връзките към ВЧМ (за OpenVPN)" +#: ../properties/auth-helpers.c:87 +msgid "Choose your personal certificate..." +msgstr "Изберете личния си сертификат…" -#: ../properties/nm-openvpn.c:143 -msgid "OpenVPN Client" -msgstr "Клиент за OpenVPN" +#: ../properties/auth-helpers.c:105 +msgid "Choose your private key..." +msgstr "Изберете личния си ключ…" -#: ../properties/nm-openvpn.c:799 -msgid "The following OpenVPN connection will be created:" -msgstr "Ще бъде създадена следната връзка чрез OpenVPN:" +#: ../properties/auth-helpers.c:158 +msgid "Choose an OpenVPN static key..." +msgstr "Изберете статичния ключ на OpenVPN…" -#: ../properties/nm-openvpn.c:801 -#, c-format -msgid "Name: %s" -msgstr "Име: „%s“" +#: ../properties/auth-helpers.c:176 ../properties/auth-helpers.c:886 +msgid "None" +msgstr "Няма" -#: ../properties/nm-openvpn.c:809 -msgid "Connection Type: X.509 Certificates" -msgstr "Вид на връзката: сертификат по X.509" +#: ../properties/auth-helpers.c:519 +msgid "PEM certificates (*.pem, *.crt, *.key)" +msgstr "Сертификати във формат PEM (*.pem, *.crt, *.key)" -#: ../properties/nm-openvpn.c:812 ../properties/nm-openvpn.c:839 -#: ../properties/nm-openvpn.c:851 -#, c-format -msgid "CA: %s" -msgstr "Серт. орг.: %s" +#: ../properties/auth-helpers.c:579 +msgid "OpenVPN Static Keys (*.key)" +msgstr "Статични ключове за OpenVPN (*.key)" -#: ../properties/nm-openvpn.c:815 ../properties/nm-openvpn.c:854 -#, c-format -msgid "Cert: %s" -msgstr "Серт.: %s" +#: ../properties/auth-helpers.c:711 +msgid "Default" +msgstr "Стандартно" -#: ../properties/nm-openvpn.c:818 ../properties/nm-openvpn.c:857 -#, c-format -msgid "Key: %s" -msgstr "Ключ: %s" +#: ../properties/nm-openvpn.c:53 +msgid "OpenVPN" +msgstr "OpenVPN" -#: ../properties/nm-openvpn.c:822 -msgid "Connection Type: Shared Key" -msgstr "Вид на връзката: споделен ключ" +#: ../properties/nm-openvpn.c:54 +msgid "Compatible with the OpenVPN server." +msgstr "Съвместим със сървърите за OpenVPN." -#: ../properties/nm-openvpn.c:825 -#, c-format -msgid "Shared Key: %s" -msgstr "Споделен ключ: %s" +#: ../properties/nm-openvpn.c:308 ../properties/nm-openvpn-dialog.glade.h:7 +msgid "Certificates (TLS)" +msgstr "Сертификати (TLS)" -#: ../properties/nm-openvpn.c:828 -#, c-format -msgid "Local IP: %s" -msgstr "Локален адрес: %s" +#: ../properties/nm-openvpn.c:320 +msgid "Password" +msgstr "Парола" -#: ../properties/nm-openvpn.c:831 -#, c-format -msgid "Remote IP: %s" -msgstr "Отдалечен адрес: %s" +#: ../properties/nm-openvpn.c:334 +msgid "Password with Certificates (TLS)" +msgstr "Парола със сертификати (TLS)" -#: ../properties/nm-openvpn.c:836 -msgid "Connection Type: Password" -msgstr "Вид на връзката: парола" +#: ../properties/nm-openvpn.c:346 +msgid "Static Key" +msgstr "Статичен ключ" -#: ../properties/nm-openvpn.c:842 ../properties/nm-openvpn.c:860 -#, c-format -msgid "Username: %s" -msgstr "Потребителско име: %s" +#: ../properties/nm-openvpn-dialog.glade.h:1 +msgid " " +msgstr " " -#: ../properties/nm-openvpn.c:848 -msgid "Connection Type: X.509 with Password Authentication" -msgstr "Вид на връзката: X.509 с парола" +#: ../properties/nm-openvpn-dialog.glade.h:2 +msgid "<b>Authentication</b>" +msgstr "<b>Идентификация</b>" -#: ../properties/nm-openvpn.c:866 -#, c-format -msgid "Remote: %s" -msgstr "Отдалечен хост: %s" +#: ../properties/nm-openvpn-dialog.glade.h:3 +msgid "<b>General</b>" +msgstr "<b>Общи</b>" -#: ../properties/nm-openvpn.c:869 -#, c-format -msgid "Port: %s" -msgstr "Порт: %s" +#: ../properties/nm-openvpn-dialog.glade.h:4 +msgid "" +"<i>If key direction is used, it must be the opposite of that used on the VPN " +"peer. For example, if the peer uses '1', this connection must use '0'. If " +"you are unsure what value to use, contact your system administrator.</i>" +msgstr "" +"<i>Ако се използва посока на ключа, тя трябва да е обратната на използваната " +"от отсрещната страна по ВЧМ. Например — ако тя ползва „1“, тази връзка " +"трябва да ползва „0“. Ако не сте сигурни, попитайте системния си " +"администратор.</i>" -#: ../properties/nm-openvpn.c:872 -#, c-format -msgid "Device: %s" -msgstr "Устройство: %s" +#: ../properties/nm-openvpn-dialog.glade.h:5 +msgid "Ad_vanced..." +msgstr "_Допълнителни…" -#: ../properties/nm-openvpn.c:872 -msgid "TAP" -msgstr "TAP" +#: ../properties/nm-openvpn-dialog.glade.h:6 +msgid "CA Certificate:" +msgstr "Сертификат на сертифициращата организация:" -#: ../properties/nm-openvpn.c:872 -msgid "TUN" -msgstr "TUN" +#: ../properties/nm-openvpn-dialog.glade.h:8 +msgid "Cipher:" +msgstr "Шифър:" -#: ../properties/nm-openvpn.c:875 -#, c-format -msgid "Protocol: %s" -msgstr "Протокол: %s" +#: ../properties/nm-openvpn-dialog.glade.h:9 +msgid "General" +msgstr "Общи" -#: ../properties/nm-openvpn.c:875 -msgid "TCP" -msgstr "TCP" +#: ../properties/nm-openvpn-dialog.glade.h:10 +msgid "Key Direction:" +msgstr "Посока на ключа:" -#: ../properties/nm-openvpn.c:875 -msgid "UDP" -msgstr "UDP" +#: ../properties/nm-openvpn-dialog.glade.h:11 +msgid "Key File:" +msgstr "Файл-ключ:" -#: ../properties/nm-openvpn.c:879 -#, c-format -msgid "Routes: %s" -msgstr "Маршрути: %s" +#: ../properties/nm-openvpn-dialog.glade.h:12 +msgid "OpenVPN Advanced Options" +msgstr "Допълнителни настройки на OpenVPN" -#: ../properties/nm-openvpn.c:883 -#, c-format -msgid "Use LZO Compression: %s" -msgstr "Използване на компресия LZO: %s" +#: ../properties/nm-openvpn-dialog.glade.h:13 +msgid "Private Key:" +msgstr "Частен ключ:" -#: ../properties/nm-openvpn.c:883 -msgid "Yes" -msgstr "да" +#: ../properties/nm-openvpn-dialog.glade.h:14 +msgid "Static Key:" +msgstr "Статичен ключ:" -#: ../properties/nm-openvpn.c:883 -msgid "No" -msgstr "не" +#: ../properties/nm-openvpn-dialog.glade.h:15 +msgid "Type:" +msgstr "Вид:" -#: ../properties/nm-openvpn.c:887 -#, c-format -msgid "Cipher: %s" -msgstr "Шифриране: %s" +#: ../properties/nm-openvpn-dialog.glade.h:16 +msgid "Use L_ZO data compression" +msgstr "Използване на _компресия LZO" -#: ../properties/nm-openvpn.c:892 -#, c-format -msgid "TLS auth: %s %s" -msgstr "Ползване на TLS: %s %s" +#: ../properties/nm-openvpn-dialog.glade.h:17 +msgid "Use a TA_P device" +msgstr "Използване на _устройство TAP" -#: ../properties/nm-openvpn.c:896 -msgid "The connection details can be changed using the \"Edit\" button." -msgstr "Настройките на връзката могат да се редактират с бутона „Редактиране“." +#: ../properties/nm-openvpn-dialog.glade.h:18 +msgid "Use a _TCP connection" +msgstr "Използване на _връзка по TCP" -#: ../properties/nm-openvpn.c:1121 -msgid "Cannot import settings" -msgstr "Настройките не могат да бъдат внесени." +#: ../properties/nm-openvpn-dialog.glade.h:19 +msgid "Use additional TLS authentication" +msgstr "Използване на допълнителна идентификация с TLS" -#: ../properties/nm-openvpn.c:1123 -#, c-format -msgid "The VPN settings file '%s' does not contain valid data." -msgstr "Файлът с настройки за ВЧМ „%s“ не съдържа валидни данни." +#: ../properties/nm-openvpn-dialog.glade.h:20 +msgid "Use custom gateway p_ort:" +msgstr "_Потребителски порт на шлюза:" -#: ../properties/nm-openvpn.c:1161 -msgid "Select file to import" -msgstr "Избор на файл за внасяне" +#: ../properties/nm-openvpn-dialog.glade.h:21 +msgid "User Certificate:" +msgstr "Потребителски сертификат:" -#: ../properties/nm-openvpn.c:1220 ../properties/nm-openvpn.c:1232 -#: ../properties/nm-openvpn.c:1235 -msgid "Select CA to use" -msgstr "Избор на сертифицираща организация" +#: ../properties/nm-openvpn-dialog.glade.h:22 +msgid "User name:" +msgstr "Потребителско име:" -#: ../properties/nm-openvpn.c:1223 ../properties/nm-openvpn.c:1238 -msgid "Select certificate to use" -msgstr "Избор на сертификат" +#: ../properties/nm-openvpn-dialog.glade.h:23 +msgid "_Gateway:" +msgstr "_Шлюз:" -#: ../properties/nm-openvpn.c:1226 ../properties/nm-openvpn.c:1241 -msgid "Select key to use" -msgstr "Избор на ключ" +#: ../properties/nm-openvpn-dialog.glade.h:24 +msgid "gtk-cancel" +msgstr "gtk-отмяна" -#: ../properties/nm-openvpn.c:1229 -msgid "Select shared key to use" -msgstr "Избор на споделен ключ" +#: ../properties/nm-openvpn-dialog.glade.h:25 +msgid "gtk-ok" +msgstr "gtk-добре" -#: ../properties/nm-openvpn.c:1244 -msgid "Select TA to use" -msgstr "Избор на TA" +#: ../properties/nm-openvpn-dialog.glade.h:26 +msgid "page 1" +msgstr "страница 1" -#. printf ("in impl_export\n"); -#: ../properties/nm-openvpn.c:1438 -msgid "Save as..." -msgstr "Запазване като..." +#: ../properties/nm-openvpn-dialog.glade.h:27 +msgid "page 2" +msgstr "страница 2" -#: ../properties/nm-openvpn.c:1468 -#, c-format -msgid "A file named \"%s\" already exists." -msgstr "Файл с име „%s“ вече съществува." +#: ../properties/nm-openvpn-dialog.glade.h:28 +msgid "page 3" +msgstr "страница 3" -#: ../properties/nm-openvpn.c:1471 -msgid "Do you want to replace it with the one you are saving?" -msgstr "Искате ли да го презапишете?" +#: ../properties/nm-openvpn-dialog.glade.h:29 +msgid "page 4" +msgstr "страница 4" -#: ../properties/nm-openvpn.c:1485 -msgid "Failed to export configuration" -msgstr "Неуспех при изнасяне на настройките" +#~ msgid "Add, Remove, and Edit VPN Connections" +#~ msgstr "Добавяне, изтриване и редактиране на връзки към ВЧМ" -#: ../properties/nm-openvpn.c:1487 -#, c-format -msgid "Failed to save file %s" -msgstr "Неуспех при запазването на файла „%s“" +#~ msgid "VPN Connection Manager (OpenVPN)" +#~ msgstr "Управление на връзките към ВЧМ (за OpenVPN)" -#: ../properties/nm-openvpn-dialog.glade.h:1 -msgid "(Default: 1194)" -msgstr "(стандартно е: 1194)" +#~ msgid "The following OpenVPN connection will be created:" +#~ msgstr "Ще бъде създадена следната връзка чрез OpenVPN:" -#: ../properties/nm-openvpn-dialog.glade.h:2 -msgid "0" -msgstr "0" +#~ msgid "Name: %s" +#~ msgstr "Име: „%s“" -#: ../properties/nm-openvpn-dialog.glade.h:3 -msgid "1" -msgstr "1" +#~ msgid "Connection Type: X.509 Certificates" +#~ msgstr "Вид на връзката: сертификат по X.509" -#: ../properties/nm-openvpn-dialog.glade.h:4 -msgid "<b>Connection Information</b>" -msgstr "<b>Информация за връзката</b>" +#~ msgid "CA: %s" +#~ msgstr "Серт. орг.: %s" -#: ../properties/nm-openvpn-dialog.glade.h:5 -msgid "<b>Connection Name</b>" -msgstr "<b>Име на връзката</b>" +#~ msgid "Cert: %s" +#~ msgstr "Серт.: %s" -#: ../properties/nm-openvpn-dialog.glade.h:6 -msgid "<b>Required</b>" -msgstr "<b>Задължителна</b>" +#~ msgid "Key: %s" +#~ msgstr "Ключ: %s" -#: ../properties/nm-openvpn-dialog.glade.h:7 -msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" -msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" +#~ msgid "Connection Type: Shared Key" +#~ msgstr "Вид на връзката: споделен ключ" -#: ../properties/nm-openvpn-dialog.glade.h:8 -msgid "CA file:" -msgstr "Файл за сертифициращите организации:" +#~ msgid "Shared Key: %s" +#~ msgstr "Споделен ключ: %s" -#: ../properties/nm-openvpn-dialog.glade.h:9 -msgid "CA file:" -msgstr "Файл за сертифициращите организации:" +#~ msgid "Local IP: %s" +#~ msgstr "Локален адрес: %s" -#: ../properties/nm-openvpn-dialog.glade.h:10 -msgid "Certificate:" -msgstr "Сертификат:" +#~ msgid "Remote IP: %s" +#~ msgstr "Отдалечен адрес: %s" -#: ../properties/nm-openvpn-dialog.glade.h:11 -msgid "Connection Name" -msgstr "Име на връзката" +#~ msgid "Connection Type: Password" +#~ msgstr "Вид на връзката: парола" -#: ../properties/nm-openvpn-dialog.glade.h:12 -msgid "Connection Type:" -msgstr "Вид на връзката:" +#~ msgid "Username: %s" +#~ msgstr "Потребителско име: %s" -#: ../properties/nm-openvpn-dialog.glade.h:13 -msgid "Direction:" -msgstr "Посока:" +#~ msgid "Connection Type: X.509 with Password Authentication" +#~ msgstr "Вид на връзката: X.509 с парола" -#: ../properties/nm-openvpn-dialog.glade.h:14 -msgid "Gateway _Port:" -msgstr "_Порт на шлюза:" +#~ msgid "Remote: %s" +#~ msgstr "Отдалечен хост: %s" -#: ../properties/nm-openvpn-dialog.glade.h:15 -msgid "Key:" -msgstr "Ключ:" +#~ msgid "Port: %s" +#~ msgstr "Порт: %s" -#: ../properties/nm-openvpn-dialog.glade.h:16 -msgid "Local IP:" -msgstr "Локален адрес:" +#~ msgid "Device: %s" +#~ msgstr "Устройство: %s" -#: ../properties/nm-openvpn-dialog.glade.h:17 -msgid "" -"Name used to identify the connection to the private network, e.g. \"Campus " -"VPN\" or \"Corporate Network\"" -msgstr "Име, което се ползва за различаването на връзката към частната мрежа, напр. „Корпоративна мрежа“." +#~ msgid "TAP" +#~ msgstr "TAP" -#: ../properties/nm-openvpn-dialog.glade.h:18 -msgid "Optional" -msgstr "Незадължителна" +#~ msgid "TUN" +#~ msgstr "TUN" -#: ../properties/nm-openvpn-dialog.glade.h:19 -msgid "Password" -msgstr "Парола" +#~ msgid "Protocol: %s" +#~ msgstr "Протокол: %s" -#: ../properties/nm-openvpn-dialog.glade.h:20 -msgid "" -"Please enter the information provided by your system administrator below. Do " -"not enter your password here as you will be prompted when connecting." -msgstr "" -"Въведете отдолу информацията предоставена от системния ви администратор. Не " -"въвеждайте паролата си. За нея ще бъдете запитани при свързване." +#~ msgid "TCP" +#~ msgstr "TCP" -#: ../properties/nm-openvpn-dialog.glade.h:21 -msgid "" -"Please note that the file you import is not an OpenVPN configuration file. " -"Ask your adminstrator for the file." -msgstr "" -"Файлът, който се опитахте да внесете, не е конфигурационен файл за OpenVPN. " -"Помолете системния си администратор за такъв файл." +#~ msgid "UDP" +#~ msgstr "UDP" -#: ../properties/nm-openvpn-dialog.glade.h:22 -msgid "Remote IP:" -msgstr "Отдалечен адрес:" +#~ msgid "Routes: %s" +#~ msgstr "Маршрути: %s" -#: ../properties/nm-openvpn-dialog.glade.h:23 -msgid "Shared Key:" -msgstr "Споделен ключ:" +#~ msgid "Use LZO Compression: %s" +#~ msgstr "Използване на компресия LZO: %s" -#: ../properties/nm-openvpn-dialog.glade.h:24 -msgid "Shared key" -msgstr "Споделен ключ" +#~ msgid "Yes" +#~ msgstr "да" -#: ../properties/nm-openvpn-dialog.glade.h:25 -msgid "Use LZO compression" -msgstr "Използване на компресия LZO" +#~ msgid "No" +#~ msgstr "не" -#: ../properties/nm-openvpn-dialog.glade.h:26 -msgid "Use TAP device" -msgstr "Използване на устройство TAP" +#~ msgid "TLS auth: %s %s" +#~ msgstr "Ползване на TLS: %s %s" -#: ../properties/nm-openvpn-dialog.glade.h:27 -msgid "Use TCP connection" -msgstr "Използване на връзка по TCP" +#~ msgid "The connection details can be changed using the \"Edit\" button." +#~ msgstr "" +#~ "Настройките на връзката могат да се редактират с бутона „Редактиране“." -#: ../properties/nm-openvpn-dialog.glade.h:28 -msgid "Use TLS auth:" -msgstr "Използване на TLS:" +#~ msgid "Cannot import settings" +#~ msgstr "Настройките не могат да бъдат внесени." -#: ../properties/nm-openvpn-dialog.glade.h:29 -msgid "Use cipher:" -msgstr "Ползване на шифриране:" +#~ msgid "The VPN settings file '%s' does not contain valid data." +#~ msgstr "Файлът с настройки за ВЧМ „%s“ не съдържа валидни данни." -#: ../properties/nm-openvpn-dialog.glade.h:30 -msgid "Username:" -msgstr "Потребителско име:" +#~ msgid "Select file to import" +#~ msgstr "Избор на файл за внасяне" -#: ../properties/nm-openvpn-dialog.glade.h:31 -msgid "X.509" -msgstr "X.509" +#~ msgid "Select CA to use" +#~ msgstr "Избор на сертифицираща организация" -#: ../properties/nm-openvpn-dialog.glade.h:32 -msgid "" -"X.509 Certificates\n" -"Pre-shared key\n" -"Password Authentication\n" -"X.509 with Password Authentication" -msgstr "" -"Сертификат по X.509\n" -"Споделен ключ\n" -"Парола\n" -"X.509 с парола" +#~ msgid "Select certificate to use" +#~ msgstr "Избор на сертификат" -#: ../properties/nm-openvpn-dialog.glade.h:36 -msgid "X.509/Pass" -msgstr "X.509/Парола" +#~ msgid "Select key to use" +#~ msgstr "Избор на ключ" -#: ../properties/nm-openvpn-dialog.glade.h:37 -msgid "_Gateway Address:" -msgstr "Адрес на _шлюза:" +#~ msgid "Select shared key to use" +#~ msgstr "Избор на споделен ключ" -#: ../properties/nm-openvpn-dialog.glade.h:38 -msgid "_Import Saved Configuration..." -msgstr "_Внасяне на запазени настройки..." +#~ msgid "Select TA to use" +#~ msgstr "Избор на TA" -#: ../properties/nm-openvpn-dialog.glade.h:39 -msgid "_Only use VPN connection for these addresses" -msgstr "Да се използва само връзката през _ВЧМ за тези адреси" +#~ msgid "Save as..." +#~ msgstr "Запазване като…" -#: ../properties/nm-openvpn-dialog.glade.h:40 -msgid "none" -msgstr "няма" +#~ msgid "A file named \"%s\" already exists." +#~ msgstr "Файл с име „%s“ вече съществува." -#: ../src/nm-openvpn-service.c:127 -msgid "" -"The VPN login failed because the user name and password were not accepted or " -"the certificate password was wrong." -msgstr "" -"Неуспешно свързване към ВЧМ - името или паролата са отхвърлени или паролата " -"за сертификата е неправилна." +#~ msgid "Do you want to replace it with the one you are saving?" +#~ msgstr "Искате ли да го презапишете?" -#: ../src/nm-openvpn-service.c:129 -msgid "The VPN login failed because the VPN program could not be started." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ не може да бъде стартирана." +#~ msgid "Failed to export configuration" +#~ msgstr "Неуспех при изнасяне на настройките" -#: ../src/nm-openvpn-service.c:131 -msgid "" -"The VPN login failed because the VPN program could not connect to the VPN " -"server." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ не успя да се свърже със " -"сървъра за ВЧМ." +#~ msgid "Failed to save file %s" +#~ msgstr "Неуспех при запазването на файла „%s“" -#: ../src/nm-openvpn-service.c:133 -msgid "" -"The VPN login failed because the VPN configuration options were invalid." -msgstr "Неуспешно свързване към ВЧМ - настройките на ВЧМ са грешни." +#~ msgid "0" +#~ msgstr "0" -#: ../src/nm-openvpn-service.c:135 -msgid "" -"The VPN login failed because the VPN program received an invalid " -"configuration from the VPN server." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ получи грешни настройки от " -"сървъра за ВЧМ." +#~ msgid "1" +#~ msgstr "1" + +#~ msgid "<b>Connection Information</b>" +#~ msgstr "<b>Информация за връзката</b>" + +#~ msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" +#~ msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" + +#~ msgid "CA file:" +#~ msgstr "Файл за сертифициращите организации:" + +#~ msgid "CA file:" +#~ msgstr "Файл за сертифициращите организации:" + +#~ msgid "Connection Name" +#~ msgstr "Име на връзката" + +#~ msgid "Connection Type:" +#~ msgstr "Вид на връзката:" + +#~ msgid "Local IP:" +#~ msgstr "Локален адрес:" + +#~ msgid "" +#~ "Name used to identify the connection to the private network, e.g. " +#~ "\"Campus VPN\" or \"Corporate Network\"" +#~ msgstr "" +#~ "Име, което се ползва за различаването на връзката към частната мрежа, " +#~ "напр. „Корпоративна мрежа“." + +#~ msgid "Optional" +#~ msgstr "Незадължителна" + +#~ msgid "" +#~ "Please enter the information provided by your system administrator below. " +#~ "Do not enter your password here as you will be prompted when connecting." +#~ msgstr "" +#~ "Въведете отдолу информацията предоставена от системния ви администратор. " +#~ "Не въвеждайте паролата си. За нея ще бъдете запитани при свързване." + +#~ msgid "" +#~ "Please note that the file you import is not an OpenVPN configuration " +#~ "file. Ask your adminstrator for the file." +#~ msgstr "" +#~ "Файлът, който се опитахте да внесете, не е конфигурационен файл за " +#~ "OpenVPN. Помолете системния си администратор за такъв файл." + +#~ msgid "Remote IP:" +#~ msgstr "Отдалечен адрес:" + +#~ msgid "Shared key" +#~ msgstr "Споделен ключ" + +#~ msgid "Use TLS auth:" +#~ msgstr "Използване на TLS:" + +#~ msgid "Use cipher:" +#~ msgstr "Ползване на шифриране:" + +#~ msgid "X.509" +#~ msgstr "X.509" + +#~ msgid "" +#~ "X.509 Certificates\n" +#~ "Pre-shared key\n" +#~ "Password Authentication\n" +#~ "X.509 with Password Authentication" +#~ msgstr "" +#~ "Сертификат по X.509\n" +#~ "Споделен ключ\n" +#~ "Парола\n" +#~ "X.509 с парола" + +#~ msgid "X.509/Pass" +#~ msgstr "X.509/Парола" + +#~ msgid "_Gateway Address:" +#~ msgstr "Адрес на _шлюза:" -#: ../src/nm-openvpn-service.c:137 -msgid "VPN connection failed" -msgstr "Неуспешно свързване към ВЧМ" +#~ msgid "_Import Saved Configuration..." +#~ msgstr "_Внасяне на запазени настройки…" + +#~ msgid "_Only use VPN connection for these addresses" +#~ msgstr "Да се използва само връзката през _ВЧМ за тези адреси" + +#~ msgid "" +#~ "The VPN login failed because the user name and password were not accepted " +#~ "or the certificate password was wrong." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — името или паролата са отхвърлени или " +#~ "паролата за сертификата е неправилна." + +#~ msgid "The VPN login failed because the VPN program could not be started." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ не може да бъде " +#~ "стартирана." + +#~ msgid "" +#~ "The VPN login failed because the VPN program could not connect to the VPN " +#~ "server." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ не успя да се свърже със " +#~ "сървъра за ВЧМ." + +#~ msgid "" +#~ "The VPN login failed because the VPN configuration options were invalid." +#~ msgstr "Неуспешно свързване към ВЧМ — настройките на ВЧМ са грешни." + +#~ msgid "" +#~ "The VPN login failed because the VPN program received an invalid " +#~ "configuration from the VPN server." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ получи грешни настройки " +#~ "от сървъра за ВЧМ." + +#~ msgid "VPN connection failed" +#~ msgstr "Неуспешно свързване към ВЧМ" diff --git a/vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c b/vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c index b819cdc4b3..f4c4cd7502 100644 --- a/vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c +++ b/vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c @@ -31,6 +31,7 @@ #include <unistd.h> #include <stdio.h> #include <string.h> +#include <errno.h> #include <regex.h> #include <sys/socket.h> #include <netinet/in.h> @@ -197,7 +198,7 @@ get_routes (void) struct in_addr network; struct in_addr netmask; struct in_addr gateway = { 0, }; - guint32 prefix; + guint32 prefix, metric = 0; snprintf (buf, BUFLEN, "route_network_%d", i); tmp = getenv (buf); @@ -218,16 +219,33 @@ get_routes (void) snprintf (buf, BUFLEN, "route_gateway_%d", i); tmp = getenv (buf); - if (!tmp || inet_pton (AF_INET, tmp, &gateway) <= 0) { + /* gateway can be missing */ + if (tmp && (inet_pton (AF_INET, tmp, &gateway) <= 0)) { nm_warning ("Ignoring invalid static route gateway '%s'", tmp ? tmp : "NULL"); continue; } - array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + snprintf (buf, BUFLEN, "route_metric_%d", i); + tmp = getenv (buf); + /* metric can be missing */ + if (tmp && strlen (tmp)) { + long int tmp_metric; + + errno = 0; + tmp_metric = strtol (tmp, NULL, 10); + if (errno || tmp_metric < 0 || tmp_metric > G_MAXUINT32) { + nm_warning ("Ignoring invalid static route metric '%s'", tmp); + continue; + } + metric = (guint32) tmp_metric; + } + + array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); g_array_append_val (array, network.s_addr); prefix = nm_utils_ip4_netmask_to_prefix (netmask.s_addr); g_array_append_val (array, prefix); g_array_append_val (array, gateway.s_addr); + g_array_append_val (array, metric); g_ptr_array_add (routes, array); } diff --git a/vpn-daemons/pptp/po/ChangeLog b/vpn-daemons/pptp/po/ChangeLog index 533bf19b72..ec2ad6b428 100644 --- a/vpn-daemons/pptp/po/ChangeLog +++ b/vpn-daemons/pptp/po/ChangeLog @@ -1,3 +1,8 @@ +2008-08-02 Alexander Shopov <ash@contact.bg> + + * bg.po: Updated Bulgarian translation by + Alexander Shopov <ash@contact.bg> + 2008-07-31 Djihed Afifi <djihed@gmail.com> * ar.po: Updated Arabic Translation by Djihed Afifi. diff --git a/vpn-daemons/pptp/po/bg.po b/vpn-daemons/pptp/po/bg.po index adfdfe4b7e..dc5f46ed67 100644 --- a/vpn-daemons/pptp/po/bg.po +++ b/vpn-daemons/pptp/po/bg.po @@ -1,14 +1,14 @@ # Bulgarian translation of NetworkManager-pptp po-file -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager-pptp package. -# Alexander Shopov <ash@contact.bg>, 2007. +# Alexander Shopov <ash@contact.bg>, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: NetworkManager-pptp\n" +"Project-Id-Version: NetworkManager-pptp trunk\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-02-02 06:44+0200\n" -"PO-Revision-Date: 2007-02-02 05:18+0200\n" +"POT-Creation-Date: 2008-08-02 08:59+0300\n" +"PO-Revision-Date: 2008-08-01 07:26+0300\n" "Last-Translator: Alexander Shopov <ash@contact.bg>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" "MIME-Version: 1.0\n" @@ -16,570 +16,533 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: ../auth-dialog-general/gnome-generic-auth-dialog.c:792 -msgid "Authentication Type:" -msgstr "Вид на идентификацията:" - -#: ../auth-dialog-general/gnome-generic-auth-dialog.c:857 -#: ../auth-dialog-general/nm-ppp-auth.glade.h:11 -msgid "_Remember for this session" -msgstr "_Запомняне за тази сесия" - -#: ../auth-dialog-general/gnome-generic-auth-dialog.c:859 -#: ../auth-dialog-general/nm-ppp-auth.glade.h:13 -msgid "_Save in keyring" -msgstr "Запазване в клю_чодържателя" - -#: ../auth-dialog-general/main.c:48 ../auth-dialog/main.c:140 -#, c-format -msgid "You need to authenticate to access '%s'." -msgstr "Трябва да се идентифицирате, за да достъпите „%s“." - -#: ../auth-dialog-general/main.c:51 ../auth-dialog/main.c:141 -msgid "Authenticate Connection" -msgstr "Идентифициране на връзката" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:2 -#, no-c-format -msgid "" -"<span weight=\"bold\" size=\"larger\">Authentication Information</span>\n" -"\n" -"The connection '%s' may need some form of authentication.\n" -"\n" -"Please select an appropriate authentication type and provide the necessary " -"credentials below:\n" -msgstr "" -"<span weight=\"bold\" size=\"larger\">Информация за идентификация</span>\n" -"\n" -"Връзката „%s“ се нуждае от някаква форма на идентификация.\n" -"\n" -"Изберете подходящия вид идентификация и добавете необходимата за това " -"информация отдолу:\n" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:8 -msgid "Authentication Required" -msgstr "Изисква се идентификация" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:9 -msgid "_Authentication Type:" -msgstr "_Вид на идентификацията:" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:10 -#: ../auth-dialog/gnome-two-password-dialog.c:272 -msgid "_Password:" -msgstr "_Парола:" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:12 -msgid "_Remote name:" -msgstr "_Отдалечено име:" +#: ../auth-dialog/gnome-two-password-dialog.c:144 +msgid "_Secondary Password:" +msgstr "_Втора парола:" -#: ../auth-dialog-general/nm-ppp-auth.glade.h:14 -#: ../auth-dialog/gnome-two-password-dialog.c:268 +#: ../auth-dialog/gnome-two-password-dialog.c:258 msgid "_Username:" msgstr "Потребителско _име:" -#: ../auth-dialog-general/nm-ppp-auth.glade.h:15 -msgid "auth-chap-window" -msgstr "прозорец-за-идентификация-с-chap" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:16 -msgid "auth-mschapv2-window" -msgstr "прозорец-за-идентификация-с-mschapv2" - -#: ../auth-dialog-general/nm-ppp-auth.glade.h:17 -msgid "auth-none-window" -msgstr "прозорец-за-никаква-идентификация" - -#: ../auth-dialog/gnome-two-password-dialog.c:147 -msgid "_Secondary Password:" -msgstr "_Втора парола:" - -#: ../auth-dialog/gnome-two-password-dialog.c:270 +#: ../auth-dialog/gnome-two-password-dialog.c:260 msgid "_Domain:" msgstr "_Домейн:" -#: ../auth-dialog/gnome-two-password-dialog.c:355 +#: ../auth-dialog/gnome-two-password-dialog.c:262 +msgid "_Password:" +msgstr "_Парола:" + +#: ../auth-dialog/gnome-two-password-dialog.c:351 msgid "Connect _anonymously" msgstr "_Анонимно свързване" -#: ../auth-dialog/gnome-two-password-dialog.c:360 +#: ../auth-dialog/gnome-two-password-dialog.c:356 msgid "Connect as _user:" msgstr "Свързване _като потребителя:" -#: ../auth-dialog/gnome-two-password-dialog.c:466 -msgid "_Remember password for this session" +#: ../auth-dialog/gnome-two-password-dialog.c:465 +msgid "_Remember passwords for this session" msgstr "_Запомняне на паролата за тази сесия" -#: ../auth-dialog/gnome-two-password-dialog.c:468 -msgid "_Save password in keyring" +#: ../auth-dialog/gnome-two-password-dialog.c:467 +msgid "_Save passwords in keyring" msgstr "Запазване на паролата в клю_чодържателя" -#: ../nm-ppp.desktop.in.h:1 -msgid "Add, Remove, and Edit VPN Connections" -msgstr "Добавяне, изтриване и редактиране на връзки към ВЧМ" +#: ../auth-dialog/main.c:169 +#, c-format +msgid "You need to authenticate to access the Virtual Private Network '%s'." +msgstr "Трябва да се идентифицирате, за да достъпите ВЧМ „%s“." -#: ../nm-ppp.desktop.in.h:2 -msgid "VPN Connection Manager (PPP generic)" -msgstr "Управление на връзките към ВЧМ (за PPP)" +#: ../auth-dialog/main.c:170 +msgid "Authenticate VPN" +msgstr "Идентифициране на ВЧМ" -#: ../properties/nm-ppp-dialog.glade.h:1 -msgid "00:00:00:00" -msgstr "00:00:00:00" +#: ../nm-pptp.desktop.in.h:1 +msgid "Add, Remove, and Edit PPTP VPN Connections" +msgstr "Добавяне, изтриване и редактиране на връзки към ВЧМ по PPTP" -#: ../properties/nm-ppp-dialog.glade.h:2 -msgid "<b>Compression</b>" -msgstr "<b>Компресия</b>" +#: ../nm-pptp.desktop.in.h:2 +msgid "PPTP VPN Connection Manager" +msgstr "Управление на връзки за ВЧМ по PPTP" -#: ../properties/nm-ppp-dialog.glade.h:3 -msgid "<b>Connection Name</b>" -msgstr "<b>Име на връзката</b>" +#: ../properties/advanced-dialog.c:173 +msgid "All Available (Default)" +msgstr "Всички налични (стандартно)" -#: ../properties/nm-ppp-dialog.glade.h:4 -msgid "<b>Delays and TImeouts</b>" -msgstr "<b>Забавяния и изтичане на времето</b>" +#: ../properties/advanced-dialog.c:177 +msgid "128-bit (most secure)" +msgstr "128-битово (най-сигурно)" -#: ../properties/nm-ppp-dialog.glade.h:5 -msgid "<b>Encryption</b>" -msgstr "<b>Шифриране</b>" +#: ../properties/advanced-dialog.c:186 +msgid "40-bit (less secure)" +msgstr "40-битово (несигурно)" -#: ../properties/nm-ppp-dialog.glade.h:6 -msgid "<b>IP Options</b>" -msgstr "<b>Настройки на IP</b>" +#: ../properties/advanced-dialog.c:257 +msgid "PAP" +msgstr "PAP" -#: ../properties/nm-ppp-dialog.glade.h:7 -msgid "<b>Packet Parameters</b>" -msgstr "<b>Параметри на пакетите</b>" +#: ../properties/advanced-dialog.c:263 +msgid "CHAP" +msgstr "CHAP" -#: ../properties/nm-ppp-dialog.glade.h:8 -msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" -msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" +#: ../properties/advanced-dialog.c:269 +msgid "MSCHAP" +msgstr "MSCHAP" -#: ../properties/nm-ppp-dialog.glade.h:9 -msgid "A list of extra options to pppd as would be typed on the command line" -msgstr "" -"Списък с допълнителните опции за pppd, които ще бъдат предадени през " -"командния ред" +#: ../properties/advanced-dialog.c:275 +msgid "MSCHAPv2" +msgstr "MSCHAPv2" + +#: ../properties/nm-pptp-dialog.glade.h:1 +msgid "<b>Authentication</b>" +msgstr "<b>Идентифициране</b>" + +#: ../properties/nm-pptp-dialog.glade.h:2 +msgid "<b>Echo</b>" +msgstr "<b>Ехо</b>" + +#: ../properties/nm-pptp-dialog.glade.h:3 +msgid "<b>General</b>" +msgstr "<b>Общи</b>" + +#: ../properties/nm-pptp-dialog.glade.h:4 +msgid "<b>Optional</b>" +msgstr "<b>Допълнителни</b>" + +#: ../properties/nm-pptp-dialog.glade.h:5 +msgid "<b>Security and Compression</b>" +msgstr "<b>Сигурност и компресия</b>" -#: ../properties/nm-ppp-dialog.glade.h:10 -msgid "Allow BSD Compression" +#: ../properties/nm-pptp-dialog.glade.h:6 +msgid "Ad_vanced..." +msgstr "_Допълнителни…" + +#: ../properties/nm-pptp-dialog.glade.h:7 +msgid "Allow BSD data compression" msgstr "Разрешаване на компресия BSD" -#: ../properties/nm-ppp-dialog.glade.h:11 -msgid "Allow Deflate compression" +#: ../properties/nm-pptp-dialog.glade.h:8 +msgid "Allow Deflate data compression" msgstr "Разрешаване на компресия deflate" -#: ../properties/nm-ppp-dialog.glade.h:12 -msgid "Authenticate Peer" -msgstr "Идентифициране на съседа" +#: ../properties/nm-pptp-dialog.glade.h:9 +msgid "Allow Stateful Encryption" +msgstr "Разрешаване на компресия със запомняне на състояние" -#: ../properties/nm-ppp-dialog.glade.h:13 -msgid "Authentication" -msgstr "Идентифициране" +#: ../properties/nm-pptp-dialog.glade.h:10 +msgid "Allow the following authentication methods:" +msgstr "Разрешаване на следните методи за идентификация:" -#: ../properties/nm-ppp-dialog.glade.h:14 -msgid "Compression & Encryption" -msgstr "Компресия и шифриране" +#: ../properties/nm-pptp-dialog.glade.h:11 +msgid "Default" +msgstr "Стандартно" -#: ../properties/nm-ppp-dialog.glade.h:15 -msgid "Connection" -msgstr "Връзката" +#: ../properties/nm-pptp-dialog.glade.h:12 +msgid "Domain:" +msgstr "Домейн:" -#: ../properties/nm-ppp-dialog.glade.h:16 -msgid "Debug Output" -msgstr "Изход за изчистване на грешки" +#: ../properties/nm-pptp-dialog.glade.h:13 +msgid "Security:" +msgstr "Сигурност:" -#: ../properties/nm-ppp-dialog.glade.h:17 -msgid "Disconnect after this many LCP echo requests fail" -msgstr "Прекъсване на връзката след следния брой неуспешни заявки echo по LCP" +#: ../properties/nm-pptp-dialog.glade.h:14 +msgid "Send PPP echo packets" +msgstr "Пращане на пакети „echo“ по PPP" -#: ../properties/nm-ppp-dialog.glade.h:18 -#: ../properties/nm-ppp-properties.c:216 -msgid "Enable stateful MPPE" -msgstr "Включване на MPPE със запазване на състоянието" +#: ../properties/nm-pptp-dialog.glade.h:15 +msgid "Use Point-to-Point Encryption (MPPE)" +msgstr "Използване на шифриране точка до точка (MPPE)" -#: ../properties/nm-ppp-dialog.glade.h:19 -msgid "Exclusive device access (UUCP-style lock)" -msgstr "Изключителен достъп до устройство (заключване в стил UUCP)" +#: ../properties/nm-pptp-dialog.glade.h:16 +msgid "Use TCP header compression" +msgstr "Използване на компресия на заглавните части на TCP" -#: ../properties/nm-ppp-dialog.glade.h:20 -msgid "Find Device" -msgstr "Търсене на устройство" +#: ../properties/nm-pptp-dialog.glade.h:17 +msgid "User name:" +msgstr "Потребителско име:" -#: ../properties/nm-ppp-dialog.glade.h:21 -msgid "" -"For security reasons, options entered in the box above are checked against a " -"list of allowed options before a connection is established. Currently there " -"are no options on the list." -msgstr "" -"По причини свързани със сигурността опциите въведени в полето отгоре се " -"сравняват със списък на позволените опции, преди да се осъществи връзка. В " -"момента няма опции в списъка." +#: ../properties/nm-pptp-dialog.glade.h:18 +msgid "_Gateway:" +msgstr "_Шлюз:" -#: ../properties/nm-ppp-dialog.glade.h:22 -msgid "GPRS Options" -msgstr "Опции за GPRS" +#: ../properties/nm-pptp-dialog.glade.h:19 +msgid "gtk-cancel" +msgstr "gtk-cancel" -#: ../properties/nm-ppp-dialog.glade.h:23 -msgid "Hardware RTS/CTS" -msgstr "Хардуерна поддръжка на RTS/CTS" +#: ../properties/nm-pptp-dialog.glade.h:20 +msgid "gtk-ok" +msgstr "gtk-ok" -#: ../properties/nm-ppp-dialog.glade.h:24 -msgid "Host name or IP address of the PPTP server" -msgstr "Име или адрес на сървъра за PPTP" +#: ../properties/nm-pptp.c:50 +msgid "Point-to-Point Tunneling Protocol (PPTP)" +msgstr "Тунелиращ протокол — точка до точка (PPTP)" -#: ../properties/nm-ppp-dialog.glade.h:25 -msgid "" -"If BSD compression is not allowed the 'nobsdcomp' option is passed to pppd" -msgstr "" -"Ако компресията BSD не е позволена, на pppd се подава опцията „nobsdcomp“." +#: ../properties/nm-pptp.c:51 +msgid "Compatible with Microsoft and other PPTP VPN servers." +msgstr "Съвместим със сървърите на Microsoft и други за ВЧМ по PPTP." -#: ../properties/nm-ppp-dialog.glade.h:26 -msgid "" -"If Deflate compression is not allowed the 'nodefate' option is passed to pppd" -msgstr "" -"Ако компресията deflate не е позволена, на pppd се подава опцията " -"„nodeflate“." +#~ msgid "Authentication Type:" +#~ msgstr "Вид на идентификацията:" -#: ../properties/nm-ppp-dialog.glade.h:27 -msgid "Maximum Receive Unit" -msgstr "Максимален пакет за приемане" +#~ msgid "_Remember for this session" +#~ msgstr "_Запомняне за тази сесия" -#: ../properties/nm-ppp-dialog.glade.h:28 -msgid "Maximum Transmit Unit" -msgstr "Максимален пакет за предаване" +#~ msgid "_Save in keyring" +#~ msgstr "Запазване в клю_чодържателя" -#: ../properties/nm-ppp-dialog.glade.h:29 -msgid "Modem Connection" -msgstr "Връзка през модем" +#~ msgid "Authenticate Connection" +#~ msgstr "Идентифициране на връзката" -#: ../properties/nm-ppp-dialog.glade.h:30 -msgid "PPP Options" -msgstr "Настройки на PPP" +#~ msgid "" +#~ "<span weight=\"bold\" size=\"larger\">Authentication Information</span>\n" +#~ "\n" +#~ "The connection '%s' may need some form of authentication.\n" +#~ "\n" +#~ "Please select an appropriate authentication type and provide the " +#~ "necessary credentials below:\n" +#~ msgstr "" +#~ "<span weight=\"bold\" size=\"larger\">Информация за идентификация</span>\n" +#~ "\n" +#~ "Връзката „%s“ се нуждае от някаква форма на идентификация.\n" +#~ "\n" +#~ "Изберете подходящия вид идентификация и добавете необходимата за това " +#~ "информация отдолу:\n" -#: ../properties/nm-ppp-dialog.glade.h:31 -msgid "Peer DNS through tunnel" -msgstr "DNS от съседа през тунел" +#~ msgid "Authentication Required" +#~ msgstr "Изисква се идентификация" -#: ../properties/nm-ppp-dialog.glade.h:32 -#: ../properties/nm-ppp-properties.c:251 -msgid "Refuse CHAP" -msgstr "Отказване на CHAP" +#~ msgid "_Authentication Type:" +#~ msgstr "_Вид на идентификацията:" -#: ../properties/nm-ppp-dialog.glade.h:33 -#: ../properties/nm-ppp-properties.c:246 -msgid "Refuse EAP" -msgstr "Отказване на EAP" +#~ msgid "_Remote name:" +#~ msgstr "_Отдалечено име:" -#: ../properties/nm-ppp-dialog.glade.h:34 -msgid "Refuse MS CHAP" -msgstr "Отказване на MS CHAP" +#~ msgid "auth-chap-window" +#~ msgstr "прозорец-за-идентификация-с-chap" -#: ../properties/nm-ppp-dialog.glade.h:35 -msgid "Require 128 bit MPPE encryption" -msgstr "Изискване на 128-битово шифриране MPPE" +#~ msgid "auth-mschapv2-window" +#~ msgstr "прозорец-за-идентификация-с-mschapv2" -#: ../properties/nm-ppp-dialog.glade.h:36 -msgid "Require Explicit IP Addr" -msgstr "Изискване на изричен IP адрес" +#~ msgid "auth-none-window" +#~ msgstr "прозорец-за-никаква-идентификация" -#: ../properties/nm-ppp-dialog.glade.h:37 -msgid "Require MPPC Compression" -msgstr "Изискване на компресия MPPC" +#~ msgid "VPN Connection Manager (PPP generic)" +#~ msgstr "Управление на връзките към ВЧМ (за PPP)" -#: ../properties/nm-ppp-dialog.glade.h:38 -msgid "Require MPPE encryption" -msgstr "Изискване на шифриране MPPE" +#~ msgid "00:00:00:00" +#~ msgstr "00:00:00:00" -#: ../properties/nm-ppp-dialog.glade.h:39 -msgid "Requires existing network connection" -msgstr "Изисква съществуваща мрежова връзка" +#~ msgid "<b>Connection Name</b>" +#~ msgstr "<b>Име на връзката</b>" -#: ../properties/nm-ppp-dialog.glade.h:40 -msgid "Routing" -msgstr "Маршрутизация" +#~ msgid "<b>Delays and TImeouts</b>" +#~ msgstr "<b>Забавяния и изтичане на времето</b>" -#: ../properties/nm-ppp-dialog.glade.h:41 -msgid "Serial Options" -msgstr "Настройки на серийния порт" +#~ msgid "<b>Packet Parameters</b>" +#~ msgstr "<b>Параметри на пакетите</b>" -#: ../properties/nm-ppp-dialog.glade.h:42 -msgid "Service providers GPRS access point from device config" -msgstr "" -"Точката за достъп на доставчика на услуги по GPRS от настройките на " -"устройството" +#~ msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" +#~ msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" -#: ../properties/nm-ppp-dialog.glade.h:43 -msgid "Service providers IP address" -msgstr "IP адрес на доставчика на услуги" +#~ msgid "" +#~ "A list of extra options to pppd as would be typed on the command line" +#~ msgstr "" +#~ "Списък с допълнителните опции за pppd, които ще бъдат предадени през " +#~ "командния ред" -#: ../properties/nm-ppp-dialog.glade.h:44 -msgid "Telephone number to dial" -msgstr "Телефонен номер за набиране" +#~ msgid "Compression & Encryption" +#~ msgstr "Компресия и шифриране" -#: ../properties/nm-ppp-dialog.glade.h:45 -msgid "" -"This is the friendly name that will be used to identify this network " -"connection, \n" -"e.g. \"Campus VPN\" or \"Corporate Network\"" -msgstr "" -"Име, което се ползва за различаването на връзката към тази мрежа, напр. " -"„Корпоративна мрежа“." +#~ msgid "Connection" +#~ msgstr "Връзката" -#: ../properties/nm-ppp-dialog.glade.h:47 -msgid "Time in seconds between echo requests" -msgstr "Интервал в секунди между заявките echo" +#~ msgid "Debug Output" +#~ msgstr "Изход за изчистване на грешки" -#: ../properties/nm-ppp-dialog.glade.h:48 -msgid "Type:" -msgstr "Вид:" +#~ msgid "Disconnect after this many LCP echo requests fail" +#~ msgstr "" +#~ "Прекъсване на връзката след следния брой неуспешни заявки „echo“ по LCP" -#: ../properties/nm-ppp-dialog.glade.h:49 -#: ../properties/nm-ppp-properties.c:201 -msgid "Use Peer DNS" -msgstr "Използване на DNS от съсед" +#~ msgid "Enable stateful MPPE" +#~ msgstr "Включване на MPPE със запомняне на състоянието" -#: ../properties/nm-ppp-dialog.glade.h:50 -msgid "When checked the \"refuse-chap\" option is passed to pppd." -msgstr "Когато е избрано, на pppd се подава опцията „refuse-chap“." +#~ msgid "Exclusive device access (UUCP-style lock)" +#~ msgstr "Изключителен достъп до устройство (заключване в стил UUCP)" -#: ../properties/nm-ppp-dialog.glade.h:51 -msgid "When checked the \"refuse-eap\" option is passed to pppd." -msgstr "Когато е избрано, на pppd се подава опцията „refuse-eap“." +#~ msgid "Find Device" +#~ msgstr "Търсене на устройство" -#: ../properties/nm-ppp-dialog.glade.h:52 -msgid "When checked the \"refuse-mschap\" option is passed to pppd." -msgstr "Когато е избрано, на pppd се подава опцията „refuse-mschap“." +#~ msgid "" +#~ "For security reasons, options entered in the box above are checked " +#~ "against a list of allowed options before a connection is established. " +#~ "Currently there are no options on the list." +#~ msgstr "" +#~ "По причини свързани със сигурността опциите въведени в полето отгоре се " +#~ "сравняват със списък на позволените опции, преди да се осъществи връзка. " +#~ "В момента няма опции в списъка." -#: ../properties/nm-ppp-dialog.glade.h:53 -msgid "When checked the 'lock' option is passed to pppd" -msgstr "Когато е избрано, на pppd се подава опцията „lock“." +#~ msgid "GPRS Options" +#~ msgstr "Опции за GPRS" -#: ../properties/nm-ppp-dialog.glade.h:54 -msgid "When checked the 'require-mppc' option is passed to pppd" -msgstr "Когато е избрано, на pppd се подава опцията „require-mppc“." +#~ msgid "Hardware RTS/CTS" +#~ msgstr "Хардуерна поддръжка на RTS/CTS" -#: ../properties/nm-ppp-dialog.glade.h:55 -msgid "" -"When checked this sets the pppd 'debug' option and adds some extra " -"information from the NetworkManager plugin" -msgstr "" -"Когато е избрано, на pppd се подава опцията „debug“ и се добавя информация " -"от приставката на NetworkManager." +#~ msgid "Host name or IP address of the PPTP server" +#~ msgstr "Име или адрес на сървъра за PPTP" -#: ../properties/nm-ppp-dialog.glade.h:56 -msgid "When checked this sets the pppd 'noipdefault' option" -msgstr "Когато е избрано, на pppd се подава опцията „noipdefault“." +#~ msgid "" +#~ "If BSD compression is not allowed the 'nobsdcomp' option is passed to pppd" +#~ msgstr "" +#~ "Ако компресията BSD не е позволена, на pppd се подава опцията „nobsdcomp“." -#: ../properties/nm-ppp-dialog.glade.h:57 -msgid "When checked this sets the pppd 'usepeerdns' option" -msgstr "Когато е избрано, на pppd се подава опцията „userpeerdns“." +#~ msgid "" +#~ "If Deflate compression is not allowed the 'nodefate' option is passed to " +#~ "pppd" +#~ msgstr "" +#~ "Ако компресията deflate не е позволена, на pppd се подава опцията " +#~ "„nodeflate“." -#: ../properties/nm-ppp-dialog.glade.h:58 -msgid "When this check box is cleared the \"noauth\" option is passed to pppd." -msgstr "Когато е избрано, на pppd се подава опцията „noauth“." +#~ msgid "Maximum Receive Unit" +#~ msgstr "Максимален пакет за приемане" -#: ../properties/nm-ppp-dialog.glade.h:59 -msgid "_Access Point Name:" -msgstr "_Номер на точката за достъп:" +#~ msgid "Maximum Transmit Unit" +#~ msgstr "Максимален пакет за предаване" -#: ../properties/nm-ppp-dialog.glade.h:60 -msgid "_Channel:" -msgstr "_Канал:" +#~ msgid "Modem Connection" +#~ msgstr "Връзка през модем" -#: ../properties/nm-ppp-dialog.glade.h:61 -msgid "_Context Num" -msgstr "Но_мер на контекста" +#~ msgid "PPP Options" +#~ msgstr "Настройки на PPP" -#: ../properties/nm-ppp-dialog.glade.h:62 -msgid "_Custom PPP options:" -msgstr "_Допълнителни опции на PPP" +#~ msgid "Peer DNS through tunnel" +#~ msgstr "DNS от съседа през тунел" -#: ../properties/nm-ppp-dialog.glade.h:63 -msgid "_Device Address:" -msgstr "_Адрес на устройството:" +#~ msgid "Refuse CHAP" +#~ msgstr "Отказване на CHAP" -#: ../properties/nm-ppp-dialog.glade.h:64 -msgid "_Gateway:" -msgstr "_Шлюз:" +#~ msgid "Refuse EAP" +#~ msgstr "Отказване на EAP" -#: ../properties/nm-ppp-dialog.glade.h:65 -msgid "_IP Address:" -msgstr "IP а_дрес" +#~ msgid "Refuse MS CHAP" +#~ msgstr "Отказване на MS CHAP" -#: ../properties/nm-ppp-dialog.glade.h:66 -msgid "_Import Saved Configuration..." -msgstr "_Внасяне на запазени настройки..." +#~ msgid "Require 128 bit MPPE encryption" +#~ msgstr "Изискване на 128-битово шифриране MPPE" -#: ../properties/nm-ppp-dialog.glade.h:67 -msgid "_Only use VPN connection for these addresses" -msgstr "Да се използва само връзката през _ВЧМ за тези адреси" +#~ msgid "Require Explicit IP Addr" +#~ msgstr "Изискване на изричен адрес по IP" -#: ../properties/nm-ppp-dialog.glade.h:68 -msgid "_Packet Type" -msgstr "Вид _пакет" +#~ msgid "Require MPPC Compression" +#~ msgstr "Изискване на компресия MPPC" -#: ../properties/nm-ppp-dialog.glade.h:69 -msgid "_Telephone Number:" -msgstr "_Телефонен номер:" +#~ msgid "Require MPPE encryption" +#~ msgstr "Изискване на шифриране MPPE" -#: ../properties/nm-ppp-dialog.glade.h:70 -msgid "connect-delay" -msgstr "забавяне при свързване" +#~ msgid "Requires existing network connection" +#~ msgstr "Изисква съществуваща мрежова връзка" -#: ../properties/nm-ppp-properties.c:45 -msgid "pppd tunnel (PPTP, BTGPRS, Dialup)" -msgstr "Тунел по pppd (PPTP, BTGPRS, връзка по телефона)" +#~ msgid "Routing" +#~ msgstr "Маршрутизация" -#: ../properties/nm-ppp-properties.c:134 -msgid "Name" -msgstr "Име" +#~ msgid "Serial Options" +#~ msgstr "Настройки на серийния порт" -#: ../properties/nm-ppp-properties.c:146 -msgid "PPTP Server" -msgstr "Сървър за PPTP" +#~ msgid "Service providers GPRS access point from device config" +#~ msgstr "" +#~ "Точката за достъп на доставчика на услуги по GPRS от настройките на " +#~ "устройството" -#: ../properties/nm-ppp-properties.c:151 -msgid "Telephone Number" -msgstr "Телефонен номер" +#~ msgid "Service providers IP address" +#~ msgstr "Адрес по IP на доставчика на услуги" -#: ../properties/nm-ppp-properties.c:156 -msgid "Bluetooth Address" -msgstr "Адрес по Bluetooth" +#~ msgid "Telephone number to dial" +#~ msgstr "Телефонен номер за набиране" -#: ../properties/nm-ppp-properties.c:161 -msgid "Bluetooth Channel" -msgstr "Канал за Bluetooth" +#~ msgid "" +#~ "This is the friendly name that will be used to identify this network " +#~ "connection, \n" +#~ "e.g. \"Campus VPN\" or \"Corporate Network\"" +#~ msgstr "" +#~ "Име, което се ползва за различаването на връзката към тази мрежа, напр. " +#~ "„Корпоративна мрежа“." -#: ../properties/nm-ppp-properties.c:166 -msgid "GPRS APN" -msgstr "№ на точка за достъп по GPRS" +#~ msgid "Time in seconds between echo requests" +#~ msgstr "Интервал в секунди между заявките „echo“" -#: ../properties/nm-ppp-properties.c:171 -msgid "GPRS IP" -msgstr "IP по GPRS" +#~ msgid "Type:" +#~ msgstr "Вид:" -#: ../properties/nm-ppp-properties.c:176 -msgid "GPRS Context No." -msgstr "№ на контекста на GPRS" +#~ msgid "Use Peer DNS" +#~ msgstr "Използване на DNS от съсед" -#: ../properties/nm-ppp-properties.c:181 -msgid "GPRS Packet Type" -msgstr "Вид на пакетите по GPRS" +#~ msgid "When checked the \"refuse-chap\" option is passed to pppd." +#~ msgstr "Когато е избрано, на pppd се подава опцията „refuse-chap“." -#: ../properties/nm-ppp-properties.c:186 -msgid "Use CTS/RTS flow control" -msgstr "Използване на CTS/RTS" +#~ msgid "When checked the \"refuse-eap\" option is passed to pppd." +#~ msgstr "Когато е избрано, на pppd се подава опцията „refuse-eap“." -#: ../properties/nm-ppp-properties.c:191 -msgid "Connect via a modem" -msgstr "Свързване през модем" +#~ msgid "When checked the \"refuse-mschap\" option is passed to pppd." +#~ msgstr "Когато е избрано, на pppd се подава опцията „refuse-mschap“." -#: ../properties/nm-ppp-properties.c:196 -msgid "Require IP to be provided" -msgstr "Изискване на предоставянето на IP" +#~ msgid "When checked the 'lock' option is passed to pppd" +#~ msgstr "Когато е избрано, на pppd се подава опцията „lock“." -#: ../properties/nm-ppp-properties.c:206 -msgid "Use MPPE encryption" -msgstr "Използване на шифриране MPPE" +#~ msgid "When checked the 'require-mppc' option is passed to pppd" +#~ msgstr "Когато е избрано, на pppd се подава опцията „require-mppc“." -#: ../properties/nm-ppp-properties.c:211 -msgid "Use 128 bit MPPE encryption" -msgstr "Използване на 128-битово шифриране MPPE" +#~ msgid "" +#~ "When checked this sets the pppd 'debug' option and adds some extra " +#~ "information from the NetworkManager plugin" +#~ msgstr "" +#~ "Когато е избрано, на pppd се подава опцията „debug“ и се добавя " +#~ "информация от приставката на NetworkManager." -#: ../properties/nm-ppp-properties.c:221 -msgid "Use MPPC compression" -msgstr "Използване на компресия MPPC" +#~ msgid "When checked this sets the pppd 'noipdefault' option" +#~ msgstr "Когато е избрано, на pppd се подава опцията „noipdefault“." -#: ../properties/nm-ppp-properties.c:226 -msgid "Do not use deflate compression" -msgstr "Без използване на компресия deflate" +#~ msgid "When checked this sets the pppd 'usepeerdns' option" +#~ msgstr "Когато е избрано, на pppd се подава опцията „userpeerdns“." -#: ../properties/nm-ppp-properties.c:231 -msgid "Do not use BSD compression" -msgstr "Без използване на компресия BSD" +#~ msgid "" +#~ "When this check box is cleared the \"noauth\" option is passed to pppd." +#~ msgstr "Когато е избрано, на pppd се подава опцията „noauth“." -#: ../properties/nm-ppp-properties.c:236 -msgid "Exclusive device access by pppd" -msgstr "Изключителен достъп до устройството от pppd" +#~ msgid "_Access Point Name:" +#~ msgstr "_Номер на точката за достъп:" -#: ../properties/nm-ppp-properties.c:241 -msgid "Authenticate remote peer" -msgstr "Идентифициране на отдалечен съсед" +#~ msgid "_Channel:" +#~ msgstr "_Канал:" -#: ../properties/nm-ppp-properties.c:256 -msgid "Refuse MSCHAP" -msgstr "Отказване на MSCHAP" +#~ msgid "_Context Num" +#~ msgstr "Но_мер на контекста" -#: ../properties/nm-ppp-properties.c:261 -msgid "Maximum transmit unit (in bytes)" -msgstr "Максимален пакет за предаване (в байтове)" +#~ msgid "_Custom PPP options:" +#~ msgstr "_Допълнителни опции на PPP" -#: ../properties/nm-ppp-properties.c:266 -msgid "Maximum receive unit (in bytes)" -msgstr "Максимален пакет за приемане (в байтове)" +#~ msgid "_Device Address:" +#~ msgstr "_Адрес на устройството:" -#: ../properties/nm-ppp-properties.c:271 -msgid "Number of failed LCP echos to cause disconnect" -msgstr "" -"Брой неуспешни заявки echo по LCP, които да предизвикат прекъсване на " -"връзката" +#~ msgid "_IP Address:" +#~ msgstr "А_дрес по IP" -#: ../properties/nm-ppp-properties.c:276 -msgid "Interval (in seconds) at which to issue LCP echos" -msgstr "Интервал (в секунди) между две последователни заявки echo по LCP" +#~ msgid "_Import Saved Configuration..." +#~ msgstr "_Внасяне на запазени настройки…" -#: ../properties/nm-ppp-properties.c:281 -msgid "Interval (in milliseconds) to wait before connecting." -msgstr "Интервал (в милисекунди) преди да се установи връзка." +#~ msgid "_Only use VPN connection for these addresses" +#~ msgstr "Да се използва само връзката през _ВЧМ за тези адреси" -#: ../properties/nm-ppp-properties.c:286 -msgid "Custom PPP options" -msgstr "Допълнителни опции за PPP" +#~ msgid "_Packet Type" +#~ msgstr "Вид _пакет" -#: ../properties/nm-ppp-properties.c:296 -msgid "Use Peer DNS over the Tunnel" -msgstr "Използване на DNS от съсед по тунел" +#~ msgid "_Telephone Number:" +#~ msgstr "_Телефонен номер:" -#: ../properties/nm-ppp-properties.c:302 -msgid "Specific networks available" -msgstr "Налични са специфични мрежи" +#~ msgid "connect-delay" +#~ msgstr "забавяне при свързване" -#: ../properties/nm-ppp-properties.c:308 -msgid "Limit to specific networks" -msgstr "Ограничаване до специфични мрежи" +#~ msgid "pppd tunnel (PPTP, BTGPRS, Dialup)" +#~ msgstr "Тунел по pppd (PPTP, BTGPRS, връзка по телефона)" -#: ../properties/vpnui_impl.c:229 -#, c-format -msgid "The following '%s' connection will be created:" -msgstr "Ще бъде създадена следната връзка „%s“:" +#~ msgid "Name" +#~ msgstr "Име" -#: ../properties/vpnui_impl.c:242 -#, c-format -msgid "\t%s: %s\n" -msgstr "\t%s: %s\n" +#~ msgid "PPTP Server" +#~ msgstr "Сървър за PPTP" -#: ../properties/vpnui_impl.c:245 -msgid "The connection details can be changed using the \"Back\" button." -msgstr "Настройките на връзката могат да се редактират с бутона „Назад“." +#~ msgid "Telephone Number" +#~ msgstr "Телефонен номер" -#: ../properties/vpnui_impl.c:317 -msgid "Select file to import" -msgstr "Избор на файл за внасяне" +#~ msgid "Bluetooth Address" +#~ msgstr "Адрес по Bluetooth" -#. printf ("in impl_export\n"); -#: ../properties/vpnui_impl.c:462 -msgid "Save as..." -msgstr "Запазване като..." +#~ msgid "Bluetooth Channel" +#~ msgstr "Канал за Bluetooth" -#: ../properties/vpnui_impl.c:491 -#, c-format -msgid "A file named \"%s\" already exists." -msgstr "Файл с име „%s“ вече съществува." +#~ msgid "GPRS APN" +#~ msgstr "№ на точка за достъп по GPRS" + +#~ msgid "GPRS IP" +#~ msgstr "IP по GPRS" + +#~ msgid "GPRS Context No." +#~ msgstr "№ на контекста на GPRS" + +#~ msgid "GPRS Packet Type" +#~ msgstr "Вид на пакетите по GPRS" + +#~ msgid "Use CTS/RTS flow control" +#~ msgstr "Използване на CTS/RTS" + +#~ msgid "Connect via a modem" +#~ msgstr "Свързване през модем" + +#~ msgid "Require IP to be provided" +#~ msgstr "Изискване на предоставянето на IP" + +#~ msgid "Use MPPE encryption" +#~ msgstr "Използване на шифриране MPPE" + +#~ msgid "Use 128 bit MPPE encryption" +#~ msgstr "Използване на 128-битово шифриране MPPE" + +#~ msgid "Do not use deflate compression" +#~ msgstr "Без използване на компресия deflate" + +#~ msgid "Do not use BSD compression" +#~ msgstr "Без използване на компресия BSD" + +#~ msgid "Exclusive device access by pppd" +#~ msgstr "Изключителен достъп до устройството от pppd" + +#~ msgid "Authenticate remote peer" +#~ msgstr "Идентифициране на отдалечен съсед" + +#~ msgid "Maximum transmit unit (in bytes)" +#~ msgstr "Максимален пакет за предаване (в байтове)" + +#~ msgid "Maximum receive unit (in bytes)" +#~ msgstr "Максимален пакет за приемане (в байтове)" + +#~ msgid "Number of failed LCP echos to cause disconnect" +#~ msgstr "" +#~ "Брой неуспешни заявки „echo“ по LCP, които да предизвикат прекъсване на " +#~ "връзката" + +#~ msgid "Interval (in seconds) at which to issue LCP echos" +#~ msgstr "Интервал (в секунди) между две последователни заявки „echo“ по LCP" + +#~ msgid "Interval (in milliseconds) to wait before connecting." +#~ msgstr "Интервал (в милисекунди) преди да се установи връзка." + +#~ msgid "Custom PPP options" +#~ msgstr "Допълнителни опции за PPP" + +#~ msgid "Use Peer DNS over the Tunnel" +#~ msgstr "Използване на DNS от съсед по тунел" + +#~ msgid "Specific networks available" +#~ msgstr "Налични са специфични мрежи" + +#~ msgid "Limit to specific networks" +#~ msgstr "Ограничаване до специфични мрежи" + +#~ msgid "The following '%s' connection will be created:" +#~ msgstr "Ще бъде създадена следната връзка „%s“:" + +#~ msgid "\t%s: %s\n" +#~ msgstr "\t%s: %s\n" + +#~ msgid "The connection details can be changed using the \"Back\" button." +#~ msgstr "Настройките на връзката могат да се редактират с бутона „Назад“." + +#~ msgid "Select file to import" +#~ msgstr "Избор на файл за внасяне" + +#~ msgid "Save as..." +#~ msgstr "Запазване като…" -#: ../properties/vpnui_impl.c:494 -msgid "Do you want to replace it with the one you are saving?" -msgstr "Искате ли да го презапишете?" +#~ msgid "A file named \"%s\" already exists." +#~ msgstr "Файл с име „%s“ вече съществува." -#: ../src/nm-ppp-starter.c:140 -msgid "VPN Connection failed" -msgstr "Неуспешно свързване към ВЧМ" +#~ msgid "Do you want to replace it with the one you are saving?" +#~ msgstr "Искате ли да го презапишете?" diff --git a/vpn-daemons/vpnc/ChangeLog b/vpn-daemons/vpnc/ChangeLog index beec53d72a..0d254c57e6 100644 --- a/vpn-daemons/vpnc/ChangeLog +++ b/vpn-daemons/vpnc/ChangeLog @@ -1,3 +1,11 @@ +2008-08-06 Dan Williams <dcbw@redhat.com> + + * src/nm-vpnc-service-vpnc-helper.c + - (get_routes): fixup for NM route metric changes + + * properties/nm-vpnc.c + - (get_routes, export): fixup for NM route metric changes + 2008-07-27 Dan Williams <dcbw@redhat.com> Patch from Michael Biebl <biebl@debian.org> diff --git a/vpn-daemons/vpnc/po/ChangeLog b/vpn-daemons/vpnc/po/ChangeLog index b8b8615160..e5b1cad9ea 100644 --- a/vpn-daemons/vpnc/po/ChangeLog +++ b/vpn-daemons/vpnc/po/ChangeLog @@ -1,3 +1,8 @@ +2008-08-02 Alexander Shopov <ash@contact.bg> + + * bg.po: Updated Bulgarian translation by + Alexander Shopov <ash@contact.bg> + 2008-07-31 Djihed Afifi <djihed@gmail.com> * ar.po: Updated Arabic Translation by Djihed Afifi. diff --git a/vpn-daemons/vpnc/po/bg.po b/vpn-daemons/vpnc/po/bg.po index 34d4a98336..fc0cc1f665 100644 --- a/vpn-daemons/vpnc/po/bg.po +++ b/vpn-daemons/vpnc/po/bg.po @@ -1,14 +1,14 @@ # Bulgarian translation of NetworkManager-vpnc po-file -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. -# Alexander Shopov <ash@contact.bg>, 2007. +# Alexander Shopov <ash@contact.bg>, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: NetworkManager-vpnc\n" +"Project-Id-Version: NetworkManager-vpnc trunk\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-02-23 00:49+0200\n" -"PO-Revision-Date: 2007-02-23 00:48+0200\n" +"POT-Creation-Date: 2008-08-02 08:59+0300\n" +"PO-Revision-Date: 2008-08-01 07:18+0300\n" "Last-Translator: Alexander Shopov <ash@contact.bg>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" "MIME-Version: 1.0\n" @@ -48,16 +48,16 @@ msgstr "_Запомняне на паролата за тази сесия" msgid "_Save passwords in keyring" msgstr "Запазване на паролата в клю_чодържателя" -#: ../auth-dialog/main.c:161 +#: ../auth-dialog/main.c:182 #, c-format msgid "You need to authenticate to access the Virtual Private Network '%s'." msgstr "Трябва да се идентифицирате, за да ползвате ВЧМ „%s“." -#: ../auth-dialog/main.c:162 +#: ../auth-dialog/main.c:183 msgid "Authenticate VPN" msgstr "Идентифициране пред ВЧМ" -#: ../auth-dialog/main.c:169 +#: ../auth-dialog/main.c:190 msgid "_Group Password:" msgstr "_Парола на групата:" @@ -69,53 +69,47 @@ msgstr "Добавяне, изтриване и редактиране на вр msgid "VPN Connection Manager (vpnc)" msgstr "Управление на връзките към ВЧМ (за vpnc)" -#: ../properties/nm-vpnc.c:84 -msgid "Compatible Cisco VPN client (vpnc)" -msgstr "Клиент съвместим с ВЧМ на Cisco (vpnc)" +#: ../properties/nm-vpnc.c:51 +msgid "Cisco Compatible VPN (vpnc)" +msgstr "ВЧМ съвместима със Cisco (vpnc)" -#: ../properties/nm-vpnc.c:448 -msgid "The following vpnc VPN connection will be created:" -msgstr "Ще бъде създадена следната връзка чрез vpnc:" - -#: ../properties/nm-vpnc.c:450 -#, c-format -msgid "Name: %s" -msgstr "Име: „%s“" +#: ../properties/nm-vpnc.c:52 +msgid "" +"Compatible with various Cisco, Juniper, Netscreen, and Sonicwall IPSec-based " +"VPN gateways." +msgstr "" +"Съвместима с шлюзове предоставящи ВЧМ чрез IPSec на Cisco, Juniper, " +"Netscreen и Sonicwall." -#: ../properties/nm-vpnc.c:453 -#, c-format -msgid "Gateway: %s" -msgstr "Шлюз: %s" +#: ../properties/nm-vpnc.c:204 +msgid "Secure (default)" +msgstr "Сигурна (стандартно)" -#: ../properties/nm-vpnc.c:455 -#, c-format -msgid "Group Name: %s" -msgstr "Име на групата: %s" +#: ../properties/nm-vpnc.c:207 +msgid "Weak (use with caution)" +msgstr "Несигурна (ползвайте с внимание)" -#: ../properties/nm-vpnc.c:459 -#, c-format -msgid "Username: %s" -msgstr "Потребителско име: %s" +#: ../properties/nm-vpnc.c:215 +msgid "None (completely insecure)" +msgstr "Никаква (напълно несигурно)" -#: ../properties/nm-vpnc.c:464 -#, c-format -msgid "Domain: %s" -msgstr "Домейн: %s" +#: ../properties/nm-vpnc.c:260 +msgid "NAT-T (default)" +msgstr "NAT-T (стандартно)" -#: ../properties/nm-vpnc.c:469 -#, c-format -msgid "Routes: %s" -msgstr "Маршрути: %s" +#: ../properties/nm-vpnc.c:267 +msgid "Cisco UDP" +msgstr "UDP на Cisco" -#: ../properties/nm-vpnc.c:473 -msgid "The connection details can be changed using the \"Edit\" button." -msgstr "Настройките на връзката могат да се редактират с бутона „Редактиране“." +#: ../properties/nm-vpnc.c:274 +msgid "Disabled" +msgstr "Изключено" -#: ../properties/nm-vpnc.c:542 +#: ../properties/nm-vpnc.c:698 msgid "TCP tunneling not supported" msgstr "Не се поддържа тунелиране по TCP" -#: ../properties/nm-vpnc.c:544 +#: ../properties/nm-vpnc.c:700 #, c-format msgid "" "The VPN settings file '%s' specifies that VPN traffic should be tunneled " @@ -124,147 +118,169 @@ msgid "" "The connection can still be created, with TCP tunneling disabled, however it " "may not work as expected." msgstr "" -"Файлът с настройки за ВЧМ - „%s“ указва да се ползва тунелиране по TCP, " +"Файлът с настройки за ВЧМ — „%s“ указва да се ползва тунелиране по TCP, " "което не се поддържа в момента от vpnc.\n" "\n" "Връзката ще бъде създадена без тунелиране по TCP, но може да не работи " "според очакванията." -#: ../properties/nm-vpnc.c:565 -msgid "Cannot import settings" -msgstr "Настройките не могат да бъдат внесени." - -#: ../properties/nm-vpnc.c:567 -#, c-format -msgid "The VPN settings file '%s' does not contain valid data." -msgstr "Файлът с настройки за ВЧМ „%s“ не съдържа валидни данни." - -#: ../properties/nm-vpnc.c:584 -msgid "Select file to import" -msgstr "Избор на файл за внасяне" - -#. printf ("in impl_export\n"); -#: ../properties/nm-vpnc.c:744 -msgid "Save as..." -msgstr "Запазване като..." - -#: ../properties/nm-vpnc.c:774 -#, c-format -msgid "A file named \"%s\" already exists." -msgstr "Файл с име „%s“ вече съществува." - -#: ../properties/nm-vpnc.c:777 -msgid "Do you want to replace it with the one you are saving?" -msgstr "Искате ли да го презапишете?" - -#: ../properties/nm-vpnc.c:791 -msgid "Failed to export configuration" -msgstr "Неуспех при изнасяне на настройките" - -#: ../properties/nm-vpnc.c:793 -#, c-format -msgid "Failed to save file %s" -msgstr "Неуспех при запазването на файла „%s“" - #: ../properties/nm-vpnc-dialog.glade.h:1 -msgid "<b>Connection Information</b>" -msgstr "<b>Информация за връзката</b>" +msgid " " +msgstr " " #: ../properties/nm-vpnc-dialog.glade.h:2 -msgid "<b>Connection Name</b>" -msgstr "<b>Име на връзката</b>" +msgid "<b>General</b>" +msgstr "<b>Общи</b>" #: ../properties/nm-vpnc-dialog.glade.h:3 -msgid "<b>Required</b>" -msgstr "<b>Задължителна</b>" +msgid "<b>Optional</b>" +msgstr "<b>Допълнителни</b>" #: ../properties/nm-vpnc-dialog.glade.h:4 -msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" -msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" +msgid "Disable Dead Peer Detection" +msgstr "Изключване на откриването на забилите съседи" #: ../properties/nm-vpnc-dialog.glade.h:5 -msgid "Connection Name" -msgstr "Име на връзката" +msgid "Domain:" +msgstr "Домейн:" #: ../properties/nm-vpnc-dialog.glade.h:6 -msgid "G_roup Name:" -msgstr "Име на _групата:" +msgid "Encryption Method:" +msgstr "Метод на шифриране:" #: ../properties/nm-vpnc-dialog.glade.h:7 -msgid "" -"Name used to identify the connection to the private network, e.g. \"Campus " -"VPN\" or \"Corporate Network\"" -msgstr "" -"_Име, което се ползва за различаването на връзката към частната мрежа, напр. " -"„Корпоративна мрежа“." +msgid "G_roup Name:" +msgstr "Име на _групата:" #: ../properties/nm-vpnc-dialog.glade.h:8 -msgid "Optional" -msgstr "Незадължителна" +msgid "NAT Traversal:" +msgstr "Преминаване на NAT:" #: ../properties/nm-vpnc-dialog.glade.h:9 -msgid "Override _user name" -msgstr "Задаване на друго _потребителско име" +msgid "User name:" +msgstr "Потребителско име:" #: ../properties/nm-vpnc-dialog.glade.h:10 -msgid "" -"Please enter the information provided by your system administrator below. Do " -"not enter your password here as you will be prompted when connecting." -msgstr "" -"Въведете отдолу информацията предоставена от системния ви администратор. Не " -"въвеждайте паролата си. За нея ще бъдете запитани при свързване." +msgid "_Gateway:" +msgstr "_Шлюз:" -#: ../properties/nm-vpnc-dialog.glade.h:11 -msgid "" -"Please note that the file you import is not a Cisco VPN or VPNC " -"configuration file. Ask your adminstrator for the file." -msgstr "" -"Файлът, който внесохте, не е файл с настройки за ВЧМ на Cisco (VPNC). " -"Помолете системния си администратор да ви предостави такъв файл." +#~ msgid "The following vpnc VPN connection will be created:" +#~ msgstr "Ще бъде създадена следната връзка чрез vpnc:" -#: ../properties/nm-vpnc-dialog.glade.h:12 -msgid "Use _domain for authentication" -msgstr "Използване на _домейн за идентификацията" +#~ msgid "Name: %s" +#~ msgstr "Име: „%s“" -#: ../properties/nm-vpnc-dialog.glade.h:13 -msgid "_Gateway:" -msgstr "_Шлюз:" +#~ msgid "Gateway: %s" +#~ msgstr "Шлюз: %s" -#: ../properties/nm-vpnc-dialog.glade.h:14 -msgid "_Import Saved Configuration..." -msgstr "_Внасяне на запазени настройки..." +#~ msgid "Group Name: %s" +#~ msgstr "Име на групата: %s" -#: ../properties/nm-vpnc-dialog.glade.h:15 -msgid "_Only use VPN connection for these addresses" -msgstr "Да се използва само връзката през _ВЧМ за тези адреси" +#~ msgid "Username: %s" +#~ msgstr "Потребителско име: %s" -#: ../src/nm-vpnc-service.c:118 -msgid "" -"The VPN login failed because the user name and password were not accepted." -msgstr "Неуспешно свързване към ВЧМ - името или паролата са отхвърлени." +#~ msgid "Domain: %s" +#~ msgstr "Домейн: %s" -#: ../src/nm-vpnc-service.c:120 -msgid "The VPN login failed because the VPN program could not be started." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ не може да бъде стартирана." +#~ msgid "Routes: %s" +#~ msgstr "Маршрути: %s" -#: ../src/nm-vpnc-service.c:122 -msgid "" -"The VPN login failed because the VPN program could not connect to the VPN " -"server." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ не успя да се свърже със " -"сървъра за ВЧМ." +#~ msgid "The connection details can be changed using the \"Edit\" button." +#~ msgstr "" +#~ "Настройките на връзката могат да се редактират с бутона „Редактиране“." -#: ../src/nm-vpnc-service.c:124 -msgid "" -"The VPN login failed because the VPN configuration options were invalid." -msgstr "Неуспешно свързване към ВЧМ - настройките на ВЧМ са грешни." +#~ msgid "Cannot import settings" +#~ msgstr "Настройките не могат да бъдат внесени." -#: ../src/nm-vpnc-service.c:126 -msgid "" -"The VPN login failed because the VPN program received an invalid " -"configuration from the VPN server." -msgstr "" -"Неуспешно свързване към ВЧМ - програмата за ВЧМ получи грешни настройки от " -"сървъра за ВЧМ." +#~ msgid "The VPN settings file '%s' does not contain valid data." +#~ msgstr "Файлът с настройки за ВЧМ „%s“ не съдържа валидни данни." + +#~ msgid "Select file to import" +#~ msgstr "Избор на файл за внасяне" + +#~ msgid "Save as..." +#~ msgstr "Запазване като…" + +#~ msgid "A file named \"%s\" already exists." +#~ msgstr "Файл с име „%s“ вече съществува." + +#~ msgid "Do you want to replace it with the one you are saving?" +#~ msgstr "Искате ли да го презапишете?" + +#~ msgid "Failed to export configuration" +#~ msgstr "Неуспех при изнасяне на настройките" + +#~ msgid "Failed to save file %s" +#~ msgstr "Неуспех при запазването на файла „%s“" + +#~ msgid "<b>Connection Information</b>" +#~ msgstr "<b>Информация за връзката</b>" + +#~ msgid "<b>Connection Name</b>" +#~ msgstr "<b>Име на връзката</b>" + +#~ msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>" +#~ msgstr "<i>например: 172.16.0.0/16 10.11.12.0/24</i>" + +#~ msgid "Connection Name" +#~ msgstr "Име на връзката" + +#~ msgid "" +#~ "Name used to identify the connection to the private network, e.g. " +#~ "\"Campus VPN\" or \"Corporate Network\"" +#~ msgstr "" +#~ "_Име, което се ползва за различаването на връзката към частната мрежа, " +#~ "напр. „Корпоративна мрежа“." + +#~ msgid "Override _user name" +#~ msgstr "Задаване на друго _потребителско име" + +#~ msgid "" +#~ "Please enter the information provided by your system administrator below. " +#~ "Do not enter your password here as you will be prompted when connecting." +#~ msgstr "" +#~ "Въведете отдолу информацията предоставена от системния ви администратор. " +#~ "Не въвеждайте паролата си. За нея ще бъдете запитани при свързване." + +#~ msgid "" +#~ "Please note that the file you import is not a Cisco VPN or VPNC " +#~ "configuration file. Ask your adminstrator for the file." +#~ msgstr "" +#~ "Файлът, който внесохте, не е файл с настройки за ВЧМ на Cisco (VPNC). " +#~ "Помолете системния си администратор да ви предостави такъв файл." + +#~ msgid "Use _domain for authentication" +#~ msgstr "Използване на _домейн за идентификацията" + +#~ msgid "_Import Saved Configuration..." +#~ msgstr "_Внасяне на запазени настройки…" + +#~ msgid "_Only use VPN connection for these addresses" +#~ msgstr "Да се използва само връзката през _ВЧМ за тези адреси" + +#~ msgid "" +#~ "The VPN login failed because the user name and password were not accepted." +#~ msgstr "Неуспешно свързване към ВЧМ — името или паролата са отхвърлени." + +#~ msgid "The VPN login failed because the VPN program could not be started." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ не може да бъде " +#~ "стартирана." + +#~ msgid "" +#~ "The VPN login failed because the VPN program could not connect to the VPN " +#~ "server." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ не успя да се свърже със " +#~ "сървъра за ВЧМ." + +#~ msgid "" +#~ "The VPN login failed because the VPN configuration options were invalid." +#~ msgstr "Неуспешно свързване към ВЧМ — настройките на ВЧМ са грешни." + +#~ msgid "" +#~ "The VPN login failed because the VPN program received an invalid " +#~ "configuration from the VPN server." +#~ msgstr "" +#~ "Неуспешно свързване към ВЧМ — програмата за ВЧМ получи грешни настройки " +#~ "от сървъра за ВЧМ." diff --git a/vpn-daemons/vpnc/properties/nm-vpnc.c b/vpn-daemons/vpnc/properties/nm-vpnc.c index 19a42cc211..8a97e2f399 100644 --- a/vpn-daemons/vpnc/properties/nm-vpnc.c +++ b/vpn-daemons/vpnc/properties/nm-vpnc.c @@ -547,39 +547,38 @@ get_routes (const char *routelist) substrs = g_strsplit (routelist, " ", 0); for (i = 0; substrs[i] != NULL; i++) { struct in_addr tmp; - char *p, *route; + char *p, *str_route; long int prefix = 32; - route = g_strdup (substrs[i]); - p = strchr (route, '/'); + str_route = g_strdup (substrs[i]); + p = strchr (str_route, '/'); if (!p || !(*(p + 1))) { - g_warning ("Ignoring invalid route '%s'", route); + g_warning ("Ignoring invalid route '%s'", str_route); goto next; } errno = 0; prefix = strtol (p + 1, NULL, 10); if (errno || prefix <= 0 || prefix > 32) { - g_warning ("Ignoring invalid route '%s'", route); + g_warning ("Ignoring invalid route '%s'", str_route); goto next; } /* don't pass the prefix to inet_pton() */ *p = '\0'; - if (inet_pton (AF_INET, route, &tmp) > 0) { - NMSettingIP4Address *addr; + if (inet_pton (AF_INET, str_route, &tmp) > 0) { + NMSettingIP4Route *route; - addr = g_new0 (NMSettingIP4Address, 1); - addr->address = tmp.s_addr; - addr->prefix = (guint32) prefix; - addr->gateway = 0; + route = g_new0 (NMSettingIP4Route, 1); + route->address = tmp.s_addr; + route->prefix = (guint32) prefix; - routes = g_slist_append (routes, addr); + routes = g_slist_append (routes, route); } else - g_warning ("Ignoring invalid route '%s'", route); + g_warning ("Ignoring invalid route '%s'", str_route); next: - g_free (route); + g_free (str_route); } g_strfreev (substrs); @@ -788,16 +787,16 @@ export (NMVpnPluginUiInterface *iface, GSList *iter; for (iter = s_ip4->routes; iter; iter = g_slist_next (iter)) { - NMSettingIP4Address *addr = (NMSettingIP4Address *) iter->data; + NMSettingIP4Route *route = (NMSettingIP4Route *) iter->data; char str_addr[INET_ADDRSTRLEN + 1]; struct in_addr num_addr; if (routes->len) g_string_append_c (routes, ' '); - num_addr.s_addr = addr->address; + num_addr.s_addr = route->address; if (inet_ntop (AF_INET, &num_addr, &str_addr[0], INET_ADDRSTRLEN + 1)) - g_string_append_printf (routes, "%s/%d", str_addr, addr->prefix); + g_string_append_printf (routes, "%s/%d", str_addr, route->prefix); } } diff --git a/vpn-daemons/vpnc/src/nm-vpnc-service-vpnc-helper.c b/vpn-daemons/vpnc/src/nm-vpnc-service-vpnc-helper.c index d392c2e988..7664cb3d01 100644 --- a/vpn-daemons/vpnc/src/nm-vpnc-service-vpnc-helper.c +++ b/vpn-daemons/vpnc/src/nm-vpnc-service-vpnc-helper.c @@ -211,8 +211,8 @@ get_routes (void) GArray *array; char buf[BUFLEN]; struct in_addr network; - guint32 gateway = 0; /* no gateway */ - guint32 prefix; + guint32 next_hop = 0; /* no next hop */ + guint32 prefix, metric = 0; snprintf (buf, BUFLEN, "CISCO_SPLIT_INC_%d_ADDR", i); tmp = getenv (buf); @@ -245,10 +245,11 @@ get_routes (void) prefix = nm_utils_ip4_netmask_to_prefix (netmask.s_addr); } - array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); g_array_append_val (array, network.s_addr); g_array_append_val (array, prefix); - g_array_append_val (array, gateway); + g_array_append_val (array, next_hop); + g_array_append_val (array, metric); g_ptr_array_add (routes, array); } diff --git a/vpn-daemons/vpnc/src/nm-vpnc-service.c b/vpn-daemons/vpnc/src/nm-vpnc-service.c index ba03f03e50..65d695cf20 100644 --- a/vpn-daemons/vpnc/src/nm-vpnc-service.c +++ b/vpn-daemons/vpnc/src/nm-vpnc-service.c @@ -38,6 +38,8 @@ typedef struct { GType type; } ValidProperty; +#define LEGACY_NAT_KEEPALIVE "NAT-Keepalive packet interval" + static ValidProperty valid_properties[] = { { NM_VPNC_KEY_GATEWAY, G_TYPE_STRING }, { NM_VPNC_KEY_ID, G_TYPE_STRING }, @@ -53,6 +55,8 @@ static ValidProperty valid_properties[] = { { NM_VPNC_KEY_DPD_IDLE_TIMEOUT, G_TYPE_INT }, { NM_VPNC_KEY_NAT_TRAVERSAL_MODE, G_TYPE_STRING }, { NM_VPNC_KEY_CISCO_UDP_ENCAPS_PORT, G_TYPE_INT }, + /* Legacy options that are ignored */ + { LEGACY_NAT_KEEPALIVE, G_TYPE_STRING }, { NULL, G_TYPE_NONE } }; |