diff --git a/diags/.gitignore b/diags/.gitignore new file mode 100644 index 0000000..e33609d --- /dev/null +++ b/diags/.gitignore @@ -0,0 +1 @@ +*.png diff --git a/diags/graph-this.sh b/diags/graph-this.sh new file mode 100755 index 0000000..14a4e2b --- /dev/null +++ b/diags/graph-this.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +if [ "$FONT" = "" ] +then + FONT=/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf +fi + +echo "font : $FONT" + +for i in *\.diag +do + PNG=$(echo ${i} | sed "s/diag$/pdf/") + + if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ] + then + + echo seqdiag ${i} + seqdiag -Tpdf -a -f $FONT ${i} + + echo touch ${PNG} + touch ${PNG} + fi +done + +# PKTDIAG=pktdiag +# for i in *\.$PKTDIAG +# do +# PNG=$(echo ${i} | sed "s/$PKTDIAG$/pdf/") +# +# if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ] +# then +# +# echo seqdiag ${i} +# packetdiag -Tpdf -a -f $FONT ${i} +# +# echo touch ${PNG} +# touch ${PNG} +# fi +# done +# +# GDOT="gviz-dot" +# for i in *\.$GDOT +# do +# PDF=$(echo ${i} | sed "s/$GDOT$/pdf/") +# +# if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ] +# then +# +# echo dot ${i} +# dot -Tpdf ${i} > ${PDF} +# +# echo touch ${PDF} +# touch ${PDF} +# fi +# done diff --git a/diags/remoted.diag b/diags/remoted.diag new file mode 100644 index 0000000..eed66c8 --- /dev/null +++ b/diags/remoted.diag @@ -0,0 +1,23 @@ +diagram { + edge_length = 300; + default_fontsize = 13; // default value is 11 + span_height = 10; // default value is 40 + activation = none; + + // Numbering edges automaticaly + autonumber = True; + + // Change note color + default_note_color = lightblue; + + + client; remoted; transportd; service; + + client -> remoted [label = "service-name"]; + client -> remoted [label = "REMOTED_VAR=URI"]; + client -> remoted [label = "END"]; + remoted -> transportd [label = "connect URI"]; + transportd -> remoted [label = "socket"]; + remoted -> client [label = "socket"]; + client -> service [label = "connection"]; +} diff --git a/diags/remoted.pdf b/diags/remoted.pdf new file mode 100644 index 0000000..e91f579 Binary files /dev/null and b/diags/remoted.pdf differ diff --git a/remote/app/README.md b/remote/app/README.md index f89adbf..5ad5f47 100644 --- a/remote/app/README.md +++ b/remote/app/README.md @@ -7,6 +7,38 @@ This service creates a path on the relevent remote location, going through anyth * authorizations * code the -d option +# Connection + +Client -> Remoted: service to contact (ex: pongd) + + format: [u8 (action); u16 (length); XXX (options)] + +Client -> Remoted: action (connect|listen) + options + + format: [u8 (action); u16 (length); XXX (options)] + + example 1: action = connect => options = uri (ex: udp://example.com:5000) + format: [u8 (1); u16 (22); udp://example.com:5000] + + example 2: action = listen => options = uri (ex: tcp://localhost:9000) + format: [u8 (2); u16 (20); tcp://localhost:9000] + +(optional) Client -> Remoted: options (environement variables) + + example: action = options => option = VAR=X + format: [u8 (4); u16 (20); VAR=X] + + The client sends all options this way, one at a time. + This sequence of messages is ended with the following message. + +Client -> Remoted: END + + format: [u8 (5)] + +Remoted -> Client: unix socket + +In the case the application has environement variables to pass to the remoted service, + ### authorizations The idea is to have a simple configuration file for authentication of remote connections, such as: diff --git a/remote/app/remotec.c b/remote/app/remotec.c index ff28d5e..46c2e22 100644 --- a/remote/app/remotec.c +++ b/remote/app/remotec.c @@ -8,6 +8,20 @@ #include #include +/** + * remoted test application + * + * this application can: + * listen, given an URI (including a transport layer and eventually a port) + * connect to a remote service through a tunnel + * the remote service used for testing is pongd + * + * TODO: this test application is a work in progress + * currently, this application will: + * connect itself to the remoted service + * hang up the connection with the remoted service + */ + void usage (char **argv) { printf ( "usage: %s uri service\n", argv[0]); } @@ -58,8 +72,7 @@ void main_loop (int argc, char **argv, char **env memset (&srv, 0, sizeof (struct service)); remotec_connection (argc, argv, env, &srv); - log_debug ("remotec connected"); - log_debug ("remotec main loop"); + log_debug ("remotec connected, entering main loop"); struct remoted_msg msg; memset (&msg, 0, sizeof (struct remoted_msg));