Commit Graph

198 Commits

Author SHA1 Message Date
Dan Williams
b4767a5c1f dns: fix handling of searches and domains in resolv.conf
Fix a few issues here:

- nm_utils_merge_ip4_config() didn't reset domains, which would cause domains
    to still be used even if the user elected to ignore DHCP-provided DNS
- nm_ip4_config_add_domain() and nm_ip4_config_add_search() didn't filter
    duplicates
- nm_ip4_config_reset_searches() leaked everything
- If the user had specified an appended search in the connection, that search
    would be added to the 'searches' field in resolv.conf, but any server
    returned domains in 'domain_name' would be ignored because at least one
    search existed.
2009-05-11 20:07:39 -04:00
Dan Williams
07cc26d5fc wifi: handle WEP & WPA passphrases (bgo #513820) (rh #441070)
Instead of requiring applets to hash passphrases, just do it in NM instead.
This should fix confusion where people don't understand that they are seeing
their hashed passphrase.
2009-05-09 23:09:42 -04:00
Dan Williams
27a1b1607f core: clean up initial device messages 2009-02-18 14:21:02 -05:00
Tambet Ingo
9c0d6b468d Share some utility helper functions to send hash tables containing GValues over dbus. 2009-02-09 11:01:35 +02:00
Dan Williams
f06a136a99 move nm_utils_ip4_addr_to_nl_addr() to nm-ip4-config.c
Since that's the only place it's used.
2009-01-18 20:04:14 -05:00
Dan Williams
948ee274da 2008-12-09 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip4-config.h
		- Add 'never-default' property, which when true indicates that a
			connection should never be the default connection

	* src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- (nm_ip4_config_get_never_default, nm_ip4_config_set_never_default):
			Add never-default helpers

	* src/NetworkManagerUtils.c
		- (nm_utils_merge_ip4_config): update never-default when merging the
			IP4 setting to the IP4 config

	* src/NetworkManagerSystem.c
		- (nm_system_apply_ip4_config): if the connection is never-default,
			don't add routes without a gateway

	* src/NetworkManagerPolicy.c
		- (get_best_device): don't let never-default connections be the best
		- (update_routing_and_dns): handle never-default for VPN connections

	* system-settings/plugins/ifcfg-rh/reader.c
		- (make_ip4_setting): handle never-default by checking GATEWAYDEV



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/NETWORKMANAGER_0_7@4378 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-12-09 20:01:49 +00:00
Dan Williams
24e50f7f6f 2008-11-02 Dan Williams <dcbw@redhat.com>
* Add license headers to everything in src/



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4247 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-03 04:13:42 +00:00
Dan Williams
bfb7243663 2008-10-29 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip4-config.h
		- Make properties private and add accessor functions

	* callouts/nm-dispatcher-action.c
	  libnm-glib/libnm-glib-test.c
	  libnm-util/nm-utils.c
	  src/NetworkManagerPolicy.c
	  src/NetworkManagerSystem.c
	  src/NetworkManagerUtils.c
	  src/dhcp-manager/nm-dhcp-dhclient.c
	  src/dhcp-manager/nm-dhcp-manager.c
	  src/dnsmasq-manager/nm-dnsmasq-manager.c
	  src/nm-device-wifi.c
	  src/nm-device.c
	  src/nm-hso-gsm-device.c
	  src/nm-ip4-config.c
	  src/nm-ip4-config.h
	  src/ppp-manager/nm-ppp-manager.c
	  src/vpn-manager/nm-vpn-connection.c
	  system-settings/plugins/ifcfg-fedora/reader.c
	  system-settings/plugins/ifcfg-suse/parser.c
	  system-settings/plugins/ifcfg-suse/plugin.c
	  system-settings/plugins/ifupdown/parser.c
	  test/nm-tool.c
	  vpn-daemons/vpnc/properties/nm-vpnc.c
		- Use IP4 accessor functions



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4233 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-29 14:35:25 +00:00
Dan Williams
831a6fae57 Unref the proxy a bit earlier in vain hope of fixing segfaults on shutdown
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4195 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-20 11:49:53 +00:00
Dan Williams
1182e8579b 2008-10-08 Dan Williams <dcbw@redhat.com>
Add a 'hostname' dispatcher action triggered on hostname changes (bgo #552983)

	* src/NetworkManagerUtils.c
		- (nm_utils_call_dispatcher): add a 'hostname' action

	* src/NetworkManagerPolicy.c
		- (set_system_hostname): dispatch hostname changes

	* callouts/nm-dispatcher-action.c
		- (nm_dispatcher_action): handle 'hostname' actions



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4158 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-08 22:40:42 +00:00
Dan Williams
c89a99a723 Fix flawed comparison (Pablo Martí)
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4029 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-03 20:51:36 +00:00
Dan Williams
93b5092423 Clean up messages
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3948 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-13 15:43:13 +00:00
Dan Williams
2c31b5499b 2008-08-06 Dan Williams <dcbw@redhat.com>
* 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
2008-08-06 22:23:48 +00:00
Dan Williams
e1e4100f76 2008-07-07 Dan Williams <dcbw@redhat.com>
Convert to using IPv4 prefixes instead of netmasks.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3812 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-07 18:57:37 +00:00
Dan Williams
b0cf66eda8 2008-06-26 Dan Williams <dcbw@redhat.com>
* Update FSF address in license headers (Michael Biebl <biebl@debian.org>)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3775 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-26 18:31:52 +00:00
Dan Williams
0fdb07ca3d 2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-11-wireless rename.  Get rid of the 802-11/80211/802_11 bits
	and use "wifi" everwhere instead.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3742 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 16:32:39 +00:00
Dan Williams
2b00116361 2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-3-ethernet rename.  Get rid of the 802-3/8023/802_3 bits.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3741 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 15:54:23 +00:00
Tambet Ingo
4874f758d8 2008-06-02 Tambet Ingo <tambet@gmail.com>
* libnm-util/nm-setting-ip4-config.[ch]: Add static routes property.

	* src/nm-ip4-config.[ch]: Store the static routes as a list of
	NMIP4Address, update the getters and setters.

	* src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config):
	Use the updated NMIP4Config routes api.

	* src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Merge
	static routes as well.

	* src/NetworkManagerSystem.c (netmask_to_prefix): Implement.
	(nm_system_device_set_from_ip4_config): Use the updated NMIP4Config
	routes api.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3715 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-02 08:44:48 +00:00
Tambet Ingo
0ada5a4263 2008-05-23 Tambet Ingo <tambet@gmail.com>
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS
	information received from DHCP.

	* libnm-util/nm-setting-ip4-config.c: Add a new membet "ignore_dhcp_dns"
	to make it possible to ignore the DNS information (both servers and
	searches) returned by DHCP server.

	* src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Reset the
	name servers and searches if "ignore_dhcp_dns" is set.

	* src/nm-ip4-config.c (nm_ip4_config_reset_nameservers)
	(nm_ip4_config_reset_searches): Implement.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3685 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-23 07:35:43 +00:00
Dan Williams
51503b2d5f 2008-05-06 Dan Williams <dcbw@redhat.com>
* 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
2008-05-06 21:53:22 +00:00
Dan Williams
74e56e23e8 2008-04-27 Dan Williams <dcbw@redhat.com>
* 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
2008-04-27 14:30:06 +00:00
Dan Williams
394ef96603 Remove unneeded includes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3604 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-27 12:25:08 +00:00
Dan Williams
6fbc29779a 2008-04-27 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
	  src/NetworkManagerUtils.h
		- remove unneeded includes
		- (nm_null_safe_strcmp, nm_ethernet_addresses_are_equal,
		   nm_utils_inet_ip4_address_as_string, nm_timeval_has_passed,
		   nm_timeval_cmp, nm_timeval_add): remove, unused
		- clean up formatting
		- (nm_spawn_process): de-uglify

	* src/nm-device-802-11-wireless.c
		- (get_active_ap): use memcmp() not nm_ethernet_addresses_are_equal()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3603 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-27 12:23:17 +00:00
Dan Williams
78e86f91fe 2008-04-20 Dan Williams <dcbw@redhat.com>
* 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
2008-04-21 03:02:32 +00:00
Dan Williams
1666852c0d Doesn't need iwlib.h
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3459 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-14 21:05:11 +00:00
Dan Williams
fab1135d97 2008-03-13 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
	  src/NetworkManagerUtils.h
		- (nm_ether_ntop): replacement for iw_ether_ntop()

	* src/NetworkManagerAP.c
	  src/nm-device-802-11-wireless.c
	  src/nm-device-802-3-ethernet.c
		- s/iw_ether_ntop/nm_ether_ntop/g



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3451 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-13 20:52:23 +00:00
Dan Williams
6cfaab9c0c 2008-03-13 Dan Williams <dcbw@redhat.com>
* NetworkManagerUtils.c
	  NetworkManagerUtils.h
		- Remove NMSock stuff
		- Remove the completion stuff

	* nm-device.c
	  nm-device.h
	  NetworkManager.c
	  NetworkManagerSystem.c
	  autoip.c
	  nm-device-802-11-wireless.c
	  nm-device-802-3-ethernet.c
		- Remove NMSock and completion stuff
		- Remove nm_ioctl_info()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3448 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-13 19:31:08 +00:00
Dan Williams
13e564174d 2007-11-15 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_ethernet_address_is_valid): unbreak previous fix



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3090 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-15 20:33:08 +00:00
Dan Williams
da4f9c0df2 2007-11-15 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_ethernet_address_is_valid): fix style, clarify
		- (nm_ethernet_addresses_are_equal): don't try to memcmp NULLs

	* src/nm-device-802-11-wireless.c
		- (get_active_ap): handle failure from nm_device_802_11_wireless_get_bssid()
		- (nm_device_802_11_wireless_get_ssid,
		   nm_device_802_11_wireless_get_bssid,
		   nm_device_802_11_wireless_get_bitrate): zero the wreq structure
		   	before calling the ioctl; fixes valgrind-reported jump depends on
			uninitialized value errors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3086 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-15 18:33:17 +00:00
