Changeset 12202
- Timestamp:
- 05/22/09 15:07:05 (4 years ago)
- Location:
- src/router/httpd
- Files:
-
- 7 edited
-
modules/broadcom.c (modified) (5 diffs)
-
validate/validators.c (modified) (1 diff)
-
validate/webs.c (modified) (2 diffs)
-
visuals/dd-wrt.c (modified) (2 diffs)
-
visuals/ejs.c (modified) (2 diffs)
-
visuals/status.c (modified) (1 diff)
-
visuals/wireless.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/modules/broadcom.c
r12145 r12202 651 651 fread( webfile, len, 1, web ); 652 652 webfile[len] = 0; 653 sprintf( temp, webfile, ifname, ifname, ifname, ifname );653 sprintf( temp, webfile, ifname, ifname, ifname, ifname, ifname, ifname ); 654 654 free( webfile ); 655 655 fclose( web ); 656 do_ej_buffer( temp, stream ); 657 } 658 659 void do_activetable( struct mime_handler *handler, char *path, webs_t stream, 660 char *query ) 661 { 662 char *temp2 = &path[indexof( path, '-' ) + 1]; 663 char ifname[16]; 664 665 strcpy( ifname, temp2 ); 666 ifname[indexof( ifname, '.' )] = 0; 667 FILE *web = getWebsFile( "WL_ActiveTable.asp" ); 668 unsigned int len = getWebsFileLen( "WL_ActiveTable.asp" ); 669 char *webfile = ( char * )malloc( len + 1 ); 670 671 fread( webfile, len, 1, web ); 672 webfile[len] = 0; 673 fclose( web ); 674 675 char temp[32768]; 676 677 memset( temp, 0, 32768 ); 678 int ai = 0; 679 int i = 0; 680 int weblen = strlen( webfile ); 681 682 for( i = 0; i < weblen; i++ ) 683 { 684 if( webfile[i] == '%' ) 685 { 686 i++; 687 switch ( webfile[i] ) 688 { 689 case '%': 690 temp[ai++] = '%'; 691 break; 692 case 's': 693 strcpy( &temp[ai], ifname ); 694 ai += strlen( ifname ); 695 break; 696 default: 697 temp[ai++] = webfile[i]; 698 break; 699 } 700 } 701 else 702 temp[ai++] = webfile[i]; 703 } 704 free( webfile ); 656 705 do_ej_buffer( temp, stream ); 657 706 } … … 884 933 {"WL_WPATable", "save", "wireless_2", 1, REFRESH, "security_save"}, 885 934 {"WL_WPATable", "keysize", "wireless_2", 1, REFRESH, "security_save"}, 886 {"WL_ActiveTable", "add_mac", "", 1, REFRESH, "add_active_mac"}, 935 {"WL_ActiveTable-wl0", "add_mac", "", 1, REFRESH, "add_active_mac"}, 936 {"WL_ActiveTable-wl1", "add_mac", "", 1, REFRESH, "add_active_mac"}, 887 937 /* 888 938 * Siafu addition … … 1088 1138 do_filtertable( NULL, path, wp, NULL ); // refresh 1089 1139 // #ifdef HAVE_MADWIFI 1140 else if( !strncmp( path, "WL_ActiveTable", 14 ) ) 1141 do_activetable( NULL, path, wp, NULL ); // refresh 1090 1142 else if( !strncmp( path, "Wireless_WDS", 12 ) ) 1091 1143 do_wds( NULL, path, wp, NULL ); // refresh … … 1396 1448 if( !strncmp( path, "WL_FilterTable", 14 ) ) 1397 1449 do_filtertable( NULL, path, wp, NULL ); // refresh 1450 else if( !strncmp( path, "WL_ActiveTable", 14 ) ) 1451 do_activetable( NULL, path, wp, NULL ); // refresh 1398 1452 else if( !strncmp( path, "Wireless_WDS", 12 ) ) 1399 1453 do_wds( NULL, path, wp, NULL ); // refresh … … 2135 2189 // #ifdef HAVE_MADWIFI 2136 2190 {"Wireless_WDS*", "text/html", no_cache, NULL, do_wds, do_auth, 1}, 2191 {"WL_ActiveTable*", "text/html", no_cache, NULL, do_activetable, do_auth, 1}, 2137 2192 {"Wireless_Advanced*", "text/html", no_cache, NULL, do_wireless_adv, do_auth, 1}, 2138 2193 // #endif -
src/router/httpd/validate/validators.c
r12129 r12202 1419 1419 sprintf( mlist, "%s_maclist", ifname ); 1420 1420 nvram_set( mlist, buf ); 1421 if( !strcmp( ifname, "wl0" ) ) 1422 { 1421 1423 nvram_set( "wl_active_mac", "" ); 1422 1424 nvram_set( "wl0_active_mac", "" ); 1425 } 1426 else 1427 nvram_set( "wl1_active_mac", "" ); 1423 1428 } 1424 1429 free(buf); -
src/router/httpd/validate/webs.c
r12173 r12202 914 914 char buf[1000] = "", *cur = buf; 915 915 int i, count = 0; 916 917 char *iface = websGetVar( wp, "iface", NULL ); 916 918 917 919 nvram_set( "wl_active_add_mac", "1" ); … … 948 950 wl_client_macs[atoi( index )].hwaddr ); 949 951 } 950 nvram_set( "wl_active_mac", buf ); 951 nvram_set( "wl0_active_mac", buf ); 952 if( !strcmp( iface "wl0" ) ) 953 { 954 nvram_set( "wl_active_mac", buf ); 955 nvram_set( "wl0_active_mac", buf ); 956 } 957 else 958 nvram_set( "wl1_active_mac", buf ) 952 959 } 953 960 -
src/router/httpd/visuals/dd-wrt.c
r12179 r12202 1528 1528 int i; 1529 1529 1530 if( nvram_match( "wl0_mode", "wet" ) ) // dhcpd settings disabled in1530 if( nvram_match( "wl0_mode", "wet" ) || nvram_match( "wl0_mode", "apstawet" )) // dhcpd settings disabled in 1531 1531 // client bridge mode, so we 1532 1532 // wont display it 1533 1533 return; 1534 if( nvram_match( "wl 0_mode", "apstawet" ) ) // dhcpd settings disabled in1534 if( nvram_match( "wl1_mode", "wet" ) || nvram_match( "wl1_mode", "apstawet" ) ) // dhcpd settings disabled in 1535 1535 // client bridge mode, so we 1536 1536 // wont display it … … 7870 7870 } 7871 7871 7872 websWrite( wp, "<option value=\"%s\" %s >WLAN</option>\n", 7873 nvram_safe_get( "wl0_ifname" ), nvram_match( "rflow_if", 7872 int cnt = get_wl_instances( ); 7873 int c; 7874 7875 for( c = 0; c < cnt; c++ ) 7876 { 7877 sprintf( var, "wl%d_ifname", c ); 7878 websWrite( wp, "<option value=\"%s\" %s >WLAN%d</option>\n", 7879 nvram_safe_get( var ), nvram_match( "rflow_if", 7874 7880 nvram_safe_get 7875 ( "wl0_ifname" ) ) 7876 ? "selected=\"selected\"" : "" ); 7881 ( var ) ) 7882 ? "selected=\"selected\"" : "", c); 7883 } 7877 7884 7878 7885 char *wanif = nvram_safe_get( "wan_ifname" ); -
src/router/httpd/visuals/ejs.c
r12199 r12202 85 85 struct onload onloads[] = { 86 86 // { "Filters", filter_onload }, 87 {"WL_ActiveTable", wl_active_onload}, 87 {"WL_ActiveTable-wl0", wl_active_onload}, 88 {"WL_ActiveTable-wl1", wl_active_onload}, 88 89 {"MACClone", macclone_onload}, 89 90 {"FilterSummary", filtersummary_onload}, … … 2018 2019 if( nvram_match( "wl0_mode", "wet" ) 2019 2020 || nvram_match( "wl0_mode", "apstawet" ) 2021 || nvram_match( "wl1_mode", "wet" ) 2022 || nvram_match( "wl1_mode", "apstawet" ) 2020 2023 || nvram_match( "wan_proto", "disabled" ) ) 2021 2024 { -
src/router/httpd/visuals/status.c
r11810 r12202 209 209 if( nvram_match( "wl0_mode", "wet" ) 210 210 || nvram_match( "wl0_mode", "apstawet" ) 211 || nvram_match( "wl1_mode", "wet" ) 212 || nvram_match( "wl1_mode", "apstawet" ) 211 213 || !strcmp( wan_proto, "disabled" ) ) 212 214 { -
src/router/httpd/visuals/wireless.c
r12129 r12202 42 42 43 43 #define ASSOCLIST_TMP "/tmp/.wl_assoclist" 44 #define ASSOCLIST_CMD " wlassoclist"44 #define ASSOCLIST_CMD "assoclist" 45 45 46 46 #define LEASES_NAME_IP "/tmp/.leases_name_ip" … … 398 398 char line[80]; 399 399 int dhcp_table_count; 400 401 if( !strcmp( argv[0], "online" ) ) 400 char *type, *ifname; 401 402 ejArgs( argc, argv, "%s %s", &type, &ifname ); 403 404 if( !strcmp( type, "online" ) ) 402 405 { 403 406 for( i = 0; i < MAX_LEASES; i++ ) … … 411 414 412 415 nv_count = 0; // init mac list 416 417 char *iface; 418 if( !strcmp( ifname, "wl0" ) ) 419 iface = get_wl_instance_name( 0 ); 420 else if ( !strcmp( ifname, "wl1" ) ) 421 iface = get_wl_instance_name( 1 ); 422 else 423 iface = nvram_safe_get( "wl0_ifname" ); 424 413 425 #ifdef HAVE_MADWIFI 414 426 char *maclist = nvram_safe_get( "ath0_maclist" ); 415 427 #else 416 char *maclist = nvram_safe_get( "wl0_maclist" ); 428 char var[32]; 429 sprintf( var, "%s_maclist", ifname ); 430 char *maclist = nvram_safe_get( var ); 417 431 #endif 418 432 foreach( word, maclist, next ) … … 424 438 nv_count++; 425 439 } 426 sysprintf( " %s > %s", ASSOCLIST_CMD, ASSOCLIST_TMP );440 sysprintf( "wl -i %s %s > %s", iface, ASSOCLIST_CMD, ASSOCLIST_TMP ); 427 441 428 442 if( ( fp = fopen( ASSOCLIST_TMP, "r" ) ) ) … … 462 476 fclose( fp ); 463 477 } 464 if( !strcmp( argv[0], "online" ) )478 if( !strcmp( type, "online" ) ) 465 479 { 466 480 dhcp_table_count = dhcp_lease_table_init( ); // init dhcp … … 473 487 } 474 488 475 if( !strcmp( argv[0], "offline" ) )489 if( !strcmp( type, "offline" ) ) 476 490 { 477 491 get_hostname_ip( "offline", OLD_NAME_IP ); 478 492 } 479 493 480 if( !strcmp( argv[0], "online" ) )494 if( !strcmp( type, "online" ) ) 481 495 { 482 496 for( i = 0; i < nv_count; i++ ) … … 493 507 } 494 508 } 495 else if( !strcmp( argv[0], "offline" ) )509 else if( !strcmp( type, "offline" ) ) 496 510 { 497 511 for( i = 0; i < nv_count; i++ ) … … 721 735 int count = 0; 722 736 723 sysprintf( " %s > %s", ASSOCLIST_CMD, ASSOCLIST_TMP );737 sysprintf( "wl %s > %s", ASSOCLIST_CMD, ASSOCLIST_TMP ); 724 738 725 739 if( ( fp = fopen( ASSOCLIST_TMP, "r" ) ) )
Note: See TracChangeset
for help on using the changeset viewer.
