Commit Graph

179 Commits

Author SHA1 Message Date
Dan Williams
ab586236e3 core: implement update_connection() for Team 2013-11-08 16:35:18 -06:00
Dan Williams
2e9fde3c28 core: set up and tear down DCB/FCoE when DCB is enabled 2013-10-31 13:29:22 -05:00
Thomas Haller
e670528778 dispatcher: fix memory leak in nm-dispatcher-action
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-22 19:53:46 +02:00
Jiří Klimeš
282b9df60d vpn: fix VPN plugin D-Bus errors
The errors were documented as org.freedesktop.NetworkManager.VPN.Error.*,
but the actual values were org.freedesktop.NetworkManager.VPN.Plugin.*

Also update the errors documentation.
2013-09-27 13:26:29 +02:00
Jiří Klimeš
9dff830692 vpn: fix connecting to VPN (bgo #708255)
The ConnectInteractive() -> Connect() fallback code doesn't work, because
_connect_internal() changes the state to NM_VPN_SERVICE_STATE_STARTING before
checking if it can implement ConnectInteractive(), and then when the Connect()
call comes in, the VPN is not in STOPPED or INIT, so it returns an error.

The commit moves setting state to STARTING after the ConnectInteractive() check
availability, in the plugin. We introduce new plugin error and set it when the
the plugin does not implement ConnectInteractive(). NetworkManager uses this
error for ConnectInteractive() -> Connect() fallback.

https://bugzilla.gnome.org/show_bug.cgi?id=708255
2013-09-27 13:26:09 +02:00
Dan Winship
26544f3148 libnm-glib: change "Since: 0.9.10" to "Since: 0.9.8.6" for backported API 2013-09-11 14:10:55 -04:00
Dan Winship
07521da591 core: provide additional network connectivity information
NM_STATE_CONNECTED_SITE doesn't distinguish between "behind a captive
portal" and "limited network connectivity" (ie, connected to a router
that has lost its upstream connection). Add a new NMManager
:connectivity property to provide this information.

Also add a CheckConnectivity method, which can be used to force NM to
re-check the connectivity state, which could be called by a client
after it completed a portal login, or fixed a network problem.
2013-08-28 10:54:08 -04:00
Jiri Pirko
23836e8146 core: add support for team device
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-08-15 10:54:15 -05:00
Dan Winship
a7068f48c5 Revert "platform, devices: add support for vxlan devices"
This requires a very recent kernel to even compile, and the kernel
code is still rapidly changing (eg, adding IPv6 support). So take it
out for now, until it stabilizes.

This reverts commit 7f0f04d106.
2013-06-04 10:30:30 -03:00
Dan Winship
d9e0a7cbd6 platform, devices: add support for gre and gretap devices 2013-06-04 10:01:14 -03:00
Dan Winship
7f0f04d106 platform, devices: add support for vxlan devices 2013-06-04 10:01:14 -03:00
Dan Winship
e9f364548a platform, devices: add support for macvlan and macvtap devices 2013-06-04 10:01:13 -03:00
Dan Winship
add316a403 platform, devices: add support for tun and tap devices 2013-06-04 10:01:13 -03:00
Dan Winship
4416155bea platform, devices: add support for veth devices
https://bugzilla.gnome.org/show_bug.cgi?id=687254
2013-05-24 16:10:03 -03:00
Dan Winship
ce4f2a4bd6 core, libnm-glib: add NMDeviceGeneric
Add NMDeviceGeneric, to provide generic support for unknown device
types, and create NMDeviceGenerics for those devices that NM
previously was ignoring. Allow NMSettingGeneric connections to be
activated on (managed) NMDeviceGenerics.
2013-05-07 12:46:56 -04:00
Dan Winship
e58d86450d core: fix build with glib < 2.34
Using g_clear_pointer() didn't trigger G_UNAVAILABLE warnings because
it's a macro. Fix the build on older glibs by just pulling in the
definition.
2013-04-03 13:11:31 -04:00
Dan Winship
be89197214 core: remove remaining pre-2.32 GLib compat / deprecated usage 2013-02-26 13:07:33 +01:00
Dan Winship
ed9e2d8377 build: avoid GValueArray deprecation warnings
Avoid warnings about GValueArray being deprecated by adding macros
that wrap G_GNUC_BEGIN_IGNORE_DEPRECATIONS /
G_GNUC_END_IGNORE_DEPRECATIONS around the GValueArray calls.
2013-02-26 13:07:33 +01:00
Dan Winship
fc700e9213 core: add NM_WIFI_DEVICE_CAP_ADHOC
Some wireless devices don't support Ad-Hoc mode. Expose this fact in
the wireless capabilities so that clients can disable the hot-spot
option if neither CAP_ADHOC nor CAP_AP is available.

