Commit Graph

188 Commits

Author SHA1 Message Date
Tambet Ingo
352caa34c6 2007-03-02 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Cache networks (bssids) list.
	We get signalled when it changes.

	* libnm-glib/nm-client.c: Cache NMState and device list, we get signalled
	when it changes.

	* libnm-glib/nm-device.c: Cache the device state property.

	* libnm-glib/nm-access-point.c: Cache the strength property.

	* src/nm-device-802-11-wireless.c: Fix wireless device scanning scheduler.
	The new algorithm is to start from SCAN_INTERVAL_MIN (currently defined as 0)
	and add a SCAN_INTERVAL_STEP (currently 20 seconds) with each successful scan
	until SCAN_INTERVAL_MAX (currently 120 seconds) is reached. Do not scan while
	the device is down, activating, or activated (in case of A/B/G cards).
	Remove some old dead ifdef'ed out code that used to configure wireless devices,
	it's all done through supplicant now.

	* src/supplicant-manager/nm-supplicant-interface.c: Fix the reference
	counting issues with pending calls which caused leaks and crashes when
	interface was removed (now that the interface actually gets removed).

	* src/nm-call-store.c: Make a copy of data before running a foreach
	with user callback on it - The most common usage pattern is to cancel
	(and thus remove) all pending calls with foreach which would modify
	the hash table we're iterating over.

	* src/nm-manager.c: When a device is added, make sure it is "up". When
	it's removed or disabled due to disabling wireless or networking, bring
	it down.

	* include/NetworkManager.h: Add new device state NM_DEVICE_STATE_DOWN.

	* src/nm-device-802-11-wireless.c: 
	* src/nm-device-802-3-ethernet.c: 
	* src/nm-device.c:
		- Remove "init" virtual function, all gobjects have a place for that
		  already (constructor).
		- Replace "start" virtual function with "bring_up", devices can be
		  brought up and down more than just on startup now.
		- Add "is_up" virtual function.
		- Implement one way to bring a device down instead of previous 4 different
		  ways, each of witch did something different.

	* src/NetworkManagerUtils.c (nm_dev_sock_open): This doesn't need an NMDevice,
	all it needs is the device interface.

	Get rid of NMData.dev_list (3 members to go).
	Get rif of NMData in a lot of places.

	* gnome/libnm_glib/libnm_glib.c: Make it compile again.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2395 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-02 09:30:48 +00:00
Tambet Ingo
537b30f99e 2007-02-20 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Add "network-added" and
	"network-removed" signals.

	* libnm-glib/libnm-glib.pc.in: Require NetworkManager >= 0.7.0.

	* libnm-glib/nm-access-point.c: Add "strength-changed" signal, emit it
	when receiving the signal from dbus.

	* src/nm-device-802-11-wireless.c (get_property): Fix PROP_ACTIVE_NETWORK
	property.

	* src/NetworkManagerPolicy.c (state_changed): Fix a typo to make the
	deactivation of the previously activated device working again.

	* src/nm-activation-request.c: Remove NMActStage property and it's getter
	and setter.

	* src/nm-device.c (nm_device_is_activated): Remove.
	state == NM_DEVICE_STATE_ACTIVATED is just as easy to use.

	* include/NetworkManager.h: Remove NM_DBUS_NO_DEVICES_ERROR,
	NM_DBUS_NO_DIALUP_ERROR, NM_DBUS_NO_NETWORKS_ERROR,
	NM_DBUS_NO_ACTIVE_DEVICE_ERROR, NM_DBUS_NO_ACTIVE_NET_ERROR errors and
	NM_DBUS_SIGNAL_STATE_CHANGE signal.
	Remove NMNetworkStatus and NMActStage enums.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2345 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-20 15:24:42 +00:00
