Commit graph

81 commits

Author SHA1 Message Date
Dan Winship c050fb7cd2 devices, active-connection: port to gdbus 2015-08-10 09:41:26 -04:00
Beniamino Galvani bbbf522941 core,libnm: add 'metered' property to NMDevice 2015-06-09 18:11:25 +02:00
Dan Williams cd3df12c8f vlan: don't fail if parent isn't found at construct time for existing devices
For existing devices, depending on the order that netlink sends interfaces to
us, the parent may be found after the VLAN interface and not be available when
the VLAN interface is constructed.  Instead of failing construction, when a
NMDeviceVlan has no parent keep it unavailable for activation.  Then have
the Manager notify existing devices when a new device is found, and let
NMDeviceVlan find the parent later and become available via that mechanism.

This doesn't apply to VLANs created by NM itself, because the kernel requires
a parent ifindex when creating a VLAN device.  Thus this fix only applies to
VLANs created outside NetworkManager, or existing when NM starts up.
2015-05-06 16:14:24 -05:00
Jiří Klimeš fc6373bea9 device: add nm-plugin-missing property indicating NM device plugin not available
It is useful for indicating that the device type is supported but the required
plugin is not installed.
2015-04-20 10:00:28 +02:00
Dan Williams e165463964 api: add missing device state reason for NewActivation
Fixes: 1ad193a017
2015-04-13 11:30:27 -05:00
Dan Williams d147c26517 core: autoconnect fixes for default-unmanaged devices and property notification
Previously the only thing preventing default-unmanaged devices from
being auto-activated was luck and the fact that they didn't have any
available connections when in the UNMANAGED state.  That's no longer
true, so we must be more explicit about their behavior.

Furthermore it makes no sense to allow default-unmanaged devices
to set priv->autoconnect=TRUE since that is never supposed to
happen, so enforce that both in NM itself and if the change
request comes in over the D-Bus interface.

Lastly, internal priv->autoconnect=TRUE changes never emitted a
property change notification, meaning the NMPolicy would never
schedule an autoconnect check if the device's priv->autoconnect
was set to TRUE as a result of re-activating or waking from sleep.
2014-10-27 13:46:06 -05:00
Jiří Klimeš 3ff1477349 device: add a new D-Bus 'Delete' method for removing software devices 2014-07-22 14:24:42 +02:00
Dan Williams d043094195 wwan: disable autoconnect if the given SIM PIN was wrong
If the given PIN was wrong, we really don't want to try that PIN
again automatically because it might lock the SIM.  To ensure that
doesn't happen, disable autoconnect so that the user must manually
request reconnection.

(this doesn't fix auto-connect-with-a-wrong-PIN completely, as
autoconnect is reset when resuming from sleep, but it's a start)
2014-05-06 21:51:24 -05:00
Dan Williams 6080425088 wwan: use modem states instead of enabled/connected properties
Determining when the NMDeviceModem is available and when different
connections are available is easier if the modem's state is tracked,
instead of using the separate Enabled and Connected properties.
These properties could not accurately represent the SIM lock state
and prevented NetworkManager from making the modem available for
auto-activation when locked, even if a PIN was available.

In this new scheme, the NMDeviceModem is UNAVAILABLE when the
ModemManager modem state is FAILED, UNKNOWN, or INITIALIZING.  It
transitions to the NM DISCONNECTED state when the modem has finished
initializing and has not failed.

Once the NMDeviceModem is in DISCONNECTED state it can be activated
even if the SIM is locked and a PIN is required; the PIN will be
requested when starting activation, either from the connection itself
or via a secrets request.  This makes auto-activation of WWAN
connections possible.

This also allows us to consolidate code dealing with modem enable/disable
into the base NMModem class using the modem state, and to log more modem
information for debugging purposes.
2014-05-06 21:48:55 -05:00
Dan Winship c0254336ce introspection: fix Device.Ip4Address type
https://bugzilla.gnome.org/show_bug.cgi?id=720963
2014-04-25 12:58:12 -04:00
Jiří Klimeš 44bd2275e7 device: add 'mtu' property 2013-12-20 11:37:54 +01:00
Jiří Klimeš 45da352c60 introspection: add missing GENERIC and TEAM device types to nm-device.xml 2013-12-16 10:52:58 +01:00
Dan Williams ab586236e3 core: implement update_connection() for Team 2013-11-08 16:35:18 -06:00
Dan Winship b7300bbe5a core: improve handling of NPAR/SR-IOV devices (rh #804527)
Use the new kernel physical_port_id interface property to recognize
when two devices are just virtual devices sharing the same physical
port, and refuse to bond/team multiple slaves on the same port.
2013-11-06 10:26:16 -05:00
Dan Williams 2e9fde3c28 core: set up and tear down DCB/FCoE when DCB is enabled 2013-10-31 13:29:22 -05:00
Dan Williams 3ee0203b8c api: note that the Ip4Address property is deprecated 2013-06-11 12:48:15 -05:00
Dan Williams 57a2a532ac api: fix location of Bridge device type enum 2013-01-11 15:40:55 -06:00
Thomas Graf cfff5a63d9 bridge: add bridge device type
This adds a new device type 'bridge'. Kernel devices are created
on demand.
2012-11-30 13:21:51 -06:00
Jiří Klimeš 07fc3dcb90 api: add NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED reason and use that 2012-09-24 10:38:26 +02:00
Dan Williams 29fe6ec830 wifi: add SSID_NOT_FOUND reason and use it when we can
When the supplicant starts connecting, or gets disconnected, track
whether it ever starts talking to an AP.  Then if the connection fails
as a result of an initial connection timeout or a link timeout, we
can use SSID_NOT_FOUND when we're reasonably sure the AP doesn't
exist.  Clients can use this to show better error messages.

Note that SSID_NOT_FOUND may only be reported when using nl80211
drivers, as WEXT drivers don't provide the status necessary to
determine whether the network exists or not.
2012-09-20 10:11:36 -05:00
Dan Williams e6061a1e96 api: add a "ModemManager unavailable" device state reason
To be used when MM quits unexpectedly, or isn't running and the
device needs MM.
2012-08-29 17:39:33 -05:00
Nathanael D. Noblet 808136ac02 core: add AvailableConnections property for NMDevice objects
Implements a new property that provides a list of currently
available connections a device could connect to. For example
if a connection for a particular wireless connection exists and
that wireless network appears in the scan list it would show in the
AvailableConnections property of the device.

(dcbw: found a slightly cleaner way to do this; it's a lot like the
check_connection_compatible class method, except it deals with
live network data too.  So convert the subclass methods to
just check additional live network data, and have the base
device class handle adding the connection to the hash and all
the associated signalling.  Also fix a bug where the available
connections were not updated when a device moved from UNAVAILABLE
to available, its available connections were not updated)
2012-08-15 16:50:49 -05:00
Jiří Klimeš f8bef2c10b docs: fix a few documentation errors 2012-06-29 11:49:51 +02:00
Dan Williams 4a2b1d631b api: fix device state reason code enum value
Probably a merge error.
2012-06-28 16:36:16 -05:00
Jiří Klimeš 25592950e9 core: add driver-version, firmware-version properties to NMDevice (bgo #636124)
The info is extracted via SIOCETHTOOL ioctl() syscall using ETHTOOL_GDRVINFO.
This works for most drivers but not all, e.g. for modems. We may figure out how
to get the info for specific devices, and enhance the solution by implementing
specific functions for particular device types later.
2012-06-08 08:55:15 +02:00
Jiří Klimeš 6d9338f2c6 core: add "Autoconnect" property to NMDevice
It is bound to autoconnect_inhibit private variable (has opposite meaning).
While 'Autoconnect' is TRUE (default value) the device can automatically
activate a connection. If it is changed to FALSE, the device will not
auto-activate until 'Autoconnect' is TRUE again.
Disconnect() method sets 'Autoconnect' to FALSE. NMPolicy monitors the property
and schedules auto activation when FALSE->TRUE transition is made.
2012-05-22 17:11:44 +02:00
Pantelis Koukousoulas d125296eb1 adsl: initial PPPoE support for ADSL devices 2012-05-18 15:42:56 -05:00
Dan Winship 49214066a4 Fix capitalization of "InfiniBand"
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.

In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Dan Williams db94e37eb5 core: wait for dependencies before continuing with device activation
Before jumping to activation stage 1, make sure dependencies are activated.
2012-03-01 17:40:17 -06:00
Dan Williams 65a13f9d8a core: convert VLAN interfaces to a device subclass
Many different interface types can support VLANs, including
Infiniband, WiFi, etc.  So we have to create a new device class
for them instead of keeping the support in NMDeviceEthernet.
2012-03-01 17:40:17 -06:00
Dan Williams 0c61a51614 bond: move bond master interfaces to NMDeviceBond
This way clients know it's a bond master, and it allows us to more
cleanly separate the code for bonding and non-bonding cases.
2012-02-16 15:20:50 -06:00
Dan Williams cd2603c713 api: fix various Infiniband introspection XML omissions 2012-02-15 17:32:41 -06:00
Dan Winship ec35d47253 introspection: add missing error description for INFINIBAND_MODE 2012-02-02 12:02:11 -06:00
Thomas Bechtold 775ec828b9 core: add device property "StateReason"
Allows clients to retrieve the reason a device changed to
the given state along with the state itself, preventing
race conditions if the state were retrieved separately
from the reason.  Reason codes were not previously
accessible without listening to the StateChanged signal.
2012-02-02 12:02:11 -06:00
Thomas Bechtold fe5392ccd9 core: add missing device state reasons
Some NMDeviceStateReason 's are not available in
introspection/nm-device.xml

Tom
2012-01-25 11:26:57 -06:00
Dan Williams 459e7b9518 api/core: add ActiveConnection property to device objects
Enables easier traversal of the object hierarchy; if a client is
watching signals on a device they can easily get back to the
parent NMActiveConnection object to grab connection details or
status.
2011-05-26 19:19:32 -05:00
Dan Williams 1c3a67aaa5 api: clarify function and usage of the Device.Udi property 2011-03-15 12:56:19 -05:00
Dan Williams c74dd8b0b7 api: fix mistakenly absent Dhcp6Config device property
It was still on the bus, but not in the introspection for some
reason.
2011-03-10 09:53:07 -06:00
Dan Williams 69f2c75956 api: fix up introspection and header documentation for modem consolidation 2011-03-03 20:16:16 -06:00
Dan Williams c5cc53a557 core: add new SECONDARIES device state for dependent connections
Will be used for things like activating a VPN connection before
signaling that the device is activated, or maybe for bridges and
bonds, to ensure that applications don't think the system has
connectivity before everything is set up.
2011-02-23 10:25:49 -06:00
Dan Williams 7971227011 api: add two more device states (IP_CHECK and DEACTIVATING)
We'll use IP_CHECK for detecting whether we're behind a captive
portal or on a network that does not have access to the Internet.
We'll probably run some variety of plugins during this stage to
help detect this, and possibly handle it for us (auto-login to
captive portal for example).

DEACTIVATING will be used for tearing down network shares or
cleanly closing network sessions when we're able to clean up
an activation.  ie, "pre-down" for Debian.
2011-02-14 17:09:36 -06:00
Dan Williams 915dd85d23 api: update device types to match NetworkManager.h 2011-02-14 16:37:50 -06:00
Dan Williams 763f2f1d01 core: expose device's IP interface when activated
Lets apps find out what the actual kernel interface name is for the
device so they can do fun stuff with it.
2010-06-10 10:16:39 -07:00
Dan Williams ae4b47ca99 core: PolicyKit protect Deactivate and Disconnect 2010-06-04 00:42:10 -07:00
Dan Williams fea6431a20 core/libnm-glib: implement better missing firmware support (rh #594578)
Track missing firmware and ensure the device can't be used when firmware
is missing.  Add a property for missing firmware so that clients can do
something intelligent with this information.
2010-05-25 10:52:25 -07:00
Dan Williams b95c390015 bluetooth: add timeout for bluetooth connection request 2010-03-23 23:07:17 -07:00
Dan Williams 86e4843902 introspection: sync device state reason codes with NetworkManager.h 2010-01-28 12:15:00 -08:00
Dan Williams 99fb844657 core: device disconnection cleanups
Return an error when trying to disconnect an already-disconnected
or deactivated device.
2009-09-18 09:05:11 -07:00
Alexander Sack 2be94b44c3 core: implement manual disconnect feature
In the past networkmanager did not allow to manually disconnect devices.

Manually disconnected devices will not be automatically reconnected until one
of the following events occur:
 1. user activates a connection for the currently disconnected device
 2. network manager awakes from hibernate/suspend
 3. network manager is restarted (e.g. reboot)

Add a Disconnect method to generic NMDevice dbus interface; set a new private
autoconnect_inhibit flag if Disconnect method is called through dbus.
Based on this auto activation for devices gets inhibited until one
of the above events occur.
2009-09-18 17:06:48 +02:00
Dan Williams 393bdd3737 core: generalize unavailable -> disconnected delayed transition
Instead of doing this in every device subclass, do it in the NMDevice
superclass.  nm_device_can_activate() already did the same logic that
each of the subclass device_state_changed() handlers were doing to
figure out whether they could do the transition from unavailable
to disconnected, so just use that in NMDevice and kill lots of code.
2009-09-14 13:24:29 -07:00