%EXTERNALROUTINE billans %alias "C#billans"(%STRING (255) s) %externalstring %fn %spec date %alias "S#date" %externalstringfnspec substring %alias "S#substring" %c (%string (*) %name s, %integer i,j) %EXTERNALROUTINESPEC prompt %ALIAS "S#PROMPT"(%STRING (255) s) %externalroutinespec EMAS3CONNECT %c (%stringname file, %integername mode, hole, prot, conad, %c type, start, end, flag) %ROUTINE define(%STRING (255) s) %EXTERNALROUTINESPEC emas3(%STRINGNAME command,params, %INTEGERNAME flag) %INTEGER flag emas3("DEFINE",s,flag) %END; ! Of %ROUTINE define. %STRING (255) t,u, sou, des %INTEGER i,j, mins, secs, num, mon, hst %integerarray figs(1:4) %ownrealarray fx(1:10, 0:4) %ownstring (25) %array host(1:10) %real x %routine skip spaces %integer i %cycle i = nextsymbol skipsymbol %if i = ' ' %repeat %until i # ' ' %end %routine skip item %integer i, j skip spaces j = 0 %cycle i = nextsymbol %if i#' ' %and i # '/' %and i # ';' %then skipsymbol %else j = 1 %repeat %until j # 0 %end %integerfn integer item %integer i, j, sum sum = 0; j = 0 skip spaces %cycle i = nextsymbol %if i=' ' %or i = '/' %or i = ';' %or i = 10 %then j = 1 %elsec sum = sum*10 +i-'0' skipsymbol %repeat %until j # 0 %result = sum %end %string (*) %fn string item %integer i, j, k %string (255) s s = ""; j = 0 skip spaces %cycle i = nextsymbol %if i=' ' %or i = '/' %or i = ';' %then j = 1 %elsec s = s.tostring(i) skipsymbol %repeat %until j # 0 %result = s %end %on 9 %start -> finish %finish %if s = "" %start printstring("params in/out ") %stop %finish %if s -> s.(":m").t %then mon = 1 %else mon = 0 %unless s -> s.("/").t %then t = ".out" define("1,".s); define("2,".t) select input(1); select output(2) num = 0 %cycle skip item; skip item mins = integer item; secs = integer item sou = string item; des = string item %for i = 1, 1, 4 %cycle figs(i) = integer item %repeat skipsymbol %if nextsymbol = 10 { printstring(sou." ->".des." ")} { %for i = 1, 1, 4 %cycle; write(figs(i), 3); %repeat} { newline} hst = 1 %if length(des)=16 %then length(des)=13 %cycle %if host(hst) = des %or host(hst) = "" %then %exit hst = hst+1 %repeat %if host(hst) = "" %then host(hst) = des secs = mins*60+secs write(secs, 4) %if mon # 0 %for i = 1, 1, 4 %cycle %if secs = 0 %then secs = 1 x = figs(i)/secs print (x, 4, 1) %if mon # 0 fx(hst, i) = fx(hst, i)+x %repeat fx(hst, 0) = fx(hst, 0)+1; ! number of samples newline %if mon # 0 %repeat finish: hst = 1 %cycle %exit %if host(hst) = "" newlines(2) printstring("overall figures for"); print(fx(hst, 0), 3, 0); printstring(" Samples on Host:".host(hst)." Pkts/sec Bytes/sec Bytes/Pkt Rx Tx Rx Tx Rx Tx ") %for i = 1, 1, 4 %cycle print(fx(hst, i)/fx(hst, 0), 5, 1) %repeat %if fx(hst, 1) = 0 %then printstring(" ") %else %c print(fx(hst, 3)/fx(hst, 1), 5, 1); %if fx(hst, 2) = 0 %then printstring(" ") %else %c print(fx(hst, 4)/fx(hst, 2), 5, 1) newline hst = hst+1 %repeat %end %endoffile