Tambet Ingo
3dcd9d2d17 2007-02-19 Tambet Ingo <tambet@ximian.com>
* src/vpn-manager/nm-vpn-manager.c: Handle the DBUS state changes itself.
	Handle device state changes and disconnect VPN if it's device deactivates.

	* src/nm-dbus-nm.c: 
	* src/nm-dbus-nm.h: 
	* src/nm-dbus-device.c: 
	* src/nm-dbus-device.c: 
	* src/nm-dbus-net.c: 
	* src/nm-dbus-net.h: Remove. All of it is implemented byt the new dbus API.

	* src/NetworkManagerMain.h: Get rid of all but 3 properties of NMData.

	* src/nm-device.c (nm_device_get_by_udi):
	(nm_device_get_by_iface): Remove. This doesn't belong here and is already
	implemented in the correct location (NMManager).
	Rip out all the test_device stuff.

	* src/NetworkManagerPolicy.c: Remove the leftover activation success and
	failure handlers, it's all done by NMDevice already.

	* src/NetworkManager.c: Move the signal handling here from nm-logging.c
	Remove the iochannel hack to route the unix signals to the main thread since
	we're not threaded anymore.

	* src/NetworkManagerAP.c: Implement HWAddress property.

	* src/NetworkManagerDbus.c: Remove the dbus signal sending code, it happens
	automatically with dbus-glib.

	* src/nm-netlink-monitor.c: 
	* src/nm-netlink-monitor.h:
		- Move it low in the class hierarchy, don't reference any NM types.
		- Remove private data from the header.
		- Use type safe checks in public API methods.
		- Make it a singleton so we don't have to pass the single reference around.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2339 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-19 13:09:32 +00:00
Tambet Ingo
c40051389c 2007-02-16 Tambet Ingo <tambet@ximian.com>
* introspection/nm-ip4-config.xml: Implement.

	* libnm-glib/libnm-glib-test.c: Use new DBUS API in tests.

	* libnm-glib/nm-ip4-config.c:
	* libnm-glib/nm-ip4-config.c: Implement.

	* src/nm-ap-security[-*]: Remove circular dependencies between APs and AP
	securities. APs reference security.

	* src/nm-device-802-11-wireless.c: Implement missing properties that need to
	be exported over DBUS.

	* src/nm-device-802-3-ethernet.c: Ditto.

	* src/NetworkManagerAP.c:
	* src/NetworkManagerAP.h:
		- Convert to GObject, export over DBUS.

	* src/nm-ip4-config.h:
	* src/nm-ip4-config.h:
		- Convert to GObject, export over DBUS.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2322 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-16 11:23:49 +00:00
Tambet Ingo
8a4c57f631 2007-02-12 Tambet Ingo <tambet@ximian.com>
Totally break NetworkManager. Please use 0.6 branch until futher notice.

	* src/:
		- Remove old low-level dbus interface implementations and replace them
		  with dbus-glib one.

	* configure.in:
		- Require dbus-glib >= 0.72.
		- Plug in new sources to build.

	* libnm-glib/:
		- Implement GObject wrappers on top of DBUS glib auto-generated bindings
		  to make it more convenient to use from GObject based programs.

	* introspection/:
		- Implement DBUS XML introspection files, used by both NM and libnm-glib.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2309 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-12 09:23:43 +00:00
Tambet Ingo
a8191ddaa3 2007-02-09 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c:
		- Add "network-added" and "network-removed" signals.
		- Use gobject boilerplate macros to define the GObject.
		- Implement wireless device activation.
		- Remove activation_failure_handler and activation_success_handler
		  and instead listen on state-changed signals and run the same code
		  from there.

	* src/nm-device.c:
		- Implment NMDeviceInterface::deactivate.
		- Remove activation_failure_handler and activation_success_handler
		  virtual methods. Each device which is interested in these events
		  can just listen on it's state changed signals.

	* src/NetworkManagerPolicy.c:
		- Move a bit more NMData usage to NMManager.
		- Remove activation scheduling bits.
		- Add listeners for wireless device's "network-added" and
		  "network-removed" signals.
		- Listen device changed signals and deactivate currently activated
		  device when another device start activating (for now).
		- Remove (nm_policy_schedule_device_change_check): There's never a need
		  for calling this, the policy code knows exactly when this should happen,
		  by listening on events from NMManager and NMDevices.

	* src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_activate):
	Implement.

	* src/nm-dbus-nm.c (nm_dbus_nm_set_active_device): Call the activation
	method on the specific device instead of going to through policy code
	and determining the device type by passed in AP's existance.

	* src/nm-device-interface.c (nm_device_interface_deactivate): Implement the
	abstract NMDevice deactivation.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2298 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-09 08:50:35 +00:00
