- Some reindentation. Nothing interesting, just syntax.
This commit is contained in:
parent
e21627442a
commit
4023ef237e
13
src/cost.c
13
src/cost.c
@ -12,7 +12,8 @@
|
|||||||
// Private methods
|
// Private methods
|
||||||
//************************************************************************
|
//************************************************************************
|
||||||
|
|
||||||
int selfInitiator(const System sys, const int run)
|
int
|
||||||
|
selfInitiator (const System sys, const int run)
|
||||||
{
|
{
|
||||||
int self_initiator;
|
int self_initiator;
|
||||||
|
|
||||||
@ -47,7 +48,8 @@ int selfInitiator(const System sys, const int run)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Count the number of any self-initiators
|
//! Count the number of any self-initiators
|
||||||
int selfInitiators(const System sys)
|
int
|
||||||
|
selfInitiators (const System sys)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
int run;
|
int run;
|
||||||
@ -77,14 +79,15 @@ int selfInitiators(const System sys)
|
|||||||
*
|
*
|
||||||
* A lower value (closer to 0) is a more feasible attack.
|
* A lower value (closer to 0) is a more feasible attack.
|
||||||
*/
|
*/
|
||||||
int attackCost(const System sys)
|
int
|
||||||
|
attackCost (const System sys)
|
||||||
{
|
{
|
||||||
int cost;
|
int cost;
|
||||||
|
|
||||||
cost = 0;
|
cost = 0;
|
||||||
|
|
||||||
cost += get_semitrace_length();
|
cost += get_semitrace_length ();
|
||||||
cost += 5 * selfInitiators(sys);
|
cost += 5 * selfInitiators (sys);
|
||||||
|
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef COST
|
#ifndef COST
|
||||||
#define COST
|
#define COST
|
||||||
|
|
||||||
int attackCost(const System sys);
|
int attackCost (const System sys);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
12
src/dotout.c
12
src/dotout.c
@ -7,8 +7,8 @@ extern int *graph;
|
|||||||
extern int nodes;
|
extern int nodes;
|
||||||
extern int graph_uordblks;
|
extern int graph_uordblks;
|
||||||
|
|
||||||
extern Protocol INTRUDER; // Pointers, to be set by the Init of arachne.c
|
extern Protocol INTRUDER; // Pointers, to be set by the Init of arachne.c
|
||||||
extern Role I_M; // Same here.
|
extern Role I_M; // Same here.
|
||||||
extern Role I_RRS;
|
extern Role I_RRS;
|
||||||
extern Role I_RRSD;
|
extern Role I_RRSD;
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ dotSemiState (const System sys)
|
|||||||
termPrint (sys->current_claim->type);
|
termPrint (sys->current_claim->type);
|
||||||
eprintf ("\";\n");
|
eprintf ("\";\n");
|
||||||
|
|
||||||
from_intruder_count = 0; // number of terms that can come from the initial knowledge
|
from_intruder_count = 0; // number of terms that can come from the initial knowledge
|
||||||
|
|
||||||
// Needed for the bindings later on: create graph
|
// Needed for the bindings later on: create graph
|
||||||
goal_graph_create (); // create graph
|
goal_graph_create (); // create graph
|
||||||
@ -333,7 +333,7 @@ dotSemiState (const System sys)
|
|||||||
if (false && incoming_arrow_count == 0)
|
if (false && incoming_arrow_count == 0)
|
||||||
{
|
{
|
||||||
// No incoming arrows: can be generated from initial intruder knowledge
|
// No incoming arrows: can be generated from initial intruder knowledge
|
||||||
|
|
||||||
from_intruder_count++;
|
from_intruder_count++;
|
||||||
eprintf ("\tintruder -> ");
|
eprintf ("\tintruder -> ");
|
||||||
node (run, ev);
|
node (run, ev);
|
||||||
@ -349,7 +349,8 @@ dotSemiState (const System sys)
|
|||||||
// Third, the intruder node (if needed)
|
// Third, the intruder node (if needed)
|
||||||
if (from_intruder_count > 0)
|
if (from_intruder_count > 0)
|
||||||
{
|
{
|
||||||
eprintf ("\tintruder [label=\"Initial intruder knowledge\", color=red];\n");
|
eprintf
|
||||||
|
("\tintruder [label=\"Initial intruder knowledge\", color=red];\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fourth, all ranking info
|
// Fourth, all ranking info
|
||||||
@ -413,4 +414,3 @@ dotSemiState (const System sys)
|
|||||||
// close graph
|
// close graph
|
||||||
eprintf ("};\n\n");
|
eprintf ("};\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,7 +609,7 @@ graphNode (const System sys)
|
|||||||
// Print step
|
// Print step
|
||||||
printf ("%i:", sys->runs[run].step - 1);
|
printf ("%i:", sys->runs[run].step - 1);
|
||||||
|
|
||||||
if (rd->type == CLAIM && (!isRunTrusted(sys,run)))
|
if (rd->type == CLAIM && (!isRunTrusted (sys, run)))
|
||||||
{
|
{
|
||||||
printf ("Skip claim in #%i\"", run);
|
printf ("Skip claim in #%i\"", run);
|
||||||
}
|
}
|
||||||
|
@ -938,7 +938,7 @@ termlistMinusTermlist (const Termlist tlbig, const Termlist tlsmall)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This item will remain in the list.
|
// This item will remain in the list.
|
||||||
tl = tl->next;
|
tl = tl->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tlnewstart;
|
return tlnewstart;
|
||||||
|
Loading…
Reference in New Issue
Block a user