/************ ** ** Old arpha-net protocol simulator ** ** ** ** "@(#)alpha.m 1.1 - 96/01/05" **************/ #include #include #include #define N 10 #define MAX_CLOCK "1000" #define MAX_DELAY 10000 #define LOAD 20 #define SEND_TABLE 300 #define INPUT_FILE "topology" /* #define MAXINT 2147483647 #define CONS #define DEBUG */ struct table { int router[N]; int send_to[N]; int delay[N]; }; entity driver {int argc, char **argv} { int i, j, input; int so, de, time; FILE *fp; int map[N][N], endsim; ename routers[N], comps[N]; message ready {} ready; if (argc == 2) maxclock(argv[1]); else maxclock(MAX_CLOCK); if ((fp = fopen (INPUT_FILE, "r")) == NULL) fputs("error opening the input file\n",stderr); /* read in the network topology */ for (i=0; i