OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 116... | Line 116... | |||
116 | *:comment) |
116 | *:comment) |
|
117 | add_insmod xt_comment |
117 | add_insmod xt_comment |
|
118 | append "$var" "-m comment --comment '$value'" |
118 | append "$var" "-m comment --comment '$value'" |
|
119 | ;; |
119 | ;; |
|
120 | *:tos) |
120 | *:tos) |
|
121 | add_insmod xt_dscp |
121 | add_insmod xt_dscp |
|
122 | case "$value" in |
122 | case "$value" in |
|
123 | !*) append "$var" "-m tos ! --tos $value";; |
123 | !*) append "$var" "-m tos ! --tos $value";; |
|
124 | *) append "$var" "-m tos --tos $value" |
124 | *) append "$var" "-m tos --tos $value" |
|
125 | esac |
125 | esac |
|
126 | ;; |
126 | ;; |
|
127 | *:dscp) |
127 | *:dscp) |
|
128 | add_insmod xt_dscp |
128 | add_insmod xt_dscp |
|
129 | dscp_option="--dscp" |
129 | dscp_option="--dscp" |
|
130 | [ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class" |
130 | [ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class" |
|
131 | case "$value" in |
131 | case "$value" in |
|
132 | !*) append "$var" "-m dscp ! $dscp_option $value";; |
132 | !*) append "$var" "-m dscp ! $dscp_option $value";; |
|
133 | *) append "$var" "-m dscp $dscp_option $value" |
133 | *) append "$var" "-m dscp $dscp_option $value" |
|
134 | esac |
134 | esac |
|
135 | ;; |
135 | ;; |
|
136 | *:direction) |
136 | *:direction) |
|
137 | value="$(echo "$value" | sed -e 's,-,:,g')" |
137 | value="$(echo "$value" | sed -e 's,-,:,g')" |
|
138 | if [ "$value" = "out" ]; then |
138 | if [ "$value" = "out" ]; then |
|
139 | append "$var" "-o $device" |
139 | append "$var" "-o $device" |
|
140 | elif [ "$value" = "in" ]; then |
140 | elif [ "$value" = "in" ]; then |
|
Line 426... | Line 426... | |||
426 | done |
426 | done |
|
427 | done |
427 | done |
|
428 | cat <<EOF |
428 | cat <<EOF |
|
429 | $INSMOD |
429 | $INSMOD |
|
430 | EOF |
430 | EOF |
|
431 | |
431 | |
|
432 | for command in $iptables; do |
432 | for command in $iptables; do |
|
433 | cat <<EOF |
433 | cat <<EOF |
|
434 | $command -w -t mangle -N qos_${cg} |
434 | $command -w -t mangle -N qos_${cg} |
|
435 | $command -w -t mangle -N qos_${cg}_ct |
435 | $command -w -t mangle -N qos_${cg}_ct |
|
436 | EOF |
436 | EOF |
|
Line 484... | Line 484... | |||
484 | # Print held lines at the end (note leading newline) |
484 | # Print held lines at the end (note leading newline) |
|
485 | sed -e '/^-N/{s/^-N/-X/;H;s/^-X/-F/}' \ |
485 | sed -e '/^-N/{s/^-N/-X/;H;s/^-X/-F/}' \ |
|
486 | -e 's/^-A/-D/' \ |
486 | -e 's/^-A/-D/' \ |
|
487 | -e '${p;g}' | |
487 | -e '${p;g}' | |
|
488 | # Make into proper iptables calls |
488 | # Make into proper iptables calls |
|
489 | # Note: awkward in previous call due to hold space usage |
489 | # Note: awkward in previous call due to hold space usage |
|
490 | sed -n -e "s/^./${command} -w -t mangle &/p" |
490 | sed -n -e "s/^./${command} -w -t mangle &/p" |
|
491 | done |
491 | done |
|
492 | } |
492 | } |
|
Line 493... | Line 493... | |||
493 | |
493 | |