Add TC_ENABLED=Internal

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2836 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2005-10-09 15:47:47 +00:00
parent 41178852fb
commit 1af4d541a0
4 changed files with 45 additions and 31 deletions

View File

@ -1,6 +1,6 @@
Changes in 2.5.9 Changes in 2.5.9
1) Add TC_SCRIPT 1) Add TC_ENABLED=Internal
2) Fix default tc class bug. 2) Fix default tc class bug.

View File

@ -3701,13 +3701,13 @@ setup_tc1() {
run_iptables -t mangle -A FORWARD -j tcfor run_iptables -t mangle -A FORWARD -j tcfor
run_iptables -t mangle -A POSTROUTING -j tcpost run_iptables -t mangle -A POSTROUTING -j tcpost
if [ -n "$TC_SCRIPT" ]; then if [ -n "$TC_ENABLED" ]; then
run_user_exit $TC_SCRIPT run_user_exit $TC_SCRIPT
save_progress_message "Restoring Traffic Control..." save_progress_message "Restoring Traffic Control..."
save_command . $TC_SCRIPT save_command . $TC_SCRIPT
else elif [ -n "$TC_ENABLED" ]; then
setup_traffic_shaping setup_traffic_shaping
fi fi
} }
@ -4129,7 +4129,7 @@ refresh_tc() {
if [ -n "$TC_SCRIPT" ]; then if [ -n "$TC_SCRIPT" ]; then
run_user_exit $TC_SCRIPT run_user_exit $TC_SCRIPT
else elif [ -n "$TC_ENABLED" ]; then
setup_traffic_shaping setup_traffic_shaping
fi fi
@ -9185,7 +9185,7 @@ do_initialize() {
LOGLIMIT= LOGLIMIT=
ADD_IP_ALIASES= ADD_IP_ALIASES=
ADD_SNAT_ALIASES= ADD_SNAT_ALIASES=
TC_SCRIPT= TC_ENABLED=
BLACKLIST_DISPOSITION= BLACKLIST_DISPOSITION=
BLACKLIST_LOGLEVEL= BLACKLIST_LOGLEVEL=
CLAMPMSS= CLAMPMSS=
@ -9434,10 +9434,28 @@ do_initialize() {
;; ;;
esac esac
if [ -n "$TC_SCRIPT" ] ; then TC_SCRIPT=
f="$TC_SCRIPT"
TC_SCRIPT=$(find_file $TC_SCRIPT) if [ -n "$TC_ENABLED" ] ; then
[ -f $TC_SCRIPT ] || startup_error "Unable to find TC_SCRIPT file ($f)" case "$TC_ENABLED" in
[Yy][Ee][Ss])
TC_ENABLED=
TC_SCRIPT=$(find_file tcstart)
[ -f $TC_SCRIPT ] || startup_error "Unable to find tcstart file"
;;
[Ii][Nn][Tt][Ee][Rr][Nn][Aa][Ll])
TC_ENABLED=Yes
;;
[Nn][Oo])
TC_ENABLED=
;;
esac
else
TC_ENABLED=Yes
fi
if [ -n "$TC_ENABLED" ];then
[ -n "$MANGLE_ENABLED" ] || startup_error "Traffic Shaping requires mangle support in your kernel and iptables"
fi fi
[ "x${SHOREWALL_DIR}" = "x." ] && SHOREWALL_DIR="$PWD" [ "x${SHOREWALL_DIR}" = "x." ] && SHOREWALL_DIR="$PWD"

View File

@ -4,13 +4,10 @@ Problems Corrected in 2.5.9:
New Features in 2.5.9: New Features in 2.5.9:
1) A new TC_SCRIPT option replaces TC_ENABLED in shorewall.conf. If the 1) A new value is defined for the TC_ENABLED option in shorewall.conf to
option is not set then the internal shaper (tc4shorewall by Arne enable the builtin tc4shorewall traffic shaper. If you set
Bernin) is used. Otherwise, the script named in the variable is TC_ENABLED=internal then tc4shorewall will be used. If the option is
used. set to Yes then Shorewall will continue to look for a 'tcstart' script.
Users who currently use an /etc/shorewall/tcstart file should set
TC_SCRIPT=/etc/shorewall/tcstart in shorewall.conf.
2) The default traffic shaping class for a device was being incorrectly 2) The default traffic shaping class for a device was being incorrectly
specified by tc4shorewall. specified by tc4shorewall.
@ -205,14 +202,10 @@ Migration Considerations:
Note that the rule is added at the front of the NEW section of the Note that the rule is added at the front of the NEW section of the
rules file. rules file.
11) A new TC_SCRIPT option replaces TC_ENABLED in shorewall.conf. If the 11) A new value is defined for the TC_ENABLED option in shorewall.conf to
option is not set then the internal shaper (tc4shorewall by Arne enable the builtin tc4shorewall traffic shaper. If you set
Bernin) is used. Otherwise, the script named in the variable is TC_ENABLED=internal then tc4shorewall will be used. If the option is
used. set to Yes then Shorewall will continue to look for a 'tcstart' script.
Users who currently use an /etc/shorewall/tcstart file and wish to
continue to do so should set
TC_SCRIPT=/etc/shorewall/tcstart in shorewall.conf.
New Features in Shorewall 2.5.* New Features in Shorewall 2.5.*

View File

@ -394,18 +394,21 @@ ADD_SNAT_ALIASES=No
RETAIN_ALIASES=No RETAIN_ALIASES=No
# #
# ENABLE EXTERNAL TRAFFIC SHAPER # ENABLE TRAFFIC SHAPING
# #
# If you wish for Shorewall to run an external traffic shaping script such as # If you say "Yes" or "yes" here, Shorewall will use a script that you
# WonderShaper then set TC_SCRIPT to the file name of that script. # supply to configure traffic shaping. The script must be named 'tcstart'
# and must be placed in a directory on your CONFIG_PATH.
# #
# Example: TC_SCRIPT=/etc/shorewall/tcstart # If you say "No" or "no" then traffic shaping is not enabled.
# #
# If you leave the option empty then Shorewall will use its internal traffic # If you set TC_ENABLED=Internal or internal or leave the option empty then
# shaper "tc4shorewall" by Arne Bernin. # Shorewall will use its builtin traffic shaper (tc4shorewall written by
# Arne Bernin).
# #
# See http://shorewall.net/traffic_shaping.htm for more information.
TC_SCRIPT= TC_ENABLED=Internal
# #
# Clear Traffic Shapping/Control # Clear Traffic Shapping/Control