From 2f8c18f73657ae01ebf87c63f5ff8aa1b105d148 Mon Sep 17 00:00:00 2001 From: Toastman Date: Tue, 10 May 2011 11:11:07 +0700 Subject: [PATCH] tidy up qos-bwlimiter,filenames,cosmetics --- release/src/router/httpd/tomato.c | 4 +- release/src/router/nvram/defaults.c | 2 +- release/src/router/rc/Makefile | 2 +- .../src/router/rc/{new_qoslimit.c => qoslimit.c} | 6 +-- release/src/router/rc/rc.h | 8 ++-- release/src/router/rc/services.c | 6 +-- release/src/router/rc/wan.c | 4 +- release/src/router/www/about.asp | 4 +- release/src/router/www/basic-static.asp | 55 +++++++++++++++------- .../www/{qos-bwlimiter.asp => qos-qoslimit.asp} | 17 ++++--- release/src/router/www/status-devices.asp | 8 ++-- release/src/router/www/tomato.js | 2 +- 12 files changed, 71 insertions(+), 47 deletions(-) rename release/src/router/rc/{new_qoslimit.c => qoslimit.c} (99%) rename release/src/router/www/{qos-bwlimiter.asp => qos-qoslimit.asp} (97%) diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index a95549b5a8..6b2a7a09af 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -947,9 +947,9 @@ static const nvset_t nvset_list[] = { { "ne_vbeta", V_NUM }, { "ne_vgamma", V_NUM }, -// new_qoslimit +// qos-bw-limiter { "qosl_enable", V_01 }, - { "qosl_rules", V_LENGTH(0, 4096) }, + { "qosl_rules", V_LENGTH(0, 4096) }, { "qosl_denable", V_01 }, { "qosl_dulr", V_RANGE(0, 999999) }, { "qosl_dulc", V_RANGE(0, 999999) }, diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index 7d4879410b..0801b24b97 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -468,7 +468,7 @@ const defaults_t defaults[] = { { "ne_vbeta", "3" }, // " { "ne_vgamma", "2" }, // " -// new_qoslimit +// qos-bw-limiter { "qosl_enable", "0" }, // { "qosl_obw", "" }, unused - used qos_obw // { "qosl_ibw", "" }, unused - used qos_obw diff --git a/release/src/router/rc/Makefile b/release/src/router/rc/Makefile index 0659eab25d..6c80f61b40 100644 --- a/release/src/router/rc/Makefile +++ b/release/src/router/rc/Makefile @@ -14,7 +14,7 @@ OBJS := rc.o init.o interface.o network.o wan.o services.o dhcp.o OBJS += firewall.o ppp.o telssh.o wnas.o OBJS += listen.o redial.o led.o qos.o forward.o misc.o mtd.o OBJS += buttons.o restrict.o gpio.o sched.o -OBJS += new_qoslimit.o arpbind.o +OBJS += qoslimit.o arpbind.o OBJS += cmon.o # heartbeat.o diff --git a/release/src/router/rc/new_qoslimit.c b/release/src/router/rc/qoslimit.c similarity index 99% rename from release/src/router/rc/new_qoslimit.c rename to release/src/router/rc/qoslimit.c index 2ef1250eed..9dd948ed1e 100644 --- a/release/src/router/rc/new_qoslimit.c +++ b/release/src/router/rc/qoslimit.c @@ -239,7 +239,7 @@ void ipt_qoslimit(int chain) } // read nvram into files -void new_qoslimit_start(void) +void start_qoslimit(void) { FILE *tc; char *buf; @@ -392,10 +392,10 @@ void new_qoslimit_start(void) eval((char *)qoslimitfn, "start"); } -void new_qoslimit_stop(void) +void stop_qoslimit(void) { FILE *f; - char *s = "/tmp/qoslimittc_stop.sh"; + char *s = "/tmp/stop_qoslimittc.sh"; if ((f = fopen(s, "w")) == NULL) return; diff --git a/release/src/router/rc/rc.h b/release/src/router/rc/rc.h index e65d31d9bf..500e6ce1ac 100644 --- a/release/src/router/rc/rc.h +++ b/release/src/router/rc/rc.h @@ -310,7 +310,6 @@ extern void start_qos(void); extern void stop_qos(void); // cmon.c -extern void ipt_cmon(void); // Do we need this ? extern void start_cmon(void); extern void stop_cmon(void); @@ -443,17 +442,16 @@ static inline void start_vpn_eas() { } #define write_vpn_resolv(f) (0) #endif -// new_qoslimit.c +// qoslimit.c extern void ipt_qoslimit(int chain); -extern void new_qoslimit_start(void); -extern void new_qoslimit_stop(void); +extern void start_qoslimit(void); +extern void stop_qoslimit(void); // arpbind.c extern void start_arpbind(void); extern void stop_arpbind(void); - #endif diff --git a/release/src/router/rc/services.c b/release/src/router/rc/services.c index df24ac8a31..981f06f06a 100644 --- a/release/src/router/rc/services.c +++ b/release/src/router/rc/services.c @@ -1893,12 +1893,12 @@ TOP: if (strcmp(service, "qoslimit") == 0) { if (action & A_STOP) { - new_qoslimit_stop(); + stop_qoslimit(); start_cmon(); } stop_firewall(); start_firewall(); // always restarted if (action & A_START) { - new_qoslimit_start(); + start_qoslimit(); start_cmon(); } @@ -1907,7 +1907,7 @@ TOP: if (strcmp(service, "arpbind") == 0) { if (action & A_STOP) stop_arpbind(); - if (action & A_START) start_arpbind(); + if (action & A_START) stop_arpbind(); goto CLEAR; } diff --git a/release/src/router/rc/wan.c b/release/src/router/rc/wan.c index 4d06e35dfc..3d9c5828aa 100644 --- a/release/src/router/rc/wan.c +++ b/release/src/router/rc/wan.c @@ -828,7 +828,7 @@ void start_wan_done(char *wan_ifname) start_firewall(); start_qos(); start_cmon(); // Where to put this? - new_qoslimit_start(); + start_qoslimit(); start_arpbind(); @@ -892,7 +892,7 @@ void stop_wan(void) TRACE_PT("begin\n"); stop_arpbind(); - new_qoslimit_stop(); + stop_qoslimit(); stop_qos(); stop_cmon(); stop_upnp(); //!!TB - moved from stop_services() diff --git a/release/src/router/www/about.asp b/release/src/router/www/about.asp index c133271c83..280ae20746 100644 --- a/release/src/router/www/about.asp +++ b/release/src/router/www/about.asp @@ -118,10 +118,10 @@ VPN integration and GUI Copyright (C) 2010 Keith Moyer,
- 250 entry limit in Static DHCP & Wireless Filter | 500 entry limit in Access Restrictions
- Configurable QOS class names | Toastman QOS rules | Fast conntrack timeout
- CPU frequency selector | Faster page refresh settings | Client Monitor Graphs
-- VLAN Support for UPnP - if exists, loads upnpconfig.custom from JFFS
+- UPnP Support for vlans - if exists, loads upnpconfig.custom from JFFS

Developments by Victek/PrinceAMD/Phykris/Shibby/Toastman
-- Revised Static ARP Binding | Revised IP/MAC/Range QOS/Bandwidth Limiter
+- Revised Static ARP Binding | Revised QOS/Bandwidth Limiter

Based on Tomato Firmware v<% version(); %>
Copyright (C) 2006-2010 Jonathan Zarate
diff --git a/release/src/router/www/basic-static.asp b/release/src/router/www/basic-static.asp index 808101219f..389624a43c 100644 --- a/release/src/router/www/basic-static.asp +++ b/release/src/router/www/basic-static.asp @@ -269,9 +269,14 @@ function init()
- -
* To specify multiple hostnames per device, separate them with spaces.
-
+
+ +
    +
  • To specify multiple hostnames per device, separate them with spaces.
    +
+
+
+
Static ARP
@@ -282,20 +287,36 @@ function init() ]);
- -
* Static ARP only works if there's one MAC address per IP. You can't enter two MAC addresses in the above table.
-
* Enabling these functions on the router will prevent unauthorized clients from accessing the router or the internet.
-
-
-
-
When using "Restrict unlisted machines":-
-
- -
* DHCP should issue a "range" with only 1 IP address, preferably the administrator's IP - e.g. 192.168.1.100-100.

