Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Winship
cb3a5998b3 trivial: .gitignore updates 2013-04-17 11:08:45 -04:00
Dan Winship
1fcb9d6de4 libnm-glib: fix nm_device_check_connection_compatible()
Set the GError when nm_device_check_connection_compatible() fails
because of interface_name mismatch.
2013-04-17 11:00:06 -04:00
Dan Winship
6fac44b872 core: set correct NMDeviceStateReason when IP config fails 2013-04-17 11:00:01 -04:00
Pavel Šimerda
6ede6ed17f trivial: fix typo in comment 2013-04-17 12:30:09 +02:00
Pavel Šimerda
0361b1ca8f trivial: ETHTOOL_GLINK usage explanation 2013-04-17 12:27:29 +02:00
Dan Williams
b6d2ae429f api: clarify expected agent behavior for GetSecrets and saving secrets
Agents are expected to save any new/updated secrets returned to
NetworkManager from a GetSecrets call, as it would be silly to return
those same secrets right back to the agent via SaveSecrets when the
agent is perfectly capable of saving the secrets itself without
round-tripping to NetworkManager and back.
2013-04-16 15:02:17 -05:00
Dan Williams
7b1fe5428a api: clarify some parameters of GetSecrets and CancelGetSecrets 2013-04-15 14:18:14 -05:00
Pavel Šimerda
b292af8e1d trivial: avoid -Wshadow
jklimes: read vs. read(3), use 'num' instead
2013-04-15 13:43:34 +02:00
Pavel Šimerda
5cc26c60ef trivial: use nl_cache_free instead of nl_cache_put
nl_cache_put is not present in older but still supported libnl releases.
2013-04-15 13:46:50 +02:00
Dan Williams
4aa91e22a0 libnm-util: fix mis-freed VLAN priority list element
We want to free the element data, then remove the element from the
list.  Instead the code freed the element data, then treated the
element data pointer as a GSList link, which is completely wrong.
2013-04-11 19:11:51 -05:00
Dan Williams
9f8b7ff51d keyfile: ensure all-default VLAN setting is read correctly
Settings with all-default values are not written to reduce
complexity of the keyfile (and be more human-readable friendly)
and that includes VLAN settings with a VLAN ID of zero.  So
when reading this file back, if there is no 'base type' setting
(eg, the setting specified by the connection::type property)
then just add that setting.  nm_connection_verify() will catch
cases where an empty 'base type' setting is invalid.
2013-04-11 14:55:37 -05:00
Dan Winship
f1d31e36da settings: consider :interface-name in default wired connection matching
The code to check if an ethernet device had a matching connection was
not taking NMSettingConnection:interface-name into account, meaning it
might think a device had a matching connection when that connection
actually only matched a different device.

Fix this by calling nm_setting_connection_get_interface_name() rather
than nm_connection_get_virtual_iface_name() (which would always be
NULL for ethernet connections anyway).

