%externalroutine anlog(%string (255) s) %externalroutinespec define(%string(255)s) %externalintegerfnspec smaddr(%integer chan, %integername len) %externalstring (*) %fnspec itos(%integer i,j) %integer i,j,k,l,m,o,p,q,type,ent, tci, tco, tbi, tbo, tpp, node %owninteger conns,info, rec, start, max, gsum, maxt %owninteger free ind = 1 %integerarray n,t,co,ci,bo,bi,pp,cf,sm, icf, ism,ssm,scf(0:127) %integer line,oline %ownintegerarray cou(0:11) %integerarray tab(1:60,1:60) %byteintegerarray nn,tt(1:60) %byteintegerarray nod(1:15, 0:200) %string (6) %array nm(1:60) %switch sw(0:11) %ownintegerarray enta(1:25) %string (255) dates,times,date1,time1,s1,s2 %on 9 %start; -> end; %finish %integerfn index(%integer n) %constbyteintegerarray ni(1:4) = 72, 75, 80, 156 %integer i %if n = 0 %start %if node = 64 %then %result = 9 %else %result = 6 %finish %if n<10 %then %result = n %cycle i = 1, 1, 4 %if ni(i) = n %then %result = 9+i %repeat %result = 15 %end %routine add to matrix(%integer n1, t1, n2, t2) %integer i, j, nind, tind, x, y nind = index(n1) %if n1 = 0 %then n1 = nind x = nod(nind, t1) %if x = 0 %start x = free ind; free ind = free ind+1 %if free ind > 61 %start out: select output(0); printstring("too many destinations ! ") select output(2) %return %finish nod(nind, t1) = x nn(x)=n1; tt(x) = t1 %finish nind = index(n2) %if n2 = 0 %then n2 = nind y = nod(nind, t2) %if y = 0 %start y = free ind; free ind = free ind+1 %if free ind > 61 %then -> out nod(nind, t2) = y nn(y) = n2; tt(y) = t2 %finish tab(x, y) = tab(x, y)+1 %if tab(x, y)>maxt %then maxt = tab(x, y) %end %routine add figs %integer x, y x = sm(line)-ism(line); x=0 %if x<0 ssm(line) = ssm(line)+x y = cf(line)-icf(line); y=0 %if y<0 scf(line) = scf(line)+y ism(line)=0; icf(line)=0 %end %routine initialise %integer i,len start = smaddr(1, len) max = start+len %end %integerfn nextsym %result = byteinteger(start) %end %routine rsymbol(%integername i) i = byteinteger(start); start = start+1 %end %integerfn stoi(%string(*)%name s) %integer i,sum sum=0 %result=0 %if length(s)=0 %cycle i = 1, 1, length(s) sum = sum*10+(charno(s, i)-'0') %repeat %result = sum %end %routine skiptoend %integer i %cycle rsymbol(i); %return %if i=nl %repeat %end %routine readstr(%string(*) %name s, %integer x) %integer i,j s = ""; gsum = 0 %cycle i = nextsym %return %if i = ' ' %or i = nl %or i='-' s = s.tostring(i) gsum = gsum*10+i-'0' %if x # 0 start=start+1 %repeat %end %string (8) %fn print name(%integer n, t) %constinteger no of names = 55 %conststring (8) %array ns(1:no of names) = %c "TCP A ","TCP C ","TCP D ","TCP M ","TCP S "," JCMB ","ENGIN ", "CHEM ","FOREST"," IGS ","G. SQ."," GEOG "," A.I. ","CS-AT1","CS-AT2", "ATB-1 ","ATB-2 "," SOCS ","EULIB ","POLLCK"," BUSH ","FCNRS ", " SIAE "," HFRO "," SCRI ","WS-COA"," GLA1 "," GLA2 "," GLA3 "," GLA4 ", " GLA5 ","STCL-1","STCL-2","2972-1","2972-2","2980-0","2980-1","2980-2", "PSSE ","FSTORE","CS-VAX","2976 ","NODE 1","NODE 2", "NODE 6","NODE 9","Node 3","Info ","Ap Twr","2972 ","2980 ", "Erte ", "Devs ", "2972-4", "Sdvs " %ownbyteintegerarray nt(1:no of names) = 4,2, 47, 8, 13, 15, 60, 20, 154, 66, 40, 26, 43, 41, 89, 27, 70, 42, 63, 67, 83, 34, 62, 65, 33, 35, 52, 53, 55, 56, 57, 50, 52, 9, 75, 180, 181, 182, 5, 90, 78, 9, 0(5), 156, 14, 72, 80, 1, 7, 3, 23 %ownbyteintegerarray nn(1:no of names) = %c 72, 72, 9, 72, 72, 9, 6, 6, 9, 6, 9, 6, 6, 9, 6, 6(11), 7(2), 2, 7, 2, 3, 3, 72, 9(2), 6, 9, 72, 90, 78, 7, 1, 2, 6, 9, 3, 156, 6, 72, 80, 72, 72, 72, 6 %integer i, j %string (25) s %if n=0 %start %if node = 64 %then n=9 %else n=6 %finish %if line = 0 %then %result = "Ap Twr" %cycle i = 1, 1, no of names %if nt(i) = t %and nn(i) = n %then %result = ns(i) %repeat s = "N".itos(n, 0)."T".itos(t, 0)." " %if length(s) > 6 %then length(s) = 6 %result = s %end %routine out(%integer l,h) %integer x, y, z, i, j %cycle x = 1, 1, 6 spaces(9) %cycle i = l, 1, h printsymbol(charno(nm(i), x)); spaces(3) %repeat newline %repeat newline %cycle i = 1, 1, k printstring(nm(i)) %cycle j = l, 1, h y = tab(i, j) %if y=0 %then printstring(" .") %else %c write(y, 3) %repeat newline %repeat %end %cycle i = 1, 1, 60; %cycle j = 1, 1, 60; tab(i, j)=0; %repeat;%repeat %cycle i = 1, 1, 15;%cycle j=0, 1, 200;nod(i,j)=0;%repeat;%repeat %for line=0, 1, 127 %cycle n(line)=-1; co(line)=0;ci(line)=0;bo(line)=0;bi(line)=0;pp(line)=0 cf(line)=0; sm(line)=0; icf(line)=-1; ism(line)=0 ssm(line)=0; scf(line)=0 %repeat %if s="" %then s = "logfile" s1="logfile";s2=".out" %if s->s1.("/").s2 %then i=0 define("1,".s1); define("2,".s2) select output(2) initialise times="";dates="" %cycle %exit %if start>=max readstr(date1, 0); start=start+2 %exit %if start>=max readstr(time1, 0); start=start+1 readstr(s, 0) %if s="N006T000" %or s="N009T000" %start %if s="N009T000" %then node = 64 %else node = 0 %if dates="" %start spaces(30); printstring("First record at:") printstring(date1." "); printstring(time1); newline dates=date1; times=time1 %finish start=start+1; ! a space rsymbol(i); ! a space or NIF %if i # ' ' %then skiptoend %and %continue readstr(s2, 1); type = gsum cou(type) = cou(type)+1 %if type > 1 %start %if type # 6 %and (type<8 %or type>10) %start skiptoend; %continue %finish %cycle ent = 1, 1, 25 rsymbol(i) readstr(s2, 1); enta(ent) = gsum %if i='-' %then enta(ent) = 65536-enta(ent) %if nextsym = nl %then %exit %repeat %finish start=start+1; ! the newline line = enta(1)+node; oline = enta(4)+node rec = rec+1 -> sw(type) sw(1): ! initialise %if node = 64 %then printstring("Node 9") %else printstring("Node 6") printstring(" reloaded at"); printstring(" ".date1." ".time1) newline %for line = node, 1, node+63 %cycle add figs %repeat -> out sw(3): ! thruput -> out sw(4): ! connect -> out sw(5): ! connect check -> out sw(6): ! disconnect conns = conns+1 %unless line = 84 %or oline = 84 %start; ! squash n9<->n6 in n9 %if enta(2) = 156 %then info = info+1 add to matrix(enta(2), enta(3), enta(5), enta(6)) %finish ci(oline) = ci(oline)+1 co(line) = co(line)+1 bo(line) = bo(line)+enta(9) bi(line) = bi(line)+enta(10) bi(oline)=bi(oline)+enta(9) bo(oline)=bo(oline)+enta(10) pp(line) = pp(line)+enta(11) pp(oline) = pp(oline)+enta(11) -> out sw(8): ! attach icf(line)=0; ism(line)=0 sw(9): ! attach check n(line) = enta(2); t(line)=enta(3) -> out %if type = 8 %if icf(line) = -1 %start icf(line) = enta(6); ism(line) = enta(5) %finish %else %start cf(line) = enta(6); sm(line) = enta(5) %if line # 0 %start %if cf(line) out sw(10): ! remove add figs -> out sw(11): ! line check -> out out: %finish %else %start skiptoend %finish %repeat end: ! end-of-file spaces(30); printstring("Last time was: ".date1." ".time1); newline printstring("No of connections was "); write(conns, 1) printstring(" Info made"); write(info, 1) printstring(" of these ") printstring("There were"); write(rec, 4); printstring(" Node records ") printstring(%c "Attach connections k bytes packets Messages Conn fails out in out in both bytes/pkt ") tci=0;tco=0;tbi=0;tbo=0;tpp=0 %cycle line = 0, 1, 127 %if line=0 %then printstring("Node 6 ") %and node = 0 %if line = 64 %then printstring(" Node 9 ") %and node = 9 %if n(line)=-1 %then %continue printstring(print name(n(line), t(line))." ") write(co(line), 6); write(ci(line), 6) write(((bo(line)*16)+999)//1000, 8); write(((bi(line)*16+999))//1000, 8) write(pp(line), 8) %if pp(line) = 0 %then print(0, 8, 0) %else %c print((bo(line)+bi(line))*16/pp(line), 8, 0) write(sm(line)-ism(line)+ssm(line), 8) write(cf(line)-icf(line)+scf(line), 8) newline tci=tci+ci(line); tco=tco+co(line) tbi=tbi+bi(line); tbo=tbo+bo(line) tpp=tpp+pp(line) %repeat printstring(" Totals ") write(tco, 6); write(tci, 6) write((tbo*16+999)//1000, 8); write((tbi*16+999)//1000, 8) write(tpp, 8) %if tpp=0 %then print(0, 8, 0) %else %c print((tbo+tbi)*16/tpp, 8, 0) newline newpage printstring("Conection Grid Destination ") k = free ind-1 k = 60 %if k>60 %cycle i = 1, 1, k nm(i) = print name(nn(i), tt(i)) %repeat out(1, 30) newlines(3) out(31, k) newlines(5) %cycle i = 1, 1, k write(i, 2) write(nn(i), 2); write(tt(i), 2); spaces(2) printstring(print name(nn(i), tt(i))) newline %repeat printstring("Analysis of types of Node record ") %cycle i = 0, 1, 11; write(i, 8); %repeat newline %cycle i = 0, 1, 11; write(cou(i), 8); %repeat newlines(15) %end %endoffile