Tambet Ingo
371de4c2d0 2007-02-08 Tambet Ingo <tambet@ximian.com>
* src/NetworkManager.c:
		- Set up all the shiny new managers.

	* src/NetworkManagerPolicy.c:
		- Add the beginnings of new NMPolicy code. Instead of requireing all
		  classes to call into policy code, make the policy code kind of like
		  a supervisor that monitors what's going on and drives the whole NM.

	* src/nm-hal-manager.c: 
	* src/nm-hal-manager.h:
		- Collect all libhal code scattered around NM to this one class.
		- Listen libhal and NMManager events and add/remove devices to
		  NMManager.

	* src/nm-manager.c:
	* src/nm-manager.h:
		- Implment a replacement for NMData. NMData is now officially
		deprecated.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2291 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-08 15:34:26 +00:00
Tambet Ingo
a88e1dd3a2 2007-02-05 Tambet Ingo <tambet@ximian.com>
Make NMDevice abstract class, remove almost all references to it's
	subclasses (the last place gets removed with new policy manager). Add
	NMDeviceInterface (which NMDevice implements) so that when we have
	NMDevice exported over DBUS, there's a common NMDevice interface which
	all instances have, plus there's a device specific interface for each
	specific type.
	Remove functions (nm_device_is_802_3_ethernet) and
	(nm_device_is_802_11_wireless). There are already standard GObject macros
	for type safe checks.
	Use the updated supplican manager API.

	* src/nm-device-interface.h: 
	* src/nm-device-interface.c: 
	* src/nm-call-store.h: 
	* src/nm-call-store.c: Implement.

	* src/supplicant-manager/nm-supplicant-interface.c:
	* src/supplicant-manager/nm-supplicant-interface.h:
	* src/supplicant-manager/nm-supplicant-manager.c:
	* src/supplicant-manager/nm-supplicant-manager.h:
		- Remove all private data type references from public header files.
		- Remove all references to other NM classes, this class is just a
		  proxy between wpa_supplicant and NM so it doesn't have to know
		  any internals.
		- Convert to dbus-glib bindings.
		- Type safe checks for public methods' arguments.
		- Store pending DBUS call ids to NMCallStore.

	* src/supplicant-manager/nm-supplicant-config.c:
		- Store config values in a GHashTable instead of GSList.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 12:14:09 +00:00
Tambet Ingo
58b53400a5 2007-02-05 Tambet Ingo <tambet@ximian.com>
* src/NetworkManagerMain.h: Remove all references to DHCP manager.

	* src/NetworkManager.c: Don't initialize the DHCP manager, it's a
	singleton now.

	* src/nm-device.c: Use the new DHCP manager API.

	* src/nm-activation-request.c:
	* src/nm-activation-request.h:
		- Remove all dhcp related properties and methods.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2284 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 09:50:11 +00:00
