summaryrefslogtreecommitdiff
path: root/src/nm-manager.h
Commit message (Collapse)AuthorAgeFilesLines
* manager: add a method to get a particular device of given typeLubomir Rintel2017-10-301-1/+6
| | | | And also make the remove_device() method use it behind the scenes.
* manager: add connectivity-check-{available,enabled} properties.James Henstridge2017-08-171-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=785117
* core: implement activation of PPP devicesBeniamino Galvani2017-08-051-0/+2
| | | | | | | | | | | | Add code to NMPppDevice to activate new-style PPPoE connections. This is a bit tricky because we can't create the link as usual in create_and_realize(). Instead, we create a device without ifindex and start pppd in stage2; when pppd reports a new configuration, we rename the platform link to the correct name and set the ifindex into the device. This mechanism is inherently racy, but there is no way to tell pppd to create an arbitrary interface name.
* hostname: cache hostname-manager's hostname propertyThomas Haller2017-05-121-1/+0
| | | | | | | | | | | | | | | | A property preferably only emits a notify-changed signal when the value actually changes and it caches the value (so that between property-changed signals the value is guaranteed not to change). NMSettings and NMManager both already cache the hostname, because NMHostnameManager didn't guarantee this basic concept. Implement it and rely on it from NMSettings and NMPolicy. And remove the copy of the property from NMManager. Move the call for nm_dispatcher_call_hostname() from NMHostnameManager to NMManager. Note that NMPolicy also has a call to the dispatcher when set-transient-hostname returns. This should be cleaned up later.
* core: add activation-type property to active-connectionThomas Haller2017-03-161-0/+1
| | | | | It is still unused, but will be useful to mark a connection whether it is a full activation or assumed.
* core: refactor nm_manager_get_activatable_connections() to return an arrayThomas Haller2017-02-101-1/+4
| | | | ... instead of a GSList.
* manager: avoid an extra path to ac translationLubomir Rintel2017-01-271-1/+1
| | | | | The ac might already be unexported which would lead to a crash. In any case, it's just unnecessary.
* ifcfg-rh: write the master device name even if the master property is an UUIDlr/ifcfg-device-rh1369008Lubomir Rintel2016-12-151-0/+3
| | | | | | | | | | | | | | We used MASTER, BRIDGE and TEAM_MASTER keys for a differnet purpose than the network.service did, confusing the legacy tooling. Let's do our best to write compatible configuration files: * Add *_UUID properties that won't clash with initscripts * Ignore non-*_UUID keys on read if *_UUID is present * If the connection.master is an UUID of a connection with a connection.interface-name, write the uuid into the *_UUID key while setting the non-*_UUID key to the interface name for compatibility https://bugzilla.redhat.com/show_bug.cgi?id=1369091
* build: don't add subdirectories to include search path but require qualified ↵Thomas Haller2016-11-211-1/+1
| | | | | | | | | | | | | | | include Keep the include paths clean and separate. We use directories to group source files together. That makes sense (I guess), but then we should use this grouping also when including files. Thus require to #include files with their path relative to "src/". Also, we build various artifacts from the "src/" tree. Instead of having individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be unified. Previously, the CFLAGS for each artifact differ and are inconsistent in which paths they add to the search path. Fix the inconsistency by just don't add the paths at all.
* core: allow passing an applied connection to nm_act_request_new()Beniamino Galvani2016-09-261-0/+1
| | | | | This is useful for the checkpoint/restore functionality to revert both the applied and the settings connections.
* manager: add nm_manager_get_device_paths()Beniamino Galvani2016-09-261-0/+1
|
* config: store and load device runtime state to fileThomas Haller2016-09-261-0/+2
| | | | | | | | | The data is still unused, the actual fields might change. Note that the actual state we store is subject to change, according to which data we need. The file format is non stable, as the files don't survive reboot. So there is no backward compatibility to maintain and the format can be changed later.
* core: use binary-search for nm_manager_set_capability()Thomas Haller2016-09-231-1/+0
| | | | | | | And drop the unused function nm_manager_check_capability(). I don't think we need such a function server-side, as the server usually has better ways to check whether a capability is supported.
* manager: Add "Capabilities" propertyMarius Vollmer2016-09-231-0/+3
|
* checkpoint: add create, rollback and destroy D-Bus APIBeniamino Galvani2016-08-171-0/+2
| | | | Co-authored-by: Thomas Haller <thaller@redhat.com>
* manager: make NMManager's structs privateThomas Haller2016-04-281-8/+0
| | | | | They are only useful when we want to derive a class from NM_TYPE_MANAGER -- which we clearly don't.
* manager: remove unused signal slots from NMManagerClassThomas Haller2016-04-281-5/+0
|
* config: let NMConfig handle "NetworkManager.state" file (bgo#764474)Thomas Haller2016-04-071-5/+1
| | | | | | | | | | | | | Move reading and writing of the state file to NMConfig ("/var/lib/NetworkManager/NetworkManager.state" file). Originally, I intended to persist more state, thus it made sense to cleanup handling of the state file and move it all at one place. Now, it's not clear that will happen anytime soon. Still, the change is a worthy cleanup, so do it anyway. https://bugzilla.gnome.org/show_bug.cgi?id=764474
* manager: use defines for signal namesThomas Haller2016-04-041-1/+9
|
* manager: export nm_manager_get_connection_iface()Lubomir Rintel2016-02-171-0/+6
| | | | | We'll need the actual device name that should be used for a connection activated on a given device when checking the connection availability.
* manager: refactor construction of manager singleton instanceThomas Haller2016-01-181-0/+1
| | | | | nm_manager_setup() should only call g_object_new() and leave most of the initialization to the GObject constructor.
* core: use define for NMManager's "state-changed" signal nameThomas Haller2015-12-071-0/+1
|
* api/manager: add GetAllDevices() method and AllDevices propertyDan Williams2015-12-041-0/+1
| | | | Returns both realized and un-realized devices.
* manager: export DNS global configuration D-Bus propertyBeniamino Galvani2015-10-011-0/+1
|
* core: separate active and applied connectionLubomir Rintel2015-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clone the connection upon activation. This makes it safe for the user to modify the original connection while it is activated. This involves several changes: - NMActiveConnection gets @settings_connection and @applied_connection. To support add-and-activate, we constructing a NMActiveConnection with no connection set. Previously, we would set the "connection" field to a temporary NMConnection. Now NMManager piggybacks this temporary connection as object-data (TAG_ACTIVE_CONNETION_ADD_AND_ACTIVATE). - get rid of the functions nm_active_connection_get_connection_type() and nm_active_connection_get_connection_uuid(). From their names it is unclear whether this returns the settings or applied connection. The (few) callers should figure that out themselves. - rename nm_active_connection_get_id() to nm_active_connection_get_settings_connection_id(). This function is only used internally for logging. - dispatcher calls now get two connections as well. The applied-connection is used for the connection data, while the settings-connection is used for the connection path. - needs special handling for properties that apply immediately when changed (nm_device_reapply_settings_immediately()). Co-Authored-By: Thomas Haller <thaller@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=724041
* manager: remove WiMAX rfkill flag from NMMangerThomas Haller2015-08-131-2/+1
| | | | | | WiMAX support was dropped in commit 721e917cb6c3f6bea7e856aaed0cd49626887db1. Also, remove support for the WiMAX rfkill flag and only preserve the D-Bus property for backward compatibility.
* core: make NMManager singleton more like othersDan Winship2015-08-101-4/+4
| | | | | | | | | Rename nm_manager_new() to nm_manager_setup(), and change the local @singleton variable to @singleton_instance. (Also, add a local @self variable inside nm_manager_setup().) Also, make NMManager own NMSettings rather than having them both owned by main().
* core: fix NMManager in private-bus-only caseDan Winship2015-08-101-2/+1
| | | | | | | | | | | NMManager was failing to initialize if there was only a private bus, despite the fact that this is exactly the use case that the private bus was added for. The only other potentially-failing code in nm_manager_new() was adding prop_filter to the D-Bus connection, but this can't really fail, so just assert that it doesn't. And now, nm_manager_new() always succeeds, so update the caller for that.
* core: add an NMExportedObject base classDan Winship2015-07-241-5/+3
| | | | | | | | | | | | | | | Add NMExportedObject, make it the base class of all D-Bus-exported types, and move the nm-properties-changed-signal logic into it. (Also, make NMSettings use the same properties-changed code as everything else, which it was not previously doing, presumably for historical reasons). (This is mostly just shuffling code around at this point, but NMExportedObject will be more important in the gdbus port, since gdbus-codegen doesn't do a very good job of supporting objects that export multiple interfaces [as each NMDevice subclass does, for example], so we will need more glue/helper code in NMExportedObject then.)
* all: rename nm-glib-compat.h to nm-glib.h, use everywhereDan Winship2015-07-241-2/+1
| | | | | | | | | | | | | | | | Rather than randomly including one or more of <glib.h>, <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to nm-glib.h, include <gio/gio.h> from there, and then change all .c files in NM to include "nm-glib.h" rather than including the glib headers directly. (Public headers files still have to include the real glib headers, since nm-glib.h isn't installed...) Also, remove glib includes from header files that are already including a base object header file (which must itself already include the glib headers).
* nm-manager: add 'metered' propertyBeniamino Galvani2015-06-091-0/+1
| | | | | | This introduces a global metered property which makes easier for clients to obtain the metered status of the current primary connection.
* iface-helper: add nm-iface-helper for dynamic configure-then-quit supportDan Williams2014-11-071-0/+2
| | | | | | | | | | | | When quitting, the Manager asks each device to spawn the interface helper, which persists and manages dynamic address on the interface after NetworkManager is gone. If the dynamic address cannot be maintaned, the helper quits and the interface's address may be removed when their lifetime runs out. To keep the helper as simple as possible, NetworkManager passes most of the configuration on the command-line, including some properties of the device's current state, which are necessary for the helper to maintain DHCP leases or IPv6 SLAAC addresses.
* core: add PrimaryConnectionType property to NMManager (bgo #739080)Ryan Lortie2014-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | This will provide an extremely easy way for applications to find out what type of connection the system is currently using. They might want to do this to avoid using data if a phone is on a 3G connection, for example. Having this as a separate property provides at least two advantages: 1) it reduces code complexity for those wanting only this one simple piece of information 2) we could allow access to this property (but nothing else) to privilege-separated applications in the future This patch adds the missing nm_active_connection_get_connection_type() which was in the header file but never actually implemented. https://bugzilla.gnome.org/show_bug.cgi?id=739080
* libnm-core, core: move NMManagerError to nm-errorsDan Winship2014-10-221-16/+0
| | | | | | | | | | | | | | | | | Move the definition of NMManagerError to nm-errors, register it with D-Bus, and verify in the tests that it maps correctly. NM_MANAGER_ERROR_INTERNAL gets renamed to NM_MANAGER_ERROR_FAILED for consistency. NM_MANAGER_ERROR_UNMANAGED_DEVICE is dropped since that name doesn't really describe the one place it was previously used in. NM_MANAGER_ERROR_SYSTEM_CONNECTION is dropped because it was't being used. NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE is dropped because it can be replaced with an NM_CONNECTION_ERROR. NM_MANAGER_ERROR_AUTOCONNECT_NOT_ALLOWED is turned into the more generic NM_MANAGER_ERROR_CONNECTION_NOT_AVAILABLE. Also, remove the <tp:possible-errors> sections from nm-manager.xml, since they were completely out of date.
* trivial: spacing and code cleanups in nm-manager.hDan Williams2014-09-111-32/+25
| | | | Remove some dead code and a redundant function.
* all: remove a bunch of unnecessary dbus/dbus-glib includesDan Winship2014-09-031-1/+0
|
* all: fix up multiple-include-guard definesDan Winship2014-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include guard, which meant that nm-test-utils.h could not tell which of them was being included (and so, eg, if you tried to include nm-ip4-config.h in a libnm test, it would fail to compile because nm-test-utils.h was referring to symbols in src/nm-ip4-config.h). Fix this by changing the include guards in the non-API-stable parts of the tree: - libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H - libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__ - src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__ And likewise for all other headers. The two non-"nm"-prefixed headers, libnm/NetworkManager.h and src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and __NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely consistent with the general scheme, do still mostly make sense in isolation.
* core: fill in nm-types.h, clean out other headersDan Winship2014-07-231-5/+5
| | | | | | | | | | | | | | Clean up some of the cross-includes between headers (which made it so that, eg, if you included NetworkManagerUtils.h in a test program, you would need to build the test with -I$(top_srcdir)/src/platform, and if you included nm-device.h you'd need $(POLKIT_CFLAGS)) by moving all GObject struct definitions for src/ and src/settings/ into nm-types.h (which already existed to solve the NMDevice/NMActRequest circular references). Update various .c files to explicitly include the headers they used to get implicitly, and remove some now-unnecessary -I options from Makefiles.
* core: refactor to return const GSList * from nm_manager_get_devices()Thomas Haller2014-05-131-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: provide useful error messages to main() on Manager creation failureDan Williams2014-01-241-0/+1
|
* api/core: add Devices property to the ManagerDan Williams2014-01-231-0/+1
|
* core: move virtual device autoconnect tracking bits out of NMManagerDan Winship2014-01-231-6/+0
| | | | | | | | | | | Virtual devices may be created and destroyed, but we need to keep their autoconnect state across that. Previously this was handled by NMManager, but it really belongs with the other autoconnect tracking in NMPolicy and NMSettingsConnection. This also fixes a bug where NMPolicy would sometimes decide to autoactivate a virtual device connection which NMManager would then have to cancel.
* Revert "core: add Devices property to Manager"Dan Williams2013-11-251-1/+0
| | | | | | | This reverts commit c1768154c4cfdc394cd175396157e5e4c48359af. Not supposed to be committed yet, see dcbw/dbus-properties for the real patch.
* core: add Devices property to ManagerDan Williams2013-11-251-0/+1
| | | | Helps other bindings.
* core: don't allow activating the same connection twice (rh #997998)Dan Winship2013-11-061-0/+2
| | | | | | Change the rules for connection activation so that a given NMConnection can only be used by a single NMActiveConnection at any given time.
* core: pass NMAuthSubject around activation paths instead of uid + dbus senderDan Williams2013-10-311-1/+2
|
* core: make nm_manager_activate_connection() take a Device, not a pathDan Williams2013-10-311-1/+1
| | | | Simpler; everywhere that called it has an NMDevice already anyway.
* core: track autoconnect for removed software devices (rh #1005913)Jiří Klimeš2013-10-241-0/+6
| | | | | | | | | | | | | | | | | When an interface is manually disconnected NM remembers that, and prevents automatic activation of the device. However, software devices are removed when they are disconnected, and thus the state of the device is lost. We need to track autoconnect outside the device - hash table of interface names not allowed to activate automatically. Without that the device would be auto-activated again and again, even if explicitly disconnected. Test case: $ nmcli con add type bond ifname bb con-name bb-con $ nmcli con add type bond-slave ifname em1 con-name b1-con master bb $ nmcli dev disconnect bb https://bugzilla.redhat.com/show_bug.cgi?id=1005913
* core: add NMManager:primary-connection and :activating-connectionDan Winship2013-08-281-0/+2
| | | | | | | | | | Add properties to track the "primary" connection (ie, the active connection with either the default route, or the route to the VPN with the default route), and the active connection that is currently activating, and likely to become the :primary-connection when it completes. https://bugzilla.gnome.org/show_bug.cgi?id=704841
* core: provide additional network connectivity informationDan Winship2013-08-281-0/+1
| | | | | | | | | | | 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.