From 2487bd6ad95ce487d55cd8af7004063f18b74149 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sun, 10 Sep 2017 00:30:45 +0200 Subject: [PATCH] readme + filename convention for diags --- diags/README.md | 8 ++ diags/graph-this.sh | 5 +- ...ed_end.pktdiag => pkt-remoted_end.pktdiag} | 26 +++--- ..._init.pktdiag => pkt-remoted_init.pktdiag} | 26 +++--- ...ns.pktdiag => pkt-remoted_options.pktdiag} | 26 +++--- diags/{remoted.diag => seq-remoted.diag} | 76 ++++++++--------- remote/app/README.md | 82 ++++++------------- 7 files changed, 113 insertions(+), 136 deletions(-) create mode 100644 diags/README.md rename diags/{remoted_end.pktdiag => pkt-remoted_end.pktdiag} (96%) rename diags/{remoted_init.pktdiag => pkt-remoted_init.pktdiag} (96%) rename diags/{remoted_options.pktdiag => pkt-remoted_options.pktdiag} (96%) rename diags/{remoted.diag => seq-remoted.diag} (97%) diff --git a/diags/README.md b/diags/README.md new file mode 100644 index 0000000..c8f1549 --- /dev/null +++ b/diags/README.md @@ -0,0 +1,8 @@ +# writing convention + +Each diagram filename should be formatted as: + + seq-service.diag: message sequence diagram + pkt-service-info.pktdiag: message format + +See the currently available files as examples. diff --git a/diags/graph-this.sh b/diags/graph-this.sh index f0406c1..8f0a524 100755 --- a/diags/graph-this.sh +++ b/diags/graph-this.sh @@ -7,9 +7,10 @@ fi echo "font : $FONT" -for i in *\.diag +DIAG=diag +for i in *\.$DIAG do - PNG=$(echo ${i} | sed "s/diag$/pdf/") + PNG=$(echo ${i} | sed "s/$DIAG$/pdf/") if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ] then diff --git a/diags/remoted_end.pktdiag b/diags/pkt-remoted_end.pktdiag similarity index 96% rename from diags/remoted_end.pktdiag rename to diags/pkt-remoted_end.pktdiag index 365792b..63079de 100644 --- a/diags/remoted_end.pktdiag +++ b/diags/pkt-remoted_end.pktdiag @@ -1,13 +1,13 @@ -packetdiag { - colwidth = 64 - node_height = 60 - node_width = 15 - default_fontsize = 16; // default value is 11 - - // basic header (type then length) - 0-7: type\n1 byte [color = "#CCEECC"] - 8-23: length\n2 bytes [color = "#CCEECC"] - - // payload - 24-63: END\n3 bytes [color = "#CCCCEE"] -} +packetdiag { + colwidth = 64 + node_height = 60 + node_width = 15 + default_fontsize = 16; // default value is 11 + + // basic header (type then length) + 0-7: type\n1 byte [color = "#CCEECC"] + 8-23: length\n2 bytes [color = "#CCEECC"] + + // payload + 24-63: END\n3 bytes [color = "#CCCCEE"] +} diff --git a/diags/remoted_init.pktdiag b/diags/pkt-remoted_init.pktdiag similarity index 96% rename from diags/remoted_init.pktdiag rename to diags/pkt-remoted_init.pktdiag index 0ab28d2..fe1cc53 100644 --- a/diags/remoted_init.pktdiag +++ b/diags/pkt-remoted_init.pktdiag @@ -1,13 +1,13 @@ -packetdiag { - colwidth = 64 - node_height = 60 - node_width = 15 - default_fontsize = 16; // default value is 11 - - // basic header (type then length) - 0-7: type\n1 byte [color = "#CCEECC"] - 8-23: length\n2 bytes [color = "#CCEECC"] - - // payload - 24-63: service name\nn bytes [color = "#CCCCEE"] -} +packetdiag { + colwidth = 64 + node_height = 60 + node_width = 15 + default_fontsize = 16; // default value is 11 + + // basic header (type then length) + 0-7: type\n1 byte [color = "#CCEECC"] + 8-23: length\n2 bytes [color = "#CCEECC"] + + // payload + 24-63: service name\nn bytes [color = "#CCCCEE"] +} diff --git a/diags/remoted_options.pktdiag b/diags/pkt-remoted_options.pktdiag similarity index 96% rename from diags/remoted_options.pktdiag rename to diags/pkt-remoted_options.pktdiag index 8fd8058..ff34ca1 100644 --- a/diags/remoted_options.pktdiag +++ b/diags/pkt-remoted_options.pktdiag @@ -1,13 +1,13 @@ -packetdiag { - colwidth = 64 - node_height = 60 - node_width = 15 - default_fontsize = 16; // default value is 11 - - // basic header (type then length) - 0-7: type\n1 byte [color = "#CCEECC"] - 8-23: length\n2 bytes [color = "#CCEECC"] - - // payload - 24-63: environment variable (one per packet)\nex: REMOTED_URI=tcp://user:pass@host.example.com:9000\nn bytes [color = "#CCCCEE"] -} +packetdiag { + colwidth = 64 + node_height = 60 + node_width = 15 + default_fontsize = 16; // default value is 11 + + // basic header (type then length) + 0-7: type\n1 byte [color = "#CCEECC"] + 8-23: length\n2 bytes [color = "#CCEECC"] + + // payload + 24-63: environment variable (one per packet)\nex: REMOTED_URI=tcp://user:pass@host.example.com:9000\nn bytes [color = "#CCCCEE"] +} diff --git a/diags/remoted.diag b/diags/seq-remoted.diag similarity index 97% rename from diags/remoted.diag rename to diags/seq-remoted.diag index aa11602..9a1a952 100644 --- a/diags/remoted.diag +++ b/diags/seq-remoted.diag @@ -1,38 +1,38 @@ -diagram { - edge_length = 300; - default_fontsize = 16; // default value is 11 - span_height = 8; // default value is 40 - node_height = 60; // default value is 40 - activation = none; - - // Numbering edges automaticaly - autonumber = True; - - // Change note color - default_note_color = lightblue; - - - client [label = "client\nlocal"]; - remoted [label = "remoted\nlocal"]; - transportd [label = "transportd\n(ex: tcpd)\nlocal"]; - transportd2 [label = "transportd\n(ex: tcpd)\nremote"]; - remoted2 [label = "remoted\nremote"]; - service [label = "service\nremote"]; - - client -> remoted [label = "service-name (ex: pongd)"]; - client -> remoted [label = "REMOTED_VAR=URI - ex: tcp://user:password@example.com:9000", fontsize=13]; - client -> remoted [label = "END (mark the end of the options)" - , rightnote = "Remoted: authenticates, authorizes, determines the right transport daemon and - applies forwarding rules", fontsize=13]; - remoted -> transportd [label = "connect URI + service name"]; - transportd -> transportd2 [label = "connection init - service name + URI"]; - transportd2 -> remoted2 [label = "connection request - service name + URI"]; - remoted2 -> transportd2 [label = "authorization (yes|no)"]; - transportd2 -> transportd [label = "connection established"]; - transportd -> remoted [label = "socket"]; - remoted -> client [label = "socket"]; - client -> service [label = "connection"]; -} +diagram { + edge_length = 300; + default_fontsize = 16; // default value is 11 + span_height = 8; // default value is 40 + node_height = 60; // default value is 40 + activation = none; + + // Numbering edges automaticaly + autonumber = True; + + // Change note color + default_note_color = lightblue; + + + client [label = "client\nlocal"]; + remoted [label = "remoted\nlocal"]; + transportd [label = "transportd\n(ex: tcpd)\nlocal"]; + transportd2 [label = "transportd\n(ex: tcpd)\nremote"]; + remoted2 [label = "remoted\nremote"]; + service [label = "service\nremote"]; + + client -> remoted [label = "service-name (ex: pongd)"]; + client -> remoted [label = "REMOTED_VAR=URI + ex: tcp://user:password@example.com:9000", fontsize=13]; + client -> remoted [label = "END (mark the end of the options)" + , rightnote = "Remoted: authenticates, authorizes, determines the right transport daemon and + applies forwarding rules", fontsize=13]; + remoted -> transportd [label = "connect URI + service name"]; + transportd -> transportd2 [label = "connection init + service name + URI"]; + transportd2 -> remoted2 [label = "connection request + service name + URI"]; + remoted2 -> transportd2 [label = "authorization (yes|no)"]; + transportd2 -> transportd [label = "connection established"]; + transportd -> remoted [label = "socket"]; + remoted -> client [label = "socket"]; + client -> service [label = "connection"]; +} diff --git a/remote/app/README.md b/remote/app/README.md index 5ad5f47..ad860d4 100644 --- a/remote/app/README.md +++ b/remote/app/README.md @@ -1,57 +1,25 @@ -# remoted - -This service creates a path on the relevent remote location, going through anything network-related: TCP, UDP, HTTP, ... - -# TODO - -* 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: - - table dynusers # dynamic user table - - clients = { "client123", alice.example.com, john@doe.com } - localclients = { pamuser1, } - - level1services = { pongd, weather } - - ifext = enp0s25 - pass in on $ifext from any for all to local services $level1services - pass out on $ifext from local for $localclients to any services $level1services - - block all +# remoted + +This service creates a path on the relevent remote location, going through anything network-related: TCP, UDP, HTTP, ... + +# TODO + +* authorizations +* code the -d option + +### authorizations + +The idea is to have a simple configuration file for authentication of remote connections, such as: + + table dynusers # dynamic user table + + clients = { "client123", alice.example.com, john@doe.com } + localclients = { pamuser1, } + + level1services = { pongd, weather } + + ifext = enp0s25 + pass in on $ifext from any for all to local services $level1services + pass out on $ifext from local for $localclients to any services $level1services + + block all