Dan Williams
0df1e42c39 2007-01-04 Dan Williams <dcbw@redhat.com>
Threading removal related cleanups:

	- Use the glib default main context.  Remove the device main context
		member from NMDevice, and the main_context member from NMData.  Change
		all the idle and timeout scheduler functions to use plain
		g_idle_add() and g_timeout_add().

	- As a side-effect of the first change, nm_dbus_manager_get() no longer
		takes an argument; fix that up too.

	- Remove all locking, which is useless since we no longer use threads.  For
		example, nm_get_device_by_iface_locked() has been removed.  The global
		device list lock, the AP List lock, and all static locks in
		NetworkManagerPolicy.c have been removed.  The locking utility functions
		in NetworkManagerUtils.c have also been removed.

	- Other cleanups in spacing and code style



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2205 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-01-04 12:06:26 +00:00
Dan Williams
a423162b36 2006-12-28 Dan Williams <dcbw@redhat.com>
Use a single thread for everything.  With the move to wpa_supplicant
	and communication over D-Bus, there's no reason for multiple threads.
	Almost all of the blocking code has been removed, with one exception in
	the DHCP manager and a few in the VPN manager.  This commit removes the
	per-device worker thread and fixes activation cancellation in the absence
	of threads.  Further removal of thread-related code would be removing
	any locking code (like the device list lock) and simplification of logic
	around areas of code or data structures that are currently locked.

	* autoip.c
	  dhcp-manager/nm-dhcp-manager.c
	  nm-device-802-11-wireless.c
	  nm-device-802-3-ethernet.c
	  nm-device.c
	  nm-device.h
		- Remove usage of multiple threads


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2197 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-28 22:13:59 +00:00
Dan Williams
cb7ca51e0a Spacing fix
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2031 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-09-20 15:02:13 +00:00
Dan Williams
7d8f84edf6 2006-07-10 Dan Williams <dcbw@redhat.com>
Patch from Valentine Sinitsyn <e_val@inbox.ru>
	* src/nm-device.c
		- (real_act_stage3_ip_config_start): don't infinite loop when
			dhcdbd isn't running (Gnome #346845)


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1866 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-07-10 17:22:32 +00:00
Robert Love
33aec50e50 2006-05-25 Robert Love <rml@novell.com>
* src/nm-device.h: Introduce nm_ioctl_info(), which defines to
	  nm_info() if IOCTL_DEBUG is set and a no-op if not.  We can use this
	  instead of dumping ifdef's throughout the code.
	* src/NetworkManagerSystem.c, src/nm-device-802-11-wireless.c,
	  src/nm-device-802-3-ethernet.c, src/nm-device.c: Remove ifdef's and
	  use nm_ioctl_info() in lieu.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1768 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-05-25 22:37:41 +00:00
Jeremy Katz
927d2b3394 2006-04-27 Jeremy Katz <katzj@redhat.com>
* src/nm-device.c (discover_device_type): Actually use the hal
	device type instead of ioctl poking


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1710 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-04-27 15:49:40 +00:00
Robert Love
2a63ff03ec 2006-03-21 Robert Love <rml@novell.com>
* src/NetworkManagerSystem.c, src/NetworkManagerSystem.h: Add
	  nm_system_get_mtu(), which returns a user-provided or system-mandated
	  MTU value for a given device, if any, or zero if no such value
	  exists.  Add nm_system_set_mtu() to set the MTU for a given device
	  if we have a provided value.
	* src/nm-device.c: Set the MTU of devices.
	* src/backends/NetworkManagerSuSE.c: Read MTU, if any, from sysconfig.
	* src/backends/NetworkManagerDebian.c,
	  src/backends/NetworkManagerGentoo.c,
	  src/backends/NetworkManagerRedHat.c,
	  src/backends/NetworkManagerSlackware.c: Implement stub functions.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1626 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-21 17:57:01 +00:00
Peter Jones
4e97221b9b - fix a race the device objects refcount during creation of the worker thread.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1603 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-14 20:51:58 +00:00
Peter Jones
efb46cb8c4 - kill an extra call to nm_device_stop(). The worker thread does this while
it's exiting, and this extra call causes it to bring the device down on
  the resume path.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1602 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-14 20:50:59 +00:00
Robert Love
32daa1d99a 2006-03-06 Robert Love <rml@novell.com>
* src/NetworkManagerSystem.h, src/nm-device.c, NetworkManagerDebian.c,
	  NetworkManagerRedHat.c, NetworkManagerGentoo.c,
	  NetworkManagerSlackware.c: Pass nm_system_device_get_system_config()
	  a second argument, NMData.
	* src/nm-ap-security.h, src/nm-ap-security.c: Export nm_ap_security_new.
	* src/backends/NetworkManagerSuSE.c: Add wireless networks from ifcfg-*
	  config files as trusted.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1564 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-08 18:33:44 +00:00
