- Started working on coloring of the attack trace in the state space.

This commit is contained in:
ccremers
2004-07-13 09:14:03 +00:00
parent 4b4c934b9c
commit 981f0a92b4
5 changed files with 47 additions and 14 deletions

View File

@@ -491,8 +491,13 @@ attackDisplay (System sys)
}
}
/* state space graph section */
void graphInit (System sys)
/*
*-------------------------------------------
* state space graph section
*-------------------------------------------
*/
void graphInit (const System sys)
{
Termlist tl;
@@ -512,18 +517,23 @@ void graphInit (System sys)
printf ("\"];\n");
}
void graphDone (System sys)
void graphDone (const System sys)
{
/* drawing state space. close up. */
printf ("}\n");
}
void graphNode (System sys)
void graphNode (const System sys)
{
Termlist newtl;
unsigned long int thisNode, parentNode;
/* determine node numbers */
parentNode = sys->traceNode[sys->step - 1];
thisNode = sys->statesLow;
/* add node */
printf ("\tn%li [shape=", sys->statesLow);
printf ("\tn%li [shape=", thisNode);
newtl = knowledgeNew (sys->traceKnow[sys->step-1], sys->traceKnow[sys->step]);
if (newtl != NULL)
@@ -542,7 +552,7 @@ void graphNode (System sys)
printf ("];\n");
/* add edge */
printf ("\tn%li -> n%li ", sys->parentState, sys->statesLow);
printf ("\tn%li -> n%li ", parentNode, thisNode);
/* add label */
printf ("[label=\"");
roledefPrint (sys->traceEvent[sys->step - 1]);
@@ -557,3 +567,15 @@ void graphNode (System sys)
printf ("]");
printf (";\n");
}
void graphPath (const System sys, const char* params)
{
int i;
i = 0;
while (i < sys->step)
{
printf ("\tn%i [%s]\n", sys->traceNode[i], params);
i++;
}
}