#!/bin/bash

latency=1ms
bw=40mbit

if [ "$1" != "" ]; then
    latency="$1"
fi
if [ "$2" != "" ]; then
    bw="$2"
fi
docker exec --privileged  -w /root/duoram/preprocessing-aes party0 tc qdisc add dev eth0 root netem delay $latency rate $bw
docker exec --privileged  -w /root/duoram/preprocessing-aes party1 tc qdisc add dev eth0 root netem delay $latency rate $bw
docker exec --privileged  -w /root/duoram/preprocessing-aes party2 tc qdisc add dev eth0 root netem delay $latency rate $bw
