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
This commit is contained in:
Dan Williams 2007-10-10 20:24:34 +00:00
parent 9d045f2e0a
commit 2766bbe292
3 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,11 @@
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
2007-10-10 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-11-wireless.c

View file

@ -1260,6 +1260,10 @@ setting_vpn_verify (NMSetting *setting, GHashTable *all_settings)
if (!self->service_type || !strlen (self->service_type))
return FALSE;
/* default username can be NULL, but can't be zero-length */
if (self->user_name && !strlen (self->user_name))
return FALSE;
return TRUE;
}
@ -1269,6 +1273,7 @@ setting_vpn_destroy (NMSetting *setting)
NMSettingVPN *self = (NMSettingVPN *) setting;
g_free (self->service_type);
g_free (self->user_name);
if (self->routes) {
g_slist_foreach (self->routes, (GFunc) g_free, NULL);
@ -1280,6 +1285,7 @@ setting_vpn_destroy (NMSetting *setting)
static SettingMember vpn_table[] = {
{ "service_type", NM_S_TYPE_STRING, G_STRUCT_OFFSET (NMSettingVPN, service_type), TRUE, FALSE },
{ "user_name", NM_S_TYPE_STRING, G_STRUCT_OFFSET (NMSettingVPN, user_name), FALSE, FALSE },
{ "routes", NM_S_TYPE_STRING_ARRAY, G_STRUCT_OFFSET (NMSettingVPN, routes), FALSE, FALSE },
{ NULL, 0, 0 },
};

View file

@ -227,6 +227,7 @@ typedef struct {
NMSetting parent;
char *service_type;
char *user_name;
GSList *routes;
} NMSettingVPN;