Commit Graph

7207 Commits

Author SHA1 Message Date
Tambet Ingo
6a68d79c08 2007-08-09 Tambet Ingo <tambet@gmail.com>
[Based on patch by Helmut Schaa <hschaa@suse.de>]

        * libnm-glib/nm-client.h:
        * libnm-glib/nm-object.h:
        * libnm-glib/nm-vpn-connection.h:
        * libnm-glib/nm-settings.h:
        * libnm-glib/nm-device.h:
        * libnm-glib/nm-ip4-config.h:
        * libnm-glib/nm-access-point.h:
        * libnm-glib/nm-device-802-3-ethernet.h:
        * libnm-util/nm-setting.h: 
        * libnm-util/nm-connection.h: Add G_BEGIN_DECLS / G_END_DECLS to
        * support C++.

        * libnm-glib/nm-object.c (nm_object_get_byte_property):
        * Implement.

        * libnm-glib/nm-access-point.c: Strength has type char.

        * gnome/vpn-properties/Makefile.am: Remove
        * GNOME_DISABLE_DEPRECTATED for now
        to fix build. GnomeDruid is deprecated in recent libgnomeui.

        * introspection/nm-access-point.xml: Strength property is char,
        * not int.

        * src/NetworkManagerAP.c (set_property): Set strength from char.
        (get_property): Handle hidden APs (with empty SSID).
        Get strength value from char.
        (nm_ap_class_init): Strength property has char type.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2659 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-09 09:19:57 +00:00
Dan Williams
59749f4c33 2007-07-26 Dan Williams <dcbw@redhat.com>
Patch from Bernhard Miklautz <bernhard.miklautz@shacknet.at>

	* src/NetworkManagerSystem.c
		- (nm_system_device_set_ip4_route): don't add the route if it's on the
			same subnet (#437396)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2651 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-07-26 15:07:36 +00:00
Dan Williams
040864f7cb Include NetworkManagerDbus.h to get def for nm_dbus_get_object_path_for_device()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2645 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-07-26 14:42:13 +00:00
Dan Williams
f4540f0412 2007-06-27 Dan Williams <dcbw@redhat.com>
* Make SSIDs GByteArrays everywhere
	* Rename "essid" -> "ssid" everywhere that's appropriate
	* Refcount activation_ap member of the 802.11 wireless device class



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2620 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-27 16:18:52 +00:00
Tambet Ingo
a61f78493d 2007-06-22 Tambet Ingo <tambet@ximian.com>
* Oops, didn't mean to commit that debug spew, fixing.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2617 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-22 16:23:16 +00:00
Tambet Ingo
d701939287 2007-06-22 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c (merge_scanned_ap): Don't advertise constantly
	that we got a new AP when we just update existing AP properties.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2616 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-22 16:21:48 +00:00
Tambet Ingo
636b1140c5 2007-06-21 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Add NMObject to build, remove nm-utils.[ch].

	* nm-utils.[ch]: Remove.

	* libnm-glib/nm-object.c: Implement a base class for all libnm-glib dbus-aware
	objects for easy property access and dbus connection handling.

	* libnm-glib/nm-client.c: Derive from NMObject.

	* libnm-glib/nm-device.c: Ditto.

	* libnm-glib/nm-device-802-3-ethernet.c: Changes for being based on NMObject.

	* libnm-glib/nm-device-802-11-wireless.c: Ditto.

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

	* libnm-glib/nm-access-point.c: Ditto.

	* libnm-util/nm-connection.c (nm_connection_compare): Add a stub for connection
	comparision. Currently used by the device activation code to determine if the new
	activation is the same as the old one.

	* src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Don't use the obsolete and
	wrong way of getting the dbus path for AP. Fixes the issue where the applet isn't
	able to ask password for the AP.

	* src/nm-device.c (nm_device_activate): Change the logic here - instead of giving
	up if the device is already connected, tear down it's connection (if it isn't the
	same as new one) and start the activation.

	* src/nm-manager.c: Add the beginnings of NMConnection storage and signals.

	* src/NetworkManagerAP.c (nm_ap_init): Set the default values to AP memebers, fixes
	the issue where all APs are always listed as encrypted.

	* src/NetworkManagerDbus.c (nm_dbus_get_object_path_for_network): Remove. APs have
	their own registered paths.

	* test/nm-tool.c (detail_device): Don't try to get active network from wireless
	device if it's not connected - dbus-glib will happily crash trying to marshal NULL.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2615 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-22 15:09:02 +00:00
