2014-10-15 23:03:11 +00:00
|
|
|
unit PointerscanStructures;
|
|
|
|
|
|
|
|
|
|
{$mode delphi}
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
2019-12-18 12:07:17 +01:00
|
|
|
{$ifdef darwin}
|
|
|
|
|
macport, Classes, SysUtils, Sockets, CELazySocket, commonTypeDefs;
|
|
|
|
|
{$endif}
|
|
|
|
|
{$ifdef windows}
|
2017-08-05 00:28:31 +02:00
|
|
|
windows, Classes, SysUtils, winsock, CELazySocket, commonTypeDefs;
|
2019-12-18 12:07:17 +01:00
|
|
|
{$endif}
|
2014-10-15 23:03:11 +00:00
|
|
|
|
2014-11-03 05:12:08 +00:00
|
|
|
const
|
|
|
|
|
MAXQUEUESIZE=64;
|
2016-09-17 14:56:32 +02:00
|
|
|
pointerscanfileversion=2;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
type
|
2017-08-05 00:28:31 +02:00
|
|
|
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
TPathQueueElement=record
|
|
|
|
|
tempresults: array of dword;
|
|
|
|
|
valuelist: array of qword;
|
|
|
|
|
valuetofind: qword;
|
|
|
|
|
startlevel: integer;
|
|
|
|
|
end;
|
|
|
|
|
PPathQueueElement=^TPathQueueElement;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TMainPathQueue=array [0..MAXQUEUESIZE-1] of TPathQueueElement;
|
|
|
|
|
|
|
|
|
|
PMainPathQueue=^TMainPathQueue;
|
|
|
|
|
TDynPathQueue=array of TPathQueueElement;
|
|
|
|
|
|
|
|
|
|
TPointerscanControllerParent=record
|
|
|
|
|
socket: TSocketstream;
|
|
|
|
|
scanid: dword;
|
2014-10-16 21:48:24 +00:00
|
|
|
name: string;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
iConnectedTo: boolean;
|
|
|
|
|
connectdata: record
|
|
|
|
|
ip: string;
|
|
|
|
|
port: word;
|
|
|
|
|
password: string;
|
|
|
|
|
end;
|
2014-10-16 11:36:19 +00:00
|
|
|
ip: string;
|
|
|
|
|
port: word;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
trustsme: boolean;
|
2014-10-22 00:39:43 +00:00
|
|
|
knowsIAmTerminating: boolean;
|
2014-10-29 01:17:06 +00:00
|
|
|
connecttime: qword;
|
2014-10-15 23:03:11 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
PPointerscanControllerParent=^TPointerscanControllerParent;
|
|
|
|
|
|
2022-10-02 23:06:32 +02:00
|
|
|
TPointerscancontrollerchild=record //todo: maybe turn this into a class with methods to call child commands ?
|
2014-10-15 23:03:11 +00:00
|
|
|
socket: TSocketstream;
|
|
|
|
|
MissingSince: qword; //holds the time when the connection was lost. If this is set to 0 the child info will be deleted
|
2014-10-22 22:26:08 +00:00
|
|
|
Error: string;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
iConnectedTo: boolean;
|
|
|
|
|
connectdata: record
|
|
|
|
|
ip: string;
|
|
|
|
|
port: word;
|
|
|
|
|
password: string;
|
|
|
|
|
end;
|
|
|
|
|
ip: string;
|
|
|
|
|
port: word;
|
|
|
|
|
childid: integer;
|
|
|
|
|
trusted: boolean;
|
2016-05-26 21:59:34 +02:00
|
|
|
takePathsAndDisconnect: boolean;
|
2014-10-15 23:03:11 +00:00
|
|
|
terminating: boolean;
|
|
|
|
|
|
|
|
|
|
idle: boolean;
|
|
|
|
|
//pathspersecond: qword;
|
|
|
|
|
|
|
|
|
|
totalPathsEvaluated: qword;
|
|
|
|
|
pathqueuesize: integer;
|
|
|
|
|
totalpathqueuesize: integer;
|
2014-10-29 11:41:25 +00:00
|
|
|
potentialthreadcount: integer;
|
|
|
|
|
actualthreadcount: integer;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
resultsfound: qword;
|
|
|
|
|
|
|
|
|
|
queued: boolean;
|
|
|
|
|
queuepos: dword;
|
|
|
|
|
queuesize: dword;
|
|
|
|
|
|
|
|
|
|
trustlevel: integer;
|
|
|
|
|
nontrustedlastpaths: TDynPathQueue;
|
2014-10-20 22:46:06 +00:00
|
|
|
nontrustedlastpathstime: qword;
|
|
|
|
|
|
2014-10-15 23:03:11 +00:00
|
|
|
|
|
|
|
|
scandatauploader: TThread;
|
2014-10-18 20:22:23 +00:00
|
|
|
ScanDataSent: qword;
|
|
|
|
|
ScanDataTotalSize: qword;
|
|
|
|
|
ScanDataStartTime: qword;
|
2014-10-28 02:45:05 +00:00
|
|
|
hasReceivedScandata: boolean;
|
2014-10-15 23:03:11 +00:00
|
|
|
|
2014-11-11 00:32:55 +00:00
|
|
|
LastUpdateReceived: qword;
|
|
|
|
|
|
2014-10-15 23:03:11 +00:00
|
|
|
scanresultDownloader: TThread; //not nil if the results it has sent me are still being processed
|
|
|
|
|
resultstream: TFilestream; //if initializer this holds an open filestream to the .ptr associated with this child
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
PPointerscancontrollerchild=^TPointerscancontrollerchild;
|
|
|
|
|
|
|
|
|
|
TQueueWriterMethod=procedure(sender: TObject; PathQueueElement: TPathQueueElement) of object;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|