The sdl.ps file needs to be included using the -l
flag, e.g.
dot -Tps -l sdl.ps tcp.dot -o tcp.ps
# Optionally, to convert to png.
gs -q -dBATCH -dNOPAUSE -sDEVICE=png256 -sOutputFile=tcp.png tcp.ps
Whith the following input file (based on half of this fsm)
digraph G {
state_start [shape=sdl_start, peripheries=0, label="Start"];
state_closed [shape=sdl_state, peripheries=0, label="CLOSED"];
state_syn_sent [shape=sdl_state, peripheries=0, label="SYN-SENT"];
state_established [shape=sdl_state, peripheries=0, label="ESTABLISHED"];
state_listen [shape=sdl_state, peripheries=0, label="LISTEN"];
state_syn_received [shape=sdl_state, peripheries=0, label="SYN-RECEIVED"];
input_active_open [shape=sdl_input_from_left, peripheries=0, label="Active open"];
input_passive_open [shape=sdl_input_from_left, peripheries=0, label="Passive open"];
input_syn [shape=sdl_input_from_left, peripheries=0, label="SYN"]
input_syn2 [shape=sdl_input_from_left, peripheries=0, label="SYN"]
input_syn_ack [shape=sdl_input_from_left, peripheries=0, label="SYN-ACK"]
input_ack [shape=sdl_input_from_left, peripheries=0, label="ACK"]
output_syn [shape=sdl_output_to_right, peripheries=0, label="SYN"]
output_syn_ack [shape=sdl_output_to_right, peripheries=0, label="SYN-ACK"]
output_ack [shape=sdl_output_to_right, peripheries=0, label="ACK"]
output_ack2 [shape=sdl_output_to_right, peripheries=0, label="ACK"]
state_start -> state_closed;
state_closed -> input_active_open;
input_active_open -> output_syn;
output_syn -> state_syn_sent;
state_syn_sent -> input_syn_ack;
input_syn_ack -> output_ack;
output_ack -> state_established;
state_closed -> input_passive_open;
input_passive_open -> state_listen;
state_listen -> input_syn;
input_syn -> output_syn_ack;
output_syn_ack -> state_syn_received;
state_syn_received -> input_ack;
input_ack -> state_established;
state_syn_sent -> input_syn2;
input_syn2 -> output_ack2;
output_ack2 -> state_syn_received;
}
the commands above generate the following output:
