Commit Graph

53 Commits

Author SHA1 Message Date
Pavel Šimerda
2a4a359eb1 libnm-util: add NM_SETTING_COMPARE_FLAG_CANDIDATE flag
Acked-by: Dan Winship <danw@gnome.org>
Acked-by: Thomas Haller <thaller@redhat.com>
2013-08-22 22:06:47 +02:00
Jiří Klimeš
edb85e9720 core: fix NM_IS_*_CLASS(klass) macros
The argument is 'klass' not 'obj'.
2012-07-27 13:15:54 +02:00
Dan Winship
54ef8f3224 Fix names of error enum values
When NM was registering all of its enum types by hand, it was using
NamesLikeThis rather than the default names-like-this for the "nick"
values. When we switched to using glib-mkenums, this resulted in
dbus-glib using different strings for the D-Bus error names, causing
compatibility problems.

Fix this by using glib-mkenums annotations to manually fix all the
enum values back to what they were before. (This can't be done in a
more automated way, because the old names aren't 100% consistent. Eg,
"UNKNOWN" frequently becomes "UnknownError" rather than just
"Unknown".)
2012-03-12 15:29:52 -04:00
Dan Winship
839eab5564 Use glib-mkenums to generate enum types
Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
2012-02-15 11:42:15 -05:00
Thomas Graf
1cd8d52061 bonding: add nm_connection_get_virtual_iface_name() to abstract kernel interface binding
Some connection types such as bonding, bridging and VLAN require
specific virtual kernel interfaces identified by name to be auto
connected to the connection.

The function nm_connection_get_virtual_iface_name() returns the name
of the kernel interface if the connection type requires this
functionatlity.

Each connection base type settings class can implement the function
get_virtual_iface_name() if the connection needs to be auto connected
to a specific kernel interface.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 09:56:47 -06:00
Dan Williams
2b2404bbef settings: preserve agent secrets the right way
What we want to do here is keep separate caches of system and
agent secrets.  For system secrets, we cache them because NM
periodically clears secrets using nm_connection_clear_secrets() to
ensure they don't stay around in memory, and that transient secrets
get requested again when they are needed.  For agent secrets, we
only want them during activation, but a connection read from disk
will not include agent secrets becuase by definition they aren't
stored in system settings along with the connection.  Thus we need
to keep the agent/transient secrets somewhere for the duration of
the activation to ensure they don't get deleted.

This removes the copy-back hack in update_auth_cb() which copied
agent/transient secrets back into the connection over top of the
transient secrets that had been copied back in
nm_settings_connection_replace_settings().  No reason to copy
them twice if we keep an agent/transient secrets hash and do
the right thing with it.
2011-08-16 16:19:23 -05:00
Dan Williams
bf1d93153c docs: update Setting object documentation 2011-07-05 14:26:52 -05:00
Dan Williams
864db9f9e8 libnm-util: add new compare flags for ignoring various types of secrets
It turns out we need a way to ignore transient (agent-owned or unsaved)
secrets during connection comparison.  For example, if the user is
connecting to a network where the password is not saved, other
changes could trigger a writeout of that connection to disk when
connecting, which would the connection back in due to inotify, and the
re-read connection would then no longer be recognized as the same as
the in-memory connection due to the transient secret which obviously
wasn't read in from disk.

Adding these compare flags allows the code to not bother writing the
connection out to disk when the only difference between the on-disk
and in-memory connections are secrets that shouldn't get written to
disk anyway.
2011-06-07 18:22:48 -05:00
Dan Williams
54918e32e4 libnm-util: add nm_connection_diff()
Returns a list of keys that differ between the settings in each
connection.  nm_connection_compare() can't do that.
2011-02-22 23:36:43 -06:00
Dan Williams
ac208cafbd libnm-util: add NM_SETTING_SECRET_FLAG_NOT_REQUIRED
Not all connections will require every secret, and sometimes we
can't automatically figure out whether we need the secret.  For
vpnc sometimes the group password isn't used, and sometimes PPP
providers require a username but don't want a password, etc.
2011-02-07 13:50:40 -06:00
Dan Williams
899b8a40dc libnm-util: NM_SETTING_SECRET_FLAG_SYSTEM_OWNED -> NM_SETTING_SECRET_FLAG_NONE
Make it a bit clearer that this value is not actually a value that
can be used as a flag, since its 0x00.
2011-02-06 23:37:39 -06:00
Dan Williams
93cbc77154 libnm-util: handle get_secret_flags/set_secret_flags for WirelessSecurity setting
Becuase there's only one 'flags' property for WEP keys (because it's pretty
dumb to have different flags for all 4 WEP keys) we need to do some tap dancing
with the secret name, so that requests for "wep-keyX" look up the "wep-key-flags"
property.
2011-01-31 19:57:48 -06:00
Dan Williams
092a6535e0 libnm-util: add generic functions for getting/setting secret flags
And remove the VPN-specific ones.  It's useful to have this stuff be
generic and the functionality wasn't really VPN-specific anyway.
2011-01-31 12:41:54 -06:00
Dan Williams
562246cb80 libnm-util: fix handling of secrets flags
It's a bitfield, not a single value.  Update GObject property
max accordingly.
2011-01-31 12:36:53 -06:00
Dan Williams
5a7cf39a62 libnm-util: add secret flags for each secret describing how the secret is stored
This allows the necessary flexibility when handling secrets; otherwise
it wouldn't be known when NM should save secrets returned from agents
to backing storage, or when the agents should store the secrets. We
can't simply use lack of a secret in persistent storage as the indicator
of this, as (for example) when creating a new connection without
secrets the storage method would be abmiguous.

