[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop: [1050]
From:       owes () users ! sourceforge ! net
Date:       2008-01-31 16:12:59
Message-ID: E1JKc27-0004R8-JO () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]

Revision: 1050
          http://ipcop.svn.sourceforge.net/ipcop/?rev=1050&view=rev
Author:   owes
Date:     2008-01-31 08:12:59 -0800 (Thu, 31 Jan 2008)

Log Message:
-----------
Ethernet settings are now colour_1_DEV colour_1_DRIVER etc.
Add GREEN_COUNT, BLUE_COUNT etc. variables.
Keep old style (i.e. GREEN_DEV, GREEN_DRIVER etc.) for now, to make migration \
smoother.

Modified Paths:
--------------
    ipcop/trunk/src/installer/networking.c

Modified: ipcop/trunk/src/installer/networking.c
===================================================================
--- ipcop/trunk/src/installer/networking.c	2008-01-31 08:56:19 UTC (rev 1049)
+++ ipcop/trunk/src/installer/networking.c	2008-01-31 16:12:59 UTC (rev 1050)
@@ -259,13 +259,19 @@
         update_kv(&eth_kv, "RED_TYPE", cfg_text[i]);
         strcpy(kv_red_type, cfg_text[i]);
 
-        /* keep CONFIG_TYPE for now */
         if ( !strcmp(cfg_text[i], "ANALOG") || !strcmp(cfg_text[i], "ISDN") )
         {
+          update_kv(&eth_kv, "RED_1_DEV", "");
+          update_kv(&eth_kv, "RED_COUNT", "0");
+
+          /* keep CONFIG_TYPE for now */
           update_kv(&eth_kv, "CONFIG_TYPE", "0");
         }
         else
         {
+          update_kv(&eth_kv, "RED_COUNT", "1");
+
+          /* keep CONFIG_TYPE for now */
           update_kv(&eth_kv, "CONFIG_TYPE", "2");
         }
         changed_config = 1;
@@ -293,6 +299,14 @@
   if ( n == -1 )
   {
     /* was occupied, now empty */
+    snprintf(key, STRING_SIZE, "%s_1_DEV", colour);
+    update_kv(&eth_kv, key, "");
+    snprintf(key, STRING_SIZE, "%s_1_DRIVER", colour);
+    update_kv(&eth_kv, key, "");
+    snprintf(key, STRING_SIZE, "%s_COUNT", colour);
+    update_kv(&eth_kv, key, "0");
+
+    /* owes: old format keep until change completed */
     snprintf(key, STRING_SIZE, "%s_DEV", colour);
     update_kv(&eth_kv, key, "");
     snprintf(key, STRING_SIZE, "%s_DRIVER", colour);
@@ -300,6 +314,14 @@
   }
   else
   {
+    snprintf(key, STRING_SIZE, "%s_1_DEV", colour);
+    update_kv(&eth_kv, key, networks[n].device);
+    snprintf(key, STRING_SIZE, "%s_1_DRIVER", colour);
+    update_kv(&eth_kv, key, networks[n].module);
+    snprintf(key, STRING_SIZE, "%s_COUNT", colour);
+    update_kv(&eth_kv, key, "1");
+
+    /* owes: old format keep until change completed */
     snprintf(key, STRING_SIZE, "%s_DEV", colour);
     update_kv(&eth_kv, key, networks[n].device);
     snprintf(key, STRING_SIZE, "%s_DRIVER", colour);
@@ -539,12 +561,23 @@
   int error;
   int numLines;
 
+	char old_addresskey[STRING_SIZE];
+	char old_netmaskkey[STRING_SIZE];
+	char old_netaddresskey[STRING_SIZE];
+	char old_broadcastkey[STRING_SIZE];
+
 	/* Build some key strings. */
-	sprintf(addresskey, "%s_ADDRESS", colour);
-	sprintf(netmaskkey, "%s_NETMASK", colour);
-	sprintf(netaddresskey, "%s_NETADDRESS", colour);
-	sprintf(broadcastkey, "%s_BROADCAST", colour);
+	sprintf(addresskey, "%s_1_ADDRESS", colour);
+	sprintf(netmaskkey, "%s_1_NETMASK", colour);
+	sprintf(netaddresskey, "%s_1_NETADDRESS", colour);
+	sprintf(broadcastkey, "%s_1_BROADCAST", colour);
 
+  /* owes: old format keep until change completed */
+	sprintf(old_addresskey, "%s_ADDRESS", colour);
+	sprintf(old_netmaskkey, "%s_NETMASK", colour);
+	sprintf(old_netaddresskey, "%s_NETADDRESS", colour);
+	sprintf(old_broadcastkey, "%s_BROADCAST", colour);
+
   snprintf(message, STRING_SIZE, gettext("TR_ENTER_THE_IP_ADDRESS_INFORMATION"), \
colour);  text = newtTextboxReflowed(1, 1, message, 68, 0, 0, 0);
   numLines = newtTextboxGetNumLines(text);
@@ -625,7 +658,9 @@
         char *broadcast;
 
         update_kv(&eth_kv, addresskey, (char *)addressresult);
+        update_kv(&eth_kv, old_addresskey, (char *)addressresult);
         update_kv(&eth_kv, netmaskkey, (char *)netmaskresult);
+        update_kv(&eth_kv, old_netmaskkey, (char *)netmaskresult);
         /* calculate netaddress */
         intaddress = inet_addr(addressresult);
         intnetmask = inet_addr(netmaskresult);
@@ -634,11 +669,13 @@
         i_addr.s_addr = intnetaddress;	
         netaddress = inet_ntoa(i_addr);
         update_kv(&eth_kv, netaddresskey, (char *)netaddress);
+        update_kv(&eth_kv, old_netaddresskey, (char *)netaddress);
 
         intbroadcast = intnetaddress | ~intnetmask;
         i_addr.s_addr = intbroadcast;
         broadcast = inet_ntoa(i_addr);	
 	      update_kv(&eth_kv, broadcastkey, (char *)broadcast);
+	      update_kv(&eth_kv, old_broadcastkey, (char *)broadcast);
 
         changed_config = 1;
         *changed_flag = 1;
@@ -876,8 +913,9 @@
     if ( !strcmp(kv_red_type, "PPPOE") )
     {
       /* default to 1.1.1.1 */
-      update_kv(&eth_kv, "RED_ADDRESS", "1.1.1.1");
+      update_kv(&eth_kv, "RED_1_ADDRESS", "1.1.1.1");
       /* do we want to be able to change this ? */
+
       changeaddress("RED", &changed_red);
     }
     else if ( !strcmp(kv_red_type, "PPTP") )
@@ -895,15 +933,15 @@
       changednsgateway();
     }
 
-    strcpy(keyvalue, "");    
-    find_kv_default(eth_kv, "BLUE_DEV", keyvalue);
-    if ( keyvalue[0] )
+    strcpy(keyvalue, "0");
+    find_kv_default(eth_kv, "BLUE_COUNT", keyvalue);
+    if ( keyvalue[0] != '0' )
     {
       changeaddress("BLUE", &changed_blue);
     }
-    strcpy(keyvalue, "");    
-    find_kv_default(eth_kv, "ORANGE_DEV", keyvalue);
-    if ( keyvalue[0] )
+    strcpy(keyvalue, "0");
+    find_kv_default(eth_kv, "ORANGE_COUNT", keyvalue);
+    if ( keyvalue[0] != '0' )
     {
       changeaddress("ORANGE", &changed_orange);
     }


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic