Commit 8f7aedc7 authored by Dan Williams's avatar Dan Williams

Merge remote branch 'origin/master' into rm-userset

parents fee318ab b368b8fe
......@@ -657,10 +657,11 @@ check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, G
if (s_wired) {
const GByteArray *mac;
const char *device_mac_str;
struct ether_addr *device_mac;
struct ether_addr *device_mac = NULL;
device_mac_str = nm_device_ethernet_get_permanent_hw_address (device);
device_mac = ether_aton (device_mac_str);
if (device_mac_str)
device_mac = ether_aton (device_mac_str);
if (!device_mac) {
g_set_error (error, 0, 0, "Invalid device MAC address.");
return FALSE;
......@@ -706,10 +707,11 @@ check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError **
if (s_wireless) {
const GByteArray *mac;
const char *device_mac_str;
struct ether_addr *device_mac;
struct ether_addr *device_mac = NULL;
device_mac_str = nm_device_wifi_get_permanent_hw_address (device);
device_mac = ether_aton (device_mac_str);
if (device_mac_str)
device_mac = ether_aton (device_mac_str);
if (!device_mac) {
g_set_error (error, 0, 0, "Invalid device MAC address.");
return FALSE;
......
......@@ -84,7 +84,7 @@ dnl Make sha1.c happy on big endian systems
dnl
AC_C_BIGENDIAN
AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva or pardus]))
AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus or linexa]))
if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
......@@ -96,6 +96,7 @@ if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
AC_CHECK_FILE(/etc/linexa-release,with_distro="linexa")
if test "z$with_distro" = "z"; then
with_distro=`lsb_release -is`
fi
......@@ -107,7 +108,7 @@ if test "z$with_distro" = "z"; then
exit 1
else
case $with_distro in
redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus) ;;
redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa) ;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
exit 1
......@@ -165,6 +166,11 @@ if test x"$with_distro" = xpardus; then
AC_DEFINE(TARGET_PARDUS, 1, [Define if you have Pardus])
fi
AM_CONDITIONAL(TARGET_LINEXA, test x"$with_distro" = xlinexa)
if test x"$with_distro" = xlinexa; then
AC_DEFINE(TARGET_LINEXA, 1, [Define if you have linexa])
fi
dnl
dnl Distribution version string
dnl
......@@ -543,6 +549,8 @@ initscript/paldo/Makefile
initscript/paldo/NetworkManager
initscript/Mandriva/Makefile
initscript/Mandriva/networkmanager
initscript/linexa/Makefile
initscript/linexa/networkmanager
introspection/Makefile
man/Makefile
man/NetworkManager.8
......@@ -560,6 +568,7 @@ docs/libnm-util/Makefile
NetworkManager.pc
examples/Makefile
examples/python/Makefile
examples/C/Makefile
])
AC_OUTPUT
......
SUBDIRS = libnm-glib libnm-util
if WITH_DOCS
SUBDIRS = libnm-glib libnm-util
INCLUDES = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util
......
EXTRA_DIST = \
add-connection-glib.c
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* (C) Copyright 2010 Red Hat, Inc.
*/
/*
* The example shows how to call AddConnection() D-Bus method to add
* a connection to system settings service. It uses dbus-glib and libnm-util
* libraries.
*
* Compile with:
* gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util` add-connection-glib.c -o add-connection-glib
*/
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-ip4-config.h>
#include <NetworkManager.h>
#include <nm-utils.h>
#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT))
void add_connection (DBusGProxy *proxy, const char *con_name)
{
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
NMSettingIP4Config *s_ip4;
char *uuid;
GHashTable *hash;
GError *error = NULL;
/* Create a new connection object */
connection = (NMConnection *) nm_connection_new ();
/* Build up the 'connection' Setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
uuid = nm_utils_uuid_generate ();
g_object_set (G_OBJECT (s_con),
NM_SETTING_CONNECTION_UUID, uuid,
NM_SETTING_CONNECTION_ID, con_name,
NM_SETTING_CONNECTION_TYPE, "802-3-ethernet",
NULL);
g_free (uuid);
nm_connection_add_setting (connection, NM_SETTING (s_con));
/* Build up the 'wired' Setting */
s_wired = (NMSettingWired *) nm_setting_wired_new ();
nm_connection_add_setting (connection, NM_SETTING (s_wired));
/* Build up the 'ipv4' Setting */
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
g_object_set (G_OBJECT (s_ip4),
NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,
NULL);
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
hash = nm_connection_to_hash (connection);
/* Call AddConnection with the hash as argument */
dbus_g_proxy_call (proxy, "AddConnection", &error,
DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
G_TYPE_INVALID);
g_hash_table_destroy (hash);
g_object_unref (connection);
}
int main (int argc, char *argv[])
{
DBusGConnection *bus;
DBusGProxy *proxy;
/* Initialize GType system */
g_type_init ();
/* Get system bus */
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
/* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */
proxy = dbus_g_proxy_new_for_name (bus,
NM_DBUS_SERVICE_SYSTEM_SETTINGS,
NM_DBUS_PATH_SETTINGS,
NM_DBUS_IFACE_SETTINGS);
/* Add a connection */
add_connection (proxy, "__Test connection__");
g_object_unref (proxy);
dbus_g_connection_unref (bus);
return 0;
}
SUBDIRS=python
SUBDIRS= \
python \
C
......@@ -23,3 +23,6 @@ endif
if TARGET_MANDRIVA
SUBDIRS += Mandriva
endif
if TARGET_LINEXA
SUBDIRS += linexa
endif
EXTRA_DIST = networkmanager
DISTCLEANFILES = networkmanager
initddir = $(sysconfdir)/rc.d/init.d
initd_SCRIPTS = networkmanager
#!/bin/bash
# Start the networkmanager daemon
#
# Author: Elias <elias@linexa.de>
# [2010-08-20]
# Information about the daemon
title="networkmanager" # No spaces allowed in here
start_after="dbus" # dependencies for start-up
stop_after="xinetd" # dependencies for stop
runlevel="2" # start/stop in this runlevel
sequence="25" # "checkinstall networkmanager enable"
# will create links to:
# /etc/rc.d/rc${runlevel}.d/S${sequence}${title}
# /etc/rc.d/rc${runlevel}.d/S$((100 - ${sequence}))${title}
# check whether daemon is running
# returns 0 if running, >0 if not
check() {
[ -f /var/run/NetworkManager.pid ]
}
# start procedure
start() {
if check ; then
warning "${title} is already running. Type 'service restart ${title}'" # Issue a warning
else
/usr/sbin/NetworkManager &
evaluate_retval "Starting ${title}. " # Print [ done ] or [ failed ] depending on outcome
fi
}
# stop procedure
stop() {
if check ; then # daemon is running
kill $(cat /var/run/NetworkManager.pid)
evaluate_retval "Stopping ${title}." # Print [ done ] or [ failed ] depending on outcome
else # daemon not running
warning "${title} is not running." # Issue a warning
fi
}
# restart procedure
restart() {
stop
sleep 1
start
}
# reload action
reload() {
if check ; then # daemon is running
kill -HUP $(cat /var/run/NetworkManager.pid) &>/dev/null
evaluate_retval "Reloading ${title}." # Print [ done ] or [ failed ] depending on outcome
else # daemon not running
warning "${title} is not running." # Issue a warning
fi
}
......@@ -117,7 +117,7 @@ libnm_glib_la_LIBADD = \
$(GUDEV_LIBS)
libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \
-version-info "6:1:4"
-version-info "6:2:4"
noinst_PROGRAMS = libnm-glib-test
......
......@@ -527,12 +527,17 @@ _nm_object_set_property (NMObject *object,
g_return_if_fail (prop_name != NULL);
g_return_if_fail (G_IS_VALUE (value));
dbus_g_proxy_call_no_reply (NM_OBJECT_GET_PRIVATE (object)->properties_proxy,
"Set",
G_TYPE_STRING, interface,
G_TYPE_STRING, prop_name,
G_TYPE_VALUE, value,
G_TYPE_INVALID);
if (!dbus_g_proxy_call_with_timeout (NM_OBJECT_GET_PRIVATE (object)->properties_proxy,
"Set", 2000, NULL,
G_TYPE_STRING, interface,
G_TYPE_STRING, prop_name,
G_TYPE_VALUE, value,
G_TYPE_INVALID)) {
/* Ignore errors. dbus_g_proxy_call_with_timeout() is called instead of
* dbus_g_proxy_call_no_reply() to give NM chance to authenticate the caller.
*/
}
}
char *
......
......@@ -23,6 +23,7 @@
#include <glib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
#include <glib/gi18n.h>
......
......@@ -19,10 +19,11 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2008 Red Hat, Inc.
* (C) Copyright 2007 - 2010 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
#include <config.h>
#include <string.h>
#include <ctype.h>
#include <dbus/dbus-glib.h>
......
......@@ -24,6 +24,7 @@
*/
#include <string.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
......
This diff is collapsed.
# translation of es.po to Spanish
# translation of NetworkManager.HEAD.po to
# translation of NetworkManager.master.po to
# Traducción de NetworkManager al español.
# Copyright (C) Spanish translation for NetworkManager
# This file is distributed under the same license as the NetworkManager package.
......@@ -12,11 +12,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: es\n"
"Project-Id-Version: NetworkManager.master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=NetworkManager&component=general\n"
"POT-Creation-Date: 2010-09-17 15:25+0000\n"
"PO-Revision-Date: 2010-09-18 11:01+0200\n"
"POT-Creation-Date: 2010-09-21 03:25+0000\n"
"PO-Revision-Date: 2010-09-25 11:36+0200\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n"
"MIME-Version: 1.0\n"
......@@ -94,7 +94,12 @@ msgstr "AUTOCONECTAR"
msgid "READONLY"
msgstr "SÓLOLECTURA"
#: ../cli/src/connections.c:158
#. 7
#: ../cli/src/connections.c:83
msgid "DBUS-PATH"
msgstr "RUTA-DBUS"
#: ../cli/src/connections.c:159
#, c-format
msgid ""
"Usage: nmcli con { COMMAND | help }\n"
......@@ -115,37 +120,37 @@ msgstr ""
"<timeout>]\n"
" down id <id> | uuid <id>\n"
#: ../cli/src/connections.c:198 ../cli/src/connections.c:537
#: ../cli/src/connections.c:199 ../cli/src/connections.c:540
#, c-format
msgid "Error: 'con list': %s"
msgstr "Error: «con list»: %s"
#: ../cli/src/connections.c:200 ../cli/src/connections.c:539
#: ../cli/src/connections.c:201 ../cli/src/connections.c:542
#, c-format
msgid "Error: 'con list': %s; allowed fields: %s"
msgstr "Error: «con list»: %s; campos permitidos: %s"
#: ../cli/src/connections.c:208
#: ../cli/src/connections.c:209
msgid "Connection details"
msgstr "Detalles de conexiones"
#: ../cli/src/connections.c:382 ../cli/src/connections.c:602
#: ../cli/src/connections.c:384 ../cli/src/connections.c:605
msgid "system"
msgstr "sistema"
#: ../cli/src/connections.c:382 ../cli/src/connections.c:602
#: ../cli/src/connections.c:384 ../cli/src/connections.c:605
msgid "user"
msgstr "usuario"
#: ../cli/src/connections.c:384
#: ../cli/src/connections.c:386
msgid "never"
msgstr "nunca"
#. "CAPABILITIES"
#. Print header
#. "WIFI-PROPERTIES"
#: ../cli/src/connections.c:385 ../cli/src/connections.c:386
#: ../cli/src/connections.c:603 ../cli/src/connections.c:606
#: ../cli/src/connections.c:387 ../cli/src/connections.c:388
#: ../cli/src/connections.c:606 ../cli/src/connections.c:609
#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583
#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586
#: ../cli/src/devices.c:587 ../cli/src/settings.c:508
......@@ -164,8 +169,8 @@ msgstr "nunca"
msgid "yes"
msgstr "sí"
#: ../cli/src/connections.c:385 ../cli/src/connections.c:386
#: ../cli/src/connections.c:603 ../cli/src/connections.c:606
#: ../cli/src/connections.c:387 ../cli/src/connections.c:388
#: ../cli/src/connections.c:606 ../cli/src/connections.c:609
#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583
#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586
#: ../cli/src/devices.c:587 ../cli/src/settings.c:508
......@@ -184,272 +189,272 @@ msgstr "sí"
msgid "no"
msgstr "no"
#: ../cli/src/connections.c:458 ../cli/src/connections.c:501
#: ../cli/src/connections.c:461 ../cli/src/connections.c:504
msgid "System connections"
msgstr "Conexiones de sistema"
#: ../cli/src/connections.c:463 ../cli/src/connections.c:514
#: ../cli/src/connections.c:466 ../cli/src/connections.c:517
msgid "User connections"
msgstr "Conexiones de usuario"
#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335
#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360
#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456
#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338
#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363
#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459
#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074
#: ../cli/src/devices.c:1081
#, c-format
msgid "Error: %s argument is missing."
msgstr "Error: falta el argumento %s."
#: ../cli/src/connections.c:488
#: ../cli/src/connections.c:491
#, c-format
msgid "Error: %s - no such connection."
msgstr "Error: %s - no hay tal conexión."
#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384
#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785
#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387
#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785
#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Parámetro desconocido: %s\n"
#: ../cli/src/connections.c:529
#: ../cli/src/connections.c:532
#, c-format
msgid "Error: no valid parameter specified."
msgstr "Error: no se especificó un parámetro válido."
#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577
#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580
#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359
#, c-format
msgid "Error: %s."
msgstr "Error: %s."
#: ../cli/src/connections.c:650
#: ../cli/src/connections.c:653
#, c-format
msgid "Error: 'con status': %s"
msgstr "Error: «con status»: %s"
#: ../cli/src/connections.c:652
#: ../cli/src/connections.c:655
#, c-format
msgid "Error: 'con status': %s; allowed fields: %s"
msgstr "Error: «con status»: %s; campos permitidos: %s"
#: ../cli/src/connections.c:659
#: ../cli/src/connections.c:662
msgid "Active connections"
msgstr "Conexiones activas"
#: ../cli/src/connections.c:1027
#: ../cli/src/connections.c:1030
#, c-format
msgid "no active connection on device '%s'"
msgstr "conexión no activa en el dispositivo «%s»"
#: ../cli/src/connections.c:1035
#: ../cli/src/connections.c:1038
#, c-format
msgid "no active connection or device"
msgstr "conexión o dispositivo no activo"
#: ../cli/src/connections.c:1085
#: ../cli/src/connections.c:1088
#, c-format
msgid "device '%s' not compatible with connection '%s'"
msgstr "dispositivo «%s» incompatible con conexión «%s»"
#: ../cli/src/connections.c:1087
#: ../cli/src/connections.c:1090
#, c-format
msgid "no device found for connection '%s'"
msgstr "no se encontró dispositivo para conexión «%s»"
#: ../cli/src/connections.c:1098
#: ../cli/src/connections.c:1101
msgid "activating"
msgstr "activando"
#: ../cli/src/connections.c:1100
#: ../cli/src/connections.c:1103
msgid "activated"
msgstr "activada"
#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126
#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246
#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129
#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246
#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94
#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473
msgid "unknown"
msgstr "desconocido"
#: ../cli/src/connections.c:1112
#: ../cli/src/connections.c:1115
msgid "VPN connecting (prepare)"
msgstr "Conectando VPN (preparar)"
#: ../cli/src/connections.c:1114
#: ../cli/src/connections.c:1117
msgid "VPN connecting (need authentication)"
msgstr "Conectando VPN (necesita autenticación)"
#: ../cli/src/connections.c:1116
#: ../cli/src/connections.c:1119
msgid "VPN connecting"
msgstr "Conectando VPN"
#: ../cli/src/connections.c:1118
#: ../cli/src/connections.c:1121
msgid "VPN connecting (getting IP configuration)"
msgstr "Conectando VPN (obteniendo configuración IP)"
#: ../cli/src/connections.c:1120
#: ../cli/src/connections.c:1123
msgid "VPN connected"
msgstr "VPN conectada"
#: ../cli/src/connections.c:1122
#: ../cli/src/connections.c:1125
msgid "VPN connection failed"
msgstr "Falló la conexión VPN"
#: ../cli/src/connections.c:1124
#: ../cli/src/connections.c:1127
msgid "VPN disconnected"
msgstr "VPN desconectada"
#: ../cli/src/connections.c:1135
#: ../cli/src/connections.c:1138
msgid "unknown reason"
msgstr "razón desconocida"
#: ../cli/src/connections.c:1137
#: ../cli/src/connections.c:1140
msgid "none"
msgstr "ninguna"
#: ../cli/src/connections.c:1139
#: ../cli/src/connections.c:1142
msgid "the user was disconnected"
msgstr "el usuario estaba desconectado"
#: ../cli/src/connections.c:1141
#: ../cli/src/connections.c:1144
msgid "the base network connection was interrupted"
msgstr "se interrumpió la conexión de red de base"
#: ../cli/src/connections.c:1143
#: ../cli/src/connections.c:1146
msgid "the VPN service stopped unexpectedly"
msgstr "el servicio VPN se detuvo inesperadamente"
#: ../cli/src/connections.c:1145
#: ../cli/src/connections.c:1148
msgid "the VPN service returned invalid configuration"
msgstr "el servicio VPN retornó una configuración no válida"
#: ../cli/src/connections.c:1147
#: ../cli/src/connections.c:1150
msgid "the connection attempt timed out"
msgstr "se agotaron los intentos de conexión"