home *** CD-ROM | disk | FTP | other *** search
- {Logproc By Joe Kasser G3ZCZ (c) 1989. Not quite public domain yet}
- {$D+}
- {$I+}
- {$R+} {Range checking on off}
- {$B+} {Boolean complete evaluation on}
- {$S+} {Stack checking on}
- {$N-} {No numeric coprocessor}
- {$m 65520,32398,655360} {stack and heap}
-
-
- USES Crt, Dos, qwik, wndwvars, Wndw;
-
- CONST
- Hit_String = 'Touch ''SPACE BAR'' to Stop Display';
-
- VAR Tempstring : STRING[255];
- BBS_Call, BBS_Type : string[10] ;
- Master_Summary, Log_list, Log_File : STRING[80];
- month, Current_Month, Activity : STRING[2];
- Auto_year, Year : STRING[4];
- Operation : Char;
- Message_Number : STRING[10];
- OutFile, InFile, Listfile : Text;
- In_Bulletins, In_Personals, In_Traffic, In_Others,
- Out_Bulletins, Out_Personals, Out_Traffic, Out_Others,
- FWD_Bulletins, FWD_Personals, FWD_Traffic, FWD_Others,
- File_Up, File_Down, Yapp_Up, Yapp_Down, Reject_Count, Orig_Count,
- logtype , Disp_Colour : Integer;
- Flag_Auto : Boolean ;
-
- TYPE name = STRING[45];
-
- FUNCTION exist(filename : name) : Boolean;
- {$I-}
- VAR fil : FILE;
- BEGIN
- Assign(fil, filename); Reset(fil);
- IF IOResult = 0 THEN
- BEGIN exist := True; Close(fil); END ELSE exist := False;
- {$I+}
- END;
-
- procedure Woops;
- begin
- makewindow(10 , 1, 4, 80, yellow+RedBG, yellow+RedBG, doublebrdr,
- StatusWindow);
- TitleWindow (Top, Center, ' UNRECOGNIZED ENTRY');
- writeln(^G);
- writeln(tempstring); delay(1000) ;
- RemoveWindow;
- end;
-
- procedure oops;
- begin
- makewindow(10 , 25, 4, 30, yellow+RedBG, yellow+RedBG, doublebrdr,
- StatusWindow);
- writeln(^G);
- writeln( Log_File+' DOES NOT EXIST'); delay(1000) ;
- RemoveWindow;
- end;
-
-
- PROCEDURE W0RLI_Scan_Entry;
- BEGIN
- Disp_Colour := lightgreen;
- Operation := Tempstring[12]; Activity := Copy(Tempstring, 12, 2);
- IF Tempstring[1] = 'C' THEN Disp_Colour := yellow ELSE
- IF Tempstring[1] = 'M' THEN BEGIN
- Disp_Colour := white;
- CASE Operation OF
- 'F' : {forward}
- if Activity = 'F ' then inc(FWD_Personals) else
- if Activity = 'F'+^I then inc(FWD_Personals) else
- if Activity = 'FA' then inc(FWD_Bulletins) else
- if Activity = 'FB' then inc(FWD_Bulletins) else
- if Activity = 'FF' then inc(FWD_Bulletins) else
- if Activity = 'FJ' then inc(FWD_Bulletins) else
- if Activity = 'FP' then inc(FWD_Personals) else
- if Activity = 'FT' then inc(FWD_Traffic) else
- IF Activity = 'FR' then begin END ELSE
- iF Activity = 'FE' THEN BEGIN END ELSE
- IF Activity = 'FS' then begin END ELSE
- BEGIN inc(Out_Others); Woops; END;
- 'Z' :
- if Activity = 'Z ' then inc(In_Personals) else
- if Activity = 'Z'+^I then inc(In_Personals) else
- if Activity = 'ZA' then inc(In_Bulletins) else
- if Activity = 'ZB' then inc(In_Bulletins) else
- if Activity = 'ZF' then inc(In_Bulletins) else
- if Activity = 'ZP' then inc(In_Personals) else
- if Activity = 'ZS' then inc(In_Traffic) else
- if Activity = 'ZT' then inc(In_Traffic) else BEGIN
- inc(Out_Others); Woops;
- end;
- 'R' :
- if Activity = 'RM' then inc(Out_Personals) else
- if Activity = 'RN' then inc(Out_Personals) else
- if Activity = 'RT' then inc(Out_Traffic) else
- if Activity = 'R ' then inc(Out_Bulletins) else
- if Activity = 'RH' then BEGIN END ELSE
- IF Activity = 'R'+^I then inc(Out_Bulletins) else begin
- inc(Out_Others); Woops;
- end;
- 'S' :
- if Activity = 'S?' then inc(In_others) else
- if Activity = 'SA' then inc(In_Bulletins) else
- if Activity = 'SS' then inc(In_Traffic) else
- if Activity = 'SP' then inc(In_Personals) else
- if Activity = 'SM' then inc(In_Personals) else
- if Activity = 'ST' then inc(In_Traffic) else
- if Activity = 'SB' then inc(In_Bulletins) else
- if Activity = 'SF' then inc(In_Bulletins) else
- if Activity = 'SJ' then inc(In_Bulletins) else
- if Activity = 'S ' then inc(In_Bulletins) else
- if Activity = 'S'+^I then inc(In_Bulletins) else begin
- inc(In_others); Woops;
- end;
- end; {case}
- END; {messsage}
- IF Tempstring[1] = 'F' {files} THEN BEGIN
- IF Operation = 'D' THEN inc(File_Down);
- IF Operation = 'U' THEN inc(File_Up);
- end;
- IF Tempstring[1] = 'F' THEN BEGIN
- IF Activity = 'FD' THEN
- begin inc(File_Down); Disp_Colour := Cyan; end;
- IF Activity = 'FU' THEN
- begin inc(File_Up); Disp_Colour := Cyan; end;
- end;
- IF Tempstring[1] = 'X' THEN Disp_Colour := Magenta;
- END;
-
- PROCEDURE B313_Scan_Entry;
- BEGIN
- Disp_Colour := lightgreen;
- Operation := Tempstring[12]; Activity := Copy(Tempstring, 12, 2);
- IF Tempstring[1] = 'C' THEN Disp_Colour := yellow ELSE
- IF (Tempstring[1] = 'M') or (Tempstring[1] = 'T') THEN BEGIN
- Disp_Colour := white;
- CASE Operation OF
- '$' , 'F' : {forward}
- if Activity = '$A' then inc(FWD_Bulletins) else
- if Activity = '$B' then inc(FWD_Bulletins) else
- if Activity = '$J' then inc(FWD_Bulletins) else
- if Activity = '$F' then inc(FWD_Bulletins) else
- if Activity = '$P' then inc(FWD_Personals) else
- if Activity = '$T' then inc(FWD_Traffic) else
- if Activity = '$ ' then inc(FWD_Personals) else
- if Activity = '$'+^I then inc(FWD_Personals) else
- if Activity = 'F ' then inc(FWD_Personals) else
- if Activity = 'F'+^I then inc(FWD_Personals) else
- if Activity = 'FA' then inc(FWD_Bulletins) else
- if Activity = 'FB' then inc(FWD_Bulletins) else
- if Activity = 'FF' then inc(FWD_Bulletins) else
- if Activity = 'FJ' then inc(FWD_Bulletins) else
- if Activity = 'FP' then inc(FWD_Personals) else
- if Activity = 'FS' then inc(FWD_Traffic) else
- if Activity = 'FT' then inc(FWD_Traffic) else begin
- inc(Out_Others); Woops;
- end;
- '<' , '>' :
- if Activity = '< ' then inc(In_Personals) else
- if Activity = '<'+^I then inc(In_Personals) else
- if Activity = '<A' then inc(In_Bulletins) else
- if Activity = '<B' then inc(In_Bulletins) else
- if Activity = '<F' then inc(In_Bulletins) else
- if Activity = '<P' then inc(In_Personals) else
- if Activity = '<S' then inc(In_Traffic) else
- if Activity = '<T' then inc(In_Traffic) else
- if Activity = '>A' then inc(In_Bulletins) else
- if Activity = '>B' then inc(In_Bulletins) else
- if Activity = '>F' then inc(In_Bulletins) else
- if Activity = '>P' then inc(In_Personals) else
- if Activity = '>S' then inc(In_Traffic) else
- if Activity = '> ' then inc(In_Personals) else
- if Activity = '>'+^I then inc(In_Personals) else
- if Activity = '>T' then inc(In_Traffic) else begin
- inc(Out_Others); Woops;
- end;
- 'R' :
- if Activity = 'RM' then inc(Out_Personals) else
- if Activity = 'RN' then inc(Out_Personals) else
- if Activity = 'RT' then inc(Out_Traffic) else
- if Activity = 'R ' then inc(Out_Bulletins) else
- if Activity = 'R'+^I then inc(Out_Bulletins) else begin
- inc(Out_Others); Woops;
- end;
- 'S' :
- if Activity = 'S?' then inc(In_others) else
- if Activity = 'SA' then inc(In_Bulletins) else
- if Activity = 'SS' then inc(In_Traffic) else
- if Activity = 'SP' then inc(In_Personals) else
- if Activity = 'SM' then inc(In_Personals) else
- if Activity = 'ST' then inc(In_Traffic) else
- if Activity = 'SB' then inc(In_Bulletins) else
- if Activity = 'SF' then inc(In_Bulletins) else
- if Activity = 'SJ' then inc(In_Bulletins) else
- if Activity = 'S ' then inc(In_Bulletins) else
- if Activity = 'S'+^I then inc(In_Bulletins) else begin
- inc(In_others); Woops;
- end;
- end; {case}
- END; {messsage}
- IF Tempstring[1] = 'F' {files} THEN BEGIN
- IF Operation = 'D' THEN inc(File_Down);
- IF Operation = 'U' THEN inc(File_Up);
- end;
- IF Tempstring[1] = 'Y' {yapp} THEN BEGIN
- if Activity = 'YU' then
- begin inc(Yapp_Up); Disp_Colour := lightblue ; end else
- if Activity = 'YD' then
- begin inc(Yapp_Down); Disp_Colour := lightblue ; end else
- if Activity <> 'YW' then Woops;
- end;
- IF Tempstring[1] = 'F' THEN BEGIN
- IF Activity = 'FD' THEN
- begin inc(File_Down); Disp_Colour := Cyan; end;
- IF Activity = 'FU' THEN
- begin inc(File_Up); Disp_Colour := Cyan; end;
- end;
- IF Tempstring[1] = 'X' THEN Disp_Colour := Magenta;
- END;
-
- procedure Make_Windows;
- begin
- Setwindowmodes(0);
- makewindow(1 , 1, 8, 80, white+blackBG, white+blueBG, doublebrdr, Inwindow);
- TitleWindow (Top, Center, 'BBS LOG TRAFFIC ANALYSIS By G3ZCZ Version 2.0');
- makewindow(9 , 1, 17, 80, lightgreen+blackBG, white+BlueBG, doublebrdr,
- OUTwindow);
- TitleWindow (Top, Center, 'BBS LOG ENTRIES');
- TitleWindow (Bottom, Center, Hit_String);
- end;
-
- procedure Display_Headings;
- begin
- AccessWindow(Inwindow); clearwindow; textcolor(yellow);
- GotoRC(2,41); write('Year'); GotoRC(2,59); write('Month');
- GotoRC(3,2); write('In_Bulletins '); GotoRC(3,21); write('In_Personals ');
- GotoRC(3,41); write('In_Traffic '); GotoRC(3,59); write('In_Others ');
- GotoRC(4,2); write('Out_Bulletins '); GotoRC(4,21); write('Out_Personals ');
- GotoRC(4,41); write('Out_Traffic '); GotoRC(4,59); write('Out_Others ');
- GotoRC(5,2); write('FWD_Bulletins '); GotoRC(5,21); write('FWD_Personals ');
- GotoRC(5,41); write('FWD_Traffic '); GotoRC(5,59); write('FWD_Others ');
- GotoRC(6,2); write('Yapp_uploads '); GotoRC(6,21); write('Yapp_downloads ');
- GotoRC(6,41); write('File_uploads '); GotoRC(6,59); write('File_downloads ');
- GotoRC(7,2); write('Reject_Count '); GotoRC(7,21); write('Orig_Count ');
- end;
-
- PROCEDURE Display_Summary;
- BEGIN
- AccessWindow(INwindow); Cursoroff; textcolor(white);
- GotoRC(2,2); write(BBS_Call); GotoRC(2,21); write(Log_File);
- GotoRC(2,54); write(Year); GotoRC(2,74); write(Month);
- GotoRC(3,16); write(In_Bulletins); GotoRC(3,36); write(In_Personals);
- GotoRC(3,54); write(In_Traffic); GotoRC(3,74); write(In_Others);
- GotoRC(4,16); write(Out_Bulletins);GotoRC(4,36); write(Out_Personals);
- GotoRC(4,54); write(Out_Traffic); GotoRC(4,74); write(Out_Others);
- GotoRC(5,16); write(FWD_Bulletins);GotoRC(5,36); write(FWD_Personals);
- GotoRC(5,54); write(FWD_Traffic); GotoRC(5,74); write(FWD_Others);
- GotoRC(6,16); write(Yapp_up); GotoRC(6,36); write(Yapp_down);
- GotoRC(6,54); write(File_up); GotoRC(6,74); write(File_down);
- GotoRC(7,16); write(Reject_Count); GotoRC(7,36); write(Orig_Count);
- AccessWindow(OUTwindow); textcolor(Disp_Colour) ;
- writeln(tempstring); (* delay(300); writeln(Operation,' ',Activity); *)
- END;
-
-
- PROCEDURE Clear_Variables;
- BEGIN
- Current_Month := '00'; Reject_Count := 0; Orig_Count := 0;
- logtype := 0; In_Bulletins := 0; In_Personals := 0;
- In_Traffic := 0; In_Others := 0; Out_Bulletins := 0;
- Out_Personals := 0; Out_Traffic := 0; Out_Others := 0;
- FWD_Bulletins := 0; FWD_Personals := 0; FWD_Traffic := 0;
- FWD_Others := 0; Yapp_Up := 0; Yapp_Down := 0;
- File_Up := 0; File_Down := 0; Disp_Colour := 4;
- END;
-
-
- procedure Get_Details_of_Job;
- begin
- makewindow(11 , 5, 10, 70, white+BlackBG, white+BlackBG, doublebrdr,
- dummywindow);
-
- Cursoron; Write ('What BBS Call ? '); Readln(BBS_Call) ;
- Master_Summary := BBS_Call + '.ZCZ';
- While logtype = 0 do begin
-
- Writeln('W0RLI (1), WA7MBL Auto (2), MBL313 (3), MBL512 (5)');
- Write('What log type 1, 2, 3 or 5 ? '); Readln(logtype) ;
- if (logtype <0) or (logtype > 5) then logtype := 0;
- case logtype of
- 1 : BBS_type := 'W0RLI';
- 2: BBS_Type := 'AUTO' ;
- 3 : BBS_type := 'MBL313';
- 5 : BBS_type := 'MBL512';
- else logtype := 0;
- end; {case}
- end ; {while}
- if (bbs_type = 'MBL512') or (bbs_type = 'AUTO') then begin
- Write('Which Year (19XX) ? '); ReadLn(Year);
- IF bbs_type = 'AUTO' then Auto_year := Year;
- end;
- Write('What Log list ? ') ; ReadLn(Log_List);
- Removewindow;
- end;
-
- PROCEDURE Record_Summary;
- BEGIN
- {$I-}
- Assign(OutFile, Master_Summary);
- Reset(OutFile);
- IF IOResult = 0 THEN Append(OutFile) ELSE BEGIN
- Rewrite(OutFile);
- WriteLn(OutFile,'"BBS_Call",', '"LOG FILE",', ' "BBS_Type",',
- '"Year",',' "Month",',' "In_Bulletins",',' "In_Personals",',
- ' "In_Traffic",', ' "In_Others",', '"Out_Bulletins",',
- ' "Out_Personals",', ' "Out_Traffic",', ' "Out_Others",',
- ' "FWD_Bulletins",',' "FWD_Personals",', ' "FWD_Traffic",',
- ' "FWD_Others",', ' "Yapp_uploads",', ' "Yapp_downloads",',
- ' "File_uploads",',' "File_downloads",', ',', ' "Reject_Count",',
- ' "Orig_Count"');
- END;
- {$I+}
- WriteLn(OutFile,'"',BBS_Call,'",', '"', Log_File, '","', BBS_Type, '"',',',
- Year, ',',month, ',', In_Bulletins, ',', In_Personals, ',', In_Traffic, ',',
- In_Others, ',', Out_Bulletins, ',', Out_Personals, ',', Out_Traffic, ',',
- Out_Others, ',', FWD_Bulletins, ',',FWD_Personals,',', FWD_Traffic, ',',
- FWD_Others, ',', Yapp_Up, ',', Yapp_Down, ',', File_Up, ',',
- File_Down, ',', Reject_Count, ',', Orig_Count);
- Close(OutFile) ;
- END;
-
- PROCEDURE B512_Scan_Entry;
- VAR i, j : Integer;
- BEGIN
- Activity := Copy(Tempstring, 11, 2);
- i := 13; WHILE Tempstring[i] = ' ' DO inc(i); {start of number}
- j := i;
- (* WHILE (Tempstring[j] <> ' ') AND (J< 255) DO inc(j); *)
- WHILE (Tempstring[j] <> ' ') AND (J<length(Tempstring)) DO inc(j);
- dec(j); {end of number}
- Operation := Tempstring[j];
- Message_Number := Copy(Tempstring, i, j-i);
- If pos('M', Activity) = 1 then
- Disp_Colour := white else Disp_Colour := lightgreen;
- IF (Activity = 'MS') OR (Activity = 'M<') THEN BEGIN
- CASE Operation OF
- 'B' : inc(In_Bulletins);
- 'P' : inc(In_Personals);
- 'T' : inc(In_Traffic);
- ELSE inc(In_Others);
- END;
- END;
- IF (Activity = 'M$') OR (Activity = 'MF') OR (Activity = 'M>') THEN BEGIN
- CASE Operation OF
- 'B' : inc(FWD_Bulletins);
- 'P' : inc(FWD_Personals);
- 'T' : inc(FWD_Traffic);
- ELSE inc(Out_Others);
- END;
- END;
- IF (Activity = 'MN') THEN inc(Reject_Count);
- IF (Activity = 'M*') THEN inc(Orig_Count);
- IF (Pos('MVM', Tempstring) = 11)
- OR (Pos('MRM', Tempstring) = 11)
- OR (Pos('MRN', Tempstring) = 11)
- THEN inc(Out_Personals) ELSE BEGIN
- IF (Activity = 'MV') OR (Activity = 'MR')
- THEN inc(Out_Bulletins);
- END;
- IF pos('X', Tempstring) = 11 THEN Disp_Colour := Magenta;
- IF pos('C', Tempstring) = 11 THEN Disp_Colour := yellow;
- IF (Pos('YYU', Tempstring) = 11) THEN
- begin inc(Yapp_Up); Disp_Colour := lightblue ; end;
- IF (Pos('YYD', Tempstring) = 11) THEN
- begin inc(Yapp_Down); Disp_Colour := lightblue ; end;
- IF Activity = 'FD' THEN
- begin inc(File_Down); Disp_Colour := Cyan; end;
- IF Activity = 'FU' THEN
- begin inc(File_Up); Disp_Colour := Cyan; end;
- {add other scans here }
- END;
-
- PROCEDURE Process_Log;
- VAR p : Integer;
- Temp_Month : STRING[2];
- keychar : char ;
- BEGIN
- WHILE NOT EoF(InFile) DO BEGIN
- ReadLn(InFile, Tempstring);
- if (length(tempstring) > 1) or (tempstring[1] <> ' ') then begin
- if bbs_type = 'AUTO' then begin
- case tempstring[1] of
- '0' .. '9' : begin bbs_type := 'MBL512'; Year := Auto_year ; end;
- else bbs_type := 'MBL313';
- end; {Case}
- end ;
- IF (BBS_Type = 'MBL313') or (BBS_Type = 'W0RLI') THEN BEGIN
- year := '19'+ Copy(Tempstring, 2, 2); month := Copy(Tempstring, 4, 2);
- END; {MBL313/W0RLI}
- IF BBS_Type = 'MBL512' THEN month := Copy(Tempstring, 1, 2);
-
- IF Current_Month = '00' THEN Current_Month := month; {first entry}
- IF month <> Current_Month THEN BEGIN
- Temp_Month := month; clearwindow; month := Current_Month;
- Record_Summary; Clear_Variables; Display_Headings;
- Current_Month := Temp_Month;
- END; {new month}
- IF BBS_Type = 'MBL512' THEN B512_Scan_Entry;
- IF BBS_Type = 'MBL313' THEN B313_Scan_Entry;
- IF BBS_Type = 'W0RLI' THEN W0RLI_Scan_Entry ;
- Display_Summary;
- if keypressed then begin
- TitleWindow (Bottom,Center,'Touch ''SPACE BAR'' to Start Display');
- keychar := readkey;
- if keychar = ' ' then begin
- while not keypressed do begin end ; {wait}
- TitleWindow (Bottom,Center,Hit_String);
- keychar := readkey; keychar := '.' ;
- end;
- end;
- end; {length}
- END; {while}
- END;
-
- BEGIN
- clrscr; Clear_Variables; Log_File := 'DUMMY';
- InitWindow(White+blackBG,True); {do this before all else}
- Make_Windows;
- Get_Details_of_Job;
- if bbs_type = 'AUTO' then Flag_Auto := true else Flag_Auto := false;
- IF exist(Log_List)THEN BEGIN
- Clear_Variables; Display_Headings;
- Assign(ListFile, Log_List); Reset(ListFile);
- WHILE NOT EoF(ListFile) DO BEGIN
- ReadLn(ListFile, Log_File);
- if flag_Auto then bbs_type := 'AUTO';
- IF exist(Log_File) THEN BEGIN
- Assign(InFile, Log_File); Reset(InFile);
- Process_Log; Close(InFile);
- Record_Summary; Clear_Variables; Display_Headings;
- END ELSE oops; {exist log-file}
- END {while} ;
- (* Record_Summary; clrscr; Display_Summary; *)
- CLOSE (Listfile);
- END ELSE begin Writeln('List DOES NOT EXIST'); DELAY(2000); end;
- RemoveWindow; RemoveWindow; Cursoron;
- END.