Commit Graph

99 Commits

Author SHA1 Message Date
Dan Williams
05e9de9402 2008-06-12 Dan Williams <dcbw@redhat.com>
Add a GError argument to nm_connection_verify() and nm_setting_verify(),
	and add error enums to each NMSetting subclass.  Each NMSetting subclass now
	returns a descriptive GError when verification fails.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3751 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-12 23:58:08 +00:00
Tambet Ingo
d95e330f96 2008-06-05 Tambet Ingo <tambet@gmail.com>
Fix memory leaks.

	* system-settings/src/nm-system-config-hal-manager.c (get_type_for_udi):
	Free data returned from dbus method call.

	* system-settings/src/nm-polkit-helpers.c (check_polkit_privileges):
	dbus_g_method_get_sender() returns a duplicated string, free it
	when done.
	(check_polkit_privileges): Looks like policykit sometimes returns
	error and non-null return value, don't leak errors in that case.

	* system-settings/src/main.c (find_plugin): Don't leak existing
	plugin names.
	(load_stuff): Don't leak device list and list items.
	(have_connection_for_device): Don't leak connection list.

	* system-settings/plugins/keyfile/reader.c (read_one_setting_value):
	Free the data received from g_keyfile_get_*.

	* system-settings/plugins/ifcfg-suse/parser.c (READ_WEP_KEY): Free
	the key when the security object is updated.

	* src/supplicant-manager/nm-supplicant-interface.c (scan_results_cb):
	Free data returned from dbus method call.
	(iface_state_cb): Ditto.
	(add_network_cb): Ditto.
	(nm_supplicant_interface_add_cb): Don't make another copy of already
	duplicated object path.
	(nm_supplicant_interface_add_to_supplicant): Free the driver GValue
	when done.

	* src/supplicant-manager/nm-supplicant-config.c
	(ADD_STRING_LIST_VAL): Fix a memory leak.

	* src/nm-manager.c (free_get_settings_info): Free the allocated
	memory slice.
	(list_connections_cb): Free data returned from dbus method call.
	(system_settings_get_unmanaged_devices_cb): Ditto.

	* src/nm-device-802-11-wireless.c (device_cleanup): Free ssid.

	* system-settings/plugins/ifcfg-suse/shvar.c (svCloseFile):
	* system-settings/plugins/ifcfg-fedora/shvar.c (svCloseFile):
	* src/backends/shvar.c (svCloseFile): Free the duplicated content
	of the GList.

	* libnm-util/nm-setting.c (nm_setting_from_hash): Free the constructor
	arguments after the object is created.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3721 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-05 13:16:02 +00:00
Tambet Ingo
0d91f460d6 2008-04-15 Tambet Ingo <tambet@gmail.com>
* libnm-util/nm-setting.c (nm_setting_duplicate): Implement.

	* libnm-util/nm-connection.c (nm_connection_remove_setting): Implement.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3560 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-15 16:03:26 +00:00
Dan Williams
ade314556c 2008-02-25 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (nm_setting_compare): Fix C&P error from r3068 that caused settings
			comparisons to always succeed; clarify assignment of values to
			'different'



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3341 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-02-25 22:06:18 +00:00
Dan Williams
00a3dfbafa 2008-02-24 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_compare): fix 'fuzzy' compare logic; add IGNORE_ID bits;
			fix return value to match nm_connection_compare() meaning



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3340 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-02-25 03:32:43 +00:00
Dan Williams
316abd62fd 2008-02-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_compare): accept compare flags and pass them to the
			setting compare function

	* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_compare): accept compare flags; ignore properties that are
			marked fuzzy

	* libnm-util/nm-setting-connection.c
	  libnm-util/nm-setting-wireless.c
	  libnm-util/nm-setting-ppp.c
	  libnm-util/nm-setting-wired.c
		- Mark some setting properties as ignorable when doing a fuzzy compare

	* src/nm-device.c
		- (device_activation_precheck): use exact compare



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3336 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-02-21 04:34:34 +00:00
Dan Williams
6003709b69 More descriptive error
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3142 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-12-06 15:25:30 +00:00
Dan Williams
53f271805f 2007-11-15 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (nm_setting_to_hash, one_property_cb): revert previous commit, it's
			unecessary to serialize 'name'

	* src/nm-activation-request.c
		- (get_secrets_cb): fix cases where a full NMSetting is returned from
			the GetSecrets call



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3085 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-15 16:57:33 +00:00
Dan Williams
dcc6b2a9c0 2007-11-15 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-connection.h
	  libnm-util/nm-setting-connection.c
		- Rename the 'name' property to 'id', because it conflicted with the
			NMSetting superclass' 'name' property.

	* libnm-util/nm-setting.c
		- (nm_setting_to_hash): serialize the 'name' property
		- (one_property_cb): ignore 'name' on deserialization of a connection

	* src/nm-device-802-11-wireless.c
	  src/vpn-manager/nm-vpn-connection.c
	  src/NetworkManagerPolicy.c
		- Fix up for NMSettingConnection 'name'->'id' changes



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3084 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-15 15:52:42 +00:00
Dan Williams
5523faaeb8 2007-11-09 Dan Williams <dcbw@redhat.com>
Fix vpn-properties setting update_secrets call for new NMSetting stuff.
	Since the vpn-properties are managed and known by the VPN daemons themselves,
	libnm-util doesn't know what's secret and what's in the setting's 'data'
	member.

	* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
		- Add the ability for subclasses to override update_one_secret

	* libnm-util/nm-setting-vpn-properties.c
		- Override update_one_secret and just copy the values into the
			internal table



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3078 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-09 19:41:20 +00:00
Tambet Ingo
6b79d40a76 2007-11-07 Tambet Ingo <tambet@gmail.com>
Rework NMSetting structures: Move each setting to it's own file.
        Convert to GObject. Remove home grown setting types and use
