From ec459dcbded2c99fbc5ff10450d4d95c895ae9a7 Mon Sep 17 00:00:00 2001 From: ccremers Date: Fri, 23 Apr 2004 14:11:51 +0000 Subject: [PATCH] - Added the names of the involved protocols to the attack output. --- src/latex.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/latex.c b/src/latex.c index 10bb807..9f2f924 100644 --- a/src/latex.c +++ b/src/latex.c @@ -228,12 +228,14 @@ latexTimers (const System sys) } void -latexMSCStart () +latexMSCStart (Termlist protocolnames) { if (landscape) printf ("\\begin{landscape}\n"); - printf ("\\begin{msc}{attack}\n"); + printf ("\\begin{msc}{attack on $"); + termlistPrint(protocolnames); + printf ("$}\n"); } void @@ -787,13 +789,34 @@ attackDisplayLatex (System sys) } } - latexMSCStart (); + /* create title */ + + Termlist protocolnames = NULL; + Term pname; + for (i = 0; i < width; i++) + { + if (runPosition[i] > 0) + { + pname = sys->runs[i].protocol->nameterm; + if (!inTermlist(protocolnames, pname)) + { + protocolnames = termlistAppend(protocolnames, pname); + } + } + } + latexMSCStart (protocolnames); + termlistDelete (protocolnames); + + /* declare instances */ + for (i = 0; i < width; i++) { if (runPosition[i] > 0) latexDeclInst (sys, i); } + /* print the events in the attack */ + //for (j=-1; j<=sys->step; j++) position = 0; cKnowledge = 0;