Tambet Ingo
24adbe3fa4 2007-10-09 Tambet Ingo <tambet@gmail.com>
* src/NetworkManagerUtils.c
        (nm_utils_is_empty_ssid):
        (nm_utils_escape_ssid):
        (nm_utils_same_ssid): Remove. These functions are copied and
pasted in a 
        lot of places, so they belong to libnm-utils instead.

        Now with 100% less compiler warnings:

        * libnm-util/nm-utils.c (nm_dbus_escape_object_path): Remove,
        * unused.
        (nm_dbus_unescape_object_path): Ditto.
        (nm_utils_ssid_to_utf8): Ditto.
        (nm_utils_is_empty_ssid): Move here from
src/NetworkManagerUtils.c
        (nm_utils_escape_ssid): Ditto.
        (nm_utils_same_ssid): Ditto.

        * src/nm-manager.c: Include 'netinet/ether.h' for ether_aton_r.
        (add_one_connection_element): Remove an unused variable.
        (impl_manager_get_active_connections): Ditto.

        * src/NetworkManagerPolicy.c (get_device_connection): Remove an
        * unused
        variable.

        * src/nm-dbus-manager.c (nm_dbus_manager_start_service): Remove
        * a leftover
        from the previous commit.

        * src/nm-device-802-11-wireless.c (set_current_ap): Remove
        * unused variable.
        (real_act_stage1_prepare): Ditto.
        (activation_success_handler): Ditto.
        (get_property): Ditto.

        * src/nm-device-802-3-ethernet.c (real_get_best_connection):
        * Remove unused
        variable.

        * src/ppp-manager/nm-pppd-plugin.c (nm_ip_up): Remove the check
        * for 'ifname',
        it's always set.

        * src/supplicant-manager/nm-supplicant-config.c 
        (nm_supplicant_config_add_setting_wireless): Cast the
