sverweij/mscgen_js

View on GitHub
src/samples/sample05_smtp.mscin

Summary

Maintainability
Test Coverage
# typical SMTP conversation example - 
# source: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
msc {
  # options
  hscale="1.8";

  # entities
  c [label="Client"],
  s [label="Server", arclinecolor="green", arctextcolor="green",
     linecolor="green"];

  # arcs
  s -> c [label="220 smtp.example.com ESMTP Postfix"];
  c -> s [label="HELO relay.example.org"];
  s >> c [label="250 Hello relay.example.org, I am glad to meet you"];
  c -> s [label="MAIL FROM:<bob@example.org>"];
  s >> c [label="250 Ok"];
  c -> s [label="RCPT TO:<alice@example.com>"];
  s >> c [label="250 Ok"];
  c -> s [label="DATA"];
  s >> c [label="354 End data with <CR><LF>.<CR><LF>"];
  c -> s [label="(mail message)"];
  ... [label="(more message body)"];
  
  |||;
  s >> c [label="250 Ok: queued as 12345"];
  c -> s [label="QUIT"];
  s >> c [label="221 Bye"];
  s -> s [label="close connection"];
}