graph
This commit is contained in:
parent
0950618bac
commit
b5d400ec10
1
diags/.gitignore
vendored
Normal file
1
diags/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.png
|
55
diags/graph-this.sh
Executable file
55
diags/graph-this.sh
Executable file
@ -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
|
23
diags/remoted.diag
Normal file
23
diags/remoted.diag
Normal file
@ -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"];
|
||||||
|
}
|
BIN
diags/remoted.pdf
Normal file
BIN
diags/remoted.pdf
Normal file
Binary file not shown.
@ -7,6 +7,38 @@ This service creates a path on the relevent remote location, going through anyth
|
|||||||
* authorizations
|
* authorizations
|
||||||
* code the -d option
|
* 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
|
### authorizations
|
||||||
|
|
||||||
The idea is to have a simple configuration file for authentication of remote connections, such as:
|
The idea is to have a simple configuration file for authentication of remote connections, such as:
|
||||||
|
@ -8,6 +8,20 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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) {
|
void usage (char **argv) {
|
||||||
printf ( "usage: %s uri service\n", argv[0]);
|
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));
|
memset (&srv, 0, sizeof (struct service));
|
||||||
|
|
||||||
remotec_connection (argc, argv, env, &srv);
|
remotec_connection (argc, argv, env, &srv);
|
||||||
log_debug ("remotec connected");
|
log_debug ("remotec connected, entering main loop");
|
||||||
log_debug ("remotec main loop");
|
|
||||||
|
|
||||||
struct remoted_msg msg;
|
struct remoted_msg msg;
|
||||||
memset (&msg, 0, sizeof (struct remoted_msg));
|
memset (&msg, 0, sizeof (struct remoted_msg));
|
||||||
|
Reference in New Issue
Block a user