At the same time, fold in "always ask" functionality for OTP tokens
so user agents don't have to store that attribute themselves out-of-band.
2011-01-29 13:34:24 -06:00
Dan Williams
e68e27aa75 libnm-util: add 'flags' argument to nm_connection_to_hash() and nm_setting_to_hash()
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
2011-01-26 14:14:37 -06:00
Dan Williams
0596068561 libnm-util: add class padding for future expansion 2009-09-30 09:21:32 -07:00
Przemysław Grzegorczyk
bac45aa0d5 clean up glib includes (bgo #564376)
Only <glib.h> and <gtk/gtk.h> need to be included.
2009-01-19 00:16:40 -05:00
Dan Williams
ccbd9155ec Documentation updates
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4331 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-24 04:30:36 +00:00
Dan Williams
2328650d2e Documentation fixes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4328 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-23 22:55:03 +00:00
Dan Williams
93f1c85b26 2008-11-20 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (NMSettingValueIterFn): instead of just a gboolean for secrets, take
			all the GParamSpec flags of the property

	* system-settings/plugins/keyfile/nm-keyfile-connection.c
	  system-settings/plugins/keyfile/reader.c
	  system-settings/plugins/keyfile/writer.c
		- Update for NMSettingValueIterFn change



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4322 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 21:23:55 +00:00
Dan Williams
320c3f378c 2008-11-20 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- Add NMSetting errors
		- (nm_setting_update_secrets): return errors

	* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_update_secrets): return errors

	* libnm-util/nm-setting-vpn.c
	  src/nm-activation-request.c
	  src/vpn-manager/nm-vpn-connection.c
		- Handle update secrets errors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4314 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 15:44:57 +00:00
Dan Williams
6e40cdb3a5 2008-11-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
	  libnm-util/libnm-util.ver
		- (nm_setting_new_from_hash): rename from nm_setting_from_hash() to be
			consistent with nm_connection_new_from_hash()

	* src/nm-activation-request.c
	  libnm-util/nm-connection.c
		- Handle rename



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4312 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 14:47:08 +00:00
Dan Williams
c47cdcf0e7 2008-11-19 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
	  src/nm-device.c
	  src/nm-manager.c
	  system-settings/plugins/ifcfg-fedora/plugin.c
		- Prefix compare flag defines with NM_SETTING_



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4299 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-19 16:20:47 +00:00
Dan Williams
c438326110 2008-10-27 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
		- Make properties private and add accessor functions

	* libnm-util/nm-connection.c
	  libnm-util/nm-setting-8021x.c
	  libnm-util/nm-setting-cdma.c
	  libnm-util/nm-setting-connection.c
	  libnm-util/nm-setting-gsm.c
	  libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip6-config.c
	  libnm-util/nm-setting-ppp.c
	  libnm-util/nm-setting-pppoe.c
	  libnm-util/nm-setting-serial.c
	  libnm-util/nm-setting-template.c
	  libnm-util/nm-setting-vpn.c
	  libnm-util/nm-setting-wired.c
	  libnm-util/nm-setting-wireless-security.c
	  libnm-util/nm-setting-wireless.c
	  system-settings/plugins/keyfile/reader.c
	  system-settings/plugins/keyfile/writer.c
		- Use setting accessors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4228 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-27 17:36:18 +00:00
Dan Williams
4a15d37c27 Add compare flag to ignore secrets
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4058 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-11 20:54:02 +00:00
Dan Williams
281791ac77 2008-07-27 Dan Williams <dcbw@redhat.com>
* libnm-util/*
		- Relicense to LGPLv2+



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3859 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-27 20:03:46 +00:00
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
Dan Williams
4f421ef874 Fix syntax errors with enums in pedantic mode (Will Stephenson)
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3664 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-13 16:57:01 +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
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
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
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
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
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
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
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
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
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
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
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
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