GByteArray's 'guint8 *'
        to expected "char *".
        (nm_supplicant_config_add_setting_wireless): Ditto.
        (nm_supplicant_config_remove_option): Remove, not used.

        * libnm-glib/libnm-glib-test.c (dump_access_point): Frequency is
        * a guint32,
        not double.
        (test_wireless_enabled): Ifdef out unused function.
        (device_deactivate): Ditto.
        (device_state_changed): Ditto.
        (nm_utils_is_empty_ssid): Remove, it's now in libnm-utils.
        (nm_utils_escape_ssid): Ditto.

        * test/nm-tool.c (nm_utils_escape_ssid): Remove, it's now in
        * libnm-utils.
        (nm_utils_is_empty_ssid): Ditto.

        * libnm-glib/nm-client.c
        * (nm_client_free_active_connection_element): Remove
        unused variable.

        * libnm-util/nm-setting.c (setting_wireless_destroy): Remove
        * unused variable.
        (setting_vpn_properties_update_secrets): Ditto.
        (int_to_gvalue): Ifdef out for now, not used.
        (byte_to_gvalue): Ditto.

        * libnm-util/dbus-dict-helpers.c
        * (_nmu_dbus_add_dict_entry_string_array): 
        Unused, remove.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2960 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-09 08:57:35 +00:00
Dan Williams
ef1624f204 2007-09-12 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
	  src/NetworkManagerUtils.h
		- (nm_utils_hexstr2bin): new function



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2794 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-12 04:45:18 +00:00
Dan Williams
0930458ea4 2007-09-10 Dan Williams <dcbw@redhat.com>
* NetworkManagerAP.c
	  NetworkManagerAP.h
	  NetworkManagerPolicy.c
	  NetworkManagerSystem.c
	  NetworkManagerUtils.c
	  NetworkManagerUtils.h
	  nm-device-802-11-wireless.c
	  nm-device-802-3-ethernet.c
	  nm-hal-manager.c
	  nm-manager.c
	  vpn-manager/nm-dbus-vpn.c
		- Warning fixes; casts and removal of unused variables



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2779 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-10 19:51:25 +00:00
Dan Williams
386998c983 2007-08-25 Dan Williams <dcbw@redhat.com>
It's 2007. Remove support for drivers that don't support wireless scanning.

	* test/nm-tool.c
	  include/NetworkManager.h
	  src/NetworkManagerUtils.c
	  src/NetworkManagerPolicy.c
	  src/nm-device-802-11-wireless.c
		- Remove special handling for non-scanning devices and mark them
			as unsupported/unhandled



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2726 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-25 15:07:23 +00:00
Dan Williams
0b9df92472 2007-08-14 Dan Williams <dcbw@redhat.com>
(force-commit to fix wrong comment and partial commit of r2685; this
	 commit actually applies to r2685)

	* src/NetworkManagerUtils.c
		- (nm_utils_same_ssid): add "ignore_trailing_null" parameter which
			ignores trailing nulls in the SSID to work around mismatches in
			expectations between WEXT and what the info-daemon passes back.  The
			info-daemon would pass back the correct length, but due to the
			ESSID length issues with WEXT 22 and greater and wpa_supplicant,
			the device would always have an SSID + 1 depending on what versions
			of wpa_supplicant, the kernel, and NM you have.  This was most often
			visible by just quitting the applet and relaunching, which caused
			NM to reassociated to the same network over again when reloading
			the save networks.

	* src/NetworkManagerPolicy.c
	  src/NetworkManagerUtils.h
	  src/nm-device-802-11-wireless.c
		- Update for new parameter to nm_utils_same_ssid()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2686 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-15 01:59:19 +00:00
