[Frugalware-darcs] setup-current: netconfig: handle sections in
parseconfig()
VMiklos
vmiklos at frugalware.org
Thu Mar 16 18:09:24 CET 2006
[netconfig: handle sections in parseconfig()
VMiklos <vmiklos at frugalware.org>**20060117215436] {
hunk ./src/config/netconfig.c 27
+#include <net/if.h>
hunk ./src/config/netconfig.c 63
- int n=0;
+ int i, n=0;
hunk ./src/config/netconfig.c 68
+ interface_t *iface;
hunk ./src/config/netconfig.c 103
+ if(strcmp(interface, "options"))
+ {
+ int found = 0;
+ for (i=0; !found && i<g_list_length(profile->interfaces); i++)
+ {
+ iface = (interface_t*)g_list_nth_data(profile->interfaces, i);
+ if(!strcmp(iface->name, interface))
+ found=1;
+ }
+ if(!found)
+ {
+ /* start a new interface record */
+ iface = (interface_t*)malloc(sizeof(interface_t));
+ if(iface==NULL)
+ return(NULL);
+ memset(iface, 0, sizeof(interface_t));
+ strncpy(iface->name, interface, IF_NAMESIZE);
+ profile->interfaces = g_list_append(profile->interfaces, iface);
+ }
+ }
hunk ./src/config/netconfig.c 127
- return(NULL);
+ /*printf("interfaces found:\n");
+ for (i=0; i<g_list_length(profile->interfaces); i++)
+ {
+ iface = (interface_t*)g_list_nth_data(profile->interfaces, i);
+ printf("%s\n", iface->name);
+ }*/
+ return(profile);
}
More information about the Frugalware-darcs
mailing list