2006-03-06 Robert Love <rml@novell.com>
* src/NetworkManagerSystem.h, src/nm-device.c, NetworkManagerDebian.c, NetworkManagerRedHat.c, NetworkManagerGentoo.c, NetworkManagerSlackware.c: Pass nm_system_device_get_system_config() a second argument, NMData. * src/nm-ap-security.h, src/nm-ap-security.c: Export nm_ap_security_new. * src/backends/NetworkManagerSuSE.c: Add wireless networks from ifcfg-* config files as trusted. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1564 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2006-03-06 Robert Love <rml@novell.com>
|
||||
|
||||
* src/NetworkManagerSystem.h, src/nm-device.c, NetworkManagerDebian.c,
|
||||
NetworkManagerRedHat.c, NetworkManagerGentoo.c,
|
||||
NetworkManagerSlackware.c: Pass nm_system_device_get_system_config()
|
||||
a second argument, NMData.
|
||||
* src/nm-ap-security.h, src/nm-ap-security.c: Export nm_ap_security_new.
|
||||
* src/backends/NetworkManagerSuSE.c: Add wireless networks from ifcfg-*
|
||||
config files as trusted.
|
||||
|
||||
2006-03-06 Robert Love <rml@novell.com>
|
||||
|
||||
* gnome/applet/Makefile.am: Define AUTOSTARTDIR.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
AC_INIT(NetworkManager, 0.6.0, dcbw@redhat.com, NetworkManager)
|
||||
AC_INIT(NetworkManager, 0.6.0cvs20060308, dcbw@redhat.com, NetworkManager)
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "nm-ip4-config.h"
|
||||
#include "nm-named-manager.h"
|
||||
|
||||
struct NMData;
|
||||
|
||||
/* Prototypes for system/distribution dependent functions,
|
||||
* implemented in the backend files in backends/ directory
|
||||
@@ -58,7 +59,7 @@ void nm_system_update_dns (void);
|
||||
void nm_system_restart_mdns_responder (void);
|
||||
void nm_system_device_add_ip6_link_address (NMDevice *dev);
|
||||
|
||||
void * nm_system_device_get_system_config (NMDevice *dev);
|
||||
void * nm_system_device_get_system_config (NMDevice *dev, struct NMData *data);
|
||||
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data);
|
||||
NMIP4Config * nm_system_device_new_ip4_system_config (NMDevice *dev);
|
||||
|
||||
|
@@ -384,7 +384,7 @@ out:
|
||||
* info before setting stuff too.
|
||||
*
|
||||
*/
|
||||
void* nm_system_device_get_system_config (NMDevice *dev)
|
||||
void* nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
||||
{
|
||||
DebSystemConfigData * sys_data = NULL;
|
||||
if_block *curr_device;
|
||||
|
@@ -300,7 +300,7 @@ typedef struct GentooSystemConfigData
|
||||
* info before setting stuff too.
|
||||
*
|
||||
*/
|
||||
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
||||
{
|
||||
char *cfg_file_path = NULL;
|
||||
FILE *file = NULL;
|
||||
|
@@ -454,7 +454,7 @@ out:
|
||||
* Read in the config file for a device.
|
||||
*
|
||||
*/
|
||||
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
||||
{
|
||||
char * cfg_file_path = NULL;
|
||||
shvarFile * file;
|
||||
|
@@ -139,7 +139,7 @@ gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
|
||||
* info before setting stuff too.
|
||||
*
|
||||
*/
|
||||
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -31,7 +31,11 @@
|
||||
|
||||
#include "NetworkManagerSystem.h"
|
||||
#include "NetworkManagerUtils.h"
|
||||
#include "NetworkManagerMain.h"
|
||||
#include "nm-device.h"
|
||||
#include "nm-ap-security.h"
|
||||
#include "NetworkManagerAPList.h"
|
||||
#include "NetworkManagerPolicy.h"
|
||||
#include "nm-device-802-3-ethernet.h"
|
||||
#include "nm-device-802-11-wireless.h"
|
||||
#include "NetworkManagerDialup.h"
|
||||
@@ -428,7 +432,7 @@ out:
|
||||
* SuSE stores this information in /etc/sysconfig/network/ifcfg-*-<MAC address>
|
||||
*
|
||||
*/
|
||||
void *nm_system_device_get_system_config (NMDevice *dev)
|
||||
void *nm_system_device_get_system_config (NMDevice *dev, NMData *app_data)
|
||||
{
|
||||
char *cfg_file_path = NULL;
|
||||
char mac[18];
|
||||
@@ -507,7 +511,52 @@ found:
|
||||
sys_data->system_disabled = TRUE;
|
||||
}
|
||||
free (buf);
|
||||
}
|
||||
}
|
||||
|
||||
if ((buf = svGetValue (file, "WIRELESS_ESSID")))
|
||||
{
|
||||
NMAccessPoint * ap;
|
||||
NMAccessPoint * list_ap;
|
||||
NMAPSecurity * security;
|
||||
GTimeVal * timestamp;
|
||||
|
||||
ap = nm_ap_new ();
|
||||
security = nm_ap_security_new (IW_AUTH_CIPHER_NONE);
|
||||
|
||||
nm_ap_set_essid (ap, buf);
|
||||
nm_ap_set_security (ap, security);
|
||||
g_object_unref (G_OBJECT (security)); /* set_security copies the object */
|
||||
|
||||
timestamp = g_malloc0 (sizeof (GTimeVal));
|
||||
timestamp->tv_sec = time (NULL);
|
||||
timestamp->tv_usec = 0;
|
||||
nm_ap_set_timestamp (ap, timestamp);
|
||||
g_free (timestamp);
|
||||
|
||||
nm_ap_set_trusted (ap, TRUE);
|
||||
|
||||
if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
|
||||
{
|
||||
nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
|
||||
nm_ap_set_timestamp (list_ap, nm_ap_get_timestamp (ap));
|
||||
nm_ap_set_trusted (list_ap, nm_ap_get_trusted (ap));
|
||||
nm_ap_set_security (list_ap, nm_ap_get_security (ap));
|
||||
nm_ap_set_user_addresses (list_ap, nm_ap_get_user_addresses (ap));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* New AP, just add it to the list */
|
||||
nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
|
||||
}
|
||||
nm_ap_unref (ap);
|
||||
|
||||
nm_debug ("Adding '%s' to the list of trusted networks", buf);
|
||||
|
||||
/* Ensure all devices get new information copied into their device lists */
|
||||
nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
|
||||
sys_data->config = nm_ip4_config_new ();
|
||||
|
||||
|
@@ -45,7 +45,7 @@ struct _NMAPSecurityPrivate
|
||||
gboolean dispose_has_run;
|
||||
};
|
||||
|
||||
static NMAPSecurity *
|
||||
NMAPSecurity *
|
||||
nm_ap_security_new (int we_cipher)
|
||||
{
|
||||
NMAPSecurity * security;
|
||||
|
@@ -77,6 +77,8 @@ GType nm_ap_security_get_type (void);
|
||||
|
||||
NMAPSecurity * nm_ap_security_new_copy (NMAPSecurity *self);
|
||||
|
||||
NMAPSecurity * nm_ap_security_new (int we_cipher);
|
||||
|
||||
NMAPSecurity * nm_ap_security_new_deserialize (DBusMessageIter *iter);
|
||||
|
||||
NMAPSecurity * nm_ap_security_new_from_ap (struct NMAccessPoint *ap);
|
||||
|
@@ -196,7 +196,7 @@ nm_device_new (const char *iface,
|
||||
nm_device_802_11_wireless_set_address (NM_DEVICE_802_11_WIRELESS (dev));
|
||||
|
||||
/* Grab IP config data for this device from the system configuration files */
|
||||
dev->priv->system_config_data = nm_system_device_get_system_config (dev);
|
||||
dev->priv->system_config_data = nm_system_device_get_system_config (dev, app_data);
|
||||
dev->priv->use_dhcp = nm_system_device_get_use_dhcp (dev);
|
||||
|
||||
/* Allow distributions to flag devices as disabled */
|
||||
|
Reference in New Issue
Block a user