GTypes.
        Use GObject property introspection for hash conversion,
enumerating
        properties, etc.

        * libnm-util/nm-setting-connection.[ch]
        * libnm-util/nm-setting-ip4-config.[ch]
        * libnm-util/nm-setting-ppp.[ch]
        * libnm-util/nm-setting-vpn.[ch]
        * libnm-util/nm-setting-vpn-properties.[ch]
        * libnm-util/nm-setting-wired.[ch]
        * libnm-util/nm-setting-wireless.[ch]
        * libnm-util/nm-setting-wireless-security.[ch]

        New files, each containing a setting.

        * libnm-util/nm-setting-template.[ch]: A template for creating
        * new
        settings. To use it, just replace 'template' with the new
setting
        name, and you're half-way done.

        * libnm-util/nm-setting.c: Convert to GObject and use GObject
        introspection instead of internal types and tables.

        * libnm-util/nm-connection.c: Adapt the new NMSetting work.

        * libnm-util/nm-param-spec-specialized.[ch]: Implement. Handles
        GValue types defined by dbus-glib for composed types like
collections,
        structures and maps.

        * src/*: The API of NMSetting and NMConnection changed a bit:
        * Getting
        a setting from connection takes the setting type now. Also,
since
        the settings are in multiple files, include relevant settings.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3068 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-07 16:06:43 +00:00
Dan Williams
97d77a648c 2007-10-24 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_need_secrets): Fix lookup table logic for
			EAP method need secrets



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3017 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-24 17:55:42 +00:00
Dan Williams
0232d9b7b1 Fix return values
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3014 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-23 21:04:36 +00:00
Dan Williams
aedced3964 2007-10-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.c
		- (nm_setting_compare): implement
		- (default_setting_compare_fn, do_one_compare, compare_gvalue_hash,
		   compare_one_hash_gvalue): compare the contents of a setting

	* libnm-util/nm-connection.c
		- (nm_connection_compare): implement



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3013 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-23 20:41:10 +00:00
Dan Williams
fbd22c96bb 2007-10-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_verify): new function; verify one setting
		- (nm_settings_verify_all): rename from nm_settings_verify()
		- (setting_connection_verify, setting_wireless_verify): allow NULL
			all_settings

	* libnm-util/nm-connection.c
		- (nm_connection_replace_settings, nm_connection_verify,
		   nm_connection_new_from_hash): handle nm_settings_verify() rename



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3011 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-23 18:33:49 +00:00
Dan Williams
a83107ff1d 2007-10-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_need_secrets): ensure auth_alg is !NULL
			before trying to do something with it



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3005 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-23 13:27:26 +00:00
Dan Williams
4c4f59674a 2007-10-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_need_secrets, need_secrets_phase2,
		   need_secrets_tls, need_secrets_sim, need_secrets_eappsk,
		   need_secrets_password, setting_wireless_security_verify): fix
			need_secrets for IEEE 802.1x and WPA-EAP by implementing need
			secrets logic for each supported EAP method



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3000 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-23 10:53:13 +00:00
Tambet Ingo
7ba9c6e1c5 2007-10-22 Tambet Ingo <tambet@gmail.com>
Implement support for static IP addresses, additional/overridden
DNS and
        DNS domain search lists.

        * libnm-util/nm-setting.c (uint_array_to_gvalue): Implement.
        (ip4_addresses_to_gvalue): Implement.
        (convert_array_to_byte_array): Implement.
        (nm_setting_populate_from_hash_default): Handle
NM_S_TYPE_UINT_ARRAY and
        NM_S_TYPE_IP4_ADDRESSES.
        (nm_setting_hash): Ditto.
        (default_setting_clear_secrets): Add a default case for the
switch: IP address
        shouldn't be secret, ever.
        (setting_ip4_config_verify): Update, requires addresses in case
of manual
        configurations.
        (setting_ip4_config_destroy): Free stuff.

        * src/nm-device.c (merge_ip4_config): Implement.
        (real_act_stage4_get_ip4_config): Merge IP4 configuration from
NMConnection.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2996 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-22 15:45:39 +00:00
Dan Williams
a7f3b960f4 2007-10-22 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_verify): allow WEP-40 and WEP-104 as
			pairwise cipher options for Dynamic WEP



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2995 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-22 13:58:04 +00:00
Dan Williams
8ea008c55c 2007-10-16 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_verify): fix phase2_auth methods; 'sim'
			also isn't valid phase2 autheap method



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2984 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-17 02:22:35 +00:00
Tambet Ingo
850f441ea5 2007-10-16 Tambet Ingo <tambet@gmail.com>
Implement a generic NMSetting creator from setting name.
        While at it, get rid of all nm_setting_foo_new_from_hash()
functions and
        add a virtual function 'populate_fn'.

        * libnm-util/nm-connection.c (nm_connection_create_setting):
        * Implement.
        (register_default_creators): Register setting creators instead
of functions
        that create and then populate.
        (parse_one_setting): Use the common setting creator and then
setting specific
        poplulation function.

        * libnm-util/nm-setting.c: Get rid of
        * nm_setting_foo_new_from_hash() functions,
        they all looked exactly the same.
        Add a 'populate_fn' virtual function to NMSetting.
        Use default virtual functions in case they are not overriden.
        (nm_setting_populate_from_hash): Implement.

        * src/nm-device.c (real_act_stage3_ip_config_start): Don't hard
        * code the setting
        name, use a defined string.
        (real_act_stage4_get_ip4_config): Ditto.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2978 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-16 15:18:01 +00:00
Dan Williams
799c141b35 2007-10-14 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_security_need_secrets): handle LEAP secrets



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2974 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-14 12:16:30 +00:00
Dan Williams
52fd366c05 2007-10-13 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
	  src/supplicant-manager/nm-supplicant-config.c
		- Make the 'proto' field of the 802-11-wireless-security field a
			string list



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2973 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-14 02:28:28 +00:00
Dan Williams
2766bbe292 2007-10-10 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- Add a default 'user_name' field to the VPN setting, which VPN plugins
			can use if they choose.  Should be filled in by the settings service
			on-the-fly with the currently logged in user's username



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2967 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-10 20:24:34 +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
80817ec8c4 2007-10-05 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_wireless_verify, setting_wireless_destroy): add seen_bssids
			to the NMSettingWireless table; it's now a string array not an array
			of byte arrays



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2938 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-06 02:33:17 +00:00
Dan Williams
6829447903 2007-10-04 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (nm_settings_verify): use #defines when possible rather than strings
		- (setting_connection_verify): ensure that 'name' and 'type' are valid
		- (setting_vpn_verify): tighter validity check on 'service_type'



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2932 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-04 14:09:59 +00:00
Dan Williams
b7e5539b8c 2007-10-01 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.h
		- Add a 'timestamp' option to NMSettingConnection
		- Add a UINT64 type

	* libnm-util/nm-setting.c
		- (uint64_to_gvalue): new function
		- (nm_setting_populate_from_hash, nm_setting_hash,
		   default_setting_clear_secrets): handle UINT64 type
		- con_table: add 'timestamp' member



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2923 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-02 01:50:59 +00:00
Dan Williams
50f2ce4fc8 2007-09-26 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (setting_vpn_properties_update_secrets): implement so VPN secrets
			actually get updated when the user enters them



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2897 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-27 03:04:22 +00:00
Dan Williams
008bab498f 2007-09-25 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_clear_secrets): new function; clear secrets out of
			each NMSetting in an NMConnection

	* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
		- (nm_setting_clear_secrets, default_setting_clear_secrets): clear 
			secrets out of an NMSetting
		- (nm_setting_connection_new, nm_setting_ip4_config_new, 
		   nm_setting_wired_new, nm_setting_wireless_new,
		   nm_setting_wireless_security_new, nm_setting_ppp_new,
		   nm_setting_vpn_new, nm_setting_vpn_properties_new): set clear_secrets
			to default handler default_setting_clear_secrets()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2871 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-25 06:11:44 +00:00
Dan Williams
192e129734 2007-09-24 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (verify_wep_key): 40-bit WEP keys are 10 bytes long, not 13



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2868 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-25 04:03:16 +00:00
Dan Williams
d9b8a5e30b 2007-09-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- Correctly dispose of settings objects if creating them from a hash
			table fails



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2860 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-24 04:02:52 +00:00
Dan Williams
4a7fb5f0b3 2007-09-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (property_value_destroy, nm_setting_vpn_properties_new): initialize
			the hash table in a standard manner.  Clients of libnm-util should
			only call g_hash_table_remove_all(), never destroy the hash table
			and recreate it.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2859 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-24 04:01:24 +00:00
Dan Williams
300b9e48eb 2007-09-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (convert_strv_to_slist): dupe the values in the list because since
			the list is a boxed value, it'll get destroyed when it's container
			(like a hash table or whatever) gets destroyed



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2835 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-21 01:25:11 +00:00
Dan Williams
d24485c553 Warning fixes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2833 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-20 12:03:30 +00:00
Tambet Ingo
3f19c07885 2007-09-20 Tambet Ingo <tambet@gmail.com>
* libnm-util/nm-setting.h: Change the type of
        * NMSettingVPN->routes to
        GSList.

        * libnm-util/nm-setting.c (setting_vpn_destroy): Free routes
        * too.

        * src/nm-manager.c (connection_get_settings_cb): No need to use
        * weakref,
        just use (g_object_set_data_full).

        * src/vpn-manager/nm-vpn-connection.c
        * (nm_vpn_connection_get_routes): Now
        that NMSettingVPN->routes is a GSList, convert it to char **.
        (nm_vpn_connection_ip4_config_get): Free routes when done.
        (nm_vpn_connection_activate): Ditto.

        * src/nm-device-802-11-wireless.c
        * (real_connection_secrets_updated)
        (real_act_stage2_config): Use defined setting names.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2832 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-20 11:52:51 +00:00
Tambet Ingo
6746319495 2007-09-20 Tambet Ingo <tambet@gmail.com>
* libnm-util/nm-connection.c (register_default_creators): Use
        * defined
        setting names. Register NMSettingVPN and NMSettingVPNProperties.

        * libnm-util/nm-setting.c: Define property name strings, use
        * them.
        Implement NMSettingVPN and NMSettingVPNProperties settings.
        Implement NM_S_TYPE_GVALUE_HASH.
        (nm_setting_populate_from_hash): Handle NM_S_TYPE_GVALUE_HASH.
        (setting_connection_verify): Rename 'devtype' property to
'type'.

        * introspection/nm-vpn-manager.xml: Use NMConnection for VPN
        * service
        properties.

        * src/vpn-manager/nm-vpn-service.c: Ditto.

        * src/vpn-manager/nm-vpn-connection.c: Ditto.

        * src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_connect):
        * Ditto.
        (nm_vpn_manager_new): Remove NMManager argument, it's easy
enough to get.

        * src/nm-device-802-11-wireless.c (find_best_connection): Use
        * defined setting
        names. NMSettingConnection->devtype got renamed to 'type'.

        * src/nm-device-802-3-ethernet.c (find_best_connection):
        (real_get_best_connection): Ditto.

        * src/NetworkManager.c (main): Update the vpn manager creation
        * arguments.

        * libnm-glib/nm-vpn-manager.[ch]: Update.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2826 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-20 06:47:15 +00:00
Dan Williams
7535733df5 2007-09-16 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_for_each_setting_value): new function; iterate over
			each setting's value and call a user-provided function with details
			about that value

	* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_enumerate_values): new function; enumerate the values
			of a specific NMSetting subclass for a user-provided function with
			details about that value
		- Change wep_tx_keyidx to a uint32
		- Create settings value tables for each setting defining their type,
			key name, offset into the NMSetting subclass' structure, and whether
			they are required and/or a secret
		- (nm_setting_populate_from_hash): generic function to populate an
			NMSetting from a GHash table, make all settings use it
		- (nm_setting_hash): generic function to derive a GHashTable from
			an NMSetting object, make all settings use it



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2823 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-16 12:47:14 +00:00
Dan Williams
f361475095 2007-09-13 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (nm_setting_wired_new): set autonegotiate to TRUE by default



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2800 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-13 11:48:56 +00:00
Dan Williams
e705a7082e 2007-09-11 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
		- (nm_connection_update_secrets, need_secrets_check): move
			802-11-wireless-security need_secrets checks to the setting object
			itself, where it belongs

	* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_need_secrets): new function
		- (setting_wireless_security_verify,
		   nm_setting_wireless_security_new_from_hash): make 'key-mgmt' required
		- (setting_wireless_security_need_secrets): mostly copy code over
			from nm-connection.c



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2784 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-11 18:28:36 +00:00
Dan Williams
937d1add73 2007-09-11 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_update_secrets): new function; add a virtual function that
			subclasses can implement to update their secrets
		- (setting_wireless_security_update_secrets): implement that function
			for the 802-11-wireless-security subclass

	* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_update_secrets): update secrets for a Setting and
			emit a signal on success

	* src/nm-manager.c
	  src/nm-manager.h
	  src/nm-marshal.list
		- (connection_get_settings_cb): enable system settings bits
		- (nm_manager_get_connection_secrets, get_secrets_cb): add function
			to request secrets from the settings dbus service and to
			push those secrets to the NMConnection itself

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- Attach to the 'secrets-updated' signal of the NMConnection that's
			currently being activated, and proxy that signal to other listeners.
			Goes through the activation request because the activation request
			is the thing that manages the lifetime of the NMConnection that's
			being activated.

	* src/nm-device-802-11-wireless.c
		- (real_connection_secrets_updated): implement the connection secrets
			updated notification and restart activation when secrets are
			received
		- (real_act_stage2_config): request secrets from the settings dbus
			service if secrets are needed

	* src/nm-device.c
	  src/nm-device.h
		- (clear_act_request, nm_device_activation_cancel,
		   nm_device_deactivate_quickly, nm_device_dispose): consolidate places
			where the activation request is cleared
		- (nm_device_activate, connection_secrets_updated_cb): attach to the
			updated secrets signal of activation request and add a function
			that subclasses can override to handle it easily



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2782 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-11 18:02:27 +00:00
Dan Williams
074dfc3f56 2007-09-02 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
		- (nm_settings_verify): correct setting name is 'connection', not 'info'
		- (setting_wireless_hash): set the right value on the item



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2762 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-03 01:08:34 +00:00
Dan Williams
d596c6113b SSID is a required setting
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2750 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-30 03:34:12 +00:00
Dan Williams
fdbfbc1d6e connection setting must have at least name and type
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2748 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-30 03:15:32 +00:00
Dan Williams
9aab44b772 2007-08-29 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
	  libnm-util/nm-connection.c
	  src/NetworkManagerPolicy.c
		- 'info' settings object should be 'connection' says the spec
		at NetworkManagerConfigurationSpecification



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2746 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-29 21:27:52 +00:00
Tambet Ingo
b1e15de652 2007-08-15 Tambet Ingo <tambet@gmail.com>
* src/ppp-manager: Implement ppp-manager. It's sort of dead code
        * for now since
        nothing is using it at the moment, but it'll be all useful and
stuff later on.

        * libnm-util/nm-setting.h: Define NMSettingPPP.

        * libnm-util/nm-setting.c: Implement NMSettingPPP.

        * libnm-util/nm-connection.c (register_default_creators):
        * Register ppp setting.

        * src/Makefile.am: Add ppp-manager to SUBDIRS.

        * configure.in: Require ppp headers. Build Makefile for
        * ppp-manager.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2695 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-15 14:30:06 +00:00
Tambet Ingo
d6cf3940cd 2007-06-08 Tambet Ingo <tambet@ximian.com>
* libnm-util/nm-setting.c: Implement NMSettingWirelessSecurity.

	* libnm-util/nm-connection.c (register_default_creators): Register wireless security
	setting.
	(gvalue_to_string): Recognize G_TYPE_UCHAR and GSList.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2581 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-08 05:47:12 +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
6c51badc69 2007-05-07 Tambet Ingo <tambet@ximian.com>
* libnm-util/nm-connection.c: 
	* libnm-util/nm-connection.h: 
	* libnm-util/nm-setting.c:
	* libnm-util/nm-setting.h: Add.

	* libnm-util/Makefile.am: Build the added files.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2568 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 14:39:20 +00:00