-
* You MUST enter your own (administrator) IP and MAC into the table, or you may be locked out of the router.

-
* You must add the IP/MAC address of all your access point(s) to the table.

-
* All listed IP's will now show as "active" in the WOL table.
-
+ +
+ +
    +
  • Static ARP only works if there's one MAC address per IP. You can't enter two MAC addresses in the above table.
    +
+
+
+ +
+
+
+ +
+ +
+ +
+ +
    +
  • DHCP should issue a "range" with only 1 IP address, preferably the administrator's IP - e.g. 192.168.1.100-100.
    +
  • You MUST enter your own (administrator) IP and MAC into the table, or you may be locked out of the router.
    +
  • You must add the IP/MAC address of all your access point(s) etc. to the table.
    +
  • All listed IP's will now show as "active" in the WOL table.
    +
+
+ +
diff --git a/release/src/router/www/qos-bwlimiter.asp b/release/src/router/www/qos-qoslimit.asp similarity index 97% rename from release/src/router/www/qos-bwlimiter.asp rename to release/src/router/www/qos-qoslimit.asp index b377acc358..b00ea5051b 100644 --- a/release/src/router/www/qos-bwlimiter.asp +++ b/release/src/router/www/qos-qoslimit.asp @@ -82,8 +82,8 @@ qosg.resetNewEditor = function() { var f = fields.getAll(this.newEditor); ferror.clearAll(f); - if ((c = cookie.get('addbwlimit')) != null) { - cookie.set('addbwlimit', '', 0); + if ((c = cookie.get('addqoslimit')) != null) { + cookie.set('addqoslimit', '', 0); c = c.split(','); if (c.length == 2) { f[0].value = c[0]; @@ -259,7 +259,7 @@ function init() - + @@ -268,7 +268,7 @@ function init() -
+
Bandwidth Limiter - QOS
@@ -282,13 +282,15 @@ function init()
+
+
+
    -
  • IP Address / IP Range - e.g. 192.168.1.5 or 192.168.1.45-57 or 45-57 - A range of IP's will share the bandwidth. +
  • IP Address / IP Range - e.g. 192.168.1.5 or 192.168.1.45-57 or 45-57 - A range of IP's will share the bandwidth.
-
Default Class rate/ceiling for unlisted IP's
@@ -323,6 +325,9 @@ function init() ]);
+
+
+
  • Default Class - All clients not included in the list will share the Default Rate/Ceiling setting.
diff --git a/release/src/router/www/status-devices.asp b/release/src/router/www/status-devices.asp index 7dfc5fed99..01203ff3f8 100644 --- a/release/src/router/www/status-devices.asp +++ b/release/src/router/www/status-devices.asp @@ -147,11 +147,11 @@ function addWF(n) location.href = 'basic-wfilter.asp'; } -function addbwlimit(n) +function addqoslimit(n) { var e = list[n]; - cookie.set('addbwlimit', [e.ip, e.name.split(',')[0]].join(','), 1); - location.href = 'qos-bwlimiter.asp'; + cookie.set('addqoslimit', [e.ip, e.name.split(',')[0]].join(','), 1); + location.href = 'qos-qoslimit.asp'; } var ref = new TomatoRefresh('update.cgi', 'exec=devlist', 0, 'status_devices_refresh'); @@ -278,7 +278,7 @@ dg.populate = function() b += '
' + '[oui] ' + '[static]' + - '[bwlimit]'; + '[qoslimit]'; if (e.rssi != '') { b += ' [wfilter]'; diff --git a/release/src/router/www/tomato.js b/release/src/router/www/tomato.js index 659bc56f77..e3c1165eb8 100644 --- a/release/src/router/www/tomato.js +++ b/release/src/router/www/tomato.js @@ -2387,7 +2387,7 @@ function navi() ['View Graphs', 'graphs.asp'], ['View Details', 'detailed.asp'], ['Transfer Rates', 'ctrate.asp'], - ['B/W Limiter', 'bwlimiter.asp'] ] ], + ['B/W Limiter', 'qoslimit.asp'] ] ], ['Access Restriction', 'restrict.asp'], /* REMOVE-BEGIN -- 2.11.4.GIT