Better debug options
This commit is contained in:
parent
2ced09ceba
commit
e176314057
8 changed files with 22 additions and 4 deletions
|
@ -6,4 +6,5 @@ mkdir -p ./shared
|
|||
valgrind --leak-check=full donar -a rr -b -c -o ./shared/onion_services.pub -r 9000 -v > ./log/client-donar-stdout.log 2> ./log/client-donar-stderr.log &
|
||||
sleep 2
|
||||
measlat -h 127.13.3.7 -p 9000 > /dev/null 2>&1 # Used to wait for connections
|
||||
dump_circuits > ./log/circuits.txt
|
||||
valgrind --leak-check=full measlat -h 127.13.3.7 -p 9000 -c $1 -i $2 -s $3 -v > ./res/rr.csv 2> ./log/client-measlat-stderr.log
|
||||
|
|
|
@ -5,5 +5,6 @@ sleep 2
|
|||
mkdir -p ./shared
|
||||
cd ./shared
|
||||
pwd
|
||||
( sleep 180; dump_circuits > ./log/server-circuits.txt ) &
|
||||
valgrind --leak-check=full donar -a rr -b -s -e 9000 -v > ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log &
|
||||
valgrind --leak-check=full udpecho -p 9000 -v > ../log/server-udpecho-stdout.log 2> ../log/server-udpecho-stderr.log
|
||||
|
|
|
@ -6,4 +6,5 @@ mkdir -p ./shared
|
|||
valgrind --leak-check=full donar -a rr -b -h -c -o ./shared/onion_services.pub -r 9000 > ./log/client-donar-stdout.log 2> ./log/client-donar-stderr.log &
|
||||
sleep 2
|
||||
measlat -h 127.13.3.7 -p 9000 > /dev/null 2>&1 # Used to wait for connections
|
||||
dump_circuits > ./log/circuits.txt
|
||||
measlat -h 127.13.3.7 -p 9000 -c $1 -i $2 -s $3 > ./res/rrh.csv 2> ./log/client-measlat-stderr.log
|
||||
|
|
|
@ -5,5 +5,6 @@ sleep 2
|
|||
mkdir -p ./shared
|
||||
cd ./shared
|
||||
pwd
|
||||
( sleep 180; dump_circuits > ./log/server-circuits.txt ) &
|
||||
valgrind --leak-check=full donar -a rr -b -h -s -e 9000 > ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log &
|
||||
udpecho -p 9000 > ../log/server-udpecho-stdout.log 2> ../log/server-udpecho-stderr.log
|
||||
|
|
5
scripts/witness-client
Executable file
5
scripts/witness-client
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
mkdir -p ./log
|
||||
measlat -h 127.0.0.1 -p 9000 > /dev/null 2>&1 # Used to wait for connections
|
||||
measlat -h 127.0.0.1 -p 9000 -c $1 -i $2 -s $3 > ./res/witness.csv 2> ./log/client-measlat-stderr.log
|
||||
|
4
scripts/witness-server
Executable file
4
scripts/witness-server
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
mkdir -p ./log
|
||||
udpecho -p 9000 > ../log/server-udpecho-stdout.log 2> ../log/server-udpecho-stderr.log
|
||||
|
|
@ -38,6 +38,7 @@ docker run \
|
|||
--privileged \
|
||||
--rm \
|
||||
--name "$XP_ID-client" \
|
||||
$( [[ "${XP_NAME}" == 'witness' ]] && echo "--net=container:$XP_ID-server" ) \
|
||||
-v `pwd`/res:/home/donar/res \
|
||||
-v `pwd`/shared:/home/donar/shared \
|
||||
-v `pwd`/log:/home/donar/log \
|
||||
|
|
|
@ -34,11 +34,11 @@ int main(int argc, char** argv) {
|
|||
printf("~ udpecho ~\n");
|
||||
|
||||
int opt, udp_sock, verbose = 0;
|
||||
char *port = NULL;
|
||||
char *port = NULL, *bindhost = NULL;
|
||||
struct evt_core_ctx evts = {0};
|
||||
|
||||
// 1. Parse parameters
|
||||
while ((opt = getopt(argc, argv, "p:v")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "b:p:v")) != -1) {
|
||||
switch(opt) {
|
||||
case 'v':
|
||||
verbose++;
|
||||
|
@ -46,10 +46,14 @@ int main(int argc, char** argv) {
|
|||
case 'p':
|
||||
port = optarg;
|
||||
break;
|
||||
case 'b':
|
||||
bindhost = optarg;
|
||||
break;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if (bindhost == NULL) bindhost = "127.0.0.1";
|
||||
|
||||
// 2. Register category
|
||||
struct evt_core_cat udp_read = {
|
||||
|
@ -65,7 +69,7 @@ int main(int argc, char** argv) {
|
|||
evt_core_add_cat(&evts, &udp_read);
|
||||
|
||||
// 3. Register UDP socket
|
||||
udp_sock = create_udp_server ("127.0.0.1", port);
|
||||
udp_sock = create_udp_server (bindhost, port);
|
||||
|
||||
char url[1024];
|
||||
struct evt_core_cat cat = {0};
|
||||
|
@ -83,5 +87,5 @@ int main(int argc, char** argv) {
|
|||
|
||||
return 0;
|
||||
usage:
|
||||
fprintf(stderr, "Usage: %s -p <port> [-v]\n", argv[0]);
|
||||
fprintf(stderr, "Usage: %s -p <port> [-v] [-b ip]\n", argv[0]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue