magic-wormhole/docs/state-machines/machines.dot
Brian Warner 34686a346a add dilation code
(this compresses several months of false starts and rearchitecting)
2018-12-23 15:21:08 -05:00

120 lines
6.1 KiB
Plaintext

digraph {
Wormhole [shape="oval" color="blue" fontcolor="blue"]
Boss [shape="box" label="Boss\n(manager)"
color="blue" fontcolor="blue"]
Nameplate [label="Nameplate\n(claimer)"
shape="box" color="blue" fontcolor="blue"]
Mailbox [label="Mailbox\n(opener)"
shape="box" color="blue" fontcolor="blue"]
Connection [label="Rendezvous\nConnector"
shape="oval" color="blue" fontcolor="blue"]
#websocket [color="blue" fontcolor="blue"]
Order [shape="box" label="Ordering" color="blue" fontcolor="blue"]
Key [shape="box" label="Key" color="blue" fontcolor="blue"]
Send [shape="box" label="Send" color="blue" fontcolor="blue"]
Receive [shape="box" label="Receive" color="blue" fontcolor="blue"]
Code [shape="box" label="Code" color="blue" fontcolor="blue"]
Lister [shape="box" label="(nameplate)\nLister"
color="blue" fontcolor="blue"]
Allocator [shape="box" label="(nameplate)\nAllocator"
color="blue" fontcolor="blue"]
Input [shape="box" label="(interactive\ncode)\nInput"
color="blue" fontcolor="blue"]
Terminator [shape="box" color="blue" fontcolor="blue"]
InputHelperAPI [shape="oval" label="input\nhelper\nAPI"
color="blue" fontcolor="blue"]
Dilator [shape="box" label="Dilator" color="blue" fontcolor="blue"]
#Connection -> websocket [color="blue"]
#Connection -> Order [color="blue"]
Wormhole -> Boss [style="dashed"
label="allocate_code\ninput_code\nset_code\ndilate\nsend\nclose\n(once)"
color="red" fontcolor="red"]
#Wormhole -> Boss [color="blue"]
Boss -> Wormhole [style="dashed" label="got_code\ngot_key\ngot_verifier\ngot_version\nreceived (seq)\nclosed\n(once)"]
#Boss -> Connection [color="blue"]
Boss -> Connection [style="dashed" label="start"
color="red" fontcolor="red"]
Connection -> Boss [style="dashed" label="rx_welcome\nrx_error\nerror"]
Boss -> Send [style="dashed" color="red" fontcolor="red" label="send"]
#Boss -> Mailbox [color="blue"]
Mailbox -> Order [style="dashed" label="got_message (once)"]
Key -> Boss [style="dashed" label="got_key\nscared"]
Order -> Key [style="dashed" label="got_pake"]
Order -> Receive [style="dashed" label="got_message"]
#Boss -> Key [color="blue"]
Key -> Mailbox [style="dashed"
label="add_message (pake)\nadd_message (version)"]
Receive -> Send [style="dashed" label="got_verified_key"]
Send -> Mailbox [style="dashed" color="red" fontcolor="red"
label="add_message (phase)"]
Key -> Receive [style="dashed" label="got_key"]
Receive -> Boss [style="dashed"
label="happy\nscared\ngot_verifier\ngot_message"]
Nameplate -> Connection [style="dashed"
label="tx_claim\ntx_release"]
Connection -> Nameplate [style="dashed"
label="connected\nlost\nrx_claimed\nrx_released"]
Mailbox -> Nameplate [style="dashed" label="release"]
Nameplate -> Mailbox [style="dashed" label="got_mailbox"]
Nameplate -> Input [style="dashed" label="got_wordlist"]
Mailbox -> Connection [style="dashed" color="red" fontcolor="red"
label="tx_open\ntx_add\ntx_close"
]
Connection -> Mailbox [style="dashed"
label="connected\nlost\nrx_message\nrx_closed"]
Connection -> Lister [style="dashed"
label="connected\nlost\nrx_nameplates"
]
Lister -> Connection [style="dashed"
label="tx_list"
]
#Boss -> Code [color="blue"]
Connection -> Allocator [style="dashed"
label="connected\nlost\nrx_allocated"]
Allocator -> Connection [style="dashed" color="red" fontcolor="red"
label="tx_allocate"
]
Lister -> Input [style="dashed"
label="got_nameplates"
]
#Code -> Lister [color="blue"]
Input -> Lister [style="dashed" color="red" fontcolor="red"
label="refresh"
]
Boss -> Code [style="dashed" color="red" fontcolor="red"
label="allocate_code\ninput_code\nset_code"]
Code -> Boss [style="dashed" label="got_code"]
Code -> Key [style="dashed" label="got_code"]
Code -> Nameplate [style="dashed" label="set_nameplate"]
Code -> Input [style="dashed" color="red" fontcolor="red" label="start"]
Input -> Code [style="dashed" label="got_nameplate\nfinished_input"]
InputHelperAPI -> Input [label="refresh_nameplates\nget_nameplate_completions\nchoose_nameplate\nget_word_completions\nchoose_words" color="orange" fontcolor="orange"]
Code -> Allocator [style="dashed" color="red" fontcolor="red"
label="allocate"]
Allocator -> Code [style="dashed" label="allocated"]
Nameplate -> Terminator [style="dashed" label="nameplate_done"]
Mailbox -> Terminator [style="dashed" label="mailbox_done"]
Terminator -> Nameplate [style="dashed" label="close"]
Terminator -> Mailbox [style="dashed" label="close"]
Terminator -> Connection [style="dashed" label="stop"]
Connection -> Terminator [style="dashed" label="stopped"]
Terminator -> Boss [style="dashed" label="closed\n(once)"]
Boss -> Terminator [style="dashed" color="red" fontcolor="red"
label="close"]
Boss -> Dilator [style="dashed" label="dilate\nreceived_dilate\ngot_wormhole_versions"]
Dilator -> Send [style="dashed" label="send(dilate-N)"]
}