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.
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
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
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.
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.
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)
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
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
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 {}
The static connection profiles are 'configured'.
So, now we have:
nmcli connection show configured [[id|uuid|path] <ID>]
- shows configured connections
nmcli connection show active [[id|uuid|path|apath] <ID>]
- shows active connections
Without arguments the commands list all connections; with an argument, the details
of the requested connection is shown.
and also allow identifying connetions with 'path' and 'apath' that accepts either
the whole D-Dus path or just an index.
nmcli connection down [id|uuid|path|apath] <ID>
Example:
nmcli connection down con1
nmcli connection down con1 con2 apath 1 id my-wifi
and also allow identifying connetions with 'path' that accepts either the whole
D-Dus path or just an index.
nmcli connection up [id|uuid|path] <ID>
Examples:
nmcli connection up "My Home Wi-Fi"
nmcli connection up id "My Home Wi-Fi"
nmcli connection up path /org/freedesktop/NetworkManager/Settings/18
nmcli connection up path 18
Note:
In order to be able to identify connections with just index number, the 'path'
keyword has to be provided.
and also allow identifying connetions with 'path' that accepts either the whole
D-Dus path or just an index.
nmcli connection delete [id|uuid|path] <ID>
Example:
nmcli connection delete "Wired 1" "Wired 2" "Wired 3"
nmcli connection delete id MyMain id "Quick Test 1" "Quick Test 2" path 23 path 47
And also allow:
- identifying connetions with 'path'/'apath' accepting either the whole D-Dus path
or just an index
- multiple connections on cmdline at once
nmcli connection list [[id|uuid|path] <ID>]
nmcli connection status [[id|uuid|path|apath] <ID>]
Examples:
nmcli c l
nmcli c l "My Wi-Fi 1" airpoirt1 cpath 23 id "My Wi-Fi 2"
nmcli c s
nmcli c s apath 1 ee19b893-e2a7-42cf-ac82-34506f07a05f
Both the VpnState property and the VpnStateChanged dbus signals update the
NMVPNConnection's 'vpn-state' GObject property, so we should ensure that
when either updates it due to a D-Bus event, GObject signals are sent
out for both too.
Though the client shouldn't be calling anything when NM isn't running
(because clients have nm_client_get_manager_running()), make sure
that NMClient never calls a NetworkManager method when NM isn't
on the bus.
Next, ensure NMObject doesn't try to refresh properties when NM isn't
running. Creating an NMClient may trigger a property refresh request,
but if NM isn't running, defer that until NM starts, to ensure that
we don't D-Bus autostart NM.
Third, ensure NMRemoteSettings doesn't attempt to list connections
unless NM is running.
This prevents service activation of NetworkManager in lieu of dbus-glib
learning about DBUS_HEADER_FLAG_NO_AUTO_START.
libnm-glib handles connecting to the bus automatically if NULL
is passed for the bus object. Do that; plus this lets us use
the private bus connection if present.
Use the D-Bus connection helper whenever we need a connection to
NM, which by default tries to use a private connection instead of
the shared bus connection whenever the user is root. Doing this
by default will not change the behavior of libnm-glib, and allows
tools like nmcli and libnm-glib-using clients to work in minimal
environments (those without a bus daemon) by default.
When using a private connection, we need to use dbus_g_proxy_new_for_peer()
because the bus isn't involved. Since many parts of libnm-glib create a
proxy for their corresponding remote object, consolidate the proxy creation
logic.
A later patch will add logic to use a private connection versus a bus-based
one.
A number of places in the code need to get a connection to NM through
D-Bus, and that connection could be either a shared bus connection or
a private connection. Consolidate that logic.
Unfortunately only dbus-glib >= 0.100 correctly supports private
connections (commit 8b7e4a1c4ae055864e26db4addbcc2dc38ee6963 fixes
this problem) so the private connection functionality is not enabled
for older dbus-glib versions.
Allows DHCP to work when a bus daemon isn't running. This also
fixes a race condition where when multiple interfaces are attempting
to get a DHCP lease at the same time, if one DHCP client instance
triggers the callout, that instance gets the bus name, and any
other client triggering the callout at that time will fail because
the bus name is already taken. Since this commit allows using
a private socket, where no process has a bus name, this race is
avoided.
Also move the DHCP helper from callouts/ to src/dhcp-manager/ to
consolidate all the DHCP stuff and clean up some of the helper's
code.