Dan Williams
a5919b696c 2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
	NetworkManager.c.  Also add support for recognizing Wireless Events.

	* configure.in
		- Find GLIB_GENMARSHAL

	* src/Makefile.am
		- Since we're marshalling custom types for wireless event signals,
			we get to create our own marshallers using GLIB_GENMARSHAL

	* src/NetworkManager.c
		- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
		- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
			cut down somewhat.  We no longer process signals here.
		- (nm_data_new): create the netlink monitor here, and remove a
			useless call to nm_policy_schedule_device_change_check()
		- (nm_data_free): get rid of the netlink monitor here
		- (nm_device_link_activated, nm_device_link_deactivated): removed
		- (main): don't create the netlink monitor here, let nm_data_new
			do that.  Call nm_policy_schedule_device_change_check() right
			before we jump to the mainloop to figure out which device
			to use first

	* src/NetworkManagerSystem.[ch]
		- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
			convert back and forth from interface names to interface
			indexes

	* src/nm-device-802-11-wireless.c
		- (real_init): connect to wireless-event signals from the netlink
			monitor object
		- (nm_device_802_11_wireless_event): new function, schedule handler
			for wireless event signals from the netlink monitor object.  We
			want the handler to run in the device's context
		- (wireless_event_helper): handle wireless-event signals from netlink
		- (nm_device_802_11_wireless_dispose): disconnect wireless-event
			signal handler

	* src/nm-device-802-11-wireless.h
		- remove unused prototype for nm_device_802_11_wireless_new

	* src/nm-device-802-3-ethernet.c
		- (real_init): new function; set up signal handlers for link events
		- (nm_device_802_3_ethernet_link_activated): new function, schedule
			handler for netlink link activated events on device's main loop
		- (link_activated_helper): when we get a link activated event, set
			the device's link to be active
		- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
			handler for netlink link deactivated events on device's main loop
		- (link_deactivated_helper): when we get a link deactivated event, set
			the device's link to be inactive
		- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
			dispose

	* src/nm-device-802-3-ethernet.h
		- remove unused prototype for nm_device_802_3_ethernet_new

	* src/nm-device.[ch]
		- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
			but locks the device list
		- (nm_device_set_active_link): a little bit of cleanup and de-indenting

	* src/nm-netlink-monitor.[ch]
		- (nm_netlink_monitor_class_install_signals): New signal
			"wireless-event"
		- (nm_netlink_monitor_new): keep reference to NMData so we can get
			at the device list
		- (nm_netlink_monitor_event_handler): expand for wireless events too

	* src/nm-marshal-main.c
		- Include generated nm-marshal.c and nm-marshal.h

	* src/nm-marshal.list
		- List of custom marshal functions


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
Dan Williams
ef9674ce75 2006-03-04 Dan Williams <dcbw@redhat.com>
Clean up activation cancellation.  Should be a lot faster now.  Observed
	an issue with wireless devices between stage 2 and 3 of activation, where
	activation would be cancelled, but the device thread wouldn't notice until
	the supplicant association timed out.  Reorganize activation such that
	a cancellation handler gets immediately scheduled in the device's thread,
	and devices have a chance to perform any custom cleanup too.

	* src/nm-device.[ch]
		- (activation_cancel_handler): new device-type-specific function
			for cleaning up device-type-specific stuff on cancellation
		- (cancel_activation): removed
		- (nm_device_activation_cancel): subsume functionality of
			real_cancel_activation, but instead of doing anything, punt
			operation to a handler that's run in device-thread context
		- (nm_device_schedule_activation_handle_cancel): fix spelling of
			a warning message
		- (activation_handle_cancel_helper): cancellation handler run in
			device-thread context, calls device-type-specific cancelation,
			then tears down the activation request
		- (real_activation_cancel_handler): generic cancellation handler,
			deals with cancelling any in-process DHCP request
		- (nm_device_activate_stage1_device_prepare,
		   nm_device_activate_stage2_device_config,
		   nm_device_activate_stage3_ip_config_start,
		   nm_device_activate_stage4_ip_config_get,
		   nm_device_activate_stage4_ip_config_timeout,
		   nm_device_activate_stage5_ip_commit): don't call
			nm_device_schedule_activation_handle_cancel() any more, since
			cancellation will have been already scheduled for us by
			nm_device_activation_cancel().  Just exit the function and
			assume that the cancel handler will be called next.

	* src/nm-device-802-3-ethernet.c
		- (real_act_stage2_config): remove; didn't do anything anyway

	* src/nm-device-802-11-wireless.c
		- (supplicant_status_cb): ensure we don't do anything if the activation
			got cancelled
		- (real_activation_cancel_handler): implement; cancel user key request
			on activation cancellation


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1549 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-04 06:44:05 +00:00
Robert Love
8cd691824c s/Stage x (foo) of y/Stage x of y (foo)/g
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1475 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-15 21:19:09 +00:00
Robert Love
ff9ec8e962 2006-02-15 Robert Love <rml@novell.com>
* src/nm-device-802-11-wireless.c, src/nm-device.c: When printing debug
	  information about what connection stage we are at, provide the total
	  number of stages, e.g. "Stage 2 of 5", so users know how far along
	  they are if they experience problems.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1474 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-15 18:33:28 +00:00