https://bugzilla.gnome.org/show_bug.cgi?id=692869
2013-02-11 12:39:28 -05:00
Jiří Klimeš
d9c1fb176d include: document NM_DEVICE_TYPE_BRIDGE device type 2013-02-11 12:55:05 +01:00
Dan Williams
7258dd270f core: add the NM_ACTIVE_CONNECTION_STATE_DEACTIVATED state
We'll use this to know when to clean up and dispose of the
active connection in the manager.
2012-12-17 17:01:10 -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
Marc Ruiz
811c87f8ae typo: replace all misstyped 'seconadary' strings with 'secondary' 2012-11-04 23:08:02 +01:00
Dan Williams
38e3819b4e libnm-util: clean up setting registration
Make setting type registration less icky; instead of having the
connection register all the settings, have the settings themselves
register that information at library load time.  Putting this sort
of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard
than the home-rolled stuff we had before.  Also document the
priority stuff so when adding new settings, people know what
priority to use.

(cleanups by jklimes)
2012-10-29 15:12:58 -05:00
Jan Luebbe
f9c72dee3e wifi: support ap-mode with wpa_supplicant
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.

If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
2012-10-17 12:08:11 -05: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
Dan Williams
5deecdb871 docs: remove gtkdoc flags directives for NetworkManager.h
They aren't in the right place anyway (they need to be after the
'enum' and before the '{') and they aren't consistently used.  We'll
add them back later for everything if we need them.
2012-08-06 19:53:40 -05:00
Jiří Klimeš
b6c1e7586a include: document NM_DEVICE_TYPE_VLAN 2012-07-11 12:50:42 +02:00
Dan Williams
18b0ba499c libnm-util: ensure address/route types are boxed on glib < 2.26 2012-07-02 13:20:21 -05:00
Dan Williams
74e262b303 agents: add a "user-requested" flag to secret agent requests
Allows agents to provide different behavior depending on whether the
secrets request was initiated by a user (eg by picking a connection
from a UI menu or by 'nmcli con up') or was automatically started by
NetworkManager.

See https://bugzilla.gnome.org/show_bug.cgi?id=660293
2012-06-27 09:42:47 -05:00
Dan Winship
960c1ae8ff vpn: support IPv6 over VPNs
Add new API to allow passing both IPv4 and IPv6 configuration
information from VPN plugins to the backend.

Now instead of a single Ip4Config, a plugin has Config, Ip4Config, and
Ip6Config. "Config" contains information which is neither IPv4 nor
IPv6 specific, and also indicates which of Ip4Config and Ip6Config are
present. Ip4Config now only contains the IPv4-specific bits of
configuration.

There is backward compatibility in both directions: if the daemon is
new and the VPN plugin is old, then NM will notice that the plugin
emitted the Ip4Config signal without having emitted the Config signal
first, and so will assume that it is IPv4-only, and that the generic
bits of configuration have been included with the Ip4Config. If the
daemon is old and the plugin is new, then NMVPNPlugin will copy the
values from the generic config into the IPv4 config as well. (In fact,
NMVPNPlugin *always* does this, because it's harmless, and it's easier
than actually checking the daemon version.)

