home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
PXAPI11.ZIP
/
PXQTYPE.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1995-10-21
|
20KB
|
444 lines
(*-------------------------------------------------------------------------*)
(* Santronics Software, Co. *)
(* 30034 SW 153 Ct. *)
(* Leisure City, FL 33033 *)
(* *)
(* Platimum Xpress Remote Host System *)
(* File Structures *)
(* (C) Copyright 1994-95, Santronics Software, Co *)
(* *)
(* L I C E N S E *)
(* *)
(* You are hereby granted a license to use the structures for product *)
(* development. These structures are own and copyrighted by Santronics *)
(* software. You are not allowed to modify these structures or use it *)
(* to develop clones or competing products of Platinum Xpress. You are *)
(* allowed to use these structures for 3rd party development only. *)
(*-------------------------------------------------------------------------*)
(* DATE VERSION *)
(* 10/20/95 1.1 Stable Structures *)
(*-------------------------------------------------------------------------*)
{$A-}
unit pxqtype;
uses dos;
Const
AutoPollFname = 'PXPOLL.DAT'; (* Auto Poll *)
FileReqFname = 'PXFREQ.DAT'; (* File Request data file *)
FRQSessionFname= 'PXFRSC.DAT'; (* file req session control *)
MagicFname = 'PXMAGIC.DAT'; (* File Request Magic File *)
AnnounceFname = 'PXTICANN.DAT'; (* Tic Annoucements *)
ObMailFname = 'PXOBMAIL.DAT'; (* Outbound Bundle database *)
ObNetFname = 'PXOBNET.DAT'; (* Outbound NetMail database *)
ObQueueFname = 'PXQUEUE.DAT'; (* Outbound Poll Queue database *)
ObAttachFname = 'PXATTACH.DAT'; (* Outbound Attach Que database *)
StatsFname : pathstr = 'PXSTAT#.DAT'; (* statistics outbound *)
PXCallLogFname = 'PXCALL.HIS'; (* Structured Call Log *)
(************************************************************************
FILE SHAREING CONSIDERATIONS
All files in Platinum Xpress are to be open in ReadWrite, DenyNone Mode.
The QUEUE files should be LOCKED prior to reading or writing. In PX,
the first byte is used as the LOCK byte. If this byte is LOCKED, no
access to the file should be made. You should wait until it is
unlocked. Recommended wait time is 60 seconds.
PXOBMAIL.DAT - Outbound Bundle Database
Holds the database of outbound files mail bundles for all nodes.
When a connection is made with a system, a scan is performed on the
PXOBMAIL.DAT to see which if there are any node files to go out.
Bundles files will be added to the Send (ObQueueFname) list if:
- Not Already Sent, and
- Not in Transient (another node is currently sending it)
- Node number is equal to 0 or equal to current node.
If a bundle is to be put into the send list, the record's _obLocked bit
is set and written back to disk. This must be done by locking the first
byte of the file. This prevents another mailer node from sending it.
After the files are sent, the bundles are deleted and the record's
_obSent bit is set, time sent is set and _obLocked bit is set off.
The utilities PXQEDIT, VIEWOUT can be used to view/manage the the
PXOBMAIL.DAT file.
PXOBNET.DAT - Outbound Netmail
Holds the database of outbound NETMAIL for all Fido nodes. It basically
contains the "Headers" of the NETMAIL conferences (*.MSG and Wildcat).
The usage logic is similar to the PXOBMAIL.DAT system. When a call
comes in, a check is made in this file for any outbound netmail.
The main difference is that outbound files (PKT and REQ files) are
created on the fly when someone calls or a poll is being mail.
When the transfer is completed, PX will go directly back to the message
base to update the status files.
PXATTACH.DAT - Outbound File Attaches
Holds the database of outbound File Attaches. Currently being used
for the TIC processor, but any process can add records to this file.
The usage logic is similar to the PXOBMAIL.DAT system. When a call
comes in, a check is made in this file for any outbound files.
PXQUEUE.DAT - Poll QUEUE Database
This file contains the nodes to poll. PX will cycle thru this file to
determine which node to poll. The queue logic is simple. Each record
has a current variable which is the file position of the record. The
next poll is taken from this previous record.
-------------------------------------------------------------------------*)
(* Transport Flags (_obXXXXXXX)
These flags tell the outbound system how to send, what to do during a
call, and what to do after a call. These flags are defined and used to
AUGMENT the FidoFlag Field in TMSGREC and the ATTR field in *.MSG
headers.
THESE MUST STAY AS A WORD SIZE (16 BITS). It is only shown as a 32 bit
because they are used as a LOW word for some internal LONGINT storage
done in PX during the scanner.
We didn't use the standard FTSC for WILDCAT because we needed more bits
to handle the kludge bits (Immed, KillFile, etc). The private bit and
receipt bits are already available in TMSGREC so we started with a clean
slate. FTSC flags are used for *.MSG messages.
NETMAIL and ECHO messages
-------------------------
When PX is importing MAIL, it will set the PX the _ObImported bit in
FidoFlags, the mfEchoFlag bit in mFlags, and set the field NETWORK to
"FIDO" to help in the determining of what came in versus what is going
out.
For scanning echo mail, PXECHO will ignore the _ObImported bit when
scanning for mail. During a scan, if the Network field is set to "FIDO"
or the mfEchoFlag bit is set, the mail is skipped. Those are the only
two conditions to skip echo mail.
For netmail scanning, PX will ignore/skip netmail that has the mfDeleted
or mfSent bits in Mflags or the _oblocked or _obImported bits in
FidoFlags
There is only one condition where PX will scan for new netmail and
ignore the Imported Bit - when mail is being forwarded. In this
case, PX will not set the import bit.
All ECHO Utilities must clear the Wildcat mfEchoFlag and the NETWORK
field must not be "FIDO" if they want the mail to go OUT.
Note, this is the opposite of the "Local" bit concept used in the Fido
World. Every fido BBS will set the FTS Local bit as done in *.MSG and in
some BBSes. But since Wildcat is not setting this bit, including
WildMail, we need to allow for these utilities to create mail PX will
scan. So make sure the bit is cleared. By having it cleared, it will
help tell utilities mail was created on-line or using an off-line mail
system.
Also:
_ObCrash - Send mail during Next available COST/EVENT slot
_ObImmed - Send it now, immediate, No rules.
If _obLocked is enable, please ignore the message. Do not allow editing.
Other node is handling message.
*)
(*************************************************************************)
Const (* attributes for obFlags *)
_obHold = $00000001; (* Hold if you make the call *)
_obImmed = $00000002; (* Call immediately *)
_obDirect = $00000004; (* Direct, do not route *)
_obImported = $00000008; (* TMSG. Imported by PX *)
_obKillMsg = $00000010; (* Kill msg when Sent *)
_obKillFile = $00000020; (* Kill file when sent *)
_obLocked = $00000040; (* In Used by mailer node *)
_obFileReq = $00000080; (* File Request->Subject Line *)
_obFileAtt = $00000100; (* File Attach-> Subject Line *)
_obFileUReq = $00000200; (* Update File Request *)
_obCrash = $00000400; (* Opposite of Hold *)
_obSent = $00000800; (* File Sent *)
_obForward = $00001000; (* In transient (forward mail)*)
_obOrphan = $00002000; (* Lost message/File *)
_obTruncate = $00004000; (* Truncate *)
_obReserved = $00008000; (* Reserved *)
Type (* PXOBMAIL.DAT *)
BundleRecType =
record
Status : longint; (* -1, deleted *)
PktName : string[12]; (* *.??x file *)
Address : AddressType; (* Fido Address *)
EntryDate : Longint; (* MSDOS 4 byte stamp *)
obFlags : longint; (* ob flags *)
FileSize : Longint;
SentDate : Longint;
TaskNumber : Word; (* 0 or the task number *)
RouteAddress : AddressType; (* not used *)
extra : array[1..82] of byte;
end;
(*************************************************************************)
Type (* PXOBNET.DAT *)
NetRecType = Record
Status : Longint;
MsgNum : Longint; (* *.MSG message number *)
obFlags : Longint; (* ob flags *)
DAddress : AddressType; (* destination address *)
OAddress : AddressType; (* Originating address *)
DateSent : Longint; (* MSDOS 4 byte stamp *)
Files : String[72]; (* Files for request/attach *)
WCNetmail : Boolean; (* if true, MsgNum is MsgNum *)
(* Must be careful if renumbering
takes place during existence
*)
TaskNumber : Word;
RouteAddress : AddressType;
PktName : Pathstr; (* Outbound PKT fname name *)
extra : array[1..50] of byte;
end;
(*************************************************************************)
(* flags for PXQUEUE.DAT *)
Const (* attributes for prFlags *)
_pqLocked = $00000001; (* currently active *)
_pqSent = $00000002; (* already sent *)
_pqBadNode = $00000004; (* not in nodelist *)
_pqMaxTries = $00000008; (* too many attempts *)
_pqBadPwd = $00000010; (* Bad Password *)
_pqPriority = $00000020; (* High Priority Poll *)
Type
QueueRecType = (* PXQUEUE.DAT *)
Record
status : Longint; (* record status -1 if deleted *)
prflags : Longint; (* Poll Rec Flags *)
_Current : Word; (* OBSOLETE file position *)
Task : Word; (* Node Handing it *)
EventTag : Word; (* Event to honor *)
Address : AddressType; (* Address to call *)
DateCreated : Longint; (* Date Poll Record Created *)
DateSent : Longint; (* Successfully Sent *)
LastPolldate : LongInt; (* Last Poll Attempt *)
Attempts : Word; (* Attempts *)
BusyCnt : Word; (* Busy *)
NoCarrierCnt : Word; (* No Carrier *)
TimeOutCnt : Word; (* time out waiting *)
DroppedCnt : Word; (* remote dropped *)
BadHSCnt : Word; (* bad handshake *)
Minutes : Word; (* Total Connect Time *)
SendMail : Boolean; (* Send Mail On Hold *)
CostToCall : Integer; (* From NodeList *)
PrevDial : Boolean; (* Previous dial. For Round Robin *)
Current : Longint; (* File Position *)
Extra : Array[1..42] of Byte;
end;
(*************************************************************************)
(*
The attach queue can be used by many things.
- Tic Processor
*)
Type _AttachQueueType = (* PXATTACH.DAT *)
record
status : longint;
Daddress : AddressType; (* Destination Address *)
obFlags : Longint; (* outbound flags *)
DateCreated : Longint;
DateSent : Longint;
files : string; (* List of files to send *)
TaskNumber : Word; (* 0 or task number *)
AppTag : String[3]; (* TIC for tic processor *)
RouteAddress : AddressType; (* not used *)
Extra : array[1..86] of char;
end;
(*************************************************************************)
Type (* PXSTATS.DAT *)
_StatRecType =
record
InB, OutB, Cost, Extra : Longint;
end;
_StatType =
record
Total : _StatRecType;
Fido : _StatRecType;
Fax : _StatRecType;
Uucp : _StatRecType;
Cis : _StatRecType;
Human : _StatRecType;
extra : array[1..10] of _StatRecType;
end;
(************************************************************ CALLER LOG *)
type (* Date Routines from Turbo Power Software *)
Date = Word;
Time = LongInt;
DateTimeRec = record
D : Date;
T : Time;
end;
Type AddressType = record
zone,
net,
node,
point : word;
end;
Type FidoAddressType = record
zone,
net,
node,
point : word;
domain : string[25];
end;
Type
EntryKindType = (HumanCall, FidoCall, InternetCall, FaxCall);
(* PXCallLogFname *)
Type _CallLogType = (* PXCALL.HIS *)
record
Status : Longint;
Header : word; (* $FFFF if header *)
LastEntry : DatetimeRec;
TaskNumber : Word;
EntryKind : EntryKindType;
case integer of
0 : ( (* Not used *)
SysopName : String[35];
Address : AddressType;
FidoTimeCalled : DateTimeRec;
YouCalled : Boolean;
);
1 : (
Name : String[35];
from : String[30];
UserId : Longint;
LoginTime : DateTimeRec;
LogoffTime : DateTimeRec;
BaudRate : Longint;
Extra : array[1..46] of byte;
);
end;
(************************************************************ AUTO POLL *)
Type PollKindType = (pkFido,pkFax,pkUUCP);
Const
PollKindStr : Array[PollKindType] of string[15] =
(
'Poll Fido Node',
'Call Fax Number',
'Call Internet'
);
Type _PollRecType = record
status : longint;
inActive : boolean;
PollKind : PollKindType;
Address : AddressType; (* fido address *)
PhoneNumber : String[30]; (* fax phone number *)
InetProvider : String[30]; (* Internet provider *)
PollEvent : Word;
TaskNumber : Word;
SendMail : Boolean;
Priority : Boolean; (* Priority, No Round Robin*)
extra : array[1..48] of char;
end;
(************************************************ FREQ LIST AND MAGIC LIST *)
type _FreqListRecType = record (* PXFREQ.DAT *)
status : longint;
InActive : Boolean;
Secured : Boolean;
PXonly : Boolean;
AddressSpec : String[25]; (* Mask Address *)
password : string[10];
Confnum : Word;
FileSpec : String;
end;
type _MagicListRecType = record (* PXMAGIC.DAT *)
status : longint; (* -1 for deleted *)
InActive : Boolean; (* true for inactive *)
Secured : Boolean; (* Secured Session Only *)
PXonly : Boolean; (* Only PX Connects *)
AddressSpec : String[25]; (* Mask Address *)
password : string[10]; (* File Password *)
MagicName : String[15]; (* Magic Name *)
FileSpec : String; (* Files(s), Spec *)
end;
Type (* FRQSessionFname= 'PXFRSC.DAT'; file req session control *)
_FreqSessionType = Record
Status : Integer;
Inactive : Integer;
Address : AddressType;
LastSessionDate : Date;
TotalFiles : Longint;
TotalBytes : Longint;
DayFiles : Longint;
DayBytes : Longint;
SessionBytes : Longint;
SessionFiles : Longint;
Extra : Array[1..50] of byte;
end;
type _TicAnnounceType = record (* PXTICANN.DAT *)
status : longint;
InActive : Boolean;
EchoTag : String[50];
ConfNumber : Word;
IgnoreMsgAnn : Boolean; (* ignore MsgAnnounce *)
Address : Addresstype;
ToWhom : String[70];
FromWhom : String[70];
Subject : String[70];
Flags : Word;
TemplateFname : Pathstr; (* Only 12 bytes used *)
AutoPostMail : Boolean;
FooterFname : String[12];
AkaAddress : AddressType;
wcPrivate : Boolean;
Extra : array[1..77] of byte;
end;
implementation
end.