Robert Love
b60c770dab 2006-01-26 Robert Love <rml@novell.com>
* configure.in: Change '-Wno-unused' to '-Wno-unused-parameter'
	* gnome/applet/applet-compat.c, gnome/applet/applet-dbus-devices.c,
	  gnome/applet/applet-dbus-info.c, gnome/applet/applet-dbus.c,
	  gnome/applet/applet.c, gnome/applet/applet.h, src/nm-dbus-device.c,
	  gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c,
	  gnome/applet/nm-gconf-wso.c, gnome/applet/nm-gconf-wso.h,
	  gnome/applet/other-network-dialog.c, src/nm-device.c, test/nm-tool.c,
	  gnome/applet/passphrase-dialog.c, src/nm-device-802-11-wireless.c,
	  gnome/applet/wireless-security-manager.c, src/nm-ip4-config.c,
	  gnome/applet/wireless-security-option.c, src/nm-ap-security.c,
	  gnome/applet/wso-wep-ascii.c, gnome/applet/wso-wep-hex.c,
	  gnome/applet/wso-wep-passphrase.c, gnome/applet/wso-wpa-psk.c,
	  libnm-util/dbus-helpers.c, src/NetworkManagerAP.c, src/nm-dbus-nmi.c,
	  src/NetworkManagerSystem.c, src/nm-ap-security-wep.c,
	  src/nm-device-802-11-wireless.h, test/libnm-util/test-ciphers.c,
	  src/named-manager/nm-named-manager.c, test/test-common/test-common.c:
	  Kill unused variables, labels, and static functions.  Don't pass
	  string literals as the format string for printf-like functions.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1391 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-26 21:08:44 +00:00
Robert Love
d1f6f5dde4 2006-01-23 Robert Love <rml@novell.com>
* dhcp-manager/nm-dhcp-manager.c, nm-device.c, nm-ip4-config.c,
	  nm-ip4-config.h, NetworkManagerSystem.h: Save the hostname reported
	  by DHCP and pass it to the backends, allowing distribution-specific
	  behavior with respect to the DHCP-supplied hostname (if nothing else,
	  some distributions might not want to set the hostname).
	* backends/NetworkManagerSuSE.c: Set the hostname if the variable
	  DHCLIENT_SET_HOSTNAME is set to "yes" in /etc/sysconfig/network/dhcp.
	  Also update our NIS behavior.
	* backends/NetworkManagerDebian.c, backends/NetworkManagerGentoo.c,
	  backends/NetworkManagerRedHat.c, backends/NetworkManagerSlackware.c:
	  Add stub functions.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1382 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-23 21:02:39 +00:00
