SHELL := /bin/bash

simple_test:
	./run-3 \
		1,simple_test . \
		thunder-client 600 100 100 8 150 . \
		thunder-server 8 150 . \
		tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple

tor_bw_small:
	./run-3 \
		1,tor_bw_small . \
		orig-client 60 1000 100, \
		  orig-client 120 500 100, \
		  orig-client 600 100 100, \
		  orig-client 1200 50 100 . \
		orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple

tor_bw_small_parse:
	@. parse_lib.sh && \
	parse_latency tor_bw_small 3

tor_bw_full:
	./run-3 \
		16,tor_bw_full . \
		orig-client 600 1000 100, \
		  orig-client 1200 500 100, \
		  orig-client 6000 100 100, \
		  orig-client 12000 50 100, \
		  orig-client 30000 20 100 . \
		orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple

tor_bw_full_parse:
	@. parse_lib.sh && \
	parse_latency tor_bw_full 4

tor_guards_small:
	./run-3 \
		1,tor_guards_small . \
		dup2-client 600 100 100 8, \
		  dup2-client 600 100 100 8, \
		  dup2-client 600 100 100 8, \
		  dup2-client 600 100 100 8 . \
		dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8 . \
		tor3 -f /etc/torrc_guard_1, \
		  tor3 -f /etc/torrc_guard_3, \
		  tor3 -f /etc/torrc_guard_5, \
		  tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_guard_1, \
		  tor3 -f /etc/torrc_guard_3, \
		  tor3 -f /etc/torrc_guard_5, \
		  tor3 -f /etc/torrc_simple

tor_guards_full:
	./run-3 \
		16,tor_guards_full . \
		dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8, \
		  dup2-client 6000 100 100 8 . \
		dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8, \
		  dup2-server 8 . \
		tor3 -f /etc/torrc_guard_1, \
		  tor3 -f /etc/torrc_guard_2, \
		  tor3 -f /etc/torrc_guard_3, \
		  tor3 -f /etc/torrc_guard_4, \
		  tor3 -f /etc/torrc_guard_5, \
		  tor3 -f /etc/torrc_guard_6, \
		  tor3 -f /etc/torrc_guard_7, \
		  tor3 -f /etc/torrc_guard_8, \
		  tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_guard_1, \
		  tor3 -f /etc/torrc_guard_2, \
		  tor3 -f /etc/torrc_guard_3, \
		  tor3 -f /etc/torrc_guard_4, \
		  tor3 -f /etc/torrc_guard_5, \
		  tor3 -f /etc/torrc_guard_6, \
		  tor3 -f /etc/torrc_guard_7, \
		  tor3 -f /etc/torrc_guard_8, \
		  tor3 -f /etc/torrc_simple

tor_guards_full_parse:
	@. parse_lib.sh && \
	parse_latency tor_guards_full 8

tor_relays_full:
	./run-3 \
		16,tor_relays_full . \
		orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100 . \
		orig-server, \
		  orig-server, \
		  orig-server-single . \
		tor3 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_single_hop

tor_relays_small:
	./run-3 \
		1,tor_relays_small . \
		orig-client 600 100 100, \
		  orig-client 600 100 100, \
		  orig-client 600 100 100 . \
		orig-server, \
		  orig-server, \
		  orig-server-single . \
		tor3 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_simple, \
		  tor2 -f /etc/torrc_single_hop

tor_relays_full_parse:
	@. parse_lib.sh && \
	parse_latency tor_relays_full 2

thunder_configure_small:
	./run-3 \
		1,thunder_configure. \
		thunder-client 600 100 100 $(link_num) 50, \
		  thunder-client 600 100 100 $(link_num) 100, \
		  thunder-client 600 100 100 $(link_num) 150, \
		  thunder-client 600 100 100 $(link_num) 200, \
		  thunder-client 600 100 100 $(link_num) 250, \
		  thunder-client 600 100 100 $(link_num) 300, \
		  thunder-client 600 100 100 $(link_num) 350. \
		thunder-server $(link_num) 50, \
		  thunder-server $(link_num) 100, \
		  thunder-server $(link_num) 150, \
		  thunder-server $(link_num) 200, \
		  thunder-server $(link_num) 250, \
		  thunder-server $(link_num) 300, \
		  thunder-server $(link_num) 350. \
		tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2. \
		tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2

thunder_configure_full:
	./run-3 \
		16,thunder_configure. \
		thunder-client 6000 100 100 $(link_num) 50, \
		  thunder-client 6000 100 100 $(link_num) 100, \
		  thunder-client 6000 100 100 $(link_num) 150, \
		  thunder-client 6000 100 100 $(link_num) 200, \
		  thunder-client 6000 100 100 $(link_num) 250, \
		  thunder-client 6000 100 100 $(link_num) 300, \
		  thunder-client 6000 100 100 $(link_num) 350. \
		thunder-server $(link_num) 50, \
		  thunder-server $(link_num) 100, \
		  thunder-server $(link_num) 150, \
		  thunder-server $(link_num) 200, \
		  thunder-server $(link_num) 250, \
		  thunder-server $(link_num) 300, \
		  thunder-server $(link_num) 350. \
		tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2. \
		tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2, \
		  tor2 -f /etc/torrc_guard_2

thunder_configure_full_parse:
	@. parse_lib.sh && \
	parse_thunder thunder_configure 6

tor_just_many_latencies:
	./run-3 \
		16,tor_just_many_latencies . \
		orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100, \
		  orig-client 6000 100 100 . \
		orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server, \
		  orig-server . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple . \
		tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple, \
		  tor3 -f /etc/torrc_simple