Tambet Ingo
a04de676ca 2007-06-13 Tambet Ingo <tambet@ximian.com>
* src/NetworkManagerAP.c (foreach_property_cb): Set WEP capabilities too!
	(0 & 0 == 0, doh)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2594 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-13 14:21:54 +00:00
Tambet Ingo
be798e43ab 2007-06-13 Tambet Ingo <tambet@ximian.com>
* src/nm-device.c (nm_device_state_changed): Emit the signal before handling it
	because the handling code will cause the next state change and signal listeners
	get the signals in wrong order.

	* src/NetworkManagerPolicy.c (nm_policy_device_change_check): Get the "old_dev"
	correctly in case of pending activation.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2593 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-13 11:58:25 +00:00
Tambet Ingo
77cdb55279 2007-06-13 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_set_activation_ap):
	Convert the essid byte array to string correctly, including the terminating NULL.

	* src/NetworkManagerPolicy.c (create_connection): Create wireless ssid and
	mode with correct types.

	* src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Fix a typo, pass the
	constructed info to dbus call instead of the activation request.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2592 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-13 09:30:44 +00:00
Tambet Ingo
9d1808c4e5 2007-06-11 Tambet Ingo <tambet@ximian.com>
* src/nm-device.c: Make the activation stage virtual functions take NMDevice
	argument. The activation request is easy to retrieve.

	* src/nm-activation-request.c: Convert to GObject. Do not include half of NM headers
	just to be a convenient location for devices to store random stuff.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2587 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-11 13:36:34 +00:00
Christopher Aillon
c50942cf2f 2007-06-11 Christopher Aillon <caillon@redhat.com>
Patch from Alex Smith <alex@alex-smith.me.uk>

	* src/backends/NetworkManagerFrugalware.c:
	Update the FrugalWare backend to fix a few segfaults. (#392642)


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2585 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-11 05:47:19 +00:00
Tambet Ingo
5623bf965b 2007-06-06 Tambet Ingo <tambet@ximian.com>
* libnm-util/nm-setting.c: Get rid of dump virtual functions, that can happen
	automagically.
	Implement NMSettingIP4Config.
	Finish NMSettingWired by adding all known members.
	(setting_wired_verify): Implement.
	Finish NMSettingWireless by adding all known members.
	(setting_wireless_verify): Implement.

	* libnm-util/nm-connection.c: Register "ipv4" setting.
	(nm_connection_dump): Implement. Instead of requiring every NMSetting to implement
	dump function, we can introspect the GHashTable which is used for sending connections
	over dbus.

	* src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_set_activation_ap):
	Take GByteArray for essid, it's really not a string.

	* src/nm-device.c (real_act_stage3_ip_config_start): Get information from NMSettings.
	Start DHCP request if setting is not passed or if it states that DHCP should be used.
	(real_act_stage4_get_ip4_config): If settings are provided, use them, even if it
	means overriding the values we got from DHCP.
	(real_activation_cancel_handler): Cancel DHCP transaction only if it has started, doh.
	(nm_device_deactivate_quickly): Ditto.

	* src/nm-device-interface.c (impl_device_activate): Dump the connection structure
	for debugging.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2577 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-06 13:33:51 +00:00
Tambet Ingo
ff0fd77b08 2007-05-07 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Link with libnm-util to gain access to
	NMConnection.

	* libnm-glib/nm-device-802-11-wireless.c:
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device-802-3-ethernet.c
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device.c (nm_device_activate): Implement.

	* src/nm-device-802-3-ethernet.c: Implement the new activation using
	NMConnection.

	* src/nm-device-802-11-wireless.c: Store an activation AP once the
	activation has started.
	Implement the new activation using NMConnection.

	* src/nm-activation-request.c: Store a generic connection object instead
	of a wireless-specific AP.

	* src/NetworkManagerPolicy.c (create_connection): Implement. Depending
	on device type, create a device specific connection object suitable for
	device activation.

	* src/nm-device.c (nm_device_activate): Re-implement. Call the device
	specific check to validate the connection and on success start the
	activation.

	* src/nm-device-interface.h: Add a activate virtual function to the
	interface definition.

	* src/nm-device-interface.c (nm_device_interface_activate): Implement.
	(impl_device_activate): Implement.

	* introspection/nm-device.xml: Add a generic device activation interface
	that accepts an abstract NMConnection structure that has device-specific
	information in it.

	* introspection/nm-device-802-3-ethernet.xml: Remove the wired-specific
	activation interface.

	* introspection/nm-device-802-11-wireless.xml: Remove the wireless-specific
	activation interface.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 15:17:45 +00:00