Also, simplify the code a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=696722
2013-04-11 14:54:40 -04:00
Dan Williams
c36200a225 keyfile: use 'ethernet', 'wifi' and 'wifi-security' group names (bgo #696940)
Add these aliases for the setting names '802-3-ethernet',
'802-11-wireless', and '802-11-wireless-security' and write them by
default.  It's much friendlier for administrators to type, and a lot
less ugly.

Also works for:

[connection]
type=ethernet
2013-04-11 10:52:39 -05:00
Jiří Klimeš
fa20c80819 wifi: fix NM crash on mode == NULL
caused by 53d8f49bcd
2013-04-11 15:29:12 +02:00
Dan Williams
302e8ccab0 core: ensure new available connections generate a ProperiesChanged signal (bgo #697743)
The TRUE return got missed in the original commit of the AvailableConnections
code.  _try_add_available_connection() returns TRUE if the connection was
added and FALSE if it wasn't, to allow the caller to optionally emit the
PropertiesChanged signal.  Only TRUE was never returned...
2013-04-10 16:03:00 -05:00
Dan Williams
53d8f49bcd wifi: AP mode connections are always available
Just like adhoc, they don't need to be found in the scan list.
2013-04-10 16:02:35 -05:00
Dan Williams
b62a3abbff api: update Settings documentation to explain NewConnection signal timing (bgo #697742) 2013-04-10 14:21:34 -05:00
Dan Williams
6701181c35 ethernet: don't crash for PPPoE connections with no wired setting
PPPoE connections don't necessarily have a wired setting, so don't
require one here.
2013-04-10 13:37:22 -05:00
Jiří Klimeš
ac697a912e core: fix an assertion in nm_default_wired_connection_new()
nm_device_get_hw_address() has to be called with out_len
initialized to 0.
2013-04-10 18:58:21 +02:00
Dan Williams
caed13b3ef mobile: only clear dbus manager on quit
The private reference to the NMDBusManager is created at
NMModemManager init time, and should only be cleared when the
NMModemManager is disposed.  Instead it was getting cleared
whenever ModemManager1 was seen on the bus, and thus was unavailable
later when it was required to watch for the old ModemManager.
This caused NetworkManager to print warnings about NULL object
access to the console, and could prevent it from noticing when
ModemManager appeared on the system bus.
2013-04-10 10:06:38 -05:00
Dan Williams
b405677a7e todo: remove item about finished VPN IPv6 support 2013-04-10 10:06:38 -05:00
Pavel Šimerda
b636ea86b1 platform: link features (carrier-detect and vlans)
Thanks to Jiří Pírko for help with ethtool features.
2013-04-10 16:40:58 +02:00
Pavel Šimerda
3071cc6511 platform: route management
Extend nm-platform to support IPv4 and IPv6 route management.

Route features:

* Retrieve the list of IPv4 and IPv6 routes
* Add/delete/lookup IPv4 and IPv6 routes
* Flush all non-linklocal routes
2013-04-10 16:40:58 +02:00
Pavel Šimerda
0209db4111 platform: address management
Extend nm-platform to support IPv4 and IPv6 address management.

Address features:

* Retrieve the list of IPv4 and IPv6 addresses
* Add/delete/lookup IPv4 and IPv6 addresses
* Flush all non-linklocal addresses
2013-04-10 16:40:58 +02:00
Pavel Šimerda
c1e53dbf7c platform: link state, carrier and arp 2013-04-10 16:40:58 +02:00
Pavel Šimerda
15fd7cd75e platform: link management
Create the new nm-platform framework and implement link (or interface)
management. The nm-platform serves as the point of contact between
the rest of NetworkManager and the operating system.

There are two backends for nm-platform:

* NMFakePlatform: Fake kernel backend for testing purposes
* NMLinuxPlatform: Linux kernel backend for actual use

A comprehensive testsuite is included and will be extended with new
feature additions. To enable the Linux part of the testsuite, use
--enable-tests=root configure options and run 'make check' as root.
Use --enable-code-coverage for code coverage support.

  ./autogen.sh --enable-tests=root --enable-code-coverage
  make
  make -C src/platform check-code-coverage

Link features:

* Retrieve the list of links
* Translate between indexes and names
* Discover device type
* Add/remove dummy interfaces (for testing)

Thanks to Thomas Graf for helping with libnl3 synchronization issues.
2013-04-10 16:40:58 +02:00
Pavel Šimerda
b530603019 valgrind: distribute valgrind.suppressions 2013-04-10 16:40:58 +02:00
Aleksander Morgado
82f8451c10 modem-manager: wait up to 120s for the connection result
We will very likely get the result of the connection attempt before the 2 mins,
either successful or error, but still we need to explicitly ask to keep the
DBus call open enough time.

This time should be enough to handle both the connection time (usually around
60s max), plus the time needed to register in the network and all the other
Simple.Connect() steps.
2013-04-09 15:48:16 -05:00
Jiří Klimeš
f1ec2aa320 dbus: fix compilation with dbus-glib < 100
private_server_get_connection_owner() is also used in
nm_dbus_manager_new_proxy(), thus it must be available.
2013-04-09 10:35:01 +02:00
Jiří Klimeš
654a79ba88 cli: update bash completion file for the new syntax 2013-04-09 10:31:13 +02:00
Jiří Klimeš
c84315fd12 cli: 'connection delete' - do not stop on invalid connection arguments
Rather report it and continue with the next one. This is the behaviour
e.g. 'rm' command uses.
2013-04-08 16:14:56 -05:00
Jiří Klimeš
b68dbf8e07 man: update nmcli manual page for recent changes 2013-04-08 16:14:11 -05:00
Jiří Klimeš
7dddead250 trivial: format nmcli usage help 2013-04-08 16:14:11 -05:00
Jiří Klimeš
15398f6fc3 trivial: fix some comments and error messages in devices.c 2013-04-08 16:14:11 -05:00
Jiří Klimeš
9ebe727d83 cli: add 'nmcli general logging'
nmcli general logging [level <log level>] [domains <log domains>]

Examples:
nmcli general logging    - print current level and domains values
nmcli general logging level ERR  - change logging level to ERR
nmcli general logging level DEBUG domains DNS  - change logging level to DEBUG and domains to DNS
nmcli g l domains DEFAULT  - set default log domains (the ones active when NM)
2013-04-08 16:14:11 -05:00
Jiří Klimeš
e2d8ca7924 cli: util function to parse command-line arguments
nmc_parse_args() - parse command-line arguments
2013-04-08 16:14:11 -05:00
Jiří Klimeš
9ddd7bc2dc cli: split 'nmcli switch' --> 'nmcli networking' and 'nmcli radio' 2013-04-08 16:14:11 -05:00
Jiří Klimeš
7e7335471c cli: rename HARDWARE -> HW in status/switch fields 2013-04-08 16:14:11 -05:00
Jiří Klimeš
2bafd7a707 cli: split 'general' into 'nmcli switch' and 'nmcli general' commands
They basically contain operations previously available via 'nmcli nm'.
'nmcli nm' is still kept for backward compatibility.

Usage:
nmcli switch  [all|networking|wifi|wwan|wimax [on/off]]
nmcli general [status|permissions]

Examples:
nmcli switch all         - show all switches
nmcli switch wifi off    - switch Wi-Fi off

nmcli g s    - show NM status
nmcli g p    - show NM permissions
2013-04-08 16:14:10 -05:00
Jiří Klimeš
7a8d654691 cli: rename 'device list' -> 'device show' and remove 'iface' keyword
Examples:
nmcli device show         - shows details for all available devices
nmcli device show eth0    - shows details for eth0
nmcli device show em1.25  - shows details for em1.25 VLAN device
2013-04-08 16:12:34 -05:00
Jiří Klimeš
51f055f74c cli: remove iface keyword for 'nmcli device disconnect'
'nmcli disconnect' allows specifying only one interface at a time.
2013-04-08 16:12:34 -05:00
Jiří Klimeš
60f54cd65d cli: 'device disconnect' - ask for interface when missing and '--ask' is present 2013-04-08 16:12:34 -05:00
Jiří Klimeš
0db4b4db90 cli: 'device wifi connect' - ask for SSID/BSSID and password if not provided
when '--ask' parameter is specified
2013-04-08 16:12:34 -05:00
Jiří Klimeš
9e8013314e cli: 'connection delete' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:12:04 -05:00
Jiří Klimeš
786ba05bfa cli: 'connection down' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:12:03 -05:00
Jiří Klimeš
97dbf98cdd cli: 'connection up' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:09:23 -05:00
Jiří Klimeš
b0bee192e8 cli: add nmc_string_to_arg_array() to split a string to arguments array 2013-04-08 16:09:23 -05:00
Jiří Klimeš
7c629bf0f4 cli: nmc_get_user_input() util function for getting user input 2013-04-08 16:09:23 -05:00
Jiří Klimeš
981a687f77 cli: add '--ask' global option
It will be used to ask user for required but missing data/parameters.
2013-04-08 16:09:23 -05:00
Jiří Klimeš
abbde8d76f cli: add 'nmcli device wifi scan' command
This requests NetworkManager to perform scanning for Wi-Fi networks.
NetworkManager scans periodically, but this command can be used by impatient
users who don't want to wait for the next scan.

Direct D-Bus API call example:
gdbus call --system -d org.freedesktop.NetworkManager \
           -o /org/freedesktop/NetworkManager/Devices/2 \
           -m org.freedesktop.NetworkManager.Device.Wireless.RequestScan {}
2013-04-08 16:09:23 -05:00