diff --git a/.gitignore b/.gitignore index 046e229..d1e78f0 100644 --- a/.gitignore +++ b/.gitignore @@ -58,7 +58,5 @@ target/ /twistd.pid /relay.sqlite /misc/node_modules/ -/docs/events.png -/docs/states-code.png -/docs/*.png /.automat_visualize/ +/docs/state-machines/*.png diff --git a/docs/_events.dot b/docs/_events.dot deleted file mode 100644 index ca1710d..0000000 --- a/docs/_events.dot +++ /dev/null @@ -1,98 +0,0 @@ -digraph { - /*rankdir=LR*/ - api_get_code [label="get_code" shape="hexagon" color="red"] - api_input_code [label="input_code" shape="hexagon" color="red"] - api_set_code [label="set_code" shape="hexagon" color="red"] - verify [label="verify" shape="hexagon" color="red"] - send [label="API\nsend" shape="hexagon" color="red"] - get [label="API\nget" shape="hexagon" color="red"] - close [label="API\nclose" shape="hexagon" color="red"] - - event_connected [label="connected" shape="box"] - event_learned_code [label="learned\ncode" shape="box"] - event_learned_nameplate [label="learned\nnameplate" shape="box"] - event_received_mailbox [label="received\nmailbox" shape="box"] - event_opened_mailbox [label="opened\nmailbox" shape="box"] - event_built_msg1 [label="built\nmsg1" shape="box"] - event_mailbox_used [label="mailbox\nused" shape="box"] - event_learned_PAKE [label="learned\nmsg2" shape="box"] - event_established_key [label="established\nkey" shape="box"] - event_computed_verifier [label="computed\nverifier" shape="box"] - event_received_confirm [label="received\nconfirm" shape="box"] - event_received_message [label="received\nmessage" shape="box"] - event_received_released [label="ack\nreleased" shape="box"] - event_received_closed [label="ack\nclosed" shape="box"] - - event_connected -> api_get_code - event_connected -> api_input_code - api_get_code -> event_learned_code - api_input_code -> event_learned_code - api_set_code -> event_learned_code - - - maybe_build_msg1 [label="build\nmsg1"] - maybe_claim_nameplate [label="claim\nnameplate"] - maybe_send_pake [label="send\npake"] - maybe_send_phase_messages [label="send\nphase\nmessages"] - - event_connected -> maybe_claim_nameplate - event_connected -> maybe_send_pake - - event_built_msg1 -> maybe_send_pake - - event_learned_code -> maybe_build_msg1 - event_learned_code -> event_learned_nameplate - - maybe_build_msg1 -> event_built_msg1 - event_learned_nameplate -> maybe_claim_nameplate - maybe_claim_nameplate -> event_received_mailbox [style="dashed"] - - event_received_mailbox -> event_opened_mailbox - maybe_claim_nameplate -> event_learned_PAKE [style="dashed"] - maybe_claim_nameplate -> event_received_confirm [style="dashed"] - - event_opened_mailbox -> event_learned_PAKE [style="dashed"] - event_learned_PAKE -> event_mailbox_used [style="dashed"] - event_learned_PAKE -> event_received_confirm [style="dashed"] - event_received_confirm -> event_received_message [style="dashed"] - - send -> maybe_send_phase_messages - release_nameplate [label="release\nnameplate"] - event_mailbox_used -> release_nameplate - event_opened_mailbox -> maybe_send_pake - event_opened_mailbox -> maybe_send_phase_messages - - event_learned_PAKE -> event_established_key - event_established_key -> event_computed_verifier - event_established_key -> check_confirmation - event_established_key -> maybe_send_phase_messages - - check_confirmation [label="check\nconfirmation"] - event_received_confirm -> check_confirmation - - notify_verifier [label="notify\nverifier"] - check_confirmation -> notify_verifier - verify -> notify_verifier - event_computed_verifier -> notify_verifier - - check_confirmation -> error - event_received_message -> error - event_received_message -> get - event_established_key -> get - - close -> close_mailbox - close -> release_nameplate - error [label="signal\nerror"] - error -> close_mailbox - error -> release_nameplate - - release_nameplate -> event_received_released [style="dashed"] - close_mailbox [label="close\nmailbox"] - close_mailbox -> event_received_closed [style="dashed"] - - maybe_close_websocket [label="close\nwebsocket"] - event_received_released -> maybe_close_websocket - event_received_closed -> maybe_close_websocket - maybe_close_websocket -> event_websocket_closed [style="dashed"] - event_websocket_closed [label="websocket\nclosed"] -} diff --git a/docs/_states-code.dot b/docs/_states-code.dot deleted file mode 100644 index c32bca2..0000000 --- a/docs/_states-code.dot +++ /dev/null @@ -1,18 +0,0 @@ -/* this state machine is just about the code */ - -digraph { - need_code [label="need\ncode"] - asking_for_code [label="asking\nuser\nfor\ncode"] - creating_code [label="allocating\nnameplate"] - creating_code2 [label="generating\nsecret"] - know_code - - need_code -> know_code [label="set_code()"] - - need_code -> asking_for_code [label="input_code()"] - asking_for_code -> know_code [label="user typed code"] - - need_code -> creating_code [label="get_code()"] - creating_code -> creating_code2 [label="rx allocation"] - creating_code2 -> know_code [label="generated secret"] -} diff --git a/docs/state-machines/Makefile b/docs/state-machines/Makefile new file mode 100644 index 0000000..d9c6ab1 --- /dev/null +++ b/docs/state-machines/Makefile @@ -0,0 +1,9 @@ + +default: images + +images: boss.png code.png key.png machines.png mailbox.png nameplate.png nameplate_lister.png order.png receive.png send.png terminator.png + +.PHONY: default images + +%.png: %.dot + dot -T png $< >$@ diff --git a/docs/_connection.dot b/docs/state-machines/_connection.dot similarity index 100% rename from docs/_connection.dot rename to docs/state-machines/_connection.dot diff --git a/docs/boss.dot b/docs/state-machines/boss.dot similarity index 100% rename from docs/boss.dot rename to docs/state-machines/boss.dot diff --git a/docs/code.dot b/docs/state-machines/code.dot similarity index 100% rename from docs/code.dot rename to docs/state-machines/code.dot diff --git a/docs/key.dot b/docs/state-machines/key.dot similarity index 100% rename from docs/key.dot rename to docs/state-machines/key.dot diff --git a/docs/machines.dot b/docs/state-machines/machines.dot similarity index 100% rename from docs/machines.dot rename to docs/state-machines/machines.dot diff --git a/docs/mailbox.dot b/docs/state-machines/mailbox.dot similarity index 100% rename from docs/mailbox.dot rename to docs/state-machines/mailbox.dot diff --git a/docs/nameplate.dot b/docs/state-machines/nameplate.dot similarity index 100% rename from docs/nameplate.dot rename to docs/state-machines/nameplate.dot diff --git a/docs/nameplate_lister.dot b/docs/state-machines/nameplate_lister.dot similarity index 100% rename from docs/nameplate_lister.dot rename to docs/state-machines/nameplate_lister.dot diff --git a/docs/order.dot b/docs/state-machines/order.dot similarity index 100% rename from docs/order.dot rename to docs/state-machines/order.dot diff --git a/docs/receive.dot b/docs/state-machines/receive.dot similarity index 100% rename from docs/receive.dot rename to docs/state-machines/receive.dot diff --git a/docs/send.dot b/docs/state-machines/send.dot similarity index 100% rename from docs/send.dot rename to docs/state-machines/send.dot diff --git a/docs/terminator.dot b/docs/state-machines/terminator.dot similarity index 100% rename from docs/terminator.dot rename to docs/state-machines/terminator.dot