~ubuntu-branches/ubuntu/precise/network-manager/precise

« back to all changes in this revision

Viewing changes to libnm-glib/nm-dhcp6-config.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2012-02-09 16:45:41 UTC
  • mfrom: (1.1.53)
  • Revision ID: package-import@ubuntu.com-20120209164541-4h90zknlsfdb7x35
Tags: 0.9.2.0+git201202091925.c721477-0ubuntu1
* upstream snapshot 2012-02-09 19:25:59 (GMT)
  + c721477d11d4fe144111d6d2eec8f93f2e9186c9
* debian/patches/avoid-periodic-disk-wakeups.patch: refreshed.
* debian/patches/nl3-default-ip6-route.patch: refreshed.
* debian/libnm-glib4.symbols: add symbols:
  + nm_active_connection_get_master@Base
  + nm_client_new_async@Base
  + nm_client_new_finish@Base
  + nm_remote_settings_new_async@Base
  + nm_remote_settings_new_finish@Base
  + nm_device_get_state_reason@Base
* debian/libnm-util2.symbols: add symbols:
  + nm_setting_802_1x_get_pac_file@Base
  + nm_setting_infiniband_get_transport_mode@Base

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
}
78
78
 
79
79
static void
80
 
register_for_property_changed (NMDHCP6Config *config)
 
80
register_properties (NMDHCP6Config *config)
81
81
{
82
82
        NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config);
83
 
        const NMPropertiesChangedInfo property_changed_info[] = {
84
 
                { NM_DHCP6_CONFIG_OPTIONS,   demarshal_dhcp6_options,  &priv->options },
 
83
        const NMPropertiesInfo property_info[] = {
 
84
                { NM_DHCP6_CONFIG_OPTIONS,   &priv->options, demarshal_dhcp6_options },
85
85
                { NULL },
86
86
        };
87
87
 
88
 
        _nm_object_handle_properties_changed (NM_OBJECT (config),
89
 
                                             priv->proxy,
90
 
                                             property_changed_info);
 
88
        _nm_object_register_properties (NM_OBJECT (config),
 
89
                                        priv->proxy,
 
90
                                        property_info);
91
91
}
92
92
 
93
 
static GObject*
94
 
constructor (GType type,
95
 
                   guint n_construct_params,
96
 
                   GObjectConstructParam *construct_params)
 
93
static void
 
94
constructed (GObject *object)
97
95
{
98
 
        NMObject *object;
99
96
        DBusGConnection *connection;
100
97
        NMDHCP6ConfigPrivate *priv;
101
98
 
102
 
        object = (NMObject *) G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructor (type,
103
 
                                                                                                                                 n_construct_params,
104
 
                                                                                                                                 construct_params);
105
 
        if (!object)
106
 
                return NULL;
 
99
        G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructed (object);
107
100
 
108
101
        priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
109
102
        priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
110
103
 
111
 
        connection = nm_object_get_connection (object);
 
104
        connection = nm_object_get_connection (NM_OBJECT (object));
112
105
 
113
106
        priv->proxy = dbus_g_proxy_new_for_name (connection,
114
107
                                                                                   NM_DBUS_SERVICE,
115
 
                                                                                   nm_object_get_path (object),
 
108
                                                                                   nm_object_get_path (NM_OBJECT (object)),
116
109
                                                                                   NM_DBUS_INTERFACE_DHCP6_CONFIG);
117
110
 
118
 
        register_for_property_changed (NM_DHCP6_CONFIG (object));
119
 
 
120
 
        return G_OBJECT (object);
 
111
        register_properties (NM_DHCP6_CONFIG (object));
121
112
}
122
113
 
123
114
static void
159
150
        g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate));
160
151
 
161
152
        /* virtual methods */
162
 
        object_class->constructor = constructor;
 
153
        object_class->constructed = constructed;
163
154
        object_class->get_property = get_property;
164
155
        object_class->finalize = finalize;
165
156
 
212
203
GHashTable *
213
204
nm_dhcp6_config_get_options (NMDHCP6Config *config)
214
205
{
215
 
        NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config);
216
 
        GValue value = { 0, };
217
 
 
218
 
        if (g_hash_table_size (priv->options))
219
 
                return priv->options;
220
 
 
221
 
        if (!_nm_object_get_property (NM_OBJECT (config),
222
 
                                      NM_DBUS_INTERFACE_DHCP6_CONFIG,
223
 
                                      "Options",
224
 
                                      &value,
225
 
                                      NULL))
226
 
                goto out;
227
 
 
228
 
        demarshal_dhcp6_options (NM_OBJECT (config), NULL, &value, &priv->options);     
229
 
        g_value_unset (&value);
230
 
 
231
 
out:
232
 
        return priv->options;
 
206
        g_return_val_if_fail (NM_IS_DHCP6_CONFIG (config), NULL);
 
207
 
 
208
        _nm_object_ensure_inited (NM_OBJECT (config));
 
209
        return NM_DHCP6_CONFIG_GET_PRIVATE (config)->options;
233
210
}
234
211
 
235
212
/**