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
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "nm-utils.h"
|
||||
#include "autoip.h"
|
||||
#include "nm-netlink.h"
|
||||
#include "nm-setting-ip4-config.h"
|
||||
|
||||
#define NM_ACT_REQUEST_IP4_CONFIG "nm-act-request-ip4-config"
|
||||
|
||||
@@ -192,8 +193,11 @@ constructor (GType type,
|
||||
|
||||
nm_info ("(%s): exporting device as %s", nm_device_get_iface (dev), nm_device_get_dbus_path (dev));
|
||||
dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (manager),
|
||||
nm_device_get_dbus_path (dev),
|
||||
object);
|
||||
nm_device_get_dbus_path (dev),
|
||||
object);
|
||||
|
||||
g_object_unref (manager);
|
||||
|
||||
priv->initialized = TRUE;
|
||||
return object;
|
||||
|
||||
@@ -557,7 +561,7 @@ real_act_stage3_ip_config_start (NMDevice *self)
|
||||
|
||||
req = nm_device_get_act_request (self);
|
||||
setting = (NMSettingIP4Config *) nm_connection_get_setting (nm_act_request_get_connection (req),
|
||||
NM_SETTING_IP4_CONFIG);
|
||||
NM_TYPE_SETTING_IP4_CONFIG);
|
||||
|
||||
/* If we did not receive IP4 configuration information, default to DHCP */
|
||||
if (!setting || setting->manual == FALSE) {
|
||||
@@ -741,7 +745,7 @@ real_act_stage4_get_ip4_config (NMDevice *self,
|
||||
req = nm_device_get_act_request (self);
|
||||
merge_ip4_config (real_config,
|
||||
(NMSettingIP4Config *) nm_connection_get_setting (nm_act_request_get_connection (req),
|
||||
NM_SETTING_IP4_CONFIG));
|
||||
NM_TYPE_SETTING_IP4_CONFIG));
|
||||
|
||||
*config = real_config;
|
||||
ret = NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
|
Reference in New Issue
Block a user