Adds a new "master" property to NMActiveConnection containing the path
of the master NMDevice if the connection has a master.
Signed-off-by: Thomas Graf <tgraf@redhat.com>
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.
Allow clients to get a device by its IP interface name instead
of having to get the device list and iterate through each one,
and read the interface name to get what they want.
If the client knows the UUID, add a convenience function to get
the connection path directly, instead of having to iterate the
whole connection list and get each connection's details and then
check the UUID.
A convenience so that clients which might key certain operations off
which connections are active (checking work mail only when on VPN for
example) can more easily get which connections are active. This would
allow those apps to store the UUID (which they would already be doing)
and not have to create a Connection proxy and then get the connection
properties just to retrieve the UUID of the connection. Instead they
can now get it from GetAll of the ActiveConnection object, which they
would already be doing.
At some point we'll be passing other info like whether we need
the 802.1x identity too, or unknown CA certificate data for the
Agent to accept, etc. Basically state that instead of only
hints from the setting, we can pass other stuff as well.
These days more and more devices are showing up that support a
number of different access technology families in the same hardware,
like Qualcomm Gobi (CDMA and GSM), Pantech UM190 (CDMA and GSM),
Pantech UML290 (CDMA and LTE), LG VL600 (CDMA and LTE), Sierra
320U (GSM and LTE), etc. The previous scheme of having device
classes based on access technology family simply cannot handle
this hardware and attempting to add LTE to both the CDMA and GSM
device classes would result in a bunch of code duplication that
we don't want. There's a better way...
Instead, combine both CDMA and GSM device classes into a generic
"Modem" device class that provides capabilities indicating what
access technology families a modem supports, and what families
it supports immediately without a firmware reload. (Gobi devices
for example require a firmware reload before they can switch
between GSM and CDMA). This provides the necessary flexibility
to the client and allows us to keep the API stable when the
same consolidation change is made in ModemManager.
The current code doesn't yet allow multi-mode operation internally,
but the API is now what we want it to be and won't need to be
changed.
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.
DISCONNECTING: the only active network connection is now being disconnected
LOCAL, SITE, GLOBAL: one-stop items for level of connectivity, which
we'll use to show when we think we're actually connected to the internet
or behind a captive portal or something
sleep, wake, StateChange, all deprecated in 0.8, are now removed.
sleep & wake are replaced with the Sleep() method, while
StateChange is replaced with the StateChanged signal which has
the same arguments.
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.
If we can authenticate the agent for 'modify' permission, then send
any existing system secrets to it as the user has permission to change
those secrets. This means the agent doesn't have to call GetSecrets()
itself, which means simpler code on the agent side for a slight LoC
hit in NM itself.
This also moves the permissions checking into the NMAgentManager to
check each agent, which is sub-optimal since now the agent manager
has to do PolicyKit stuff, but hey that's life. Agents need secrets,
and we do need to authenticate every agent before we send secrets to
them, and the NMSettingsConnection doesn't know about individual
agents at all.
The Settings.Connection interface is now only provided by NetworkManager
itself since there is only one settings service. NM can validate
requests for secrets internally and thus there's no need to lock down
GetSecrets using a separate D-Bus interface, since PolicyKit provides
that functionality on systems where this is desirable (ie multi-user).
Single-user systems that do not have PolicyKit will inherently trust
the user already, or if not D-Bus auth is flexible enough to lock
down the GetSecrets method individually even if it's not on a separate
D-Bus interface.
Second, since only clients like connection editors or applets will be
calling the GetSecrets method, there's no need for 'hints' or
'request_new' arguments here since this method should never trigger
an interactive secrets request. Only NM should send those requests
when it knows it needs to ask the user, either during connection or
after validating the incoming GetSecrets request. A connection editor
type application should never be able to trigger the normal
"What's your passphrase" dialog thats provided by the secret agent
for that user's session.
Due to limitations in dbus-glib, where one GObject cannot have more
than one introspection XML object attached to it, we used to include
more than one <interface> in the VPNConnection object introspection
XML. This was suboptimal for two reasons:
1) it duplicated the Connection.Active introspection XML which
made it harder for clients to use the introspection data in a
dynamic fashion, besides looking ugly in the docs
2) not many other programs use this feature of dbus-glib, which
means it didn't get a lot of testing, and broke, which sucks
for NM.
To fix this issue, create a base class for NMVpnConnection that
handles the Connection.Active API, and make NMVpnConnection itself
handle just the VPN pieces that it layers on top. This makes
dbus-glib happy because we aren't using two <interface> blocks
in the same introspection XML, and it makes the NM code more
robust because we can re-use the existing Connection.Active
introspection XML in the NMVpnConnectionBase class.
Allows NM to signal to an agent that an in-progress secrets
request is no longer needed. This could happen if the device
for which the request was started was removed, disabled, or the
network being connected to changed, or whatever.
Given connection details, complete the connection as well as possible
using the given specific object and device, add it to system
settings, and activate it all in one method.
Heavily modify Inaky's Intel WiMAX SDK glue (originally from connman)
to be more generic and more thread-safe, and suitable for use with
NetworkManager instead of rolling our own client code. Rewrite the
NMDeviceWimax code to mostly work.
Still to be done: actual connection logic, DHCP handling, spawning
wimaxd if it's not started yet
New connections should not be pushed out in the Updated signal
because signals cannot be restricted to particular clients, and
some clients may not have permission to view the connection.
Upon receiving the Updated signal, clients should re-read the
connection using GetSettings to ensure that the client still
has permissions to view the connection, and to get the updated
settings.
Moves the system settings permissions checking into the core service's
permissions checking, which at the same time enables 3-way permission
reporting (yes, no, auth) instead of the old yes/no that we had for
system settings permissions before. This allows UI to show a lock
icon or such when the user could authenticate to gain the permission.
It also moves the wifi-create permissions' namespace to the main
namespace (not .settings) since they really should be checked before
starting a shared wifi connection, rather than having anything to do
with the settings service.
Just for consistency, make settings related stuff live under the
org.freedesktop.NetworkManager namespace, rather than its own
org.freedesktop.NetworkManagerSettings namespace. Renames are done for
DBus interface names, DBus object paths, and polkit actions.
In continuation of the theme, the removal of user settings services
means that the distinction between NMSysconfigConnection and
NMExportedConnection is no longer needed. Merge NMExportedConnection
into NMSysconfigConnection.
Much as with nm-remote-settings and nm-remote-settings-system, the
removal of user settings services means there is no more need for
separate interfaces for user and system settings services.
In libnm-glib, this commit merges everything in
nm-settings-system-interface into nm-settings-interface. Alongside with
that, we merge everything in the
org.freedesktop.NetworkManagerSettings.System DBus interface into
org.freedesktop.NetworkManagerSettings.
This commit implements MAC cloning feature in NetworkManager. To support that,
'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless
interfaces. The permanent MAC address is obtained when creating the device, and
is used for 'locking' connections to the device. If a cloned MAC is specified
in connection to be activated, the MAC is set to the interface in stage1. While
disconecting, the permanent MAC is set back to the interface.
Default to 'not allowed', distros that need backwards compatibility
can flip this to 'yes' if they need to. At this point, only power
management scripts should call these functions.
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.
Since forever we've used sleep/wake as the way to implement
Networking Enabled. When the state file was introduced to make the
networking and wifi states persistent, we ran into a bug where
a failed suspend (like if the machine ran out of power while
suspended) would result in networking being disabled on reboot
since suspend/resume used the same knob as enable/disable.
This patch adds a distinct call for enable/disable networking
which changes the state file, while sleep/wake no longer change
the state file.
We can change the property's D-Bus signature (and thus API) here
because querying the IP6Config object's properties caused NM to
crash. Apparently we forgot to change the type of the Address
property when we C&P-ed the IP4Config into the IP6Config, and
DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT is certainly the wrong type
to use since the backing object that dbus-glib would marshal
into the ARRAY_OF_ARRAY_OF_UINT wasn't that type, causing a
crash in dbus-glib when a client got the IP6Config.
Due to dbus-glib limitations we still have to keep two copies of this,
and furthermore PropertiesChanged won't yet trigger for the VPN bits
since there's no way to push out signals on a different interface.
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.
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.
Since the new PolicyKit does away with easy checking of authorizations,
we get to implement it by ourselves, but that's OK since we can actually
use it for a lot more stuff. So add the GetPermissions call which returns
the permissions the caller actually has, and a signal informing callers
that their permissions might have changed. Hook this all up to
PolicyKit so it's useful.
Make NMSettingsService implement most of the NMSettingsInterface
API to make subclasses simpler, and consolidate exporting of
NMExportedConnection subclasses in NMSettingsService instead of
in 3 places. Make NMSysconfigSettings a subclass of
NMSettingsService and save a ton of code.
Mark activation requests that contain connections to be assumed,
and use that to short-circuit various parts of the activation
process by not touching various device attributes, since they
are already set up. Also ensure the device is not deactivated
when it initially becomes managed, because that would kill the
connection we are about to assume.
The old NMExportedConnection was used for both client and server-side classes,
which was a mistake and made the code very complicated to follow. Additionally,
all PolicyKit operations were synchronous, and PK operations can block for a
long time (ie for user input) before returning, so they need to be async. But
NMExportedConnection and NMSysconfigConnection didn't allow for async PK ops
at all.
Use this opportunity to clean up the mess and create GInterfaces that both
server and client objects implement, so that the connection editor and applet
can operate on generic objects like they did before (using the interfaces) but
can perform specific operations (like async PK verification of callers) depending
on whether they are local or remote or whatever.
The only thing that doesn't work yet is the system-settings service's
"auto eth" connections for ethernet devices that don't have an existing
connection. Might also have issues with unmanaged devices that can't
provide a MAC address until they are brought up, but we'll see.
Don't do anything with WINS servers (dispatcher scripts installed with
samba could certainly update samba's idea of WINS servers), but at least
provide them so that the VPNs that can get upstream WINS servers can
at least make other stuff aware of them.
* introspection/nm-settings-system.xml
system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- Add a "CanModify" property to indicate if any plugins support
connection modification
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4286 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
introspection/nm-device.xml
- Add device state change reason for carrier changes
* src/nm-device-ethernet.c
- (set_carrier): use the carrier change reason when changing device
state in response to carrier changes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4203 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
introspection/nm-device.xml
include/NetworkManagerVPN.h
- Add a few more state reasons for the device deactivated state
* src/nm-device-interface.c
src/nm-device-interface.h
- (nm_device_interface_deactivate): add a 'reason' argument
* src/nm-device.c
src/nm-device.h
- (nm_device_deactivate, nm_device_take_down): add a 'reason' argument
- (nm_device_state_changed): pass the state change reason to
nm_device_take_down()
- (nm_device_set_managed): take a 'reason' argument, and pass it along
to the state change function
* src/nm-manager.c
src/nm-manager.h
- (remove_one_device, handle_unmanaged_devices, sync_devices,
impl_manager_sleep): pass a reason code to nm_device_set_managed()
- (nm_manager_deactivate_connection): add a 'reason' argument and pass
something reasonable along to VPN deactivation
* src/vpn-manager/nm-vpn-manager.c
src/vpn-manager/nm-vpn-manager.h
- (nm_vpn_manager_deactivate_connection): add a 'reason' argument and
pass that along to nm_vpn_connection_disconnect()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4174 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/vpn-manager/nm-vpn-connection.c: Add a signal handler for the
"Failure" signal from VPN plugins, store the failure reason, and
use it when the state is changed to failure.
* introspection/nm-vpn-plugin.xml: Fix the "Failure" signal's type
description.
* include/NetworkManagerVPN.h (NMVPNConnectionStateReason): Add a new
reason to the end of the list to not break the API.
(NMVPNPluginFailure): Move it here (from libnm-glib/nm-vpn-plugin.h)
so it can be shared by plugins and daemon.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4088 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Implement support for honoring configured and automatic hostnames, and for
setting the configured hostname.
* introspection/nm-ip4-config.xml
src/nm-ip4-config.c
src/nm-ip4-config.h
src/dhcp-manager/nm-dhcp-manager.c
- Remove useless hostname property; it's not really part of the IPv4
config
* introspection/nm-settings-system.xml
libnm-glib/nm-dbus-settings-system.c
libnm-glib/nm-dbus-settings-system.h
- Add SetHostname() call to system settings D-Bus interface
- Add Hostname property to system settings D-Bus interface
- (nm_dbus_settings_system_save_hostname,
nm_dbus_settings_system_get_hostname): implement
* src/nm-device.c
src/nm-device.h
- (nm_device_get_dhcp4_config): implement
* src/nm-manager.c
src/nm-manager.h
- Fetch and track system settings service hostname changes, and proxy
the changes via a GObject property of the manager
* system-settings/src/nm-system-config-interface.c
system-settings/src/nm-system-config-interface.h
- Replace nm_system_config_interface_supports_add() with a capabilities
bitfield
* system-settings/src/nm-system-config-error.c
system-settings/src/nm-system-config-error.h
- Add additional errors
* system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- (get_property, nm_sysconfig_settings_class_init): add hostname
property; first plugin returning a hostname wins
- (impl_settings_add_connection): use plugin capabilities instead of
nm_system_config_interface_supports_add()
- (impl_settings_save_hostname): implement hostname saving
* src/NetworkManagerPolicy.c
- (lookup_thread_run_cb, lookup_thread_worker, lookup_thread_new,
lookup_thread_die): implement an asynchronous hostname lookup thread
which given an IPv4 address tries to look up the hostname for that
address with reverse DNS
- (get_best_device): split out best device code from
update_routing_and_dns()
- (update_etc_hosts): update /etc/hosts with the machine's new hostname
to preserve the 127.0.0.1 reverse mapping that so many things require
- (set_system_hostname): set a given hostname
- (update_system_hostname): implement hostname policy; a configured
hostname (from the system settings service) is used if available,
otherwise an automatically determined hostname from DHCP, VPN, etc.
If there was no automatically determined hostname, reverse DNS of
the best device's IP address will be used, and as a last resort the
hostname 'localhost.localdomain' is set.
- (update_routing_and_dns): use get_best_device(); update the system
hostname when the network config changes
- (hostname_changed): update system hostname if the system settings
service signals a hostname change
- (nm_policy_new): list for system settings service hostname changes
- (nm_policy_destroy): ensure that an in-progress hostname lookup thread
gets told to die
* system-settings/plugins/keyfile/plugin.c
system-settings/plugins/ifcfg-suse/plugin.c
- (get_property, sc_plugin_ifcfg_class_init): implement hostname and
capabilities properties
* system-settings/plugins/ifcfg-fedora/shvar.c
- (svOpenFile): re-enable R/W access of ifcfg files since the plugin
writes out /etc/sysconfig/network now
* system-settings/plugins/ifcfg-fedora/plugin.c
- (plugin_get_hostname): get hostname from /etc/sysconfig/network
- (plugin_set_hostname): save hostname to /etc/sysconfig/network
- (sc_network_changed_cb): handle changes to /etc/sysconfig/network
- (sc_plugin_ifcfg_init): monitor /etc/sysconfig/network for changes
- (get_property, set_property, sc_plugin_ifcfg_class_init): implement
hostname get/set and capabilities get
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4077 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add connection UUIDs, since connection names can be changed, and since
old-style connection IDs could change over the life of the connection. The
UUID should be assigned at connection creation time, be stable for a given
connection, and should be unique among all connections for a given settings
service.
* configure.in
libnm-util/Makefile.am
- Require libuuid
* introspection/nm-exported-connection.xml
- Remove "GetID" method
* libnm-glib/nm-dbus-connection.c
libnm-glib/nm-settings.c
libnm-glib/nm-settings.h
- Remove id-related stuff
* libnm-util/nm-utils.c
libnm-util/nm-utils.h
libnm-util/libnm-util.ver
- (nm_utils_uuid_generate, nm_utils_uuid_generate_from_string): Add
utility functions to generate UUIDs
* libnm-util/nm-setting-connection.c
libnm-util/nm-setting-connection.h
- Add 'uuid' member to the connection setting
- (verify): require valid 'uuid' for a valid connection
* system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c
system-settings/plugins/ifcfg-fedora/reader.c
system-settings/plugins/ifcfg-suse/nm-suse-connection.c
system-settings/plugins/ifcfg-suse/parser.c
system-settings/plugins/keyfile/nm-keyfile-connection.c
system-settings/src/main.c
- Remove id-related stuff
- Give connections UUIDs where needed
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4013 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
introspection/nm-device.xml
- Add a "missing firmware" device state reason
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_device_set_up_down): add a no_firmware argument
- (nm_system_device_set_up_down_with_iface): if the result of setting
IFF_UP is ENOENT, that almost always means missing firmware
* src/backends/NetworkManagerGeneric.c
src/nm-device-ethernet.c
src/nm-device-private.h
src/nm-device-wifi.c
src/nm-device.c
src/nm-device.h
src/nm-hso-gsm-device.c
src/vpn-manager/nm-vpn-connection.c
- Pass no_firmware along; check it where appropriate
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3983 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Revert most of the 'hostname' patch. Too much stuff still breaks when
hostname is updated at runtime. Distros or users who want hostname updates
can use dispatcher scripts to update the hostname if they need it.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3945 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* introspection/nm-settings-system.xml
system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- Add a 'Hostname' property (rw) which represents the configured
hostname and domain of the system, if any
* system-settings/src/nm-system-config-error.c
system-settings/src/nm-system-config-error.h
system-settings/src/nm-system-config-interface.c
system-settings/src/nm-system-config-interface.h
- Add a 'hostname' property to the plugin interface
- Add a method to send updated hostname to plugins to save in their
backing configuration store
* system-settings/plugins/keyfile/nm-keyfile-connection.c
system-settings/plugins/keyfile/plugin.c
system-settings/plugins/keyfile/writer.c
system-settings/plugins/keyfile/writer.h
system-settings/plugins/ifcfg-suse/plugin.c
- Add minimal hostname support
* system-settings/plugins/ifcfg-fedora/plugin.c
- Add support for updating system hostname in /etc/sysconfig/network
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3941 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Add 'routes' property
* libnm-util/nm-setting-vpn.c
libnm-util/nm-setting-vpn.h
- Remove 'routes' property
* libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- 'ignore-dhcp-dns' renamed to 'ignore-auto-dns'
- Add 'ignore-auto-routes' property
- 'routes' exposed over D-Bus is now an array of array of uint (4) to
accomodate route metrics
- 'routes' exposed in C is now a list of NMSettingIP4Route structures
* libnm-util/nm-utils.c
libnm-util/nm-utils.h
- Add helpers for marshalling IP4 routes
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): handle property renames and new route
structure
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route, nm_system_device_set_from_ip4_config,
nm_system_vpn_device_set_from_ip4_config): respect route metrics
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): handle new route structure
* system-settings/plugins/ifcfg-fedora/reader.c
system-settings/plugins/ifcfg-fedora/writer.c
- Handle routes separately from addresses now that routes have a different
format
* introspection/nm-ip4-config.xml
src/nm-ip4-config.c
src/nm-ip4-config.h
- Rename internal routing functions
- 'static-routes' renamed to 'routes'
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3898 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* introspection/Makefile.am
introspection/nm-device.xml
introspection/nm-dhcp4-config.xml
- Add bits for the DHCP4Config property of the device, and the DHCP4Config
itself
* src/nm-device-interface.c
src/nm-device-interface.h
- Add the DHCP4Config property
* src/nm-device.c
- Keep track of DHCP4 options via a new DHCP4Config property and notify
D-Bus clients when it changes
* src/nm-dhcp4-config.c
src/nm-dhcp4-config.h
- Simple object to store DHCP4 options, export them over D-Bus, and
notify when they change
* src/dhcp-manager/nm-dhcp-manager.c
src/dhcp-manager/nm-dhcp-manager.h
- (nm_dhcp_manager_set_dhcp4_config, copy_dhcp4_config_option): copy and
filter server-returned DHCP options into an NMDHCP4Config object
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3829 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Modify the NMDevice::state-changed signal to include the previous state
and reason. Enables the applet to provide more information why device
activation failed.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3819 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* introspection/nm-active-connection.xml
introspection/nm-vpn-connection.xml
libnm-glib/nm-active-connection.c
src/nm-activation-request.c
src/nm-active-connection.h
src/vpn-manager/nm-vpn-connection.c
- Remove "SharedServiceName" and "SharedConnection" bits from the D-Bus
and libnm-glib API since sharing didn't get implemented that way
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3797 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Patch from Tambet Ingo <tambet@gmail.com>
* src/ppp-manager/nm-ppp-manager.c: Add ppp stats monitoring, signal the
changes.
* src/nm-serial-device.c: Monitor "ppp-stats" signals from NMPPPManager. Add
a signal to emit these changes over dbus.
* src/Makefile.am: Genereate nm-serial-device-glue.
* libnm-glib/nm-serial-device.[ch]: Implement.
* libnm-glib/nm-cdma-device.[ch]
libnm-glib/nm-gsm-device.[ch]: Inherit from NMSerialDevice.
* libnm-glib/Makefile.am: Add nm-serial-device.[ch].
* introspection/nm-device-serial.xml: Implement.
* introspection/all.xml: Fix a couple of typos, add nm-device-serial.xml.
* introspection/Makefile.am: Add nm-device-serial.xml.
* include/NetworkManager.h: Add a DBus interface for serial device.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3740 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Use PolicyKit to authorize the system settings' AddConnection method
and the system settings connections' Update and Delete methods.
* libnm-glib/nm-settings.c (impl_exported_connection_update)
(impl_exported_connection_delete, nm_exported_connection_update)
(nm_exported_connection_delete): Return boolean and fill GError
to notify the callers of the reasons why it might have failed.
* libnm-glib/nm-dbus-settings-system.c
(nm_dbus_settings_system_add_connection): Return the error from dbus
call so that the callers can see why it failed.
* libnm-glib/nm-dbus-connection.c (update, delete): Update the
signatures.
* system-settings/src/nm-polkit-helpers.[ch]: Implement.
* system-settings/src/nm-sysconfig-connection.[ch]: Implement. New
abstract base class that checks PolicyKit permissions.
* system-settings/src/dbus-settings.c:
(impl_settings_add_connection): Check the policy before carring out
the request.
* system-settings/plugins/keyfile/nm-keyfile-connection.c:
Inherit from NMSysconfigConnection, check the policies before
allowing updating or removing.
* system-settings/plugins/ifcfg-suse/nm-suse-connection.c:
Inherit from NMSysconfigConnection.
* introspection/nm-exported-connection.xml: Annotate "Update" and
"Delete" methods with async flag so that the implementations can get
access to DBusGMethodInvocation.
* system-settings/src/dbus-settings.c
(settings_add_connection_check_privileges): Implement.
(impl_settings_add_connection): Check the privileges before adding a new
connection. Improve error reporting.
* introspection/nm-settings-system.xml: Make the 'AddConnection' method
async so that the implementation can access DBusGMethodInvocation.
* configure.in: Check for PolicyKit.
* policy/org.freedesktop.network-manager-settings.system.policy:
New file.
* policy/Makefile.am: Install the policy file.
* configure.in: Add 'policy' subdir.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3646 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Implement GKeyFile system settings plugin.
Implement writing system settings (currently supported only by GKeyFile plugin).
* system-settings/src/main.c:
* system-settings/src/dbus-settings.c: Move the communication with plugins
from main.c to dbus-settings.c. Makes it possible to talk to all registered
plugins for adding/updating/removing connections.
* system-settings/src/nm-system-config-interface.c
(nm_system_config_interface_add_connection): Implement
(nm_system_config_interface_update_connection): Implement.
(nm_system_config_interface_remove_connection): Implement.
* system-settings/plugins/keyfile/Makefile.am:
* system-settings/plugins/keyfile/plugin.[ch]:
* system-settings/plugins/keyfile/writer.[ch]:
* system-settings/plugins/keyfile/reader.[ch]: Implement.
* system-settings/plugins/Makefile.am: Add GKeyFile plugin.
* configure.in: Generate GKeyFile Makefile.
* libnm-glib/nm-settings.c (impl_exported_connection_get_id): Fix a memory
corruption, need to duplicate the returned string.
(impl_exported_connection_update): Implement.
(impl_exported_connection_delete): Implement.
* introspection/nm-settings-system.xml: Add "AddConnection" method.
* introspection/nm-exported-connection.xml: Add "Update" and "Delete" methods.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3587 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
- Add NMActiveConnectionState enum
* introspection/nm-active-connection.xml
introspection/nm-vpn-connection.xml
- Add 'State' property for overall active connection state
- Add 'Default' property, when True means this active connection
has the default route
- Add PropertyChanged signals so changes actually go out over the bus
* src/nm-active-connection.h
- Add defines for State & Default properties
* src/nm-activation-request.c
- Add 'state' and 'default' properties, hook up to device 'state-changed'
signal to determine active connection state
* src/vpn-manager/nm-vpn-connection.c
src/vpn-manager/nm-vpn-connection.h
src/vpn-manager/nm-vpn-manager.c
src/vpn-manager/nm-vpn-service.c
- Rename old 'state' to 'vpn-state'
- Rename nm_vpn_connection_get_state() -> nm_vpn_connection_get_vpn_state()
- Add 'state' and 'default' properties, hook up to the vpn connection's
'vpn-state-changed' signal
* libnm-glib/nm-active-connection.c
libnm-glib/nm-active-connection.h
- Add new 'state' and 'default' properties and accessors
* libnm-glib/nm-vpn-connection.c
libnm-glib/nm-vpn-connection.h
- Rename old 'state' property to 'vpn-state'
- Add new 'state' and 'default' properties and accessors
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3582 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Remove exposure of wireless-tools mode types in the API.
* include/NetworkManager.h
- Define NM80211Mode enum
* introspection/generic-types.xml
- Describe NM_802_11_MODE enum
- Remove IW_MODE_* enum
* introspection/nm-access-point.xml
libnm-glib/nm-access-point.c
libnm-glib/nm-access-point.h
- 'mode' is now of type NM80211Mode, a DBUS_TYPE_UINT
* introspection/nm-device-802-11-wireless.xml
libnm-glib/nm-device-802-11-wireless.c
libnm-glib/nm-device-802-11-wireless.h
- 'mode' is now of type NM80211Mode, a DBUS_TYPE_UINT
* libnm-util/nm-setting-wireless.c
src/NetworkManagerAP.c
src/NetworkManagerAP.h
src/nm-device-802-11-wireless.c
src/nm-device-802-11-wireless.h
test/nm-tool.c
- Use NM80211Mode not IW_MODE_*
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3562 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
- Remove the DOWN and CANCELLED device states
- Add UNMANAGED and UNAVAILABLE device states
- Document the device states
* introspection/nm-device.xml
src/nm-device-interface.c
src/nm-device-interface.h
- Add the 'managed' property
* test/nm-tool.c
- (detail_device): print out device state
* src/NetworkManagerSystem.h
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerMandriva.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerSuSE.c
- (nm_system_device_get_system_config, nm_system_device_get_disabled
nm_system_device_free_system_config): remove; they were unused and
their functionality should be re-implemented in each distro's
system settings service plugin
* src/nm-gsm-device.c
src/nm-gsm-device.h
src/nm-cdma-device.c
src/nm-cdma-device.h
- (*_new): take the 'managed' argument
* src/nm-device.c
- (nm_device_set_address): remove, fold into nm_device_bring_up()
- (nm_device_init): start in unmanaged state, not disconnected
- (constructor): don't start device until the system settings service
has had a chance to figure out if the device is managed or not
- (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down):
don't set device state here, let callers handle that as appropriate
- (nm_device_dispose): don't touch the device if it's not managed
- (set_property, get_property, nm_device_class_init): implement the
'managed' property
- (nm_device_state_changed): bring the device up if its now managed,
and deactivate it if it used to be active
- (nm_device_get_managed, nm_device_set_managed): do the right thing
with the managed state
* src/nm-hal-manager.c
- (wired_device_creator, wireless_device_creator, modem_device_creator):
take initial managed state and pass it along to device constructors
- (create_device_and_add_to_list): get managed state and pass to
type creators
* src/nm-device-802-11-wireless.c
- (real_can_activate): fold in most of
nm_device_802_11_wireless_can_activate()
- (can_scan): can't scan in UNAVAILABLE or UNMANAGED
- (link_timeout_cb): instead of deactivating, change device state and
let the device state handler to it
- (real_update_hw_address): clean up
- (state_changed_cb): when entering UNAVAILABLE state, schedule an idle
handler to transition to DISCONNECTED if the device isn't rfkilled
* src/nm-device-802-3-ethernet.c
- (set_carrier): move above callers and get rid of prototype
- (device_state_changed): when entering UNAVAILABLE state, schedule an
idle handler to transition to DISCONNECTED if the device has a
carrier
- (real_update_hw_address): clean up
- (link_timeout_cb, ppp_state_changed): change state instead of calling
deactivation directly as deactivation doesn't change state anymore
* src/NetworkManagerPolicy.c
- (schedule_activate_check): yay, remove wireless_enabled hack since
the NMManager and wireless devices work that out themselves now
- (device_state_changed): change to a switch and update for new device
states
- (device_carrier_changed): remove; device handles this now through
state changes
- (device_added): don't care about carrier any more; the initial
activation check will happen when the device transitions to
DISCONNECTED
* src/nm-manager.c
- (dispose): clear unmanaged devices
- (handle_unmanaged_devices): update unmanaged device list and toggle
the managed property on each device when needed
- (system_settings_properties_changed_cb): handle signals from the
system settings service
- (system_settings_get_unmanaged_devices_cb): handle callback from
getting the unmanaged device list method call
- (query_unmanaged_devices): ask the system settings service for its
list of unmanaged devices
- (nm_manager_name_owner_changed, initial_get_connections): get unmanaged
devices
- (manager_set_wireless_enabled): push rfkill state down to wireless
devices directly and let them handle the necessary state transitions
- (manager_device_state_changed): update for new device states
- (nm_manager_add_device): set initial rfkill state on wireless devices
- (nm_manager_remove_device): don't touch the device if it's unmanaged
- (nm_manager_activate_connection): return error if the device is
unmanaged
- (nm_manager_sleep): handle new device states correctly; don't change
the state of unavailable/unmanaged devices
* libnm-glib/nm-device-802-11-wireless.c
- (state_changed_cb): update for new device states
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* introspection/nm-settings-system.xml
introspection/Makefile.am
- Define the unmanaged devices interface for the system settings service
* system-settings/src/nm-system-config-hal-manager.c
system-settings/src/nm-system-config-hal-manager.h
system-settings/src/nm-system-config-hal-manager-private.h
system-settings/src/Makefile.am
- Add a lightweight HAL manager object for tracking network devices for
the purpose of determining unmanaged devices and which devices need
the default DHCP connections
* system-settings/src/nm-system-config-interface.c
system-settings/src/nm-system-config-interface.h
- (nm_system_config_interface_init): add the HAL manager as an argument
- (nm_system_config_interface_get_unmanaged_devices): implement
- Define 'unmanaged-devices-changed' signal
* system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- Implement the unmanaged devices interface; some cleanups
* system-settings/plugins/ifcfg-suse/plugin.c
- Fixup for plugin interface changes
* system-settings/plugins/ifcfg-fedora/plugin.c
- (get_ether_device_udi): new function; find the device that has
a specified MAC address and return its UDI
- (get_udi_for_connection): new function; try to find the specific
device a connection is locked to, if any
- (device_added_cb, device_removed_cb): update unmanaged device list in
response to HAL events
- (get_unmanaged_devices): new function; return unmanaged device list
- (build_one_connection): set the connection's locked device, if any
- (write_auto_wired_connection): remove
- (kill_old_auto_wired_file): remove the ifcfg-Auto Wired file if found
- (handle_connection_changed): alert listeners that the unmanaged device
list has changed
- (init): fixup for plugin interface changes, implement unmanaged devices
* system-settings/plugins/ifcfg-fedora/parser.c
system-settings/plugins/ifcfg-fedora/parser.h
- (connection_data_free): clean up connection UDI
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3537 4912f4e0-d625-0410-9fb7-b9a5a253dbdc