NetworkManager r3545 - trunk/src/backends



Author: dcbw
Date: Tue Apr  8 17:11:25 2008
New Revision: 3545
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3545&view=rev

Log:
Remove unused function

Modified:
   trunk/src/backends/NetworkManagerArch.c

Modified: trunk/src/backends/NetworkManagerArch.c
==============================================================================
--- trunk/src/backends/NetworkManagerArch.c	(original)
+++ trunk/src/backends/NetworkManagerArch.c	Tue Apr  8 17:11:25 2008
@@ -344,154 +344,6 @@
 }
 
 /*
-*   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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]