NetworkManager r3360 - in trunk: . src src/backends
- From: tambeti svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3360 - in trunk: . src src/backends
- Date: Thu, 28 Feb 2008 22:31:55 +0000 (GMT)
Author: tambeti
Date: Thu Feb 28 22:31:55 2008
New Revision: 3360
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3360&view=rev
Log:
2008-02-28 Tambet Ingo <tambet gmail com>
Get rid of a bunch of unused distro specific functions.
Removed:
trunk/src/NetworkManagerDialup.h
Modified:
trunk/ChangeLog
trunk/src/NetworkManagerSystem.h
trunk/src/backends/NetworkManagerArch.c
trunk/src/backends/NetworkManagerDebian.c
trunk/src/backends/NetworkManagerFrugalware.c
trunk/src/backends/NetworkManagerGeneric.c
trunk/src/backends/NetworkManagerGeneric.h
trunk/src/backends/NetworkManagerGentoo.c
trunk/src/backends/NetworkManagerPaldo.c
trunk/src/backends/NetworkManagerRedHat.c
trunk/src/backends/NetworkManagerSlackware.c
trunk/src/backends/NetworkManagerSuSE.c
Modified: trunk/src/NetworkManagerSystem.h
==============================================================================
--- trunk/src/NetworkManagerSystem.h (original)
+++ trunk/src/NetworkManagerSystem.h Thu Feb 28 22:31:55 2008
@@ -57,9 +57,6 @@
void * nm_system_device_get_system_config (NMDevice *dev);
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data);
-NMIP4Config * nm_system_device_new_ip4_system_config (NMDevice *dev);
-
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev);
gboolean nm_system_device_get_disabled (NMDevice *dev);
@@ -81,11 +78,6 @@
gboolean nm_system_device_update_resolv_conf (void *data, int len, const char *domain_name);
-GSList * nm_system_get_dialup_config (void);
-void nm_system_deactivate_all_dialup (GSList *list);
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup);
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup);
-
void nm_system_set_hostname (NMIP4Config *config);
void nm_system_activate_nis (NMIP4Config *config);
void nm_system_shutdown_nis (void);
Modified: trunk/src/backends/NetworkManagerArch.c
==============================================================================
--- trunk/src/backends/NetworkManagerArch.c (original)
+++ trunk/src/backends/NetworkManagerArch.c Thu Feb 28 22:31:55 2008
@@ -48,7 +48,6 @@
#include "nm-device.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-device-802-11-wireless.h"
-#include "NetworkManagerDialup.h"
#include "interface_parser.h"
#include "nm-utils.h"
@@ -636,27 +635,6 @@
/*
- * nm_system_device_get_use_dhcp
- *
- * Return whether the distro-specific system config tells us to use
- * dhcp for this device.
- *
- */
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- ArchSystemConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data(dev)))
- {
- return sys_data->use_dhcp;
- }
-
- return TRUE;
-}
-
-/*
* nm_system_device_get_disabled
*
* Return whether the distro-specific system config tells us to use
@@ -668,130 +646,6 @@
return FALSE;
}
-
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- ArchSystemConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-void nm_system_deactivate_all_dialup (GSList *list)
-{
- GSList *elt;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- char *cmd;
-
- cmd = g_strdup_printf ("/sbin/ifconfig %s down", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-}
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Deactivating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifconfig %s down", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Activating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifconfig %s up", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-GSList * nm_system_get_dialup_config (void)
-{
- const char *buf;
- if_block *curr_device;
- gboolean error = FALSE;
- GError *err;
- unsigned int i = 0;
- size_t len;
- GSList *list = NULL;
-#if 0 // PORT me
- if_block *curr;
- ifparser_init();
-
- /* FIXME: get all ppp(and others?) lines from /e/n/i here */
- curr = ifparser_getfirst();
- while (curr!=NULL)
- {
- NMDialUpConfig *config;
- if (strcmp(curr->type,"iface")==0)
- {
- buf = ifparser_getkey(curr,"inet");
- if (buf && strcmp (buf, "ppp")==0)
- {
- config = g_malloc (sizeof (NMDialUpConfig));
- config->name = g_strdup_printf ("Modem (#%d)", i++);
- config->data = g_strdup (curr->name); /* interface name */
-
- list = g_slist_append (list, config);
-
- nm_info ("Found dial up configuration for %s: %s", config->name, (char *) config->data);
- }
- }
- curr = curr->next;
- }
- ifparser_destroy();
-
- /* Hack: Go back and remove the "(#0)" if there is only one device */
- if (i == 1)
- {
- NMDialUpConfig *config = (NMDialUpConfig *) list->data;
- g_free (config->name);
- config->name = g_strdup ("Modem");
- }
-#endif
- return list;
-}
-
/*
* nm_system_activate_nis
*
Modified: trunk/src/backends/NetworkManagerDebian.c
==============================================================================
--- trunk/src/backends/NetworkManagerDebian.c (original)
+++ trunk/src/backends/NetworkManagerDebian.c Thu Feb 28 22:31:55 2008
@@ -37,7 +37,6 @@
#include "nm-device.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-device-802-11-wireless.h"
-#include "NetworkManagerDialup.h"
#include "interface_parser.h"
#include "nm-utils.h"
@@ -355,26 +354,6 @@
/*
- * nm_system_device_get_use_dhcp
- *
- * Return whether the distro-specific system config tells us to use
- * dhcp for this device.
- *
- */
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- DebSystemConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- return sys_data->use_dhcp;
-
- return TRUE;
-}
-
-
-/*
* nm_system_device_get_disabled
*
* Return whether the distro-specific system config tells us to use
@@ -386,125 +365,6 @@
return FALSE;
}
-
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- DebSystemConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-void nm_system_deactivate_all_dialup (GSList *list)
-{
- GSList *elt;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- char *cmd;
-
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-}
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Deactivating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Activating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifup %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-GSList * nm_system_get_dialup_config (void)
-{
- const char *buf;
- unsigned int i = 0;
- GSList *list = NULL;
- if_block *curr;
- ifparser_init();
-
- /* FIXME: get all ppp(and others?) lines from /e/n/i here */
- curr = ifparser_getfirst();
- while(curr!=NULL)
- {
- NMDialUpConfig *config;
- if (strcmp(curr->type,"iface")==0)
- {
- buf = ifparser_getkey(curr,"inet");
- if (buf && strcmp (buf, "ppp")==0)
- {
- config = g_malloc (sizeof (NMDialUpConfig));
- config->name = g_strdup_printf ("Modem (#%d)", i++);
- config->data = g_strdup (curr->name); /* interface name */
-
- list = g_slist_append (list, config);
-
- nm_info ("Found dial up configuration for %s: %s", config->name, (char *) config->data);
- }
- }
- curr = curr->next;
- }
- ifparser_destroy();
-
- /* Hack: Go back and remove the "(#0)" if there is only one device */
- if (i == 1)
- {
- NMDialUpConfig *config = (NMDialUpConfig *) list->data;
- g_free (config->name);
- config->name = g_strdup ("Modem");
- }
-
- return list;
-}
-
/*
* nm_system_activate_nis
*
Modified: trunk/src/backends/NetworkManagerFrugalware.c
==============================================================================
--- trunk/src/backends/NetworkManagerFrugalware.c (original)
+++ trunk/src/backends/NetworkManagerFrugalware.c Thu Feb 28 22:31:55 2008
@@ -299,55 +299,10 @@
nm_spawn_process ("/usr/sbin/ip neigh flush all");
}
-void nm_system_deactivate_all_dialup (GSList *list)
-{
-}
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-/*
- * nm_system_get_dialup_config
- *
- * Enumerate dial up options on this system, allocate NMDialUpConfig's,
- * fill them out, and return.
- *
- */
-GSList * nm_system_get_dialup_config (void)
-{
- return NULL;
-}
-
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
{
}
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- return NULL;
-}
-
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- FWDeviceConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data(dev)))
- {
- return sys_data->use_dhcp;
- }
-
- return TRUE;
-}
-
/*
* get_current_profile_name
*
Modified: trunk/src/backends/NetworkManagerGeneric.c
==============================================================================
--- trunk/src/backends/NetworkManagerGeneric.c (original)
+++ trunk/src/backends/NetworkManagerGeneric.c Thu Feb 28 22:31:55 2008
@@ -412,25 +412,6 @@
return NULL;
}
-void nm_generic_deactivate_all_dialup (GSList *list)
-{
-}
-
-gboolean nm_generic_deactivate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-gboolean nm_generic_activate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-GSList * nm_generic_get_dialup_config (void)
-{
- return NULL;
-}
-
/*
* nm_generic_activate_nis
*
Modified: trunk/src/backends/NetworkManagerGeneric.h
==============================================================================
--- trunk/src/backends/NetworkManagerGeneric.h (original)
+++ trunk/src/backends/NetworkManagerGeneric.h Thu Feb 28 22:31:55 2008
@@ -74,11 +74,6 @@
gboolean nm_generic_device_update_resolv_conf (void *data, int len, const char *domain_name);
-GSList * nm_generic_get_dialup_config (void);
-void nm_generic_deactivate_all_dialup (GSList *list);
-gboolean nm_generic_activate_dialup (GSList *list, const char *dialup);
-gboolean nm_generic_deactivate_dialup (GSList *list, const char *dialup);
-
void nm_generic_set_hostname (NMIP4Config *config);
void nm_generic_activate_nis (NMIP4Config *config);
void nm_generic_shutdown_nis (void);
Modified: trunk/src/backends/NetworkManagerGentoo.c
==============================================================================
--- trunk/src/backends/NetworkManagerGentoo.c (original)
+++ trunk/src/backends/NetworkManagerGentoo.c Thu Feb 28 22:31:55 2008
@@ -447,31 +447,6 @@
g_free (sys_data);
}
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- GentooSystemConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- GentooSystemConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- return sys_data->use_dhcp;
-
- return TRUE;
-}
-
/*
* nm_system_device_get_disabled
*
@@ -484,32 +459,6 @@
return FALSE;
}
-void nm_system_deactivate_all_dialup (GSList *list)
-{
-}
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-/*
- * nm_system_get_dialup_config
- *
- * Enumerate dial up options on this system, allocate NMDialUpConfig's,
- * fill them out, and return.
- *
- */
-GSList * nm_system_get_dialup_config (void)
-{
- return NULL;
-}
-
/*
* nm_system_activate_nis
*
Modified: trunk/src/backends/NetworkManagerPaldo.c
==============================================================================
--- trunk/src/backends/NetworkManagerPaldo.c (original)
+++ trunk/src/backends/NetworkManagerPaldo.c Thu Feb 28 22:31:55 2008
@@ -467,26 +467,6 @@
/*
- * nm_system_device_get_use_dhcp
- *
- * Return whether the distro-specific system config tells us to use
- * dhcp for this device.
- *
- */
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- PaldoSystemConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- return sys_data->use_dhcp;
-
- return TRUE;
-}
-
-
-/*
* nm_system_device_get_disabled
*
* Return whether the distro-specific system config tells us to
@@ -506,49 +486,6 @@
}
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- PaldoSystemConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-
-void nm_system_deactivate_all_dialup (GSList *list)
-{
- /* FIXME: implement for paldo */
-}
-
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- /* FIXME: implement for paldo */
-
- return FALSE;
-}
-
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- /* FIXME: implement for paldo */
-
- return FALSE;
-}
-
-
-GSList * nm_system_get_dialup_config (void)
-{
- /* FIXME: implement for paldo */
-
- return NULL;
-}
-
/*
* nm_system_activate_nis
*
Modified: trunk/src/backends/NetworkManagerRedHat.c
==============================================================================
--- trunk/src/backends/NetworkManagerRedHat.c (original)
+++ trunk/src/backends/NetworkManagerRedHat.c Thu Feb 28 22:31:55 2008
@@ -33,7 +33,6 @@
#include "nm-device.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-device-802-11-wireless.h"
-#include "NetworkManagerDialup.h"
#include "nm-utils.h"
#include "shvar.h"
@@ -485,26 +484,6 @@
/*
- * nm_system_device_get_use_dhcp
- *
- * Return whether the distro-specific system config tells us to use
- * dhcp for this device.
- *
- */
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- RHSystemConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, TRUE);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- return sys_data->use_dhcp;
-
- return TRUE;
-}
-
-
-/*
* nm_system_device_get_disabled
*
* Return whether the distro-specific system config tells us to use
@@ -523,228 +502,6 @@
return FALSE;
}
-
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- RHSystemConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-
-void nm_system_deactivate_all_dialup (GSList *list)
-{
- GSList *l;
-
- for (l = list; l; l = g_slist_next(l))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) l->data;
- char *cmd;
-
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *)config->data);
- nm_spawn_process (cmd);
- g_free(cmd);
- }
-}
-
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- GSList *l;
- gboolean ret = FALSE;
-
- for (l = list; l; l = g_slist_next (l))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) l->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
- int status;
-
- nm_info ("Dectivating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *) config->data);
- status = nm_spawn_process (cmd);
- g_free (cmd);
- if (status == 0) {
- ret = TRUE;
- } else {
- /* FIXME: Decode errors into something sensible */
- nm_warning ("Couldn't deactivate dialup device %s (%s) - %d", dialup, (char *) config->data, status);
- ret = FALSE;
- }
- break;
- }
- }
- return ret;
-}
-
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- GSList *l;
- gboolean ret = FALSE;
-
- for (l = list; l; l = g_slist_next (l))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) l->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
- int status;
-
- nm_info ("Activating dialup device %s (%s) ...", dialup, (char *) config->data);
- cmd = g_strdup_printf ("/sbin/ifup %s", (char *) config->data);
- status = nm_spawn_process (cmd);
- g_free (cmd);
- if (status == 0) {
- ret = TRUE;
- } else {
- /* FIXME: Decode errors into something sensible */
- nm_warning ("Couldn't activate dialup device %s (%s) - %d", dialup, (char *) config->data, status);
- ret = FALSE;
- }
- break;
- }
- }
- return ret;
-}
-
-
-static gboolean is_valid_cfg(const char *cfg)
-{
- char *exts[] = { ".rpmsave", ".rpmorig", ".rpmnew", "~", ".bak", NULL };
- int x;
-
- if (!g_str_has_prefix (cfg, "ifcfg-"))
- return FALSE;
- for (x = 0 ; exts[x] ; x++) {
- if (g_str_has_suffix(cfg,exts[x]))
- return FALSE;
- }
- return TRUE;
-}
-
-static char *get_config_name(const char *cfg)
-{
- char *ret = NULL;
- shvarFile *cfg_file;
- char *path, *tmp;
- gboolean is_dialup = FALSE;
-
- path = g_strdup_printf ("/etc/sysconfig/network-scripts/%s", cfg);
- cfg_file = svNewFile (path);
- g_free (path);
- if (!cfg_file)
- return NULL;
-
-
- /* Check for a dialup TYPE */
- tmp = svGetValue (cfg_file, "TYPE");
- if (tmp)
- {
- if ((strcmp (tmp, "Modem") == 0) ||
- (strcmp (tmp, "ISDN") == 0))
- is_dialup = TRUE;
- free(tmp);
- }
-
- /* Check for a dialup BOOTPROTO */
- tmp = svGetValue (cfg_file, "BOOTPROTO");
- if (tmp)
- {
- if ((strcmp (tmp, "dialup") == 0))
- is_dialup = TRUE;
- free(tmp);
- }
-
- /* Check for a dialup device name */
- if (g_str_has_prefix(cfg+6, "ppp") || g_str_has_prefix(cfg+6, "ippp"))
- is_dialup = TRUE;
-
- if (!is_dialup)
- goto out_close;
-
- /* PROVIDER isn't actually used, but s-c-network writes it. */
- tmp = svGetValue (cfg_file, "PROVIDER");
- if (tmp)
- {
- ret = tmp;
- goto out_close;
- }
-
- /* NAME isn't used either... */
- tmp = svGetValue (cfg_file, "NAME");
- if (tmp)
- {
- ret = tmp;
- goto out_close;
- }
-
- tmp = svGetValue (cfg_file, "WVDIALSECT");
- if (tmp)
- {
- ret = tmp;
- goto out_close;
- }
-
- /* Fallback - use the config*/
- ret = strdup(cfg + 6);
-
-out_close:
- svCloseFile (cfg_file);
- return ret;
-
-}
-
-GSList * nm_system_get_dialup_config (void)
-{
- GSList *list = NULL;
- GDir *dir;
- GError *err;
- const char *entry;
-
- dir = g_dir_open ("/etc/sysconfig/network-scripts", 0, &err);
- if (!dir)
- {
- nm_warning ("Could not open directory /etc/sysconfig/network-scripts: %s", err->message);
- return NULL;
- }
-
- while ((entry = g_dir_read_name(dir)))
- {
- NMDialUpConfig *config;
- char *buf;
-
- if (!is_valid_cfg(entry))
- continue;
-
- buf = get_config_name(entry);
-
- if (!buf)
- continue;
-
- config = g_malloc (sizeof (NMDialUpConfig));
- config->name = g_strdup_printf ("%s via Modem", buf);
- config->data = g_strdup (entry + 6);
- list = g_slist_append (list, config);
-
- nm_info ("Found dial up configuration for %s: %s", config->name, (char *) config->data);
-
- free (buf);
-
- }
-
- g_dir_close (dir);
-
- return list;
-}
-
/*
* nm_system_activate_nis
*
Modified: trunk/src/backends/NetworkManagerSlackware.c
==============================================================================
--- trunk/src/backends/NetworkManagerSlackware.c (original)
+++ trunk/src/backends/NetworkManagerSlackware.c Thu Feb 28 22:31:55 2008
@@ -265,47 +265,10 @@
nm_generic_flush_arp_cache ();
}
-void nm_system_deactivate_all_dialup (GSList *list)
-{
-}
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- return FALSE;
-}
-
-/*
- * nm_system_get_dialup_config
- *
- * Enumerate dial up options on this system, allocate NMDialUpConfig's,
- * fill them out, and return.
- *
- */
-GSList * nm_system_get_dialup_config (void)
-{
- return NULL;
-}
-
void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
{
}
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- return NULL;
-}
-
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- return TRUE;
-}
-
-
/*
* nm_system_device_get_disabled
*
Modified: trunk/src/backends/NetworkManagerSuSE.c
==============================================================================
--- trunk/src/backends/NetworkManagerSuSE.c (original)
+++ trunk/src/backends/NetworkManagerSuSE.c Thu Feb 28 22:31:55 2008
@@ -40,7 +40,6 @@
#include "NetworkManagerPolicy.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-device-802-11-wireless.h"
-#include "NetworkManagerDialup.h"
#include "nm-utils.h"
#include "shvar.h"
@@ -528,26 +527,6 @@
/*
- * nm_system_device_get_use_dhcp
- *
- * Return whether the distro-specific system config tells us to use
- * dhcp for this device.
- *
- */
-gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
-{
- SuSEDeviceConfigData *sys_data;
-
- g_return_val_if_fail (dev != NULL, FALSE);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- return sys_data->use_dhcp;
-
- return FALSE;
-}
-
-
-/*
* nm_system_device_get_disabled
*
* Return whether the distribution has flagged this device as disabled.
@@ -566,231 +545,6 @@
}
-NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
-{
- SuSEDeviceConfigData *sys_data;
- NMIP4Config *new_config = NULL;
-
- g_return_val_if_fail (dev != NULL, NULL);
-
- if ((sys_data = nm_device_get_system_config_data (dev)))
- new_config = nm_ip4_config_copy (sys_data->config);
-
- return new_config;
-}
-
-
-void nm_system_deactivate_all_dialup (GSList *list)
-{
- GSList *elt;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- char *cmd;
-
- if (config->type == NM_DIALUP_TYPE_ISDN)
- {
- cmd = g_strdup_printf ("/sbin/isdnctrl hangup %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-}
-
-
-gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Deactivating dialup device %s (%s) ...", dialup, (char *) config->data);
-
- cmd = g_strdup_printf ("/sbin/ifdown %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
-
- if (config->type == NM_DIALUP_TYPE_ISDN)
- {
- cmd = g_strdup_printf ("/sbin/isdnctrl hangup %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-
-gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
-{
- GSList *elt;
- gboolean ret = FALSE;
-
- for (elt = list; elt; elt = g_slist_next (elt))
- {
- NMDialUpConfig *config = (NMDialUpConfig *) elt->data;
- if (strcmp (dialup, config->name) == 0)
- {
- char *cmd;
-
- nm_info ("Activating dialup device %s (%s) ...", dialup, (char *) config->data);
-
- cmd = g_strdup_printf ("/sbin/ifup %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
-
- if (config->type == NM_DIALUP_TYPE_ISDN)
- {
- cmd = g_strdup_printf ("/sbin/isdnctrl dial %s", (char *) config->data);
- nm_spawn_process (cmd);
- g_free (cmd);
- }
-
- ret = TRUE;
- break;
- }
- }
-
- return ret;
-}
-
-
-/*
- * verify_and_return_provider - given a provider identifier, verify that it is able to dial without
- * prompting and return the provider name. On failure, return NULL. Caller is responsible for
- * free'ing the return.
-*/
-static char * verify_and_return_provider (const char *provider)
-{
- shvarFile *file;
- char *name, *buf = NULL;
- int ret;
-
- name = g_strdup_printf (SYSCONFDIR"/sysconfig/network/providers/%s", provider);
-
- file = svNewFile (name);
- if (!file)
- goto out_gfree;
-
- buf = svGetValue (file, "ASKPASSWORD");
- if (!buf)
- goto out_close;
- ret = strcmp (buf, "no");
- free (buf);
- if (ret)
- {
- buf = NULL;
- goto out_close;
- }
-
- buf = svGetValue (file, "PROVIDER");
-
-out_close:
- svCloseFile (file);
-out_gfree:
- g_free (name);
-
- return buf;
-}
-
-
-/*
- * nm_system_get_dialup_config
- *
- * Enumerate dial up options on this system, allocate NMDialUpConfig's,
- * fill them out, and return.
- *
- */
-GSList * nm_system_get_dialup_config (void)
-{
- GSList *list = NULL;
- const char *dentry;
- GError *err = NULL;
- GDir *dir;
-
- dir = g_dir_open (SYSCONFDIR "/sysconfig/network", 0, &err);
- if (!dir)
- {
- nm_warning ("Could not open directory " SYSCONFDIR "/sysconfig/network: %s", err->message);
- return NULL;
- }
-
- while ((dentry = g_dir_read_name (dir)))
- {
- NMDialUpConfig *config;
- shvarFile *modem_file;
- char *name, *buf, *provider_name;
- int modem;
-
- /* we only want modems and isdn */
- if (g_str_has_prefix (dentry, "ifcfg-modem"))
- modem = 1;
- else if (g_str_has_prefix (dentry, "ifcfg-ippp"))
- modem = 0;
- else
- continue;
-
- /* open the configuration file */
- name = g_strdup_printf (SYSCONFDIR"/sysconfig/network/%s", dentry);
- modem_file = svNewFile (name);
- if (!modem_file)
- goto out_gfree;
- /* get the name of the provider used for this entry */
- buf = svGetValue (modem_file, "PROVIDER");
- if (!buf)
- goto out_close;
-
- provider_name = verify_and_return_provider (buf);
- if (!provider_name)
- goto out_free;
-
- config = g_malloc (sizeof (NMDialUpConfig));
- config->data = g_strdup (dentry + 6); /* skip the "ifcfg-" prefix */
- if (modem)
- {
- config->name = g_strdup_printf ("%s via modem (%s)", provider_name, (char *) config->data);
- config->type = NM_DIALUP_TYPE_MODEM;
- } else
- {
- config->name = g_strdup_printf ("%s via ISDN (%s)", provider_name, (char *) config->data);
- config->type = NM_DIALUP_TYPE_ISDN;
- }
-
- list = g_slist_append (list, config);
-
- nm_info ("Found dial up configuration for %s: %s", config->name, (char *) config->data);
-
- free (provider_name);
-out_free:
- free (buf);
-out_close:
- svCloseFile (modem_file);
-out_gfree:
- g_free (name);
- }
-
- g_dir_close (dir);
-
- return list;
-}
-
-
/*
* nm_system_activate_nis
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]