Commit Graph

8762 Commits

Author SHA1 Message Date
Colin Walters
34c88dd8e4 man: rewrite NetworkManager.8 and NetworkManager.conf.5 in DocBook
DocBook is not my favorite thing in the world, but it's
<lots-of-emphasis>far</lots-of-emphasis> saner than troff.  Some style
parts cribbed from systemd.

This is preparatory work for actually improving the content of the
man pages.
2013-04-24 11:44:50 -05:00
Pavel Šimerda
a3d6a825df coverage: delete *.gcno on make clean 2013-04-24 14:50:04 +02:00
Jiří Klimeš
8215fd92fc cli: rename 'nmcli dev wifi scan' to 'nmcli dev wifi rescan' (bgo #698241) 2013-04-24 10:22:57 +02:00
Jiří Klimeš
3560024de9 cli: remove obsolete 'nmcli nm'
The functionality is present in 'general', 'networking' and 'radio'.
We changed syntax anyway, so it doesn't make much sense to keep 'nm'.
2013-04-24 10:04:43 +02:00
Jiří Klimeš
3bf97fafe7 cli: rename 'iface' --> 'ifname' in all commands 2013-04-24 10:04:37 +02:00
Jiří Klimeš
5f523d8f4d cli: accept shortcuts for --mode and --escape arguments
--mode tabular | multiline  -->  --mode t | m
--escape yes | no           -->  --escape y | n
2013-04-24 10:04:33 +02:00
Dan Williams
ef151c3f04 core: fix memory leak
get_virtual_iface_name() returns an allocated interface name which
we must free; that wasn't being done when attempting to find the
interface for which a virtual interface needs to be created.  Also
throw in a cleanup for the given-device-doesn't-exist case just to
make it clearer when the interface name is freed.
2013-04-23 14:01:24 -05:00
Jiří Klimeš
ac6543305e config: fix a crash in nm_config_device_get_hwaddr()
get_hw_address (nm_device_get_hw_address()) asserts and then SIGSEGV
happens in nm_utils_hwaddr_ntoa().

Found by pavlix in NM live VM.
2013-04-23 18:47:30 +02:00
Jiří Klimeš
841c259119 libnm-util: make nm_connection_replace_settings_from_connection() safer
When 'connection' and 'new_connection' arguments are the same object make the
function no-op and simply return true. Otherwise 'connection's settings are
removed, making it invalid.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2013-04-22 10:15:53 -05:00
Pavel Šimerda
f5507633f8 platform: bridging and bonding options 2013-04-20 03:43:25 +02:00
Pavel Šimerda
359dc35aa3 platform: setter/getter of /proc/sys and /sys options 2013-04-20 03:43:25 +02:00
Pavel Šimerda
81bf475b78 platform: master and slave devices 2013-04-20 03:43:25 +02:00
Dan Winship
649d2e4c1b libnm-util: fix doc bug in NMSettingIP6Config 2013-04-19 15:37:48 -04:00
Dan Winship
ac50fc2642 build: update Makefile.glib
If a SOURCES variable changes, we need to recheck the generated files,
since a file may have been removed from SOURCES, but still be
referenced in a previously-generated -enum-types.c file, etc. So make
these generated files depend on Makefile.

Also, update spacing of silent rules to match current automake.
2013-04-19 10:52:21 -04:00
Martin Pitt
57a9fb3c89 Use %NULL macro in doc strings
Mass-converted "NULL" to "%NULL" in docstrings with

  find -name '*.c'| xargs sed -i '/^ \*.*[^%]NULL/ s/NULL\b/%NULL/g'
2013-04-19 10:08:17 -04:00
Martin Pitt
6226fb9b59 libnm-util: Fix transfer annotations of nm_{connection,setting}_need_secrets()
The various need_secrets() implementation do allocate a fresh GPtrArray, but
add static strings to them without dup'ing. Thus callers must _not_ free the
array elements, only the array itself. Adjust documentation and annotations
accordingly.

Also adjust the corresponding comment in the goi-list-connections.py example.

https://bugzilla.gnome.org/show_bug.cgi?id=698175
2013-04-19 09:43:56 -04:00
Martin Pitt
d5fb24b5b5 libnm-glib: Make SecretAgent introspectable
Use the correct annotation for vfuncs, so that NMClient.SecretAgent becomes
introspectable.

Use "self" as the first argument of the vfuncs in their declarations, to match
the actual name in nm-secret-agent.c. This avoids warnings from g-ir-scanner.

https://bugzilla.gnome.org/show_bug.cgi?id=698184
2013-04-19 09:40:32 -04:00
Jiří Klimeš
d3ea9ee472 cli: handle NULL gracefully in nmc_arg_is_help() 2013-04-18 12:42:54 +02:00
Jiří Klimeš
4950abfb87 trivial: update comments for 'new' --> 'new_connection' renaming 2013-04-18 11:38:08 +02:00
Jiří Klimeš
7d5df73d76 cli: add nmc_arg_is_help() and use it to save some code lines 2013-04-18 11:25:49 +02:00
Dan Williams
83baf86a27 core: use nm_connection_replace_settings_from_connection()
And consolidate some of the code; we never need to replace the
connection's settings if nothing has changed.
2013-04-17 12:23:34 -05:00
Dan Williams
bafd0d557d libnm-util: add nm_connection_replace_settings_from_connection() (bgo #696387)
Convenience function to replace settings in one conneciton with settings
from another, without having to go through the nm_connection_to_hash()
steps, which are just inefficient and kinda pointless.
2013-04-17 12:23:34 -05:00
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