online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#!/bin/bash # https://github.com/tohojo/sqm-scripts # adapt for small/slow link UPLINK=1000 # in kbps DOWNLINK=2000 # in kbps MTU=1500 # default ethernet 1500 get_target_interval() { # for ATM the worst case expansion including overhead seems to be 33 clls of # 53 bytes each, max delay in us at 1kbps MAX_DELAY=$((1000 * 1000 * 33 * 53 * 8 / 1000)) TARGET=$((MAX_DELAY / $2)) # do not change anything for fast links if [ "$TARGET" -lt 5000 ]; then TARGET=5000 fi INTERVAL=$(((100 - 5) * 1000 + TARGET)) echo "target $1 = $((TARGET / 1000))" echo "interval $1 = $((INTERVAL / 1000))" } get_quantum() { SHAPER_BURST_US=1000 # default duration of the burst in us # lets assume ATM/AAL5 to be the worst case encapsulation # and 48 Bytes a reasonable worst case per packet overhead # for MTU 1489 to 1536 this will result in MIN_BURST = 1749 Bytes MIN_BURST=$((MTU + 48)) MIN_BURST=$((MIN_BURST + 47)) MIN_BURST=$((MIN_BURST / 48)) MIN_BURST=$((MIN_BURST * 53)) # htb/tbf expect burst to be specified in bytes, while bandwidth is in kbps BURST=$((((SHAPER_BURST_US * $2) / 8000))) if [ ${BURST} -lt ${MIN_BURST} ]; then BURST=${MIN_BURST} fi echo "quantum $1 = ${BURST}" } get_limit() { LIMIT=10240 # default limit # limits are tuned towards a <10Mb uplink <60Mb downlink if [ "$2" -lt "10000" ] && [ "$1" = "UPLOAD" ]; then LIMIT=1001 elif [ "$2" -lt "60000" ] && [ "$1" = "DOWNLOAD" ]; then LIMIT=1001 fi echo "limit $1 = ${LIMIT}" } get_target_interval "UPLOAD" ${UPLINK} get_quantum "UPLOAD" ${UPLINK} get_limit "UPLOAD" ${UPLINK} get_target_interval "DOWNLOAD" ${DOWNLINK} get_quantum "DOWNLOAD" ${DOWNLINK} get_limit "DOWNLOAD" ${DOWNLINK}

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue