Handle HAL dropouts better; allow NM to start up even if HAL isn't up yet.
* marshallers/nm-marshal.list
- Add marshaller
* src/NetworkManager.c
- (main): let the NMManager handle the NMHalManager
* src/nm-hal-manager.c
src/nm-hal-manager.h
- convert to a GObject, and emit singals when stuff changes. Let the
NMManager handle the signals, instead of the NMHalManager calling
into the NMManager.
* src/nm-manager.c
src/nm-manager.h
- (remove_one_device): consolidate device removals here
- (dispose): use remove_one_device()
- (nm_manager_get_device_by_udi): make static
- (deferred_hal_manager_query_devices): idle handler to query the HAL
manager for devices at startup or wakeup time
- (nm_manager_new): create and monitor the HAL manager
- (hal_manager_udi_added_cb): new function; do what
nm_manager_add_device() used to do when signalled by the hal manager
- (hal_manager_udi_removed_cb): new function; do what
nm_manager_remove_device() used to do when signalled by the hal
manager
- (hal_manager_rfkill_changed_cb): handle rfkill changes from the
hal manager
- (hal_manager_hal_reappeared_cb): when HAL comes back, remove devices
in our device list that aren't known to HAL
- (impl_manager_sleep): on wakeup, re-add devices from an idle handler;
see comments on nm-hal-manager.c::nm_manager_state_changed() a few
commits ago
- (nm_manager_get_device_by_path, nm_manager_is_udi_managed,
nm_manager_activation_pending, nm_manager_wireless_enabled,
nm_manager_wireless_hardware_enabled,
nm_manager_set_wireless_hardware_enabled): remove, unused
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3619 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Fix the device up/down ambiguities. Up/down state used to be a
conglomeration of hardware state (IFF_UP) and any device-specific things
(supplicant, periodic timers, etc) that the device used to indicate
readiness. Unfortunately, if the hardware was already IFF_UP for some
reason, then the device specific stuff wouldn't get run, and the device
would be stuck.
* src/nm-device.c
src/nm-device.h
- Create hw_is_up, hw_bring_up, and hw_take_down
- Rename bring_down -> take_down
- (real_hw_is_up): check interface flags for IFF_UP
- (nm_device_hw_is_up): let subclasses figure out their own HW state
- (nm_device_is_up): make static; only used locally
- (nm_device_hw_bring_up): update the hardware and IPv4 addresses even
if the device is already up; if the device isn't up, bring it up
- (nm_device_hw_take_down): just take down hardware
- (nm_device_bring_up): bring up HW first, then device specific stuff
- (nm_device_take_down): always deactivate device when called; always
try to take hardware down too
- (nm_device_state_changed): take device down when entering unmanaged
state from a higher state
* src/nm-device-802-11-wireless.c
- (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just
check IFF_UP really
- (real_take_down, supplicant_iface_state_cb_handler,
supplicant_iface_connection_state_cb_handler,
supplicant_mgr_state_cb_handler): fix some messages
* src/nm-device-802-3-ethernet.c
- (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just
check IFF_UP really
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3618 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-manager.c
src/nm-manager.h
- (nm_manager_error_get_type): add new error
- (nm_manager_remove_device): don't bother taking down the device here,
the state change from unmanaging the device will do it
- (impl_manager_sleep): move nm_manager_sleep() here since nothing else
uses it; when going to sleep, just unmanage the device instead of
taking it down, because stuff will cleaned up correctly when the
device gets unmanaged
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3617 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-hal-manager.c
- (add_initial_devices): convert to a GSourceFunc prototype
- (nm_manager_state_changed): when coming out of sleep, punt the
device re-addition to an idle handler to let D-Bus events go out
first, fixing a potential dbus-glib assert if the old device was
not yet disposed (due to references held while emitting the D-Bus
signals) but the new device was found, because the mainloop didn't
run between signal emission and add_initial_devices()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3616 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device-802-11-wireless.c
- (link_timeout_cb): don't ask for secrets when disconnected during
association/authentication phase, drivers are still just too crappy
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3613 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* callouts/Makefile.am
callouts/nm-dispatcher-action.c
callouts/nm-dispatcher-action.h
callouts/nm-dispatcher.conf
callouts/nm-dispatcher.xml
callouts/org.freedesktop.nm_dispatcher.service
- Re-implement the dispatcher as a system-bus activated service that
NM calls on-demand, rather than an always running daemon
* src/Makefile.am
- Add callouts dir to includes to pick up dispatcher defines
* src/nm-device.c
- (nm_device_state_changed): call dispatcher on device activated/
deactivated
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_set_vpn_state): call dispatcher when VPN connections
go up and down
* src/NetworkManagerUtils.c
src/NetworkManagerUtils.h
- (nm_utils_call_dispatcher): helper to call dispatcher
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3607 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerPolicy.c
- (update_routing_and_dns): when checking for a gateway, look at the
composite IP4 config, not the connection's ip4-config setting, which
doesn't include DHCP-returned information
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3589 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
* src/nm-activation-request.c
src/nm-activation-request.h
- (dispose): ensure to disconnect from the device's state-changed signal
when appropriate so the signal doesn't get handled by an already
disposed NMActRequest
- (device_state_changed): update is_default here too just to make sure
default is only True when the child device is activated
- (nm_act_request_set_default): new function
* src/NetworkManagerPolicy.c
- (update_routing_and_dns): set 'default' on the active connection which
has the default route and DNS
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3584 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerPolicy.c
- (device_state_changed): update routing and DNS when a device goes
into unmanaged or unavailable states too (like rfkill or carrier loss)
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3583 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
* src/NetworkManagerUtils.c
src/NetworkManagerUtils.h
- (nm_utils_merge_ip4_config): new function; merge settings from an
NMSettingIP4Config to an NMIP4Config object
* src/nm-device.c
- (merge_ip4_config): move to NetworkManagerUtils.c
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_ip4_config_get): merge in user-specified settings
too
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3580 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ppp.c
libnm-util/nm-setting-ppp.h
src/ppp-manager/nm-ppp-manager.c
- Remove the 'usepeerdns' option and always request DNS servers from
the PPP server; the connection chooses to use/override/ignore the
DNS servers returned from the PPP server
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3576 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ppp.c
libnm-util/nm-setting-ppp.h
src/ppp-manager/nm-ppp-manager.c
- Remove the 'require-mppc' option, because pppd doesn't support it and
it seems to have been an erroneous addition to the PPTP plugin in
the first place (from which the ppp-manager is derived)
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3575 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-pppoe.c
- (verify): require a PPP setting too
* src/ppp-manager/nm-ppp-manager.c
- (nm_ppp_manager_start): fail if no PPP setting is present instead of
segfaulting
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3574 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device.c
- (nm_device_state_changed): do deactivation and and promotion to
unavailable here, so that the device gets cleaned up before the
manager runs and starts emitting signals; do the
FAILED->DISCONNECTED transition from an idle handler rather than
immediately to guard against recursion
- (nm_device_deactivate_quickly, nm_device_dispose): stop the
FAILED->DISCONNECTED handler if it's scheduled
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3573 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device-802-11-wireless.c
- (state_changed_cb): clear AP list when device transitions to
unavailable or unmanaged
- (nm_device_802_11_wireless_dispose): remove redundant set_current_ap()
since this is already done in device_cleanup()
- (supplicant_iface_scanned_ap_cb): don't leak new APs when the device
isn't available or managed
- (device_cleanup): use remove_all_aps()
- (remove_all_aps): consolidate code removing all APs
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3572 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-serial-device.c
src/nm-serial-device.h
- (wait_for_reply_got_data): break input into lines, and search each
line for responses _and_ terminator strings; also make sure that
the read loop doesn't continue after the timeout is supposed to fire
- (nm_serial_device_wait_for_reply): take an array of terminators too
* src/nm-gsm-device.c
src/nm-cdma-device.c
- Send terminators to nm_serial_device_wait_for_reply()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3570 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Patch from 陈鑫 <znscnchen@gmail.com>
* src/ppp-manager/nm-pppd-plugin.c
- (get_credentials): return correct value for success; handle case where
pppd just does some checking but doesn't want a password
- (plugin_init): make CHAP work too
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Patch from 陈鑫 <znscnchen@gmail.com>
* src/nm-device-802-3-ethernet.c
- (real_deactivate_quickly): clear the IP interface name on
deactivation, otherwise the wrong interface might get used later
for routing and IP management
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3567 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
Enhance nm-online based on a patch from Bill Nottingham.
* test/nm-online.c
- Add a '-q' option
- Add help messages and option summary
- Add long-format options
- Add a '-x' option to exit if NM isn't running or isn't connecting
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3561 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/plugins/ifcfg-suse/parser.c (make_wireless_security_setting):
Make it compile again by commenting out broken code that at first didn't work and
now didn't compile either.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3550 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-glib/nm-object-cache.c
libnm-glib/nm-settings.c
src/dhcp-manager/nm-dhcp-manager.c
system-settings/plugins/ifcfg-fedora/plugin.c
system-settings/plugins/ifcfg-suse/plugin.c
system-settings/src/nm-system-config-hal-manager.c
libnm-util/nm-utils.c
- Remove usage of GStaticMutex since gcc-4.3 hates it and because we're
not threadsafe anyway
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3548 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/src/main.c
- (load_stuff, device_added_cb, device_removed_cb): device added/removed
callbacks take a device type too
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3546 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
The system settings service will now create a new default DHCP connection
for wired devices that have no existing applicable connection.
* system-settings/src/nm-system-config-hal-manager.c
system-settings/src/nm-system-config-hal-manager.h
- (nm_system_config_hal_manager_get_type_for_udi): new function
* system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- (nm_sysconfig_settings_get_connections): new function
- (nm_sysconfig_settings_is_device_managed): new function
* system-settings/src/main.c
- (load_stuff): check for wired devices that need a default connection
- (get_details_for_udi): get interface and MAC address from HAL
- (add_default_dhcp_connection): add a default connection for a wired
device if needed
- (device_added_cb, device_removed_cb): do the right thing with
wired devices and their default connections on HAL device events
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3544 4912f4e0-d625-0410-9fb7-b9a5a253dbdc