Dan Williams
2864ede525 2006-01-22 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerAP.[ch]
		- (nm_ap_get_matched, nm_ap_set_matched): remove

	* src/NetworkManagerAPList.[ch]
		- (nm_ap_list_diff): removed
		- (nm_ap_list_merge_scanned_ap): move AP dbus signal logic here,
			deal with access points changing essids on us

	* src/nm-device-802-11-wireless.c
		- (add_new_ap_to_device_list): move AP dbus signal logic to
			src/NetworkManagerAPList.c
		- (real_can_interrupt_activation): new function; allow interruption
			of device activation if we are waiting for a network key

	* src/NetworkManagerPolicy.c
		- (nm_policy_device_change_check): allow interruption of currently
			activating devices if the device allows it.  Previous behavior
			would refuse to activate a just-plugged wired device if a
			wireless device was waiting for a key.

	* src/nm-device.[ch]
		- (nm_device_can_interrupt_activation): new function; ask devices
			whether their activation can be interrupted


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1375 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-22 22:40:14 +00:00
Robert Love
cbd27080ed 2006-01-18 Robert Love <rml@novell.com>
* src/NetworkManager.c, src/NetworkManagerSystem.h, src/nm-device.c:
	  Allow backends to flag a device (in whatever distro-dependent way
	  they so desire) as disabled.  NM will ignore any such device.
	* src/backends/NetworkManagerDebian.c,
	  src/backends/NetworkManagerRedHat.c,
	  src/backends/NetworkManagerSlackware.c: Add stub function
	  nm_system_device_get_disabled() that always returns FALSE (enabled).
	* src/backends/NetworkManagerSuSE.c: Add system_disabled field to the
	  SUSE-specific configuration structure.  Fill it in from the
	  NM_CONTROLLED variable in the system networking scripts.  If this var
	  exists and is "no", we ignore the device.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1361 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-19 18:00:48 +00:00
Dan Williams
135da08fc5 2006-01-17 Dan Williams <dcbw@redhat.com>
* src/nm-device.c
		- (nm_device_class_init): connect a default act_stage4_ip_config_timeout
			function.  Fixes crash when wired DHCP fails.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1355 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-18 02:27:38 +00:00
Robert Love
8eb99d62fc 2006-01-16 Robert Love <rml@novell.com>
* gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c,
	  gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c,
	  gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c,
	  gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c,
	  src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c,
	  src/nm-netlink-monitor.c: Don't miss any initializers on structure
	  declarations, ever.
	* gnome/applet/applet.c: Remove useless check (NMState is unsigned and
	  NM_STATE_DISCONNECTED is zero).


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1351 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-17 18:22:56 +00:00
Dan Williams
8b1b8ee7a5 2006-01-13 Dan Williams <dcbw@redhat.com>
* src/nm-device.c
	  src/nm-device.h
		- Allow subclasses to implement deactivate_quickly()
		- (nm_device_deactivate_quickly): call subclass
			deactivate_quickly() methods
		- (nm_device_set_active_link): small cleanups, and don't
			deactivate the device right away because we risk a deadlock
			when called from device thread, waiting for the device
			thread to cancel activation

	* src/nm-device-802-11-wireless.c
		- (real_deactivate_quickly): new function
		- (nm_device_802_11_wireless_class_init): hook in real_deactivate_quickly
		- (real_deactivate): move supplicant cleanup to real_deactivate_quickly
			so that we kill the supplicant when we sleep too
		- (supplicant_interface_init): work around naive naming attempts of
			wpa_ctrl when naming sockets


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1326 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-13 16:53:55 +00:00
Robert Love
5b8589dfb0 2006-01-10 Robert Love <rml@novell.com>
* src/nm-device-802-11-wireless.c, src/nm-device-802-11-wireless.h,
	  src/nm-device-802-3-ethernet.c, src/nm-device-802-3-ethernet.h,
	  src/nm-device.c: Fix a FIXME!  Reimplement the function
	  nm_device_update_hw_address() in device subclass variants,
	  nm_device_802_3_ethernet_set_address() and
	  nm_device_802_11_wireless_set_address(), hook them up, and use them.
	  This fixes the existing bug where MAC addresses are all zeros.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1309 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-10 21:15:54 +00:00
