Add force dhcp mtu option to setup.
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 30 Nov 2010 20:58:20 +0000 (21:58 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 30 Nov 2010 20:58:20 +0000 (21:58 +0100)
config/rootfiles/core/43/filelists/files
langs/de/install/lang_de.c
langs/en/install/lang_en.c
langs/es/install/lang_es.c
langs/fr/install/lang_fr.c
src/install+setup/libsmooth/netstuff.c

index 9088d65e75118c4b6e73969e72373f5182b1f8b4..5bc212763f0c388c580666720a80765bf19adddf 100644 (file)
@@ -13,4 +13,5 @@ var/ipfire/general-functions.pl
 var/ipfire/extrahd/bin/extrahd.pl
 usr/local/bin/rebuild-initrd
 usr/local/bin/scanhd
+usr/local/sbin/setup
 usr/bin/ldd
index a1df97c22de95639ae296a2737ce22bb121c048c..6c8c7e5b0dffe8151e16fd9d1b768919e037f054 100644 (file)
@@ -589,4 +589,6 @@ char *de_tr[] = {
 "Lade Installations-Abbild ...",
 /* TR_DOWNLOAD_ERROR */
 "Beim Herunterladen ist ein Fehler aufgetreten!",
+/* TR_DHCP_FORCE_MTU */
+"DHCP MTU setzen:",
 };
index b8edeac15922d5dbb7ded0bc99e5c5eeeccbbdb3..10c35b4e82a5fe46ec1d7068974eb0a47d3819f1 100644 (file)
@@ -585,4 +585,6 @@ char *en_tr[] = {
 "Downloading Installation-Image ...",
 /* TR_DOWNLOAD_ERROR */
 "Error while downloading!",
+/* TR_DHCP_FORCE_MTU */
+"Force DHCP mtu:",
 };
index 63e2eab0f45ecfee90a517272f9619627492f9f5..a6ad3e91a8a61084e516b646b8ab013a0c2c72a6 100644 (file)
@@ -581,4 +581,6 @@ char *es_tr[] = {
 "Downloading Installation-Image ...",
 /* TR_DOWNLOAD_ERROR */
 "Error while downloading!",
+/* TR_DHCP_FORCE_MTU */
+"Force DHCP mtu:",
 };
index d2abdbad185bbb4d295be413ecfa67f286c6e7a0..6fbcc4113bb5a94225b8d698c6c94f82ee085c0c 100644 (file)
@@ -581,4 +581,6 @@ char *fr_tr[] = {
 "Downloading Installation-Image ...",
 /* TR_DOWNLOAD_ERROR */
 "Error while downloading!",
+/* TR_DHCP_FORCE_MTU */
+"Force DHCP mtu:",
 };
index eb0c4e7990ba41874285b3f9d2e4e1fe240abbc9..46e49c01b368afcce164dc93a2cef934e0db20c9 100644 (file)
@@ -31,6 +31,7 @@ newtComponent statictyperadio;
 newtComponent dhcptyperadio;
 newtComponent pppoetyperadio;
 newtComponent dhcphostnameentry;
+newtComponent dhcpforcemtuentry;
 
 /* acceptable character filter for IP and netmaks entry boxes */
 static int ip_input_filter(newtComponent entry, void * data, int ch, int cursor)
@@ -49,11 +50,13 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
        char *addressresult;
        char *netmaskresult;
        char *dhcphostnameresult;
+       char *dhcpforcemturesult;
        struct newtExitStruct es;
        newtComponent header;
        newtComponent addresslabel;
        newtComponent netmasklabel;
        newtComponent dhcphostnamelabel;
+       newtComponent dhcpforcemtulabel;
        newtComponent ok, cancel;       
        char message[1000];
        char temp[STRING_SIZE];
@@ -61,6 +64,7 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
        char netmaskfield[STRING_SIZE];
        char typefield[STRING_SIZE];
        char dhcphostnamefield[STRING_SIZE];
+       char dhcpforcemtufield[STRING_SIZE];
        int error;
        int result = 0;
        char type[STRING_SIZE];
@@ -73,6 +77,7 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
        sprintf(netmaskfield, "%s_NETMASK", colour);
        sprintf(typefield, "%s_TYPE", colour);
        sprintf(dhcphostnamefield, "%s_DHCP_HOSTNAME", colour);
+       sprintf(dhcpforcemtufield, "%s_DHCP_FORCE_MTU", colour);
                
        sprintf(message, ctr[TR_INTERFACE], colour);
        newtCenteredWindow(44, (typeflag ? 18 : 12), message);
@@ -99,15 +104,25 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
                newtComponentAddCallback(statictyperadio, networkdialogcallbacktype, NULL);
                newtComponentAddCallback(dhcptyperadio, networkdialogcallbacktype, NULL);
                newtComponentAddCallback(pppoetyperadio, networkdialogcallbacktype, NULL);
-               dhcphostnamelabel = newtTextbox(2, 9, 18, 1, 0);
+               dhcphostnamelabel = newtTextbox(2, 8, 18, 1, 0);
                newtTextboxSetText(dhcphostnamelabel, ctr[TR_DHCP_HOSTNAME]);
+               dhcpforcemtulabel = newtTextbox(2, 9, 18, 1, 0);
+               newtTextboxSetText(dhcpforcemtulabel, ctr[TR_DHCP_FORCE_MTU]);
                strcpy(temp, defaultdhcphostname);
                findkey(kv, dhcphostnamefield, temp);
-               dhcphostnameentry = newtEntry(20, 9, temp, 20, &dhcphostnameresult, 0);
-               newtFormAddComponent(networkform, dhcphostnamelabel);           
-               newtFormAddComponent(networkform, dhcphostnameentry);   
+               dhcphostnameentry = newtEntry(20, 8, temp, 20, &dhcphostnameresult, 0);
+               strcpy(temp, "");
+               findkey(kv, dhcpforcemtufield, temp);
+               dhcpforcemtuentry = newtEntry(20, 9, temp, 20, &dhcpforcemturesult, 0);
+               newtFormAddComponent(networkform, dhcphostnamelabel);
+               newtFormAddComponent(networkform, dhcphostnameentry);
+               newtFormAddComponent(networkform, dhcpforcemtulabel);
+               newtFormAddComponent(networkform, dhcpforcemtuentry);
                if (startdhcptype == 0)
-                       newtEntrySetFlags(dhcphostnameentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);
+                       {
+                               newtEntrySetFlags(dhcphostnameentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);
+                               newtEntrySetFlags(dhcpforcemtuentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);
+                       }
        }
        /* Address */
        addresslabel = newtTextbox(2, (typeflag ? 11 : 4) + 0, 18, 1, 0);
@@ -184,6 +199,7 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
                                if (typeflag)
                                {
                                        replacekeyvalue(kv, dhcphostnamefield, dhcphostnameresult);
+                                       replacekeyvalue(kv, dhcpforcemtufield, dhcpforcemturesult);
                                        if (strcmp(type, "STATIC") != 0)
                                        {
                                                replacekeyvalue(kv, addressfield, "0.0.0.0");
@@ -296,10 +312,15 @@ void networkdialogcallbacktype(newtComponent cm, void *data)
                newtEntrySetFlags(netmaskentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_RESET);
        }
        if (strcmp(type, "DHCP") == 0)
+       {
                newtEntrySetFlags(dhcphostnameentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_RESET);
+               newtEntrySetFlags(dhcpforcemtuentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_RESET);
+       }
        else
+       {
                newtEntrySetFlags(dhcphostnameentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);               
-               
+               newtEntrySetFlags(dhcpforcemtuentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);               
+       }
        newtRefresh();
        newtDrawForm(networkform);      
 }