Currently the VPN is still configured all-at-once, after both IPv4 and
IPv6 information has been received, but the APIs allow for the
possibility of configuring them one at a time in the future.
2012-05-30 14:24:46 -04:00
Dan Winship
f306989734 vpn: allow connecting to an IPv6-based VPN endpoint
Even if a VPN is only tunneling IPv4, you might still be connected to
the tunnel endpoint via IPv6. Allow
NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY to be either an IPv4 or an IPv6
address, and set up an appropriate static route either way.
2012-05-30 13:45:26 -04:00
Pantelis Koukousoulas
d125296eb1 adsl: initial PPPoE support for ADSL devices 2012-05-18 15:42:56 -05:00
Pantelis Koukousoulas
9039c24bf5 adsl: carrier handling and PPPoA support
This is the "juice" of the patch series. Initial cut at carrier handling
(by polling /sys/class/atm/$iface/carrier) and also support for calling
pppd with the proper command-line to achieve a connection.

Also implement the necessary boilerplate for the NM state machine to
be happy with our device.

This is a "duct tape and gum" implementation, i.e., prefer copy&paste
over proper refactoring, due to limited time, but the foundations are
now there, so we can make it work right slowly-slowly :)

With this patch, you can already test carrier management but not yet
make a complete connection.

Relevant extract from logs:
<info> (ueagle-atm0): carrier now ON (device state 20)
<info> (ueagle-atm0): device state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40]

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2012-05-18 15:42:55 -05:00
Pantelis Koukousoulas
0e6f5ce38e adsl: settings and initial "scaffolding"
This patch adds the settings code (NMSettingAdsl) and the initial
"scaffolding" i.e., a tiny stub version of NMDeviceAdsl and the
udev handler code to get the device detected.

With this patch you should be able to see an atm device being detected
by networkmanager in the logs, although of course it doesn't
do anything useful yet.

Extract from the logs:

 [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device detected from udev. Adding ..
(ueagle-atm0): failed to look up interface index
(ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1)
(ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2
(ueagle-atm0): now managed
(ueagle-atm0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
(ueagle-atm0): deactivating device (reason: 2).
 [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to lookup interface index
 [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): (ueagle-atm0): device is available,

In this version, we hack the nm-device.c:nm_device_get_priority() to get better priority
instead of changing the DeviceType enum.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2012-05-18 15:42:55 -05:00
Dan Williams
9c2c4e0591 libnm-glib: fix build on older glib without g_clear_object() 2012-04-27 15:04:29 -05:00
Dan Winship
be18dd06cd libnm-glib: NULL out priv fields on dispose()
In some situations, objects might get used after being disposed, so
clear out their various priv fields so we don't try to access unreffed
objects, freed strings, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=674473
2012-04-23 16:09:58 -04:00
Evan Broder
447342744e vpn: add a new field so VPN plugins can specify multiple domains 2012-03-15 17:10:15 -05:00
Dan Williams
c02702e574 libnm-glib: add NMDeviceVlan
And fix a small bug with bond devices too if their device type
isnt' set at construction time.
2012-03-07 11:45:25 -06: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 Winship
6c38f0cfd1 libnm-glib: add NMDeviceBond
it exists on the server/D-Bus side, so it should exist in libnm-glib too
2012-03-05 15:55:43 -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
Jiří Klimeš
ff249e871f libnm-glib: add NMDeviceOlpcMesh 2012-02-28 10:29:03 +01: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
Thomas Bechtold
32157d5187 libnm-glib: fix missing G_VALUE_INIT to not depend on newer glib 2012-02-07 12:43:39 -06:00
Dan Winship
410ac72325 libnm-glib: fix to not depend on newer glib 2012-02-06 17:29:49 -06:00
Dan Winship
b860c7be4a infiniband: add transport-mode property
Add transport-mode property to NMSettingInfiniband (and parse it
correctly in ifcfg-rh), and set it up properly on the device in
NMDeviceInfiniband.
2012-01-26 09:58:48 -06:00