Dan Williams
30cc1984f7 2006-01-07 Dan Williams <dcbw@redhat.com>
* src/nm-device-private.h
	  src/nm-device.c
		- (nm_device_activate_schedule_stage3_ip_config_start): make this
			function available to subclasses


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1283 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-07 16:22:17 +00:00
Dan Williams
7f07df2466 2006-01-03 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c
	  src/nm-device.[ch]
	  src/nm-device-802-11-wireless.c
		- Move wireless-specific activation failure and success code
			into wireless device class


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1259 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-03 22:11:35 +00:00
Dan Williams
1c5f300910 2006-01-03 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
		- Recognize activation cancellation when waiting for DHCP
			configuration from dhcdbd
		- Ignore non-dhcdbd messages

	* src/nm-device.c
		- (real_act_stage3_ip_config_start): return to correct behavior
			of letting the dhcp-manager notify us of failure or
			success rather than incorrectly doing that ourselves
		- (nm_device_activate_stage4_ip_config_get): deal with
			activation cancellation a bit earlier


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1253 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-03 18:18:05 +00:00
Dan Williams
d242edf282 2006-1-3 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c
	  src/nm-device.[ch]
		- Add hooks to subclasses for stage3_ip_config_start and
			stage4_ip_config_timeout

	* src/nm-device-802-3-ethernet.c
		- (real_get_generic_capabilities): make devices NM-supported
			by default


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1251 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-03 17:47:38 +00:00
Dan Williams
d639dbeac0 2006-1-3 Dan Williams <dcbw@redhat.com>
* src/NetworkManager.c
		- Move link-checking/probing into the device subclasses
			themselves

	* src/nm-device.[ch]
	  src/nm-device-802-11-wireless.c
	  src/nm-device-802-3-ethernet.c
		- Do periodic link checking in device subclasses rather
			than being triggered from NetworkManager.c
		- discover_wireless_capabilities -> get_wireless_capabilities
		- discover_generic_capabilities -> get_generic_capabilities
		- Device subclass activation routines now return a value of type
			NMActStageReturn to indicate what step to perform next
		- Devices now override stage4_get_ip4_config if they choose


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1249 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-03 17:07:07 +00:00
Dan Williams
6a35ad489c 2006-1-1 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c
		- (real_init): don't chain up to parent init because we don't
			need to do that anymore

	* src/nm-device.c
		- (discover_device_type): fix arguments to ioctl() to correctly
			pass interface name
		- (nm_device_new): consolidate generic device initialization into
			nm_device_new()
		- (real_init): remove, consolidated to nm_device_new()
		- (nm_device_deactivate, real_deactivate): consolidate


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1247 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-02 02:50:47 +00:00
Dan Williams
4ed4b491fa 2005-12-31 Dan Williams <dcbw@redhat.com>
* refactor NMDevice into a GObject-based framework with separate
		objects for wired and wireless.  The following files are no
		longer used but should stick around for a bit so we don't
		loose code through the cracks:
			NetworkManagerDevice.c
			NetworkManagerDevice.h
			NetworkManagerWireless.c
			NetworkManagerWireless.h

	The intent here is to allow each device type to manage its own
	connection & activation life-cycle, ie to allow wireless devices
	to interface with wpa_supplicant, etc.  There's a fair bit of
	encapsulation breakage right now that should gradually get pulled
	back into each device, along with things like periodic property
	updates and link probing.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1244 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-12-31 08:21:24 +00:00