#! /bin/bash

inrate=1024
outrate=1024
ratep=99
ackp=93
#bidirect=1

export LATENCY=500
export LAN=eth0
export WAN=eth1
export IN_RATE=$[inrate*ratep/100]Kibit
export OUT_RATE=$[outrate]Kibit
test "$bidirect" && export OUT_RATE=$[outrate*ratep/100]Kibit
export HASHKEY="0"
test "$bidirect" && export ACK_IN=$[outrate*ackp/100]Kibit
export ACK_OUT=$[inrate*ackp/100]Kibit
export ACK_FILTER="small: ~all_ack_!fin_!rst gre_ack"
#export ACK_FILTER="small: ack gre_ack"
export ESTIMATOR=1
export EST_FILTER=2

killall psp-shaper-est.pl
./psp-shaper-0.56.sh $*
test "$ACK_OUT$ACK_IN" && ./psp-shaper-est.pl
