mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 04:50:30 +01:00
2006-12-03 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/Makefile.am src/supplicant-manager/nm-supplicant-connection.h src/supplicant-manager/nm-supplicant-connection.c src/supplicant-manager/nm-supplicant-config.h src/supplicant-manager/nm-supplicant-config.c src/supplicant-manager/nm-supplicant-types.h src/supplicant-manager/nm-supplicant-interface.h src/supplicant-manager/nm-supplicant-interface.c - Rename NMSupplicantConnection -> NMSupplicantConfig git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2154 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
23527a52f7
commit
141af10189
8 changed files with 154 additions and 142 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2006-12-03 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/supplicant-manager/Makefile.am
|
||||
src/supplicant-manager/nm-supplicant-connection.h
|
||||
src/supplicant-manager/nm-supplicant-connection.c
|
||||
src/supplicant-manager/nm-supplicant-config.h
|
||||
src/supplicant-manager/nm-supplicant-config.c
|
||||
src/supplicant-manager/nm-supplicant-types.h
|
||||
src/supplicant-manager/nm-supplicant-interface.h
|
||||
src/supplicant-manager/nm-supplicant-interface.c
|
||||
- Rename NMSupplicantConnection -> NMSupplicantConfig
|
||||
|
||||
2006-12-03 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Gabor Kelemen <kelemeng@gnome.hu> (Gnome.org #381890)
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ libsupplicant_manager_la_SOURCES = \
|
|||
nm-supplicant-types.h \
|
||||
nm-supplicant-manager.h \
|
||||
nm-supplicant-manager.c \
|
||||
nm-supplicant-connection.h \
|
||||
nm-supplicant-connection.c \
|
||||
nm-supplicant-config.h \
|
||||
nm-supplicant-config.c \
|
||||
nm-supplicant-interface.c \
|
||||
nm-supplicant-interface.h \
|
||||
nm-supplicant-settings-verify.h \
|
||||
|
|
|
|||
|
|
@ -21,50 +21,50 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#include "nm-supplicant-connection.h"
|
||||
#include "nm-supplicant-config.h"
|
||||
#include "nm-supplicant-settings-verify.h"
|
||||
#include "nm-utils.h"
|
||||
|
||||
#define NM_SUPPLICANT_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
|
||||
NM_TYPE_SUPPLICANT_CONNECTION, \
|
||||
NMSupplicantConnectionPrivate))
|
||||
#define NM_SUPPLICANT_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
|
||||
NM_TYPE_SUPPLICANT_CONFIG, \
|
||||
NMSupplicantConfigPrivate))
|
||||
|
||||
|
||||
static void nm_supplicant_connection_set_device (NMSupplicantConnection *con,
|
||||
NMDevice *dev);
|
||||
static void nm_supplicant_config_set_device (NMSupplicantConfig *con,
|
||||
NMDevice *dev);
|
||||
|
||||
|
||||
struct _NMSupplicantConnectionPrivate
|
||||
struct _NMSupplicantConfigPrivate
|
||||
{
|
||||
NMDevice *dev;
|
||||
GHashTable *config;
|
||||
gboolean dispose_has_run;
|
||||
NMDevice * dev;
|
||||
GHashTable * config;
|
||||
gboolean dispose_has_run;
|
||||
};
|
||||
|
||||
NMSupplicantConnection *
|
||||
nm_supplicant_connection_new (NMDevice *dev)
|
||||
NMSupplicantConfig *
|
||||
nm_supplicant_config_new (NMDevice *dev)
|
||||
{
|
||||
NMSupplicantConnection * scfg;
|
||||
NMSupplicantConfig * scfg;
|
||||
|
||||
g_return_val_if_fail (dev != NULL, NULL);
|
||||
|
||||
scfg = g_object_new (NM_TYPE_SUPPLICANT_CONNECTION, NULL);
|
||||
nm_supplicant_connection_set_device (scfg, dev);
|
||||
scfg = g_object_new (NM_TYPE_SUPPLICANT_CONFIG, NULL);
|
||||
nm_supplicant_config_set_device (scfg, dev);
|
||||
return scfg;
|
||||
}
|
||||
|
||||
static void
|
||||
nm_supplicant_connection_init (NMSupplicantConnection * self)
|
||||
nm_supplicant_config_init (NMSupplicantConfig * self)
|
||||
{
|
||||
self->priv = NM_SUPPLICANT_CONNECTION_GET_PRIVATE (self);
|
||||
self->priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
|
||||
self->priv->config = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||
g_free);
|
||||
self->priv->dispose_has_run = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
nm_supplicant_connection_set_device (NMSupplicantConnection *self,
|
||||
NMDevice *dev)
|
||||
nm_supplicant_config_set_device (NMSupplicantConfig *self,
|
||||
NMDevice *dev)
|
||||
{
|
||||
g_return_if_fail (self != NULL);
|
||||
g_return_if_fail (dev != NULL);
|
||||
|
|
@ -74,9 +74,9 @@ nm_supplicant_connection_set_device (NMSupplicantConnection *self,
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_supplicant_connection_add_option (NMSupplicantConnection *self,
|
||||
const char * key,
|
||||
const char * value)
|
||||
nm_supplicant_config_add_option (NMSupplicantConfig *self,
|
||||
const char * key,
|
||||
const char * value)
|
||||
{
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (key != NULL, FALSE);
|
||||
|
|
@ -97,8 +97,8 @@ nm_supplicant_connection_add_option (NMSupplicantConnection *self,
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_supplicant_connection_remove_option (NMSupplicantConnection *self,
|
||||
const char * key)
|
||||
nm_supplicant_config_remove_option (NMSupplicantConfig *self,
|
||||
const char * key)
|
||||
{
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (key != NULL, FALSE);
|
||||
|
|
@ -107,10 +107,10 @@ nm_supplicant_connection_remove_option (NMSupplicantConnection *self,
|
|||
}
|
||||
|
||||
static void
|
||||
nm_supplicant_connection_dispose (GObject *object)
|
||||
nm_supplicant_config_dispose (GObject *object)
|
||||
{
|
||||
NMSupplicantConnection * self = NM_SUPPLICANT_CONNECTION (object);
|
||||
NMSupplicantConnectionClass * klass;
|
||||
NMSupplicantConfig * self = NM_SUPPLICANT_CONFIG (object);
|
||||
NMSupplicantConfigClass * klass;
|
||||
GObjectClass * parent_class;
|
||||
|
||||
if (self->priv->dispose_has_run)
|
||||
|
|
@ -132,59 +132,59 @@ nm_supplicant_connection_dispose (GObject *object)
|
|||
}
|
||||
|
||||
/* Chain up to the parent class */
|
||||
klass = NM_SUPPLICANT_CONNECTION_CLASS (g_type_class_peek (NM_TYPE_SUPPLICANT_CONNECTION));
|
||||
klass = NM_SUPPLICANT_CONFIG_CLASS (g_type_class_peek (NM_TYPE_SUPPLICANT_CONFIG));
|
||||
parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
|
||||
parent_class->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nm_supplicant_connection_finalize (GObject *object)
|
||||
nm_supplicant_config_finalize (GObject *object)
|
||||
{
|
||||
NMSupplicantConnection * self = NM_SUPPLICANT_CONNECTION (object);
|
||||
NMSupplicantConnectionClass * klass;
|
||||
GObjectClass * parent_class;
|
||||
NMSupplicantConfig * self = NM_SUPPLICANT_CONFIG (object);
|
||||
NMSupplicantConfigClass * klass;
|
||||
GObjectClass * parent_class;
|
||||
|
||||
/* Complete object destruction */
|
||||
g_hash_table_destroy (self->priv->config);
|
||||
|
||||
/* Chain up to the parent class */
|
||||
klass = NM_SUPPLICANT_CONNECTION_CLASS (g_type_class_peek (NM_TYPE_SUPPLICANT_CONNECTION));
|
||||
klass = NM_SUPPLICANT_CONFIG_CLASS (g_type_class_peek (NM_TYPE_SUPPLICANT_CONFIG));
|
||||
parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
|
||||
parent_class->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
nm_supplicant_connection_class_init (NMSupplicantConnectionClass *klass)
|
||||
nm_supplicant_config_class_init (NMSupplicantConfigClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = nm_supplicant_connection_dispose;
|
||||
object_class->finalize = nm_supplicant_connection_finalize;
|
||||
object_class->dispose = nm_supplicant_config_dispose;
|
||||
object_class->finalize = nm_supplicant_config_finalize;
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (NMSupplicantConnectionPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (NMSupplicantConfigPrivate));
|
||||
}
|
||||
|
||||
GType
|
||||
nm_supplicant_connection_get_type (void)
|
||||
nm_supplicant_config_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
static const GTypeInfo info = {
|
||||
sizeof (NMSupplicantConnectionClass),
|
||||
sizeof (NMSupplicantConfigClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) nm_supplicant_connection_class_init,
|
||||
(GClassInitFunc) nm_supplicant_config_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (NMSupplicantConnection),
|
||||
sizeof (NMSupplicantConfig),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) nm_supplicant_connection_init,
|
||||
(GInstanceInitFunc) nm_supplicant_config_init,
|
||||
NULL /* value_table */
|
||||
};
|
||||
|
||||
type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"NMSupplicantConnection",
|
||||
"NMSupplicantConfig",
|
||||
&info, 0);
|
||||
}
|
||||
return type;
|
||||
70
src/supplicant-manager/nm-supplicant-config.h
Normal file
70
src/supplicant-manager/nm-supplicant-config.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
/* NetworkManager -- Network link manager
|
||||
*
|
||||
* Dan Williams <dcbw@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* (C) Copyright 2006 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NM_SUPPLICANT_CONFIG_H
|
||||
#define NM_SUPPLICANT_CONFIG_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nm-supplicant-types.h"
|
||||
#include "nm-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NM_TYPE_SUPPLICANT_CONFIG (nm_supplicant_config_get_type ())
|
||||
#define NM_SUPPLICANT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfig))
|
||||
#define NM_SUPPLICANT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfigClass))
|
||||
#define NM_IS_SUPPLICANT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_CONFIG))
|
||||
#define NM_IS_SUPPLICANT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_CONFIG))
|
||||
#define NM_SUPPLICANT_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfigClass))
|
||||
|
||||
typedef struct _NMSupplicantConfigClass NMSupplicantConfigClass;
|
||||
typedef struct _NMSupplicantConfigPrivate NMSupplicantConfigPrivate;
|
||||
|
||||
struct _NMSupplicantConfig
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
/*< private >*/
|
||||
NMSupplicantConfigPrivate *priv;
|
||||
};
|
||||
|
||||
struct _NMSupplicantConfigClass
|
||||
{
|
||||
GObjectClass parent;
|
||||
|
||||
/* class members */
|
||||
};
|
||||
|
||||
|
||||
GType nm_supplicant_config_get_type (void);
|
||||
|
||||
NMSupplicantConfig * nm_supplicant_config_new (NMDevice *dev);
|
||||
|
||||
gboolean nm_supplicant_config_add_option (NMSupplicantConfig *scfg,
|
||||
const char * key,
|
||||
const char * value);
|
||||
|
||||
gboolean nm_supplicant_config_remove_option (NMSupplicantConfig *self,
|
||||
const char * key);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NM_SUPPLICANT_CONFIG_H */
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/* NetworkManager -- Network link manager
|
||||
*
|
||||
* Dan Williams <dcbw@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* (C) Copyright 2006 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NM_SUPPLICANT_CONNECTION_H
|
||||
#define NM_SUPPLICANT_CONNECTION_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nm-supplicant-types.h"
|
||||
#include "nm-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NM_TYPE_SUPPLICANT_CONNECTION (nm_supplicant_connection_get_type ())
|
||||
#define NM_SUPPLICANT_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_CONNECTION, NMSupplicantConnection))
|
||||
#define NM_SUPPLICANT_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_CONNECTION, NMSupplicantConnectionClass))
|
||||
#define NM_IS_SUPPLICANT_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_CONNECTION))
|
||||
#define NM_IS_SUPPLICANT_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_CONNECTION))
|
||||
#define NM_SUPPLICANT_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_CONNECTION, NMSupplicantConnectionClass))
|
||||
|
||||
typedef struct _NMSupplicantConnectionClass NMSupplicantConnectionClass;
|
||||
typedef struct _NMSupplicantConnectionPrivate NMSupplicantConnectionPrivate;
|
||||
|
||||
struct _NMSupplicantConnection
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
/*< private >*/
|
||||
NMSupplicantConnectionPrivate *priv;
|
||||
};
|
||||
|
||||
struct _NMSupplicantConnectionClass
|
||||
{
|
||||
GObjectClass parent;
|
||||
|
||||
/* class members */
|
||||
};
|
||||
|
||||
|
||||
GType nm_supplicant_connection_get_type (void);
|
||||
|
||||
NMSupplicantConnection * nm_supplicant_connection_new (NMDevice *dev);
|
||||
|
||||
gboolean nm_supplicant_connection_add_option (NMSupplicantConnection *scfg,
|
||||
const char * key,
|
||||
const char * value);
|
||||
|
||||
gboolean nm_supplicant_connection_remove_option (NMSupplicantConnection *self,
|
||||
const char * key);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NM_SUPPLICANT_CONNECTION_H */
|
||||
|
|
@ -87,22 +87,22 @@ enum {
|
|||
|
||||
struct _NMSupplicantInterfacePrivate
|
||||
{
|
||||
NMSupplicantManager * smgr;
|
||||
NMDBusManager * dbus_mgr;
|
||||
NMDevice * dev;
|
||||
NMSupplicantManager * smgr;
|
||||
NMDBusManager * dbus_mgr;
|
||||
NMDevice * dev;
|
||||
|
||||
guint32 state;
|
||||
GSList * pcalls;
|
||||
guint32 state;
|
||||
GSList * pcalls;
|
||||
|
||||
char * wpas_iface_op;
|
||||
char * wpas_net_op;
|
||||
guint32 wpas_sig_handler_id;
|
||||
GSource * scan_results_timeout;
|
||||
guint32 last_scan;
|
||||
char * wpas_iface_op;
|
||||
char * wpas_net_op;
|
||||
guint32 wpas_sig_handler_id;
|
||||
GSource * scan_results_timeout;
|
||||
guint32 last_scan;
|
||||
|
||||
NMSupplicantConnection * con;
|
||||
NMSupplicantConfig * cfg;
|
||||
|
||||
gboolean dispose_has_run;
|
||||
gboolean dispose_has_run;
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
@ -300,9 +300,9 @@ nm_supplicant_interface_dispose (GObject *object)
|
|||
self->priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
if (self->priv->con) {
|
||||
g_object_unref (self->priv->con);
|
||||
self->priv->con = NULL;
|
||||
if (self->priv->cfg) {
|
||||
g_object_unref (self->priv->cfg);
|
||||
self->priv->cfg = NULL;
|
||||
}
|
||||
|
||||
/* Chain up to the parent class */
|
||||
|
|
@ -951,7 +951,7 @@ nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr,
|
|||
|
||||
#if 0
|
||||
static void
|
||||
add_connection_to_iface (NMSupplicantInterface *self)
|
||||
add_config_to_iface (NMSupplicantInterface *self)
|
||||
{
|
||||
DBusConnection * dbus_connection;
|
||||
DBusMessage * message = NULL;
|
||||
|
|
@ -977,7 +977,7 @@ add_connection_to_iface (NMSupplicantInterface *self)
|
|||
#if 0
|
||||
pcall = nm_dbus_send_with_callback (dbus_connection,
|
||||
message,
|
||||
(DBusPendingCallNotifyFunction) nm_supplicant_interface_add_connection_cb,
|
||||
(DBusPendingCallNotifyFunction) nm_supplicant_interface_add_config_cb,
|
||||
self,
|
||||
NULL,
|
||||
__func__);
|
||||
|
|
@ -989,16 +989,16 @@ out:
|
|||
#endif
|
||||
|
||||
void
|
||||
nm_supplicant_interface_set_connection (NMSupplicantInterface * self,
|
||||
NMSupplicantConnection * con)
|
||||
nm_supplicant_interface_set_config (NMSupplicantInterface * self,
|
||||
NMSupplicantConfig * cfg)
|
||||
{
|
||||
g_return_if_fail (self != NULL);
|
||||
|
||||
if (self->priv->con)
|
||||
g_object_unref (self->priv->con);
|
||||
self->priv->con = con;
|
||||
if (self->priv->con)
|
||||
g_object_ref (self->priv->con);
|
||||
if (self->priv->cfg)
|
||||
g_object_unref (self->priv->cfg);
|
||||
self->priv->cfg = cfg;
|
||||
if (self->priv->cfg)
|
||||
g_object_ref (self->priv->cfg);
|
||||
}
|
||||
|
||||
NMDevice *
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ GType nm_supplicant_interface_get_type (void);
|
|||
NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr,
|
||||
NMDevice * dev);
|
||||
|
||||
void nm_supplicant_interface_set_connection (NMSupplicantInterface * iface,
|
||||
NMSupplicantConnection * con);
|
||||
void nm_supplicant_interface_set_config (NMSupplicantInterface * iface,
|
||||
NMSupplicantConfig * cfg);
|
||||
|
||||
NMDevice * nm_supplicant_interface_get_device (NMSupplicantInterface * iface);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@
|
|||
|
||||
typedef struct _NMSupplicantManager NMSupplicantManager;
|
||||
typedef struct _NMSupplicantInterface NMSupplicantInterface;
|
||||
typedef struct _NMSupplicantConnection NMSupplicantConnection;
|
||||
typedef struct _NMSupplicantConfig NMSupplicantConfig;
|
||||
|
||||
#endif /* NM_SUPPLICANT_TYPES_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue