Changeset 7413


Ignore:
Timestamp:
07/09/07 19:01:34 (6 years ago)
Author:
BrainSlayer
Message:

some new experiments

Location:
src/router
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/modules/broadcom.c

    r7326 r7413  
    35103510 
    35113511  /** Apply **/ 
    3512   if (!strcmp (value, "Apply")) 
     3512  if (!strcmp (value, "Apply") || !strcmp (value, "ApplyTake")) 
    35133513    { 
    35143514      struct apply_action *act; 
     
    35273527                   "submit_button=[%s] service=[%s] sleep_time=[%d] action=[%d]\n", 
    35283528                   act->name, act->service, act->sleep_time, act->action); 
     3529 
    35293530          if ((act->action == SYS_RESTART) 
    35303531              || (act->action == SERVICE_RESTART)) 
    35313532            nvram_set ("action_service", act->service); 
     3533          char *actionstack; 
     3534          int freeit=0; 
     3535          if (nvram_get("action_service")!=NULL) 
     3536          { 
     3537          actionstack = malloc(strlen(nvram_safe_get("action_service")) + strlen(act->service) + 2); 
     3538          sprintf(actionstack,"%s %s",nvram_safe_get("action_service"),act->service); 
     3539          freeit=0; 
     3540          } 
    35323541          else 
    3533             nvram_set ("action_service", ""); 
    3534  
     3542          { 
     3543          actionstack = nvram_get("action_service"); 
     3544          } 
     3545          nvram_set("action_service",actionstack); 
     3546          if (freeit) 
     3547            free(actionstack); 
    35353548          sleep_time = act->sleep_time; 
    35363549          action = act->action; 
     
    35413554      else 
    35423555        { 
    3543           nvram_set ("action_service", ""); 
     3556          //nvram_set ("action_service", ""); 
    35443557          sleep_time = 1; 
    35453558          action = RESTART; 
    35463559        } 
    35473560 
    3548       if (need_commit) 
     3561      if (need_commit && !strcmp (value, "ApplyTake")) 
    35493562        { 
    35503563          diag_led (DIAG, STOP_LED); 
     
    36023615 
    36033616footer: 
     3617 
    36043618  if (do_reboot) 
    36053619    action = REBOOT; 
     
    36083622  if (need_reboot) 
    36093623    action = REBOOT; 
     3624 
     3625if (!strcmp (value, "ApplyTake")) 
     3626    { 
     3627    action=NOTHING; 
     3628    } 
    36103629 
    36113630  if (action != REBOOT) 
  • src/router/kromo/cisco_wrt54g_en/common.js

    r6983 r7413  
    835835// Gray all form when submitting 
    836836function apply(form, text, delay) { 
     837    form.submit(); 
     838} 
     839function applytake(form, text, delay) { 
     840    form.action.value = "ApplyTake"; 
    837841    if(!text) 
    838842        text=errmsg.err100; 
     
    10851089        if(sub) 
    10861090                document.write("<input class=\"button\" type=\"button\" name=\"save_button\" value=\"" + sbutton.save + "\" onclick=\"to_submit(this.form);\" />"); 
     1091        if(sub) 
     1092                document.write("<input class=\"button\" type=\"button\" name=\"apply_button\" value=\"" + sbutton.apply + "\" onclick=\"applytake(this.form);\" />"); 
    10871093        if(res) 
    10881094                document.write("<input class=\"button\" type=\"button\" name=\"reset_button\" value=\"" + sbutton.cancel + "\" onclick=\"window.location.reload();\" />"); 
  • src/router/kromo/cisco_wrt54g_en/common_micro.js

    r6983 r7413  
    818818function apply(form) { 
    819819        form.submit(); 
     820} 
     821 
     822function applytake(form) { 
     823        form.action.value="ApplyTake"; 
     824        form.submit(); 
    820825        for (i = 0; i < form.elements.length; i++) { 
    821826                if(defined(form.elements[i].disabled))  
     
    10051010        if(sub) 
    10061011                document.write("<input class=\"button\" type=\"button\" name=\"save_button\" value=\"" + sbutton.save + "\" onclick=\"to_submit(this.form);\" />"); 
     1012        if(sub) 
     1013                document.write("<input class=\"button\" type=\"button\" name=\"apply_button\" value=\"" + sbutton.apply + "\" onclick=\"applytake(this.form);\" />"); 
    10071014        if(res) 
    10081015                document.write("<input class=\"button\" type=\"button\" name=\"reset_button\" value=\"" + sbutton.cancel + "\" onclick=\"window.location.reload();\" />"); 
  • src/router/kromo/cisco_wrt54g_en/lang_pack/english.js

    r7291 r7413  
    164164 
    165165var sbutton = new Object(); 
    166 sbutton.save="Save Settings"; 
     166sbutton.save="Save"; 
     167sbutton.apply="Apply Settings"; 
    167168sbutton.saving="Saved"; 
    168169sbutton.cmd="Executing"; 
  • src/router/kromo/cisco_wrt54g_en/lang_pack/german.js

    r7291 r7413  
    137137share.user="Nutzer"; 
    138138 
    139 sbutton.save="Einstellungen speichern"; 
     139sbutton.save="Speichern"; 
     140sbutton.apply="Übernehmen"; 
    140141sbutton.saving="Gespeichert"; 
    141142sbutton.cmd="Ausführen"; 
  • src/router/rc/services.c

    r7266 r7413  
    269269    kill (1, SIGHUP); 
    270270  fprintf (stderr, "Action %s\n", service); 
    271  
     271  sleep(3); 
    272272  cprintf ("Restart service=[%s]\n", service); 
    273273  start_service ("overclocking"); 
  • src/router/services/networking/madwifi.c

    r7404 r7413  
    14391439  int s; 
    14401440 
    1441  
    1442  
    14431441  char *m; 
    14441442  char *first = NULL; 
  • src/router/services/networking/network.c

    r7376 r7413  
    18361836  br_shutdown (); 
    18371837#endif 
     1838  eval("rm","/tmp/.ifcache"); 
    18381839 
    18391840} 
     
    28342835#endif 
    28352836#endif 
     2837  eval("rm","/tmp/.ifcache"); 
    28362838 
    28372839} 
  • src/router/services/services/vlantagging.c

    r6759 r7413  
    2323    sprintf (vlan_name, "%s.%s", tag, port); 
    2424    eval ("ifconfig", vlan_name, "0.0.0.0", "up"); 
     25    eval("rm","/tmp/.ifcache"); 
    2526  } 
    2627} 
     
    4142    sprintf (vlan_name, "%s.%s", tag, port); 
    4243    if (ifexists (vlan_name)) 
     44      { 
    4345      eval ("vconfig", "rem", vlan_name); 
     46      eval("rm","/tmp/.ifcache"); 
     47      } 
    4448  } 
    4549} 
     
    9296 
    9397    eval ("brctl", "addbr", tag); 
     98    eval("rm","/tmp/.ifcache"); 
    9499    if (!strcmp (port, "On")) 
    95100      br_set_stp_state (tag, 1); 
     
    205210        eval ("ifconfig", tag, "down"); 
    206211        eval ("brctl", "delbr", tag); 
     212        eval("rm","/tmp/.ifcache"); 
    207213      } 
    208214  } 
  • src/router/services/tools/site_survey_broadcom.c

    r7325 r7413  
    299299 
    300300  /* can only scan in STA mode */ 
    301 //#ifndef HAVE_MSSID 
     301#ifndef HAVE_MSSID 
    302302  wl_ioctl (dev, WLC_GET_AP, &oldap, sizeof (oldap)); 
    303303  if (oldap > 0) 
    304304    eval ("wl", "ap", "0"); 
    305 //#endif 
     305#endif 
    306306  if (wl_ioctl (dev, WLC_SCAN, &params, 64) < 0) 
    307307    { 
     
    367367 
    368368endss: 
    369 //#ifndef HAVE_MSSID 
     369#ifndef HAVE_MSSID 
    370370  if (oldap > 0) 
    371371    eval ("wl", "ap", "1"); 
    372 //#endif 
     372#endif 
    373373 
    374374  C_led (0); 
  • src/router/shared/utils.c

    r7368 r7413  
    27152715getIfList (char *buffer, char *ifprefix) 
    27162716{ 
    2717   FILE *in = fopen ("/proc/net/dev", "rb"); 
     2717  FILE *in = fopen("/tmp/.ifcache","rb"); 
     2718  if (in==NULL) 
     2719    { 
     2720    in = fopen("/proc/net/dev","rb"); 
     2721    FILE *tmp = fopen("/tmp/.ifcache","wb"); 
     2722    int c=getc(in); 
     2723    while(c!=EOF) 
     2724        { 
     2725        putc(c,tmp); 
     2726        c=getc(in); 
     2727        } 
     2728    fclose(tmp); 
     2729    fclose(in); 
     2730    in=fopen("/tmp/.ifcache","rb"); 
     2731    } 
    27182732  char ifname[32]; 
    27192733//skip the first 2 lines 
  • src/router/shared/wl.c

    r7384 r7413  
    673673  char type[32]; 
    674674  char netmode[32]; 
     675  unsigned int *count = (unsigned int *) list; 
    675676  sprintf (type, "%s_mode",ifname); 
    676677  sprintf (netmode, "%s_net_mode",ifname); 
     
    686687      getAssocMAC (ifname,mac); 
    687688      memcpy (&list[4], mac, 6); 
     689      count[0]=1; 
    688690      mincount = 1; 
    689691    } 
     
    693695      fprintf (stderr, "socket(SOCK_DRAGM)\n"); 
    694696      free (buf); 
    695       return -1; 
     697      mincount = 1; 
     698      return mincount; 
    696699    } 
    697700  (void) memset (&iwr, 0, sizeof (iwr)); 
     
    715718  cp = buf; 
    716719  unsigned char *l = (unsigned char *) list; 
    717   unsigned int *count = (unsigned int *) list; 
    718720  count[0] = 0; 
    719721  l += 4; 
Note: See TracChangeset for help on using the changeset viewer.