- Improved dot output for Arachne attacks.

This commit is contained in:
ccremers 2004-08-28 11:43:06 +00:00
parent 9d64b837db
commit 2ddd1eee13

View File

@ -666,10 +666,17 @@ dotSemiState ()
int run; int run;
Protocol p; Protocol p;
void node (int run, int index) void node (const int run, const int index)
{
if (sys->runs[run].protocol == INTRUDER)
{
eprintf ("i%i", run);
}
else
{ {
eprintf ("r%ii%i", run, index); eprintf ("r%ii%i", run, index);
} }
}
int binder (void *data) int binder (void *data)
{ {
@ -712,27 +719,40 @@ dotSemiState ()
index = 0; index = 0;
rd = sys->runs[run].start; rd = sys->runs[run].start;
eprintf ("\tsubgraph cluster_run%i {\n", run);
eprintf ("\t\tlabel = \"");
if (sys->runs[run].protocol != INTRUDER) if (sys->runs[run].protocol != INTRUDER)
{ {
// Regular run
eprintf ("\tsubgraph cluster_run%i {\n", run);
eprintf ("\t\tlabel = \"");
eprintf ("run #%i, protocol ", run); eprintf ("run #%i, protocol ", run);
termPrint (sys->runs[run].protocol->nameterm); termPrint (sys->runs[run].protocol->nameterm);
eprintf (", role "); eprintf (", role ");
termPrint (sys->runs[run].role->nameterm); termPrint (sys->runs[run].role->nameterm);
eprintf ("\";\n", run);
if (run == 0)
{
eprintf ("\t\tcolor = red;\n");
} }
else else
{ {
eprintf ("(intruder)");
}
eprintf ("\";\n", run);
eprintf ("\t\tcolor = blue;\n"); eprintf ("\t\tcolor = blue;\n");
}
while (index < sys->runs[run].length) while (index < sys->runs[run].length)
{ {
// Print node itself // Print node itself
eprintf ("\t\t"); eprintf ("\t\t");
node (run, index); node (run, index);
eprintf (" [shape=box,label=\""); eprintf (" [");
if (run == 0 && index == current_claim->ev)
{
eprintf ("shape=doubleoctagon,");
}
else
{
eprintf ("shape=box,");
}
eprintf ("label=\"");
roledefPrint (rd); roledefPrint (rd);
eprintf ("\"]"); eprintf ("\"]");
eprintf (";\n"); eprintf (";\n");
@ -750,6 +770,16 @@ dotSemiState ()
rd = rd->next; rd = rd->next;
} }
eprintf ("\t}\n"); eprintf ("\t}\n");
}
else
{
// INTRUDER run
eprintf ("\t");
node (run, 0);
eprintf (" [label=\"");
termPrint (sys->runs[run].role->nameterm);
eprintf ("\"];\n");
}
run++; run++;
} }