Changeset 13126

Show
Ignore:
Timestamp:
10/22/09 00:05:47 (1 month ago)
Author:
BrainSlayer
Message:

add some code formating and module comments

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/router/httpd/httpd.c

    r12533 r13126  
    770770                return; 
    771771        } 
    772         int nodetect=0; 
    773         if (nvram_match("status_auth", "0") && endswith(file,"Info.htm")) 
    774                 nodetect=1; 
    775  
    776         if (referer && host && nodetect==0) { 
     772        int nodetect = 0; 
     773        if (nvram_match("status_auth", "0") && endswith(file, "Info.htm")) 
     774                nodetect = 1; 
     775 
     776        if (referer && host && nodetect == 0) { 
    777777                int i; 
    778778                int hlen = strlen(host); 
     
    941941        } else 
    942942#endif 
    943 
     943       
    944944                /* extract url args if present */ 
    945945                query = strchr(file, '?'); 
     
    965965                { 
    966966                        if (((nvram_match("http_username", DEFAULT_USER) 
    967                              && nvram_match("http_passwd", DEFAULT_PASS)) 
    968                             || nvram_match("http_username", "") 
    969                             || nvram_match("http_passwd", "admin")) && !endswith(file, "register.asp")){ 
     967                              && nvram_match("http_passwd", DEFAULT_PASS)) 
     968                             || nvram_match("http_username", "") 
     969                             || nvram_match("http_passwd", "admin")) 
     970                            && !endswith(file, "register.asp")) { 
    970971                                changepassword = 1; 
    971972                                if (endswith(file, ".asp")) 
     
    10561057                                        if (handler->send_headers) 
    10571058                                                send_headers(200, "Ok", 
    1058                                                              handler->extra_header, 
     1059                                                             handler-> 
     1060                                                             extra_header, 
    10591061                                                             handler->mime_type, 
    10601062                                                             0, NULL); 
  • src/router/httpd/modules/broadcom.c

    r13064 r13126  
    21342134        if (sscanf(query, "%u-%u", &month, &year) != 2) 
    21352135                return; 
    2136         if (month<1 || month>12) 
     2136        if (month < 1 || month > 12) 
    21372137                return; 
    21382138 
     
    21512151                                break;  //skip monthly total 
    21522152                        int ret = sscanf(var, "%lu:%lu", &rcvd[i], &sent[i]); 
    2153                         if (ret!=2) 
    2154                             break; 
     2153                        if (ret != 2) 
     2154                               break; 
    21552155                        totin += rcvd[i]; 
    21562156                        totout += sent[i]; 
     
    21752175        char incom[32]; 
    21762176 
    2177         snprintf(incom,32, "%s", live_translate("status_inet.traffin")); 
     2177        snprintf(incom, 32, "%s", live_translate("status_inet.traffin")); 
    21782178        char outcom[32]; 
    21792179 
    2180         snprintf(outcom,32, "%s", live_translate("status_inet.traffout")); 
     2180        snprintf(outcom, 32, "%s", live_translate("status_inet.traffout")); 
    21812181        char monthname[32]; 
    21822182 
    2183         snprintf(monthname,32, "%s", live_translate(months[month - 1])); 
     2183        snprintf(monthname, 32, "%s", live_translate(months[month - 1])); 
    21842184 
    21852185        websWrite(stream, 
  • src/router/httpd/modules/callvalidate.c

    r13102 r13126  
    280280void *call_ej(char *name, void *handle, webs_t wp, int argc, char_t ** argv) 
    281281{ 
    282         if (nvram_match("console_debug", "1")) 
    283                 { 
     282        if (nvram_match("console_debug", "1")) { 
    284283                fprintf(stderr, "call_ej %s\n", name); 
    285                 int i=0; 
    286                 for (i=0;i<argc;i++) 
    287                 fprintf(stderr,"argument %s\n",argv[i]); 
    288                
     284                int i = 0; 
     285                for (i = 0; i < argc; i++) 
     286                       fprintf(stderr, "argument %s\n", argv[i]); 
     287       
    289288        char service[64]; 
    290289        int nohandle = 0; 
  • src/router/httpd/validate/validators.c

    r13058 r13126  
    810810        if (!valid_ipaddr(wp, lan_ipaddr, v)) 
    811811                return; 
    812          
    813812 
    814813        if (strcmp(nvram_safe_get("lan_ipaddr"), lan_ipaddr)) { 
  • src/router/httpd/visuals/dd-wrt.c

    r13083 r13126  
    25092509 
    25102510#ifdef HAVE_MADWIFI 
    2511 //     memset(bufferif2, 0, 256); 
    2512 //     getIfList(bufferif2, "ath"); 
    2513 //     foreach(word, bufferif2, next) { 
    2514 //             if (contains(word, '.')) 
    2515 //                     sprintf(bufferif, "%s %s", bufferif, word); 
    2516 //     
     2511//      memset(bufferif2, 0, 256); 
     2512//      getIfList(bufferif2, "ath"); 
     2513//      foreach(word, bufferif2, next) { 
     2514//              if (contains(word, '.')) 
     2515//                      sprintf(bufferif, "%s %s", bufferif, word); 
     2516//     
    25172517        int c = getifcount("wifi"); 
    25182518 
     
    25202520                char ath[32]; 
    25212521 
    2522 //             sprintf(ath, "ath%d_bridged", i); 
    2523 //             if (nvram_default_match(ath, "1", "1"))  
     2522//              sprintf(ath, "ath%d_bridged", i); 
     2523//              if (nvram_default_match(ath, "1", "1"))  
    25242524                { 
    25252525                        sprintf(bufferif, "%s ath%d", bufferif, i); 
     
    27092709                                sprintf(cn, "%d", chan[i].channel); 
    27102710                                sprintf(fr, "%d", chan[i].freq); 
    2711                                 int freq = get_wififreq(prefix,chan[i].freq); 
    2712                                 if (freq!=-1) 
    2713                                 websWrite(wp, 
    2714                                           "document.write(\"<option value=\\\"%s\\\" %s>%s - %d MHz</option>\");\n", 
    2715                                           fr, nvram_match(wl_channel, 
    2716                                                           fr) ? 
    2717                                           "selected=\\\"selected\\\"" : "", cn, 
    2718                                         (freq)); 
     2711                                int freq = get_wififreq(prefix, chan[i].freq); 
     2712                                if (freq != -1) 
     2713                                       websWrite(wp, 
     2714                                                 "document.write(\"<option value=\\\"%s\\\" %s>%s - %d MHz</option>\");\n", 
     2715                                                 fr, nvram_match(wl_channel, 
     2716                                                                 fr) ? 
     2717                                                 "selected=\\\"selected\\\"" : 
     2718                                                 "", cn, (freq)); 
    27192719                                // free (chan[i].freq); 
    27202720                                i++; 
     
    48884888        websWrite(wp, "//]]>\n</script>\n"); 
    48894889        websWrite(wp, "</div>\n"); 
    4890          
     4890 
    48914891        websWrite(wp, "<div class=\"setting\">\n"); 
    48924892        websWrite(wp, 
     
    49044904        websWrite(wp, "//]]>\n</script>\n"); 
    49054905        websWrite(wp, "</div>\n"); 
    4906          
     4906 
    49074907        websWrite(wp, "</div>\n"); 
    49084908 
     
    49534953        websWrite(wp, "//]]>\n</script>\n"); 
    49544954        websWrite(wp, "</div>\n"); 
    4955          
     4955 
    49564956        websWrite(wp, "<div class=\"setting\">\n"); 
    49574957        websWrite(wp, 
     
    49684968                  prefix, prefix); 
    49694969        websWrite(wp, "//]]>\n</script>\n"); 
    4970         websWrite(wp, "</div>\n");      
    4971          
     4970        websWrite(wp, "</div>\n"); 
     4971 
    49724972        websWrite(wp, "</div>\n"); 
    49734973        // leap authentication 
     
    50005000                  "<input name=\"%s_leap8021xphase2\" size=\"20\" maxlength=\"79\" value=\"%s\" /></div>\n", 
    50015001                  prefix, nvram_prefix_get("leap8021xphase2", prefix)); 
    5002                    
     5002 
    50035003        websWrite(wp, "<div class=\"setting\">\n"); 
    50045004        websWrite(wp, 
     
    50965096        websWrite(wp, "//]]>\n</script>\n"); 
    50975097        websWrite(wp, "</div>\n"); 
    5098          
     5098 
    50995099        websWrite(wp, "<div class=\"setting\">\n"); 
    51005100        websWrite(wp, 
     
    57635763 
    57645764        if (channel > 0 && channel < 1000) { 
    5765                 websWrite(wp, "%d (%d Mhz)", channel,get_wififreq(nvram_safe_get("wifi_display"),wifi_getfreq(nvram_safe_get("wifi_display")))); 
     5765                websWrite(wp, "%d (%d Mhz)", channel, 
     5766                          get_wififreq(nvram_safe_get("wifi_display"), 
     5767                                       wifi_getfreq(nvram_safe_get 
     5768                                                    ("wifi_display")))); 
    57665769        } else 
    57675770                // websWrite (wp, "unknown"); 
     
    58215824 
    58225825#endif 
    5823  
    5824  
    5825  
    58265826 
    58275827#define WDS_RSSI_TMP    "/tmp/.rssi" 
     
    74157415                                  "<td><input name=\"%s\" size=\"8\" value=\"%s\" /></td>\n", 
    74167416                                  vlan_name, (db->users[i].user != NULL 
    7417                                               && db->users[i]. 
    7418                                               usersize) ? db->users[i]. 
    7419                                   user : ""); 
     7417                                              && db->users[i].usersize) ? db-> 
     7418                                  users[i].user : ""); 
    74207419 
    74217420                        sprintf(vlan_name, "password%d", i); 
     
    74237422                                  "<td><input name=\"%s\" size=\"8\" value=\"%s\" /></td>\n", 
    74247423                                  vlan_name, (db->users[i].passwd != NULL 
    7425                                               && db-> 
    7426                                               users[i].passwordsize) ? db-> 
    7427                                   users[i].passwd : ""); 
     7424                                              && db->users[i]. 
     7425                                              passwordsize) ? db->users[i]. 
     7426                                  passwd : ""); 
    74287427 
    74297428                        sprintf(vlan_name, "downstream%d", i); 
     
    74827481                                  "<td><input name=\"%s\" size=\"20\" value=\"%s\" /></td>\n", 
    74837482                                  vlan_name, (db->users[i].client != NULL 
    7484                                               && db->users[i]. 
    7485                                               clientsize) ? db->users[i]. 
    7486                                   client : ""); 
     7483                                              && db->users[i].clientsize) ? db-> 
     7484                                  users[i].client : ""); 
    74877485 
    74887486                        sprintf(vlan_name, "shared%d", i); 
     
    74907488                                  "<td><input name=\"%s\" size=\"20\" value=\"%s\" /></td>\n", 
    74917489                                  vlan_name, (db->users[i].passwd != NULL 
    7492                                               && db-> 
    7493                                               users[i].passwordsize) ? db-> 
    7494                                   users[i].passwd : ""); 
     7490                                              && db->users[i]. 
     7491                                              passwordsize) ? db->users[i]. 
     7492                                  passwd : ""); 
    74957493 
    74967494                        websWrite(wp, 
  • src/router/httpd/visuals/dhcp.c

    r12846 r13126  
    274274                                          "%c\"%s\",\"%s\",\"%s\",\"%s\",\"%d\"", 
    275275                                          count ? ',' : ' ', 
    276                                           !*lease. 
    277                                           hostname ? "&nbsp;" : lease.hostname, 
    278                                           ipaddr, mac, expires_time, 
     276                                          !*lease.hostname ? "&nbsp;" : lease. 
     277                                          hostname, ipaddr, mac, expires_time, 
    279278                                          get_single_ip(ipaddr, 3)); 
    280279                                cprintf("entry dumpleases:%d\n", __LINE__); 
  • src/router/httpd/visuals/wireless.c

    r13119 r13126  
    771771#endif 
    772772        else if (!strcmp(security_mode, "radius")) 
    773                 show_radius(wp, prefix, 1,0); 
     773                show_radius(wp, prefix, 1, 0); 
    774774        else if (!strcmp(security_mode, "wpa") 
    775775                 || !strcmp(security_mode, "wpa2") 
  • src/router/httpd/visuals/wireless_broadcom.c

    r12998 r13126  
    148148        } 
    149149} 
    150  
  • src/router/httpd/visuals/wireless_generic.c

    r12998 r13126  
    1616        return str; 
    1717} 
    18  
  • src/router/httpd/visuals/wireless_madwifi.c

    r12998 r13126  
    2727 
    2828#include "wireless_generic.c" 
    29  
    3029 
    3130#include <sys/types.h> 
  • src/router/httpd/visuals/wireless_ralink.c

    r12998 r13126  
    2727 
    2828#include "wireless_generic.c" 
    29  
    30  
    3129 
    3230#include <sys/types.h>