Obsolete
/
libipc-old
Archived
3
0
Fork 0
more_to_read
Philippe PITTOLI 2017-08-28 23:51:44 +02:00
parent 0950618bac
commit b5d400ec10
6 changed files with 126 additions and 2 deletions

1
diags/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.png

55
diags/graph-this.sh Executable file
View 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
View 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

Binary file not shown.

View File

@ -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:

View File

@ -8,6 +8,20 @@
#include <pthread.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) {
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));