Tambet Ingo
40db9193d3 2007-05-07 Tambet Ingo <tambet@ximian.com>
* src/nm-dbus-manager.c
	(proxy_name_owner_changed, nm_dbus_manager_class_init): Remove the
	DbusConnection argument from 'name-owner-changed' signal. The manager
	is already passed as a first argument to the signal and the connection
	is easy enough to get from it.

	* src/vpn-manager/nm-vpn-service.c (nm_vpn_service_name_owner_changed):
	Update the signature of the function.

	* src/vpn-manager/nm-vpn-manager.c (nm_name_owner_changed_handler):
	Ditto.

	* src/NetworkManager.c: Ditto.

	* src/named-manager/nm-named-manager.c
	(nm_named_manager_name_owner_changed): Ditto.

	* src/supplicant-manager/nm-supplicant-manager.c
	(nm_supplicant_manager_name_owner_changed): Ditto.

	* src/nm-hal-manager.c (name_owner_changed): Ditto.

	* src/dhcp-manager/nm-dhcp-manager.c
	(nm_dhcp_manager_name_owner_changed): Ditto.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2567 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 14:33:51 +00:00
Tambet Ingo
5dc9b90a83 2007-05-07 Tambet Ingo <tambet@ximian.com>
* src/nm-hal-manager.c: Add a list of device detectors and creators
	to make it easier to add new devices. Each device type has it's own
	entry in the table so adding new device types is only a matter of
	implementing a couple of functions, one for device detection and the
	other for device creation.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2566 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 14:27:50 +00:00
Dan Williams
65a7f23b9f 2007-03-30 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerSystem.c
		- (nm_system_device_set_ip4_route): clean up and fix argument
			to nm_dev_sock_open()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2509 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-31 01:21:06 +00:00
Tambet Ingo
59d7210d4b 2007-03-28 Tambet Ingo <tambet@ximian.com>
* src/supplicant-manager/nm-supplicant-config.c (get_hash_cb): Marshal the
	data to correct types instead of always using string.

	* src/NetworkManagerAP.c (get_property): AP is encrypted if capabilities does
	_not_ have NM_802_11_CAP_PROTO_NONE.
	(foreach_property_cb): Set AP capabilities if it's not set or if the protocol
	is not set.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2507 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-28 13:39:09 +00:00
Tambet Ingo
229624b88f 2007-03-26 Tambet Ingo <tambet@ximian.com>
* src/vpn-manager/nm-dbus-vpn.c (dbus_message_handler): Implement DBUS message
	handler for VPN.

	* src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_new): Register VPN interface
	on DBUS again.

2007-03-26  Dan Williams  <dcbw@redhat.com>

	* src/NetworkManagerAPList.c
	* src/nm-device-802-11-wireless.c
	* src/NetworkManagerAP.c:
		- Store last seen as glong instead of GTimeVal.
		- Fix the upper bound of capabilities, it's a bitfield.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2500 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-26 12:29:49 +00:00
Tambet Ingo
8fa8ac4c80 2007-03-15 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c (constructor): Initialize the iw_ext structures
	with zeroes before passing them to functions - the functions never do that and
	reading the values back may produce wrong values.
	(real_bring_up): Store the signal handler id ...
	(real_bring_down): ... So that it can be removed here.
	Disconnect the supplicant interface here as well.
	(nm_device_802_11_wireless_ap_list_get_ap_by_obj_path): Use the dbus object path
	from the access point instead of old $device/Networks/$essid.

	* src/nm-manager.c (nm_manager_get_state): Return NM_STATE_CONNECTED when the
	device state is connected (instead of just having link/carrier).

	* src/nm-activation-request.c: Don't store NMData in activation request, it's
	already easily accessible through the device.

	* src/NetworkManagerAP.c (nm_ap_init): Construct the dbus object path here and
	store it within the object.
	(nm_ap_get_dbus_path): Export it to public as well.

	* src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get): Keep the ownership
	of the singleton.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2478 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-16 09:06:48 +00:00
