2006-01-04 Robert Love <rml@novell.com>
* src/NetworkManagerDialup.h: add 'type' field and NM_DIALUP_TYPE values so that distribution-backends can differentiate between the various types (modem, ISDN, et cetera) of dialup device that they support. * src/backends/NetworkManagerSuSE.c: perform isdnctrl on interface, as needed. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1265 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2006-01-04 Robert Love <rml@novell.com>
|
||||
|
||||
* src/NetworkManagerDialup.h: add 'type' field and NM_DIALUP_TYPE
|
||||
values so that distribution-backends can differentiate between the
|
||||
various types (modem, ISDN, et cetera) of dialup device that they
|
||||
support.
|
||||
* src/backends/NetworkManagerSuSE.c: perform isdnctrl on interface, as
|
||||
needed.
|
||||
|
||||
2006-01-03 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/NetworkManagerPolicy.c
|
||||
|
@@ -1,10 +1,14 @@
|
||||
#ifndef _NETWORK_MANAGER_DIALUP_H
|
||||
#define _NETWORK_MANAGER_DIALUP_H
|
||||
|
||||
#define NM_DIALUP_TYPE_MODEM 1
|
||||
#define NM_DIALUP_TYPE_ISDN 2
|
||||
|
||||
typedef struct NMDialUpConfig
|
||||
{
|
||||
char *name; /* user-readable name, unique */
|
||||
void *data; /* backend internal data */
|
||||
char *name; /* user-readable name, unique */
|
||||
void *data; /* backend internal data */
|
||||
unsigned int type; /* type: modem or ISDN, currently */
|
||||
} NMDialUpConfig;
|
||||
|
||||
#endif /* _NETWORK_MANAGER_DIALUP_H */
|
||||
|
@@ -686,6 +686,12 @@ void nm_system_deactivate_all_dialup (GSList *list)
|
||||
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);
|
||||
@@ -706,9 +712,17 @@ gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
|
||||
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;
|
||||
}
|
||||
@@ -807,10 +821,13 @@ GSList * nm_system_get_dialup_config (void)
|
||||
goto out_free;
|
||||
|
||||
config = g_malloc (sizeof (NMDialUpConfig));
|
||||
if (modem)
|
||||
if (modem) {
|
||||
config->name = g_strdup_printf ("%s via Modem", provider_name);
|
||||
else
|
||||
config->type = NM_DIALUP_TYPE_MODEM;
|
||||
} else {
|
||||
config->name = g_strdup_printf ("%s via ISDN", provider_name);
|
||||
config->type = NM_DIALUP_TYPE_ISDN;
|
||||
}
|
||||
config->data = g_strdup (dentry + 6); /* skip the "ifcfg-" prefix */
|
||||
|
||||
list = g_slist_append (list, config);
|
||||
|
Reference in New Issue
Block a user