2007-08-28 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerSystem.h src/nm-device.c src/nm-device.h src/nm-hal-manager.c src/NetworkManager.c src/nm-device-802-11-wireless.c src/nm-hal-manager.h src/nm-device-802-3-ethernet.c src/vpn-manager/nm-vpn-service.h src/vpn-manager/nm-vpn-manager.c src/vpn-manager/nm-vpn-manager.h src/vpn-manager/nm-vpn-service.c src/nm-device-802-11-wireless.h src/NetworkManagerMain.h src/nm-device-802-3-ethernet.h src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerPaldo.c src/backends/NetworkManagerFrugalware.c src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSlackware.c src/backends/NetworkManagerGeneric.c src/backends/NetworkManagerArch.c src/backends/NetworkManagerSuSE.c src/backends/NetworkManagerGeneric.h src/backends/NetworkManagerDebian.c - Kill NMData git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2742 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
29
ChangeLog
29
ChangeLog
@@ -1,3 +1,32 @@
|
|||||||
|
2007-08-28 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* src/NetworkManagerSystem.h
|
||||||
|
src/nm-device.c
|
||||||
|
src/nm-device.h
|
||||||
|
src/nm-hal-manager.c
|
||||||
|
src/NetworkManager.c
|
||||||
|
src/nm-device-802-11-wireless.c
|
||||||
|
src/nm-hal-manager.h
|
||||||
|
src/nm-device-802-3-ethernet.c
|
||||||
|
src/vpn-manager/nm-vpn-service.h
|
||||||
|
src/vpn-manager/nm-vpn-manager.c
|
||||||
|
src/vpn-manager/nm-vpn-manager.h
|
||||||
|
src/vpn-manager/nm-vpn-service.c
|
||||||
|
src/nm-device-802-11-wireless.h
|
||||||
|
src/NetworkManagerMain.h
|
||||||
|
src/nm-device-802-3-ethernet.h
|
||||||
|
src/backends/NetworkManagerGentoo.c
|
||||||
|
src/backends/NetworkManagerPaldo.c
|
||||||
|
src/backends/NetworkManagerFrugalware.c
|
||||||
|
src/backends/NetworkManagerRedHat.c
|
||||||
|
src/backends/NetworkManagerSlackware.c
|
||||||
|
src/backends/NetworkManagerGeneric.c
|
||||||
|
src/backends/NetworkManagerArch.c
|
||||||
|
src/backends/NetworkManagerSuSE.c
|
||||||
|
src/backends/NetworkManagerGeneric.h
|
||||||
|
src/backends/NetworkManagerDebian.c
|
||||||
|
- Kill NMData
|
||||||
|
|
||||||
2007-08-28 Dan Williams <dcbw@redhat.com>
|
2007-08-28 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/NetworkManagerMain.h
|
* src/NetworkManagerMain.h
|
||||||
|
@@ -65,9 +65,6 @@
|
|||||||
*/
|
*/
|
||||||
static NMManager *manager = NULL;
|
static NMManager *manager = NULL;
|
||||||
static GMainLoop *main_loop = NULL;
|
static GMainLoop *main_loop = NULL;
|
||||||
static NMData *nm_data = NULL;
|
|
||||||
|
|
||||||
static void nm_data_free (NMData *data);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor,
|
nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor,
|
||||||
@@ -108,35 +105,6 @@ nm_monitor_setup (void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* nm_data_new
|
|
||||||
*
|
|
||||||
* Create data structure used in callbacks from libhal.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static NMData *nm_data_new (void)
|
|
||||||
{
|
|
||||||
NMData * data;
|
|
||||||
|
|
||||||
data = g_slice_new0 (NMData);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* nm_data_free
|
|
||||||
*
|
|
||||||
* Free data structure used in callbacks.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static void nm_data_free (NMData *data)
|
|
||||||
{
|
|
||||||
g_return_if_fail (data != NULL);
|
|
||||||
|
|
||||||
g_slice_free (NMData, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_name_owner_changed_handler (NMDBusManager *mgr,
|
nm_name_owner_changed_handler (NMDBusManager *mgr,
|
||||||
const char *name,
|
const char *name,
|
||||||
@@ -144,7 +112,6 @@ nm_name_owner_changed_handler (NMDBusManager *mgr,
|
|||||||
const char *new,
|
const char *new,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
NMData * data = (NMData *) user_data;
|
|
||||||
gboolean old_owner_good = (old && (strlen (old) > 0));
|
gboolean old_owner_good = (old && (strlen (old) > 0));
|
||||||
gboolean new_owner_good = (new && (strlen (new) > 0));
|
gboolean new_owner_good = (new && (strlen (new) > 0));
|
||||||
|
|
||||||
@@ -286,11 +253,11 @@ main (int argc, char *argv[])
|
|||||||
gboolean show_usage = FALSE;
|
gboolean show_usage = FALSE;
|
||||||
char * pidfile = NULL;
|
char * pidfile = NULL;
|
||||||
char * user_pidfile = NULL;
|
char * user_pidfile = NULL;
|
||||||
NMPolicy *policy;
|
NMPolicy *policy = NULL;
|
||||||
NMHalManager *hal_manager = NULL;
|
NMHalManager *hal_manager = NULL;
|
||||||
NMVPNManager *vpn_manager = NULL;
|
NMVPNManager *vpn_manager = NULL;
|
||||||
NMNamedManager *named_mgr = NULL;
|
NMNamedManager *named_mgr = NULL;
|
||||||
NMDBusManager * dbus_mgr;
|
NMDBusManager * dbus_mgr = NULL;
|
||||||
DBusConnection *dbus_connection;
|
DBusConnection *dbus_connection;
|
||||||
NMSupplicantManager * sup_mgr = NULL;
|
NMSupplicantManager * sup_mgr = NULL;
|
||||||
int exit_status = EXIT_FAILURE;
|
int exit_status = EXIT_FAILURE;
|
||||||
@@ -362,13 +329,6 @@ main (int argc, char *argv[])
|
|||||||
nm_system_init ();
|
nm_system_init ();
|
||||||
main_loop = g_main_loop_new (NULL, FALSE);
|
main_loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
/* Initialize our instance data */
|
|
||||||
nm_data = nm_data_new ();
|
|
||||||
if (!nm_data) {
|
|
||||||
nm_error ("Failed to initialize.");
|
|
||||||
goto pidfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create watch functions that monitor cards for link status. */
|
/* Create watch functions that monitor cards for link status. */
|
||||||
if (!nm_monitor_setup ())
|
if (!nm_monitor_setup ())
|
||||||
goto done;
|
goto done;
|
||||||
@@ -387,11 +347,19 @@ main (int argc, char *argv[])
|
|||||||
g_signal_connect (dbus_mgr,
|
g_signal_connect (dbus_mgr,
|
||||||
"name-owner-changed",
|
"name-owner-changed",
|
||||||
G_CALLBACK (nm_name_owner_changed_handler),
|
G_CALLBACK (nm_name_owner_changed_handler),
|
||||||
nm_data);
|
NULL);
|
||||||
|
|
||||||
manager = nm_manager_new ();
|
manager = nm_manager_new ();
|
||||||
g_object_set_data (G_OBJECT (manager), "NM_DATA_HACK", nm_data);
|
if (manager == NULL) {
|
||||||
|
nm_error ("Failed to initialize the network manager.");
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
policy = nm_policy_new (manager);
|
policy = nm_policy_new (manager);
|
||||||
|
if (policy == NULL) {
|
||||||
|
nm_error ("Failed to initialize the policy.");
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
nm_dbus_manager_register_signal_handler (dbus_mgr,
|
nm_dbus_manager_register_signal_handler (dbus_mgr,
|
||||||
NMI_DBUS_INTERFACE,
|
NMI_DBUS_INTERFACE,
|
||||||
@@ -406,7 +374,7 @@ main (int argc, char *argv[])
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
vpn_manager = nm_vpn_manager_new (manager, nm_data);
|
vpn_manager = nm_vpn_manager_new (manager);
|
||||||
if (!vpn_manager) {
|
if (!vpn_manager) {
|
||||||
nm_warning ("Failed to start the VPN manager.");
|
nm_warning ("Failed to start the VPN manager.");
|
||||||
goto done;
|
goto done;
|
||||||
@@ -424,7 +392,7 @@ main (int argc, char *argv[])
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
hal_manager = nm_hal_manager_new (manager, nm_data);
|
hal_manager = nm_hal_manager_new (manager);
|
||||||
if (!hal_manager)
|
if (!hal_manager)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@@ -454,8 +422,6 @@ done:
|
|||||||
if (manager)
|
if (manager)
|
||||||
g_object_unref (manager);
|
g_object_unref (manager);
|
||||||
|
|
||||||
nm_data_free (nm_data);
|
|
||||||
|
|
||||||
if (sup_mgr)
|
if (sup_mgr)
|
||||||
g_object_unref (sup_mgr);
|
g_object_unref (sup_mgr);
|
||||||
|
|
||||||
@@ -465,7 +431,6 @@ done:
|
|||||||
g_object_unref (dbus_mgr);
|
g_object_unref (dbus_mgr);
|
||||||
nm_logging_shutdown ();
|
nm_logging_shutdown ();
|
||||||
|
|
||||||
pidfile:
|
|
||||||
if (pidfile)
|
if (pidfile)
|
||||||
unlink (pidfile);
|
unlink (pidfile);
|
||||||
g_free (pidfile);
|
g_free (pidfile);
|
||||||
|
@@ -32,8 +32,4 @@
|
|||||||
typedef struct NMVPNActRequest NMVPNActRequest;
|
typedef struct NMVPNActRequest NMVPNActRequest;
|
||||||
typedef struct NMVPNManager NMVPNManager;
|
typedef struct NMVPNManager NMVPNManager;
|
||||||
|
|
||||||
typedef struct NMData
|
|
||||||
{
|
|
||||||
} NMData;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
#include "nm-ip4-config.h"
|
#include "nm-ip4-config.h"
|
||||||
#include "nm-named-manager.h"
|
#include "nm-named-manager.h"
|
||||||
|
|
||||||
struct NMData;
|
|
||||||
|
|
||||||
/* Prototypes for system/distribution dependent functions,
|
/* Prototypes for system/distribution dependent functions,
|
||||||
* implemented in the backend files in backends/ directory
|
* implemented in the backend files in backends/ directory
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +54,7 @@ void nm_system_update_dns (void);
|
|||||||
void nm_system_restart_mdns_responder (void);
|
void nm_system_restart_mdns_responder (void);
|
||||||
void nm_system_device_add_ip6_link_address (NMDevice *dev);
|
void nm_system_device_add_ip6_link_address (NMDevice *dev);
|
||||||
|
|
||||||
void * nm_system_device_get_system_config (NMDevice *dev, struct NMData *data);
|
void * nm_system_device_get_system_config (NMDevice *dev);
|
||||||
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data);
|
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data);
|
||||||
NMIP4Config * nm_system_device_new_ip4_system_config (NMDevice *dev);
|
NMIP4Config * nm_system_device_new_ip4_system_config (NMDevice *dev);
|
||||||
|
|
||||||
|
@@ -527,7 +527,7 @@ typedef struct ArchSystemConfigData
|
|||||||
* info before setting stuff too.
|
* info before setting stuff too.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void* nm_system_device_get_system_config (NMDevice * dev, NMData *app_data)
|
void* nm_system_device_get_system_config (NMDevice * dev)
|
||||||
{
|
{
|
||||||
|
|
||||||
GHashTable* ifh;
|
GHashTable* ifh;
|
||||||
|
@@ -247,7 +247,7 @@ typedef struct DebSystemConfigData
|
|||||||
* info before setting stuff too.
|
* info before setting stuff too.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void* nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void* nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
DebSystemConfigData * sys_data = NULL;
|
DebSystemConfigData * sys_data = NULL;
|
||||||
if_block *curr_device;
|
if_block *curr_device;
|
||||||
|
@@ -433,7 +433,7 @@ guint32 nm_system_get_mtu (NMDevice *dev)
|
|||||||
* Read in the config file for a device.
|
* Read in the config file for a device.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
fwnet_profile_t *profile;
|
fwnet_profile_t *profile;
|
||||||
fwnet_interface_t *interface;
|
fwnet_interface_t *interface;
|
||||||
|
@@ -364,7 +364,7 @@ out:
|
|||||||
* info before setting stuff too.
|
* info before setting stuff too.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void* nm_generic_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void* nm_generic_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
#include "nm-ip4-config.h"
|
#include "nm-ip4-config.h"
|
||||||
#include "nm-named-manager.h"
|
#include "nm-named-manager.h"
|
||||||
|
|
||||||
struct NMData;
|
|
||||||
|
|
||||||
/* Prototypes for system/distribution dependent functions,
|
/* Prototypes for system/distribution dependent functions,
|
||||||
* implemented in the backend files in backends/ directory
|
* implemented in the backend files in backends/ directory
|
||||||
*/
|
*/
|
||||||
@@ -59,7 +57,7 @@ void nm_generic_restart_mdns_responder (void);
|
|||||||
void nm_generic_device_add_ip6_link_address (NMDevice *dev);
|
void nm_generic_device_add_ip6_link_address (NMDevice *dev);
|
||||||
|
|
||||||
void nm_generic_set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *ip4_config);
|
void nm_generic_set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *ip4_config);
|
||||||
void * nm_generic_device_get_system_config (NMDevice *dev, struct NMData *data);
|
void * nm_generic_device_get_system_config (NMDevice *dev);
|
||||||
void nm_generic_device_free_system_config (NMDevice *dev, void *system_config_data);
|
void nm_generic_device_free_system_config (NMDevice *dev, void *system_config_data);
|
||||||
NMIP4Config * nm_generic_device_new_ip4_system_config (NMDevice *dev);
|
NMIP4Config * nm_generic_device_new_ip4_system_config (NMDevice *dev);
|
||||||
|
|
||||||
|
@@ -258,7 +258,7 @@ typedef struct GentooSystemConfigData
|
|||||||
* info before setting stuff too.
|
* info before setting stuff too.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
char *cfg_file_path = NULL;
|
char *cfg_file_path = NULL;
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
|
@@ -406,7 +406,7 @@ static NMIP4Config *netdevice_file_get_ip4_config (GKeyFile *file)
|
|||||||
* Read in the config file for a device.
|
* Read in the config file for a device.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
PaldoSystemConfigData *sys_data = NULL;
|
PaldoSystemConfigData *sys_data = NULL;
|
||||||
GKeyFile *file;
|
GKeyFile *file;
|
||||||
|
@@ -314,7 +314,7 @@ static char *get_current_profile_name (void)
|
|||||||
* Read in the config file for a device.
|
* Read in the config file for a device.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
char * cfg_file_path = NULL;
|
char * cfg_file_path = NULL;
|
||||||
shvarFile * file;
|
shvarFile * file;
|
||||||
|
@@ -118,7 +118,7 @@ gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
|
|||||||
* info before setting stuff too.
|
* info before setting stuff too.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -286,7 +286,7 @@ typedef struct SuSEDeviceConfigData
|
|||||||
* SuSE stores this information in /etc/sysconfig/network/ifcfg-*-<MAC address>
|
* SuSE stores this information in /etc/sysconfig/network/ifcfg-*-<MAC address>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||||
{
|
{
|
||||||
char *cfg_file_path = NULL;
|
char *cfg_file_path = NULL;
|
||||||
char mac[18];
|
char mac[18];
|
||||||
|
@@ -411,7 +411,6 @@ constructor (GType type,
|
|||||||
GObject *object;
|
GObject *object;
|
||||||
NMDevice80211Wireless *self;
|
NMDevice80211Wireless *self;
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDevice80211WirelessPrivate *priv;
|
||||||
NMData *app_data;
|
|
||||||
const char *iface;
|
const char *iface;
|
||||||
NMSock *sk;
|
NMSock *sk;
|
||||||
|
|
||||||
@@ -424,7 +423,6 @@ constructor (GType type,
|
|||||||
self = NM_DEVICE_802_11_WIRELESS (object);
|
self = NM_DEVICE_802_11_WIRELESS (object);
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
||||||
|
|
||||||
app_data = nm_device_get_app_data (NM_DEVICE (self));
|
|
||||||
iface = nm_device_get_iface (NM_DEVICE (self));
|
iface = nm_device_get_iface (NM_DEVICE (self));
|
||||||
|
|
||||||
if ((sk = nm_dev_sock_open (iface, DEV_WIRELESS, __FUNCTION__, NULL))) {
|
if ((sk = nm_dev_sock_open (iface, DEV_WIRELESS, __FUNCTION__, NULL))) {
|
||||||
@@ -804,13 +802,9 @@ nm_device_802_11_wireless_get_best_ap (NMDevice80211Wireless *self)
|
|||||||
NMAccessPoint * cur_ap = NULL;
|
NMAccessPoint * cur_ap = NULL;
|
||||||
NMActRequest * req = NULL;
|
NMActRequest * req = NULL;
|
||||||
GTimeVal best_timestamp = {0, 0};
|
GTimeVal best_timestamp = {0, 0};
|
||||||
NMData * app_data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (self != NULL, NULL);
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
|
||||||
app_data = nm_device_get_app_data (NM_DEVICE (self));
|
|
||||||
g_assert (app_data);
|
|
||||||
|
|
||||||
if (!(ap_list = nm_device_802_11_wireless_ap_list_get (self)))
|
if (!(ap_list = nm_device_802_11_wireless_ap_list_get (self)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -887,12 +881,8 @@ nm_device_802_11_wireless_set_activation_ap (NMDevice80211Wireless *self,
|
|||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
||||||
NMAccessPoint *ap = NULL;
|
NMAccessPoint *ap = NULL;
|
||||||
NMData * app_data;
|
|
||||||
NMAccessPointList * dev_ap_list;
|
NMAccessPointList * dev_ap_list;
|
||||||
|
|
||||||
app_data = nm_device_get_app_data (NM_DEVICE (self));
|
|
||||||
g_assert (app_data);
|
|
||||||
|
|
||||||
nm_debug ("Forcing AP '%s'", nm_utils_escape_ssid (ssid->data, ssid->len));
|
nm_debug ("Forcing AP '%s'", nm_utils_escape_ssid (ssid->data, ssid->len));
|
||||||
|
|
||||||
/* Find the AP in our card's scan list first.
|
/* Find the AP in our card's scan list first.
|
||||||
@@ -1978,15 +1968,11 @@ supplicant_iface_scanned_ap_cb (NMSupplicantInterface * iface,
|
|||||||
NMDevice80211Wireless * self)
|
NMDevice80211Wireless * self)
|
||||||
{
|
{
|
||||||
NMAccessPoint *ap;
|
NMAccessPoint *ap;
|
||||||
NMData *app_data;
|
|
||||||
|
|
||||||
g_return_if_fail (self != NULL);
|
g_return_if_fail (self != NULL);
|
||||||
g_return_if_fail (properties != NULL);
|
g_return_if_fail (properties != NULL);
|
||||||
g_return_if_fail (iface != NULL);
|
g_return_if_fail (iface != NULL);
|
||||||
|
|
||||||
if (!(app_data = nm_device_get_app_data (NM_DEVICE (self))))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ap = nm_ap_new_from_properties (properties);
|
ap = nm_ap_new_from_properties (properties);
|
||||||
if (!ap)
|
if (!ap)
|
||||||
return;
|
return;
|
||||||
@@ -2838,14 +2824,10 @@ activation_success_handler (NMDevice *dev)
|
|||||||
static void
|
static void
|
||||||
activation_failure_handler (NMDevice *dev)
|
activation_failure_handler (NMDevice *dev)
|
||||||
{
|
{
|
||||||
NMData * app_data;
|
|
||||||
NMDevice80211Wireless * self = NM_DEVICE_802_11_WIRELESS (dev);
|
NMDevice80211Wireless * self = NM_DEVICE_802_11_WIRELESS (dev);
|
||||||
NMAccessPoint * ap;
|
NMAccessPoint * ap;
|
||||||
const GByteArray * ssid;
|
const GByteArray * ssid;
|
||||||
|
|
||||||
app_data = nm_device_get_app_data (dev);
|
|
||||||
g_assert (app_data);
|
|
||||||
|
|
||||||
if ((ap = nm_device_802_11_wireless_get_activation_ap (self)))
|
if ((ap = nm_device_802_11_wireless_get_activation_ap (self)))
|
||||||
{
|
{
|
||||||
if (nm_ap_get_artificial (ap))
|
if (nm_ap_get_artificial (ap))
|
||||||
@@ -3090,21 +3072,18 @@ NMDevice80211Wireless *
|
|||||||
nm_device_802_11_wireless_new (int index,
|
nm_device_802_11_wireless_new (int index,
|
||||||
const char *udi,
|
const char *udi,
|
||||||
const char *driver,
|
const char *driver,
|
||||||
gboolean test_dev,
|
gboolean test_dev)
|
||||||
NMData *app_data)
|
|
||||||
{
|
{
|
||||||
GObject *obj;
|
GObject *obj;
|
||||||
|
|
||||||
g_return_val_if_fail (index >= 0, NULL);
|
g_return_val_if_fail (index >= 0, NULL);
|
||||||
g_return_val_if_fail (udi != NULL, NULL);
|
g_return_val_if_fail (udi != NULL, NULL);
|
||||||
g_return_val_if_fail (driver != NULL, NULL);
|
g_return_val_if_fail (driver != NULL, NULL);
|
||||||
g_return_val_if_fail (app_data != NULL, NULL);
|
|
||||||
|
|
||||||
obj = g_object_new (NM_TYPE_DEVICE_802_11_WIRELESS,
|
obj = g_object_new (NM_TYPE_DEVICE_802_11_WIRELESS,
|
||||||
NM_DEVICE_INTERFACE_UDI, udi,
|
NM_DEVICE_INTERFACE_UDI, udi,
|
||||||
NM_DEVICE_INTERFACE_INDEX, index,
|
NM_DEVICE_INTERFACE_INDEX, index,
|
||||||
NM_DEVICE_INTERFACE_DRIVER, driver,
|
NM_DEVICE_INTERFACE_DRIVER, driver,
|
||||||
NM_DEVICE_INTERFACE_APP_DATA, app_data,
|
|
||||||
NULL);
|
NULL);
|
||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -80,8 +80,7 @@ GType nm_device_802_11_wireless_get_type (void);
|
|||||||
NMDevice80211Wireless *nm_device_802_11_wireless_new (int index,
|
NMDevice80211Wireless *nm_device_802_11_wireless_new (int index,
|
||||||
const char *udi,
|
const char *udi,
|
||||||
const char *driver,
|
const char *driver,
|
||||||
gboolean test_dev,
|
gboolean test_dev);
|
||||||
NMData *app_data);
|
|
||||||
|
|
||||||
void nm_device_802_11_wireless_set_ssid (NMDevice80211Wireless *self,
|
void nm_device_802_11_wireless_set_ssid (NMDevice80211Wireless *self,
|
||||||
const GByteArray * ssid);
|
const GByteArray * ssid);
|
||||||
|
@@ -244,21 +244,18 @@ NMDevice8023Ethernet *
|
|||||||
nm_device_802_3_ethernet_new (int index,
|
nm_device_802_3_ethernet_new (int index,
|
||||||
const char *udi,
|
const char *udi,
|
||||||
const char *driver,
|
const char *driver,
|
||||||
gboolean test_dev,
|
gboolean test_dev)
|
||||||
NMData *app_data)
|
|
||||||
{
|
{
|
||||||
GObject *obj;
|
GObject *obj;
|
||||||
|
|
||||||
g_return_val_if_fail (index >= 0, NULL);
|
g_return_val_if_fail (index >= 0, NULL);
|
||||||
g_return_val_if_fail (udi != NULL, NULL);
|
g_return_val_if_fail (udi != NULL, NULL);
|
||||||
g_return_val_if_fail (driver != NULL, NULL);
|
g_return_val_if_fail (driver != NULL, NULL);
|
||||||
g_return_val_if_fail (app_data != NULL, NULL);
|
|
||||||
|
|
||||||
obj = g_object_new (NM_TYPE_DEVICE_802_3_ETHERNET,
|
obj = g_object_new (NM_TYPE_DEVICE_802_3_ETHERNET,
|
||||||
NM_DEVICE_INTERFACE_UDI, udi,
|
NM_DEVICE_INTERFACE_UDI, udi,
|
||||||
NM_DEVICE_INTERFACE_INDEX, index,
|
NM_DEVICE_INTERFACE_INDEX, index,
|
||||||
NM_DEVICE_INTERFACE_DRIVER, driver,
|
NM_DEVICE_INTERFACE_DRIVER, driver,
|
||||||
NM_DEVICE_INTERFACE_APP_DATA, app_data,
|
|
||||||
NULL);
|
NULL);
|
||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -55,8 +55,7 @@ GType nm_device_802_3_ethernet_get_type (void);
|
|||||||
NMDevice8023Ethernet *nm_device_802_3_ethernet_new (int index,
|
NMDevice8023Ethernet *nm_device_802_3_ethernet_new (int index,
|
||||||
const char *udi,
|
const char *udi,
|
||||||
const char *driver,
|
const char *driver,
|
||||||
gboolean test_dev,
|
gboolean test_dev);
|
||||||
NMData *app_data);
|
|
||||||
|
|
||||||
void nm_device_802_3_ethernet_get_address (NMDevice8023Ethernet *dev,
|
void nm_device_802_3_ethernet_get_address (NMDevice8023Ethernet *dev,
|
||||||
struct ether_addr *addr);
|
struct ether_addr *addr);
|
||||||
|
@@ -68,7 +68,6 @@ struct _NMDevicePrivate
|
|||||||
gboolean link_active;
|
gboolean link_active;
|
||||||
guint32 ip4_address;
|
guint32 ip4_address;
|
||||||
struct in6_addr ip6_address;
|
struct in6_addr ip6_address;
|
||||||
NMData * app_data;
|
|
||||||
|
|
||||||
NMActRequest * act_request;
|
NMActRequest * act_request;
|
||||||
guint act_source_id;
|
guint act_source_id;
|
||||||
@@ -121,7 +120,6 @@ nm_device_init (NMDevice * self)
|
|||||||
self->priv->link_active = FALSE;
|
self->priv->link_active = FALSE;
|
||||||
self->priv->ip4_address = 0;
|
self->priv->ip4_address = 0;
|
||||||
memset (&self->priv->ip6_address, 0, sizeof (struct in6_addr));
|
memset (&self->priv->ip6_address, 0, sizeof (struct in6_addr));
|
||||||
self->priv->app_data = NULL;
|
|
||||||
|
|
||||||
self->priv->act_source_id = 0;
|
self->priv->act_source_id = 0;
|
||||||
|
|
||||||
@@ -171,7 +169,7 @@ constructor (GType type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Grab IP config data for this device from the system configuration files */
|
/* Grab IP config data for this device from the system configuration files */
|
||||||
priv->system_config_data = nm_system_device_get_system_config (dev, priv->app_data);
|
priv->system_config_data = nm_system_device_get_system_config (dev);
|
||||||
|
|
||||||
/* Allow distributions to flag devices as disabled */
|
/* Allow distributions to flag devices as disabled */
|
||||||
if (nm_system_device_get_disabled (dev)) {
|
if (nm_system_device_get_disabled (dev)) {
|
||||||
@@ -341,19 +339,6 @@ real_get_type_capabilities (NMDevice *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* nm_device_get_app_data
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct NMData *
|
|
||||||
nm_device_get_app_data (NMDevice *self)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (self != NULL, FALSE);
|
|
||||||
|
|
||||||
return self->priv->app_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* nm_device_get_act_request
|
* nm_device_get_act_request
|
||||||
*
|
*
|
||||||
@@ -1481,9 +1466,6 @@ set_property (GObject *object, guint prop_id,
|
|||||||
case NM_DEVICE_INTERFACE_PROP_DRIVER:
|
case NM_DEVICE_INTERFACE_PROP_DRIVER:
|
||||||
priv->driver = g_strdup (g_value_get_string (value));
|
priv->driver = g_strdup (g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_INTERFACE_PROP_APP_DATA:
|
|
||||||
priv->app_data = g_value_get_pointer (value);
|
|
||||||
break;
|
|
||||||
case NM_DEVICE_INTERFACE_PROP_CAPABILITIES:
|
case NM_DEVICE_INTERFACE_PROP_CAPABILITIES:
|
||||||
priv->capabilities = g_value_get_uint (value);
|
priv->capabilities = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
@@ -1515,9 +1497,6 @@ get_property (GObject *object, guint prop_id,
|
|||||||
case NM_DEVICE_INTERFACE_PROP_DRIVER:
|
case NM_DEVICE_INTERFACE_PROP_DRIVER:
|
||||||
g_value_set_string (value, priv->driver);
|
g_value_set_string (value, priv->driver);
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_INTERFACE_PROP_APP_DATA:
|
|
||||||
g_value_set_pointer (value, priv->app_data);
|
|
||||||
break;
|
|
||||||
case NM_DEVICE_INTERFACE_PROP_CAPABILITIES:
|
case NM_DEVICE_INTERFACE_PROP_CAPABILITIES:
|
||||||
g_value_set_uint (value, priv->capabilities);
|
g_value_set_uint (value, priv->capabilities);
|
||||||
break;
|
break;
|
||||||
@@ -1598,10 +1577,6 @@ nm_device_class_init (NMDeviceClass *klass)
|
|||||||
NM_DEVICE_INTERFACE_PROP_STATE,
|
NM_DEVICE_INTERFACE_PROP_STATE,
|
||||||
NM_DEVICE_INTERFACE_STATE);
|
NM_DEVICE_INTERFACE_STATE);
|
||||||
|
|
||||||
g_object_class_override_property (object_class,
|
|
||||||
NM_DEVICE_INTERFACE_PROP_APP_DATA,
|
|
||||||
NM_DEVICE_INTERFACE_APP_DATA);
|
|
||||||
|
|
||||||
g_object_class_override_property (object_class,
|
g_object_class_override_property (object_class,
|
||||||
NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE,
|
NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE,
|
||||||
NM_DEVICE_INTERFACE_DEVICE_TYPE);
|
NM_DEVICE_INTERFACE_DEVICE_TYPE);
|
||||||
|
@@ -120,8 +120,6 @@ NMDeviceType nm_device_get_device_type (NMDevice *dev);
|
|||||||
guint32 nm_device_get_capabilities (NMDevice *dev);
|
guint32 nm_device_get_capabilities (NMDevice *dev);
|
||||||
guint32 nm_device_get_type_capabilities (NMDevice *dev);
|
guint32 nm_device_get_type_capabilities (NMDevice *dev);
|
||||||
|
|
||||||
struct NMData * nm_device_get_app_data (NMDevice *dev);
|
|
||||||
|
|
||||||
gboolean nm_device_has_active_link (NMDevice *dev);
|
gboolean nm_device_has_active_link (NMDevice *dev);
|
||||||
guint32 nm_device_get_ip4_address (NMDevice *dev);
|
guint32 nm_device_get_ip4_address (NMDevice *dev);
|
||||||
void nm_device_update_ip4_address (NMDevice *dev);
|
void nm_device_update_ip4_address (NMDevice *dev);
|
||||||
|
@@ -11,7 +11,6 @@ struct _NMHalManager {
|
|||||||
LibHalContext *hal_ctx;
|
LibHalContext *hal_ctx;
|
||||||
NMDBusManager *dbus_mgr;
|
NMDBusManager *dbus_mgr;
|
||||||
NMManager *nm_manager;
|
NMManager *nm_manager;
|
||||||
NMData *nm_data;
|
|
||||||
GSList *device_creators;
|
GSList *device_creators;
|
||||||
|
|
||||||
gboolean nm_sleeping;
|
gboolean nm_sleeping;
|
||||||
@@ -118,7 +117,7 @@ wired_device_creator (NMHalManager *manager, const char *udi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
driver = nm_get_device_driver_name (manager->hal_ctx, udi);
|
driver = nm_get_device_driver_name (manager->hal_ctx, udi);
|
||||||
device = (NMDevice *) nm_device_802_3_ethernet_new (idx, udi, driver, FALSE, manager->nm_data);
|
device = (NMDevice *) nm_device_802_3_ethernet_new (idx, udi, driver, FALSE);
|
||||||
g_free (driver);
|
g_free (driver);
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
@@ -159,7 +158,7 @@ wireless_device_creator (NMHalManager *manager, const char *udi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
driver = nm_get_device_driver_name (manager->hal_ctx, udi);
|
driver = nm_get_device_driver_name (manager->hal_ctx, udi);
|
||||||
device = (NMDevice *) nm_device_802_11_wireless_new (idx, udi, driver, FALSE, manager->nm_data);
|
device = (NMDevice *) nm_device_802_11_wireless_new (idx, udi, driver, FALSE);
|
||||||
g_free (driver);
|
g_free (driver);
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
@@ -429,7 +428,7 @@ nm_manager_state_changed (NMManager *nm_manager, NMState state, gpointer user_da
|
|||||||
}
|
}
|
||||||
|
|
||||||
NMHalManager *
|
NMHalManager *
|
||||||
nm_hal_manager_new (NMManager *nm_manager, NMData *nm_data)
|
nm_hal_manager_new (NMManager *nm_manager)
|
||||||
{
|
{
|
||||||
NMHalManager *manager;
|
NMHalManager *manager;
|
||||||
NMDBusManager *dbus_mgr;
|
NMDBusManager *dbus_mgr;
|
||||||
@@ -445,7 +444,6 @@ nm_hal_manager_new (NMManager *nm_manager, NMData *nm_data)
|
|||||||
manager = g_slice_new0 (NMHalManager);
|
manager = g_slice_new0 (NMHalManager);
|
||||||
manager->nm_manager = g_object_ref (nm_manager);
|
manager->nm_manager = g_object_ref (nm_manager);
|
||||||
manager->dbus_mgr = dbus_mgr;
|
manager->dbus_mgr = dbus_mgr;
|
||||||
manager->nm_data = nm_data;
|
|
||||||
|
|
||||||
register_built_in_creators (manager);
|
register_built_in_creators (manager);
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
typedef struct _NMHalManager NMHalManager;
|
typedef struct _NMHalManager NMHalManager;
|
||||||
|
|
||||||
NMHalManager *nm_hal_manager_new (NMManager *nm_manager, NMData *nm_data);
|
NMHalManager *nm_hal_manager_new (NMManager *nm_manager);
|
||||||
void nm_hal_manager_destroy (NMHalManager *manager);
|
void nm_hal_manager_destroy (NMHalManager *manager);
|
||||||
|
|
||||||
#endif /* NM_HAL_MANAGER_H */
|
#endif /* NM_HAL_MANAGER_H */
|
||||||
|
@@ -40,7 +40,6 @@
|
|||||||
struct NMVPNManager
|
struct NMVPNManager
|
||||||
{
|
{
|
||||||
NMManager * nm_manager;
|
NMManager * nm_manager;
|
||||||
NMData * app_data;
|
|
||||||
GHashTable * service_table;
|
GHashTable * service_table;
|
||||||
GSList * connections;
|
GSList * connections;
|
||||||
|
|
||||||
@@ -103,17 +102,15 @@ nm_dbus_nmi_vpn_signal_handler (DBusConnection *connection,
|
|||||||
* Create a new VPN manager instance.
|
* Create a new VPN manager instance.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NMVPNManager *nm_vpn_manager_new (NMManager *nm_manager, NMData *app_data)
|
NMVPNManager *nm_vpn_manager_new (NMManager *nm_manager)
|
||||||
{
|
{
|
||||||
NMVPNManager * manager;
|
NMVPNManager * manager;
|
||||||
NMDBusManager * dbus_mgr;
|
NMDBusManager * dbus_mgr;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_MANAGER (nm_manager), NULL);
|
g_return_val_if_fail (NM_IS_MANAGER (nm_manager), NULL);
|
||||||
g_return_val_if_fail (app_data != NULL, NULL);
|
|
||||||
|
|
||||||
manager = g_slice_new0 (NMVPNManager);
|
manager = g_slice_new0 (NMVPNManager);
|
||||||
manager->nm_manager = g_object_ref (nm_manager);
|
manager->nm_manager = g_object_ref (nm_manager);
|
||||||
manager->app_data = app_data;
|
|
||||||
|
|
||||||
manager->service_table = g_hash_table_new_full (g_str_hash,
|
manager->service_table = g_hash_table_new_full (g_str_hash,
|
||||||
g_str_equal,
|
g_str_equal,
|
||||||
@@ -680,7 +677,7 @@ load_services (NMVPNManager *manager, GHashTable *table)
|
|||||||
if (!lines)
|
if (!lines)
|
||||||
goto free_file_path;
|
goto free_file_path;
|
||||||
|
|
||||||
service = nm_vpn_service_new (manager, manager->app_data);
|
service = nm_vpn_service_new (manager);
|
||||||
success = set_service_from_contents (lines, service, &err);
|
success = set_service_from_contents (lines, service, &err);
|
||||||
g_strfreev (lines);
|
g_strfreev (lines);
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include "nm-vpn-service.h"
|
#include "nm-vpn-service.h"
|
||||||
|
|
||||||
|
|
||||||
NMVPNManager * nm_vpn_manager_new (NMManager *nm_manager, NMData *app_data);
|
NMVPNManager * nm_vpn_manager_new (NMManager *nm_manager);
|
||||||
NMVPNConnection * nm_vpn_manager_add_connection (NMVPNManager *manager, const char *name, const char *service_name, const char *user_name);
|
NMVPNConnection * nm_vpn_manager_add_connection (NMVPNManager *manager, const char *name, const char *service_name, const char *user_name);
|
||||||
void nm_vpn_manager_remove_connection (NMVPNManager *manager, NMVPNConnection *vpn);
|
void nm_vpn_manager_remove_connection (NMVPNManager *manager, NMVPNConnection *vpn);
|
||||||
char ** nm_vpn_manager_get_connection_names (NMVPNManager *manager);
|
char ** nm_vpn_manager_get_connection_names (NMVPNManager *manager);
|
||||||
|
@@ -44,7 +44,6 @@ struct NMVPNService
|
|||||||
{
|
{
|
||||||
int refcount;
|
int refcount;
|
||||||
NMVPNManager * manager;
|
NMVPNManager * manager;
|
||||||
NMData * app_data;
|
|
||||||
GPid pid;
|
GPid pid;
|
||||||
guint32 sig_handler_id;
|
guint32 sig_handler_id;
|
||||||
gulong watch_id;
|
gulong watch_id;
|
||||||
@@ -95,13 +94,12 @@ static void print_vpn_config (NMIP4Config *config,
|
|||||||
* Create a new VPNService object
|
* Create a new VPNService object
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NMVPNService *nm_vpn_service_new (NMVPNManager *manager, NMData *app_data)
|
NMVPNService *nm_vpn_service_new (NMVPNManager *manager)
|
||||||
{
|
{
|
||||||
NMVPNService *service = g_malloc0 (sizeof (NMVPNService));
|
NMVPNService *service = g_malloc0 (sizeof (NMVPNService));
|
||||||
|
|
||||||
service->refcount = 1;
|
service->refcount = 1;
|
||||||
service->state = NM_VPN_SERVICE_STATE_SHUTDOWN;
|
service->state = NM_VPN_SERVICE_STATE_SHUTDOWN;
|
||||||
service->app_data = app_data;
|
|
||||||
service->manager = manager;
|
service->manager = manager;
|
||||||
service->dbus_mgr = nm_dbus_manager_get ();
|
service->dbus_mgr = nm_dbus_manager_get ();
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
typedef struct NMVPNService NMVPNService;
|
typedef struct NMVPNService NMVPNService;
|
||||||
|
|
||||||
|
|
||||||
NMVPNService * nm_vpn_service_new (NMVPNManager *manager, NMData *app_data);
|
NMVPNService * nm_vpn_service_new (NMVPNManager *manager);
|
||||||
|
|
||||||
void nm_vpn_service_ref (NMVPNService *service);
|
void nm_vpn_service_ref (NMVPNService *service);
|
||||||
void nm_vpn_service_unref (NMVPNService *service);
|
void nm_vpn_service_unref (NMVPNService *service);
|
||||||
|
Reference in New Issue
Block a user