Dan Williams
06d43d3a62 2007-03-12 Dan Williams <dcbw@redhat.com>
Get rid of 2 second poll of sysfs 'carrier' file for wired devices.  Useless
	for non-carrier-detect capable devices, and useless for carrier-detect
	devices since we get notifications from netlink about carrier status anyway.

	* src/nm-device-802-3-ethernet.c
		- remove 'link_source_id' member from private data
		- (probe_link): remove and collapse into real_update_link()
		- (nm_device_802_3_periodic_update): remove
		- (real_is_up): check for sup_iface rather than link_source_id
		- (real_bring_up): return gboolean for success/fail; require that
			sup_iface be valid for device bringup to succeed
		- (real_bring_down): zero out link signal ids

	* src/nm-device.c
		- (nm_device_activate_stage2_device_config): fail activation if device
			bringup fails
		- (real_act_stage4_get_ip4_config): fail activation if device bringup
			fails
		- (nm_device_bring_up): return success/fail

	* src/nm-device.h
		- bring_up now returns success/fail

	* src/nm-device-802-11-wireless.c
		- (real_bring_up): return success from bringup



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2464 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-12 04:49:29 +00:00
Dan Williams
d4fb095dd7 Quiet warning
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2463 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-12 04:24:32 +00:00
Dan Williams
c190818f37 2007-03-07 Dan Williams <dcbw@redhat.com>
Patch from Simon Geard <delgarde@ihug.co.nz>  (Gnome.org #394956)
	* src/nm-ap-security-wpa-psk.c
		- (real_write_supplicant_config): work with PSKs that may contain
			zeros in the binary format rather than treating it as a string



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2445 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-07 20:40:21 +00:00
Tambet Ingo
96c246cfc4 2007-03-02 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c
	(nm_device_802_11_wireless_get_capabilities): Implement.

	* libnm-glib/nm-device.c (nm_device_get_capabilities): Implement.

	* src/nm-device-802-11-wireless.c: Add "WirelessCapabilities" property.

	* src/named-manager/nm-named-manager.c (remove_one_zone_from_named): Unref the
	reply only if it's not NULL. Not sure why this started happening right now.

	* src/nm-manager.c (device_stop_and_free): Remove. No need to have different
	code paths for when devices get removed on shutdown or when a device is just
	removed.
	(finalize): Don't use a g_slist_foreach() when removing devices, the list data
	gets freed so any signal from a device (disconnected for instance) would invoke
	NMState update which would crash.
	(nm_manager_remove_device): Bring the device down when it gets removed.

	* src/NetworkManagerPolicy.c (nm_policy_auto_get_best_device): Remove
	the unused dev_type.

	* src/nm-hal-manager.c (create_device_and_add_to_list): Don't keep the
	reference to the added device, NMManager will own it (if it wants).

	* test/nm-tool.c: Rewrite using libnm-glib.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2417 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-05 08:49:30 +00:00
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
Dan Williams
a2ff5bd22b 2007-02-23 Dan Williams <dcbw@redhat.com>
Patch from Andy Whitcroft <apw@shadowen.org> (Gnome.org #410426)

	* src/NetworkManagerAP.c
		- (add_capabilities_from_cipher): fix addition of WEP capabilities by
			OR-ing rather than AND-ing



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2358 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-23 15:46:12 +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
f6aa7b4599 2007-02-19 Tambet Ingo <tambet@ximian.com>
* src/NetworkManagerDbus.c: Don't try to include non-existant files.

	* src/NetworkManager.c: Ditto.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2340 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-19 13:28:31 +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
b6680375d1 2007-02-05 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c (supplicant_iface_scan_result_cb): 
	* src/supplicant-manager/nm-supplicant-interface.h
	* src/supplicant-manager/nm-supplicant-interface.c
	(nm_supplicant_interface_class_init): Change the "scan-result" signal's
	argument to boolean from enum.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2287 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 16:21:25 +00:00
Tambet Ingo
d9ea10a633 2007-02-05 Tambet Ingo <tambet@ximian.com>
* src/backends/NetworkManagerFrugalware.c: Oops, forgot to commit this.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2286 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 12:24:31 +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
Tambet Ingo
1bbdd977e3 2007-02-05 Tambet Ingo <tambet@ximian.com>
* src/dhcp-manager/nm-dhcp-marshal-main.c: Add.

	* src/dhcp-manager/nm-dhcp-marshal.list: Add.

	* src/dhcp-manager/nm-dhcp-manager.c:
	* src/dhcp-manager/nm-dhcp-manager.h:
		- Convert it to GObject since we need to signal state changes.
		- Remove all references to other NM classes, this class is one
		  of the lowest classes in our hierarchy.
		- One less class to use NMActRequest.
		- Make it singleton, one less user of NMData.
		- Remove a couple of sleep() calls.
		- Convert a bunch of low-level dbus API calls to dbus-glib calls.
		  One less class to use the NM's custom tailored signal handlig.

	* Makefile.am: Generate marshallers, add them to build.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2283 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 09:42:19 +00:00
Dan Williams
06fe3cfed9 2007-02-02 Dan Williams <dcbw@redhat.com>
* src/vpn-manager/nm-vpn-service.c
		- (nm_vpn_service_stage4_ip4_config_get): use uint32 arrays for DNS
			and NBNS server addresses



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2265 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-02 21:14:56 +00:00
Tambet Ingo
b8e56f0ba6 2007-02-02 Tambet Ingo <tambet@ximian.com>
* src/nm-dbus-manager.c:
	* src/nm-dbus-manager.h:
		- Convert all internal DBUS code to use dbus-glib bindings.
		- Remove GObject properties, we don't need them here.
		- Don't explicitly set things to NULL after freeing, glib is
		  happy to do it if asked nicely (G_DEBUG=gc-friendly).
		- Make public API argument checks type safe.
		- Remove unnecessary (and wrong) cast to GObject for the first
		  argument to g_signal_* calls - The first argument is a gpointer.
		- Export DBusGConnection to other cool classes that (are going to)
		  use dbus-glib.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2260 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-02 08:50:56 +00:00
Jürg Billeter
7798f8b2e6 2007-01-27 Jürg Billeter <j@bitron.ch>
* src/backends/NetworkManagerPaldo.c
		- (nm_system_update_dns): clear nscd hosts cache


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2248 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-01-26 23:05:51 +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
c430ba3336 2007-01-01 Dan Williams <dcbw@redhat.com>
Found by Bill Moss:

	* src/supplicant-manager/nm-supplicant-interface.c
		- (nm_supplicant_interface_disconnect): fix cleanup logic when
			the supplicant interface wasn't already disconnected.  Always
			call removeNetwork and disconnect unless the supplicant interface
			is in the DISCONNECTED or INACTIVE state.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2202 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-01-02 05:01:07 +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
a6f5833cb3 2006-12-19 Dan Williams <dcbw@redhat.com>
Big wpa_supplicant + dbus update; need latest wpa_supplicant from CVS
	plus a few other patches from wpa_supplicant bugzilla.

	* src/Makefile.am
	  src/NetworkManagerPolicy.c
	  src/NetworkManagerUtils.c
	  src/NetworkManagerUtils.h
	  src/nm-ap-security-leap.c
	  src/nm-ap-security-wep.c
	  src/nm-ap-security-wpa-eap.c
	  src/nm-ap-security-wpa-psk.c
	  src/nm-ap-security.c
	  src/nm-ap-security.h
	  src/nm-device-802-11-wireless.c
	  src/nm-device-802-11-wireless.h
	  src/supplicant-manager/nm-supplicant-config.c
	  src/supplicant-manager/nm-supplicant-config.h
	  src/supplicant-manager/nm-supplicant-interface.c
	  src/supplicant-manager/nm-supplicant-interface.h
	  src/supplicant-manager/nm-supplicant-marshal.list
	  src/supplicant-manager/nm-supplicant-settings-verify.c
	  src/supplicant-manager/nm-supplicant-settings-verify.h
		- Move all connection management and association handling to
			wpa_supplicant over dbus, rather than spawning a private copy


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2192 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-19 19:15:31 +00:00
Dan Williams
3834255f8c 2006-12-19 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c
		- (nm_policy_device_change_check, nm_policy_schedule_device_change_check):
			better locking of the device change check handler ID.  Incorrect
			locking was causing lost device change requests


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2191 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-19 19:04:04 +00:00
Dan Williams
6b089976ad Cleanup up error output
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2190 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-19 18:49:59 +00:00
Dan Williams
bcd251672e 2006-12-11 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/nm-supplicant-interface.c
		- (iface_state_cb, wpas_iface_get_state): new functions; query initial
			wpa_supplicant interface state
		- (nm_supplicant_interface_add_cb): query initial wpa_supplicant interface
			state before transitioning to READY state


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2181 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-12 03:27:35 +00:00
Dan Williams
485d49f05c Cleanup finalize and free lists
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2171 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-05 04:14:43 +00:00
Dan Williams
1afbd66971 Really fix dispatch_signal() segfault by removing signal handlers that were supposed to be removed from the internal signal handler list
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2170 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-05 04:14:04 +00:00