Changeset 15295


Ignore:
Timestamp:
09/27/10 19:01:07 (3 years ago)
Author:
BrainSlayer
Message:

formating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/visuals/dd-wrt.c

    r15294 r15295  
    4949#include <bcmnvram.h> 
    5050#include <l7protocols.h> 
    51  
    5251 
    5352#ifdef HAVE_OVERCLOCKING 
     
    23282327                char cn[32]; 
    23292328                char fr[32]; 
    2330                 int gotchannels=0; 
     2329                int gotchannels = 0; 
    23312330 
    23322331#if defined(HAVE_MADWIFI_MIMO) || defined(HAVE_ATH9K) 
     
    23342333#ifdef HAVE_MADWIFI_MIMO 
    23352334                        if (is_ar5008(prefix)) { 
    2336                         chan = list_channels_11n(prefix); 
    2337                         if (chan == NULL) 
    2338                                 chan = list_channels_11n(dev); 
    2339                         gotchannels=1; 
     2335                                chan = list_channels_11n(prefix); 
     2336                                if (chan == NULL) 
     2337                                        chan = list_channels_11n(dev); 
     2338                                gotchannels = 1; 
    23402339                        } 
    23412340#endif 
    23422341#ifdef HAVE_ATH9K 
    2343                 if (is_ath9k(prefix)) { 
    2344                 chan = list_channels_ath9k(prefix); 
    2345                 if (chan == NULL) 
    2346                                 chan = list_channels_ath9k(dev); 
    2347                 gotchannels=1; 
     2342                        if (is_ath9k(prefix)) { 
     2343                                chan = list_channels_ath9k(prefix); 
     2344                                if (chan == NULL) 
     2345                                        chan = list_channels_ath9k(dev); 
     2346                                gotchannels = 1; 
     2347                        } 
     2348#endif 
    23482349                } 
    23492350#endif 
    2350           } 
    2351 #endif 
    2352           if (!gotchannels) 
    2353                 { 
     2351                if (!gotchannels) { 
    23542352                        chan = list_channels(prefix); 
    23552353                        if (chan == NULL) 
     
    35983596        char wl_ssid[16]; 
    35993597        char frequencies[16]; 
    3600          
     3598 
    36013599        sprintf(wl_mode, "%s_mode", prefix); 
    36023600        sprintf(wl_macaddr, "%s_hwaddr", prefix); 
     
    36043602 
    36053603        // check the frequency capabilities; 
    3606         if(has_5ghz(prefix) && has_2ghz(prefix)) { 
     3604        if (has_5ghz(prefix) && has_2ghz(prefix)) { 
    36073605                sprintf(frequencies, " [2.4/5 GHz]"); 
    3608         } else if(has_5ghz(prefix)) { 
     3606        } else if (has_5ghz(prefix)) { 
    36093607                sprintf(frequencies, " [5 GHz]"); 
    3610         } else if(has_2ghz(prefix)) { 
     3608        } else if (has_2ghz(prefix)) { 
    36113609                sprintf(frequencies, " [2.4 GHz]"); 
    36123610        } else { 
    36133611                sprintf(frequencies, ""); 
    36143612        } 
    3615          
     3613 
    36163614        // wireless mode 
    36173615        websWrite(wp, 
     
    38263824                                  "document.write(\"<option value=\\\"wet\\\" %s >\" + wl_basic.clientBridge + \"</option>\");\n", 
    38273825#endif 
    3828                                           nvram_match(wl_mode, 
    3829                                                        "wet") ?  
    3830                                           "selected=\\\"selected\\\"" : ""); 
     3826                                  nvram_match(wl_mode, 
     3827                                              "wet") ? 
     3828                                  "selected=\\\"selected\\\"" : ""); 
    38313829#endif 
    38323830                        if (!cpeonly) 
     
    45984596// RELAYD OPTIONAL SETTINGS 
    45994597#ifdef HAVE_RELAYD 
    4600         if( nvram_match(wl_mode, "wet") ) { 
     4598        if (nvram_match(wl_mode, "wet")) { 
    46014599                char wl_relayd[32]; 
    46024600                int ip[4] = { 0, 0, 0, 0 }; 
    4603                  
     4601 
    46044602                websWrite(wp, 
    46054603                          "<div class=\"setting\">\n<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.clientRelaydDefaultGwMode)</script></div>"); 
     
    46074605                websWrite(wp, 
    46084606                          "             <input class=\"spaceradio\" type=\"radio\" value=\"1\" name=\"%s_relayd_gw_auto\" onclick=\"show_layer_ext(this, '%s_relayd_gw_ipaddr', false)\" %s /><script type=\"text/javascript\">Capture(share.auto)</script>&nbsp;(DHCP)&nbsp;\n", 
    4609                           prefix, prefix, nvram_default_match(wl_relayd, 
    4610                                               "1", "1") ? "checked" : ""); 
     4607                          prefix, prefix, 
     4608                          nvram_default_match(wl_relayd, "1", 
     4609                                              "1") ? "checked" : ""); 
    46114610                websWrite(wp, 
    46124611                          "             <input class=\"spaceradio\" type=\"radio\" value=\"0\" name=\"%s_relayd_gw_auto\" onclick=\"show_layer_ext(this, '%s_relayd_gw_ipaddr', true)\" %s/><script type=\"text/javascript\">Capture(share.manual)</script>\n", 
    4613                           prefix, prefix, nvram_default_match(wl_relayd, 
    4614                                               "0", "1") ? "checked" : ""); 
     4612                          prefix, prefix, 
     4613                          nvram_default_match(wl_relayd, "0", 
     4614                                              "1") ? "checked" : ""); 
    46154615                websWrite(wp, "</div>\n"); 
    46164616 
    46174617                sprintf(wl_relayd, "%s_relayd_gw_ipaddr", prefix); 
    4618                 sscanf(nvram_safe_get(wl_relayd), "%d.%d.%d.%d", &ip[0], &ip[1], &ip[2], 
    4619                        &ip[3]); 
     4618                sscanf(nvram_safe_get(wl_relayd), "%d.%d.%d.%d", &ip[0], &ip[1], 
     4619                       &ip[2], &ip[3]); 
    46204620                sprintf(wl_relayd, "%s_relayd_gw_auto", prefix); 
    46214621                websWrite(wp, "\ 
     
    46244624                  <div class=\"label\"><script type=\"text/javascript\">Capture(share.gateway)</script></div>\n\ 
    46254625                  <input size=\"3\" maxlength=\"3\" name=\"%s_relayd_gw_ipaddr_0\" value=\"%d\" onblur=\"valid_range(this,0,255,'IP')\" class=\"num\">.<input size=\"3\" maxlength=\"3\" name=\"%s_relayd_gw_ipaddr_1\" value=\"%d\" onblur=\"valid_range(this,0,255,'IP')\" class=\"num\">.<input size=\"3\" maxlength=\"3\" name=\"%s_relayd_gw_ipaddr_2\" value=\"%d\" onblur=\"valid_range(this,0,255,'IP')\" class=\"num\">.<input size=\"3\" maxlength=\"3\" name=\"%s_relayd_gw_ipaddr_3\" value=\"%d\" onblur=\"valid_range(this,1,254,'IP')\" class=\"num\">\n\ 
    4626        </div>\n", prefix, nvram_default_match(wl_relayd, 
    4627                 "1", "0") ? " style=\"display: none; visibility: hidden;\"" : "",         
    4628                         prefix, prefix, ip[0], prefix, ip[1], prefix, ip[2], prefix, ip[3]); 
     4626       </div>\n", prefix, nvram_default_match(wl_relayd, "1", "0") ? " style=\"display: none; visibility: hidden;\"" : "", prefix, prefix, ip[0], prefix, ip[1], prefix, ip[2], prefix, ip[3]); 
    46294627        } 
    46304628#endif 
     
    77797777        char var[80]; 
    77807778        char eths[256]; 
    7781         FILE *fp = fopen("/proc/sys/net/ipv4/tcp_available_congestion_control","rb"); 
    7782         if (fp==NULL) 
    7783             return; 
    7784         int c=0; 
    7785         while(1 && c<255) 
    7786         { 
    7787         int v = getc(fp); 
    7788         if (v==EOF || v == 0xa ) 
    7789             break; 
    7790         eths[c++]=v; 
    7791         } 
    7792         eths[c++]=0; 
     7779        FILE *fp = 
     7780            fopen("/proc/sys/net/ipv4/tcp_available_congestion_control", "rb"); 
     7781        if (fp == NULL) 
     7782                return; 
     7783        int c = 0; 
     7784        while (1 && c < 255) { 
     7785                int v = getc(fp); 
     7786                if (v == EOF || v == 0xa) 
     7787                        break; 
     7788                eths[c++] = v; 
     7789        } 
     7790        eths[c++] = 0; 
    77937791        fclose(fp); 
    7794          
    7795         websWrite(wp,"<div class=\"setting\">\n"); 
    7796         websWrite(wp,"<div class=\"label\">TCP Congestion Control</div>\n"); 
     7792 
     7793        websWrite(wp, "<div class=\"setting\">\n"); 
     7794        websWrite(wp, "<div class=\"label\">TCP Congestion Control</div>\n"); 
    77977795        websWrite(wp, "<select name=\"tcp_congestion_control\">\n"); 
    77987796        foreach(var, eths, next) { 
    77997797                websWrite(wp, "<option value=\"%s\" %s >%s</option>\n", var, 
    7800                           nvram_match("tcp_congestion_control", var) ? "selected" : "", var); 
     7798                          nvram_match("tcp_congestion_control", 
     7799                                      var) ? "selected" : "", var); 
    78017800        } 
    78027801        websWrite(wp, "</select>\n"); 
    78037802        websWrite(wp, "</div>\n"); 
    78047803} 
     7804 
    78057805void ej_show_ifselect(webs_t wp, int argc, char_t ** argv) 
    78067806{ 
     
    78257825                if (!strcmp(nvram_safe_get("lan_ifname"), var)) 
    78267826                        continue; 
    7827                 if (!nvram_nmatch("0","%s_bridged",var) && strncmp(var,"br",2)) 
     7827                if (!nvram_nmatch("0", "%s_bridged", var) 
     7828                    && strncmp(var, "br", 2)) 
    78287829                        continue; 
    78297830                websWrite(wp, "<option value=\"%s\" %s >%s</option>\n", var, 
     
    79597960                                  "<td><input name=\"%s\" size=\"8\" value=\"%s\" /></td>\n", 
    79607961                                  vlan_name, (db->users[i].user != NULL 
    7961                                               && db->users[i]. 
    7962                                               usersize) ? db->users[i]. 
    7963                                   user : ""); 
     7962                                              && db->users[i].usersize) ? db-> 
     7963                                  users[i].user : ""); 
    79647964 
    79657965                        sprintf(vlan_name, "password%d", i); 
     
    79677967                                  "<td><input name=\"%s\" size=\"8\" value=\"%s\" /></td>\n", 
    79687968                                  vlan_name, (db->users[i].passwd != NULL 
    7969                                               && db-> 
    7970                                               users[i].passwordsize) ? db-> 
    7971                                   users[i].passwd : ""); 
     7969                                              && db->users[i]. 
     7970                                              passwordsize) ? db->users[i]. 
     7971                                  passwd : ""); 
    79727972 
    79737973                        sprintf(vlan_name, "downstream%d", i); 
     
    80268026                                  "<td><input name=\"%s\" size=\"20\" value=\"%s\" /></td>\n", 
    80278027                                  vlan_name, (db->users[i].client != NULL 
    8028                                               && db->users[i]. 
    8029                                               clientsize) ? db->users[i]. 
    8030                                   client : ""); 
     8028                                              && db->users[i].clientsize) ? db-> 
     8029                                  users[i].client : ""); 
    80318030 
    80328031                        sprintf(vlan_name, "shared%d", i); 
     
    80348033                                  "<td><input name=\"%s\" size=\"20\" value=\"%s\" /></td>\n", 
    80358034                                  vlan_name, (db->users[i].passwd != NULL 
    8036                                               && db-> 
    8037                                               users[i].passwordsize) ? db-> 
    8038                                   users[i].passwd : ""); 
     8035                                              && db->users[i]. 
     8036                                              passwordsize) ? db->users[i]. 
     8037                                  passwd : ""); 
    80398038 
    80408039                        websWrite(wp, 
Note: See TracChangeset for help on using the changeset viewer.