summaryrefslogtreecommitdiff
path: root/src/backends
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-04-08 16:11:25 +0000
committerDan Williams <dcbw@redhat.com>2008-04-08 16:11:25 +0000
commit958a96def9e1c57727b7e5edb4e43ef9f95aa781 (patch)
treeef753760e4f5d3be2b2e13f6d72c9ca0d20a1a91 /src/backends
parent0825542f26c8856909d9dad0753896ec05176038 (diff)
downloadNetworkManager-958a96def9e1c57727b7e5edb4e43ef9f95aa781.tar.gz
Remove unused function
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3545 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'src/backends')
-rw-r--r--src/backends/NetworkManagerArch.c148
1 files changed, 0 insertions, 148 deletions
diff --git a/src/backends/NetworkManagerArch.c b/src/backends/NetworkManagerArch.c
index 4c94e9fe8f..04541397fb 100644
--- a/src/backends/NetworkManagerArch.c
+++ b/src/backends/NetworkManagerArch.c
@@ -344,154 +344,6 @@ void nm_system_device_add_ip6_link_address (NMDevice *dev)
}
/*
-* ArchReadConfig
-*
-* Read platform dependant config file and fill hash with relevant info
-*/
-
-static GHashTable * ArchReadConfig(const char* file, const char* dev)
-{
- gchar *contents=NULL;
- gchar **split_contents=NULL;
- GHashTable *cfg,*ifs;
- guint len;
- gint i;
- gpointer val;
-
- if (!g_file_get_contents (file, &contents, NULL, NULL) || (contents == NULL))
- {
- return NULL;
- }
-
- if (!(split_contents = g_strsplit (contents, "\n", 0)))
- {
- g_free(contents);
- return NULL;
- }
-
- cfg=g_hash_table_new_full(g_str_hash,g_str_equal,g_free,g_free);
- if (cfg==NULL)
- {
- g_free(contents);
- return NULL;
- }
-
- ifs=g_hash_table_new_full(g_str_hash,g_str_equal,g_free,g_free);
- if (ifs==NULL)
- {
- g_free(contents);
- g_hash_table_destroy(cfg);
- return NULL;
- }
-
- /* load hash with key value pairs from config file */
- len = g_strv_length (split_contents);
- for (i = 0; i < len; i++)
- {
- char *line = split_contents[i];
- gchar** splt;
-
- /* Ignore comments */
- if (!line || (line[0] == ';') || (line[0] == '#'))
- {
- continue;
- }
-
- line = g_strstrip(line);
-
- splt=g_strsplit(line,"=",0);
- if (g_strv_length(splt)==2)
- {
- g_hash_table_insert(cfg,g_strstrip(splt[0]),g_strstrip(splt[1]));
- }
- else
- {
- g_strfreev(splt);
- }
-
- }
-
- /* Find our network device */
- if ((val=g_hash_table_lookup(cfg,dev)))
- {
- char hit[128];
- gchar** splt;
- gint hits;
-
- if (sscanf(val,"\"%[0-9a-zA-Z .]\"",hit))
- {
-
- splt=g_strsplit(hit," ",0);
-
- hits=g_strv_length(splt);
- if (hits>1)
- {
- guint j=0;
- while ((hits-=2)>=0)
- {
- g_hash_table_insert(ifs,splt[j],splt[j+1]);
- j+=2;
- }
-
- }
- else
- {
- /* This interface is probably using DHCP - check this */
- if (!g_ascii_strcasecmp(splt[0],"dhcp"))
- {
- g_hash_table_insert(ifs,g_strdup("dhcp"),g_strdup("true"));
- }
- }
-
- }
- }
-
- /* Find out any default route */
- if ((val=g_hash_table_lookup(cfg,"ROUTES")))
- {
- char hit[128];
- gchar** splt;
- gint hits,j;
-
- if (sscanf(val,"( %[!0-9a-zA-z ] )",hit))
- {
-
- splt=g_strsplit(hit," ",0);
-
- hits=g_strv_length(splt);
- for (j=0;j<hits;j++)
- {
-
- if (splt[j][0]=='!')
- {
- continue;
- }
-
- if ((val=g_hash_table_lookup(cfg,splt[j])))
- {
-
- if (sscanf(val," \" default gw %[0-9a-zA-Z.-_] \"",hit))
- {
- g_hash_table_insert(ifs,g_strdup("gateway"),g_strdup(hit));
- break; /* Only one default gw */
- }
-
- }
- }
- g_strfreev(splt);
-
- }
-
- }
-
- g_hash_table_destroy(cfg);
- g_strfreev (split_contents);
- g_free(contents);
-
- return ifs;
-}
-
-/*
* nm_system_activate_nis
*
* set up the nis domain and write a yp.conf