Dan Williams
ccb13f0bdd 2007-08-14 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_utils_escape_ssid): add "ignore_trailing_null" parameter which
			ignores trailing nulls in the SSID to work around mismatches in
			expectations between WEXT and what the info-daemon passes back.  The
			info-daemon would pass back the correct length, but due to the
			ESSID length issues with WEXT 22 and greater and wpa_supplicant,
			the device would always have an SSID + 1 depending on what versions
			of wpa_supplicant, the kernel, and NM you have.  This was most often
			visible by just quitting the applet and relaunching, which caused
			NM to reassociated to the same network over again when reloading
			the save networks.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2685 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-15 01:56:02 +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
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
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
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
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
f05b1fc87f 2006-10-25 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_utils_supplicant_request_with_check): suppress messages for the
			"SCAN" command


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2085 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-10-25 04:11:05 +00:00
Dan Williams
1e28384c62 2006-08-24 Dan Williams <dcbw@redhat.com>
Patch from Ed Catmur:
	* src/NetworkManagerUtils.c
		- (nm_utils_ip4_netmask_to_prefix): don't infinitely loop
		if netmask is 0 (Gnome #352634)


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1987 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-08-24 11:01:37 +00:00
Dan Williams
09c39bede0 Set driver name to <unknown> when the driver is unknown
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1863 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-07-09 22:08:18 +00:00
Robert Love
b428d9d8a2 2006-05-17 Robert Love <rml@novell.com>
Functionality to automatically add BSSIDs to the allowed-MAC list as
	one roams from access point to access point on a given network:
	* src/NetworkManagerUtils.c: Add nm_ethernet_addresses_are_equal(),
	  helper function to compare two ether_addr structures and return TRUE
	  if they contain the same MAC address.
	* src/NetworkManagerUtils.h: Add nm_ethernet_addresses_are_equal()
	  prototype.
	* src/nm-device-802-11-wireless.c: New function to update the BSSID
	  stored with the current AP.  If the BSSID has indeed changed, we
	  send it out to the applet, allowing the allowed-MAC list to grow
	  automatically in response to roaming.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1739 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-05-17 15:02:57 +00:00
Robert Love
dc0ce48841 2006-02-06 Robert Love <rml@novell.com>
* src/NetworkManagerUtils.c: kill_newline(): 'l' is unsigned so the
	  test ">=" is never false.  If no newline is found, we loop forever.
	  We can just check for ">" because the following if will see zero-th
	  argument if the while gets that far.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1455 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-06 17:12:04 +00:00
Dan Williams
52eb85845a 2006-02-05 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_utils_supplicant_request_with_check, nm_utils_supplicant_request):
			Handle newline killing better


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1444 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-05 05:50:03 +00:00
Robert Love
77e9f0997e 2006-02-03 Robert Love <rml@novell.com>
* src/NetworkManagerUtils.c: Even for debugging, we should not log the
	  user's encryption key, so we print the err_msg_cmd not the command,
	  if available.  So long as SUPPLICANT_DEBUG is default, this makes
	  sense.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1441 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-03 20:18:58 +00:00
Dan Williams
d42f707d14 Remove newlines from debug output
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-07 23:19:55 +00:00
Dan Williams
e260b697fc 2006-01-07 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
		- (nm_utils_supplicant_request, nm_utils_supplicant_request_with_check):
			pass correct buffer length to wpa_ctrl_request()


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1284 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-07 16:22:57 +00:00
Dan Williams
9dcbf019bb 2006-01-04 Dan Williams <dcbw@redhat.com>
First dump of wpa_supplicant-related code.  It's not hooked up to
	anything yet though.  Thanks to Kay Sievers for
	wpa_supplicant_wrapper.c, which formed the basis for this work,
	and to Jouni Malinen for writing wpa_ctrl.c and wpa_ctrl.h.

	* src/Makefile.am
	  src/wpa_ctrl.[ch]
		- Add wpa_ctrl stuff from wpa_supplicant so we can talk to it

	* src/NetworkManagerUtils.[ch]
		- (nm_utils_supplicant_request, nm_utils_supplicant_request_with_check):
			Add convenience functions for talking to wpa_supplicant

	* src/nm-ap-security.[ch]
	  src/nm-ap-security-wep.c
	  src/nm-ap-security-wpa-psk.[ch]
		- Update and implement real_write_supplicant_config functions
			in all security types
		- (nm_ap_security_wpa_psk_new_from_ap): implement in
			nm-ap-security-wpa-psk.c

	* src/nm-device-802-11-wireless.c
		- (supplicant_cleanup, supplicant_watch_cb, supplicant_monitor_status_cb,
		   wpa_supplicant_start, wpa_supplicant_interface_init,
		   wpa_supplicant_send_network_config): add functions to talk to
			wpa_supplicant and write network config to it


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1267 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-05 04:44:11 +00:00