Category : Pascal Source Code
Archive   : TPNOV6.ZIP
Filename : IPXHDR.DOC

 
Output of file : IPXHDR.DOC contained in archive : TPNOV6.ZIP
unit IPXLib;

interface

uses DOS;

const
UNKNOWN_PACKET_TYPE = 0;
ROUTING_INFORMATION_PACKET = 1;
ECHO_PACKET = 2;
ERROR_PACKET = 3;
PACKET_EXCHANGE_PACKET = 4;
SEQUENCED_PACKET_PROTOCOL_PACKET = 5;

ANY_SERVER = $FFFF;


type
ServerID = array[1..48] of char;

NetworkAddress = array[1..4] of byte;
NodeAddress = array[1..6] of byte;
SocketAddress = word;

InternetworkAddress = RECORD
NetworkNumber : NetworkAddress;
PhysicalNodeNumber : NodeAddress;
SocketNumber : SocketAddress;
end;

IPXHeaderType = RECORD
CheckSum : word;
Length : word;
TransportControl : byte;
PacketType : byte;
Destination : InternetworkAddress;
Source : InternetworkAddress;
end;

IPXPacketType = RECORD
Header : IPXHeaderType;
end;

SPXPacketType = RECORD
Header : IPXHeaderType;
ConnectionControl : byte;
DataStreamType : byte;
SourceConnectionID : word;
DestinationConnectionID : word;
SequenceNumber : word;
AcknowledgeNumber : word;
AllocationNumber : word;
end;

ConnectionStatusBlock = RECORD
ConnectionState : byte;
ConnectionFlags : byte;
SourceConnectionID : word;
DestinationConnectionID : word;
SequenceNumber : word;
AcknowledgeNumber : word;
AllocationNumber : word;
RemoteAcknowledgeNumber : word;
RemoteAllocationNumber : word;
ConnectionSocket : word;
ImmeadiateAddress : word;
Destination : InternetworkAddress;
RetransmissionCount : word;
EstimatedRoundtripDelay : word;
RetransmittedPackets : word;
SuppressedPackets : word;
end;

SAPFunctionType = RECORD
case integer of
1 : (ResponseType : word);
2 : (QueryType : word);
3 : (AutoBroadcastType : word);
4 : (ServerShutdownAdType : word);
end;

SAPPacketType = RECORD
Header : IPXHeaderType;
FunctionCode : SAPFunctionType;
ServerType : word;
ServerName : ServerID;
ResidentNetwork : InternetworkAddress;
IntermediateNetworks : word;
end;

ServerIDInfo = RECORD
ServerType : word;
ServerName : ServerID;
ResidentNetwork : InternetworkAddress;
IntermediateNetworks : word;
end;

GSQPacketType = RECORD
Header : IPXHeaderType;
FunctionCode : SAPFunctionType;
ServerInfo : array[1..8] of ServerIDInfo
end;

PacketDescriptorType = RECORD
case integer of
1 : (IPXAddress : ^IPXPacketType;
IPXSize : integer);
2 : (SPXAddress : ^SPXPacketType;
SPXSize : integer);
3 : (SAPAddress : ^SAPPacketType;
SAPSize : integer);
4 : (GSQAddress : ^GSQPacketType;
GSQSize : integer);
end;

DescriptorType = RECORD
Address : pointer;
Size : integer;
end;

AESECB = RECORD
Link : pointer;
ESRAddress : pointer;
InUse : boolean;
AESWorkSpace : array[1..5] of byte;
end;

WorkSpaceArray = array[1..12] of byte;

IPXECB = RECORD
Link : pointer;
ESRAddress : pointer;
InUse : boolean;
CompletionCode : byte;
SocketNumber : word;
IPXWorkSpace : longint;
DriverWorkSpace : WorkSpaceArray;
ImmediateAddress : NodeAddress;
FragmentCount : integer;
PacketDescriptor : PacketDescriptorType;
FragmentDescriptor : DescriptorType;
PascalESRAddress : pointer;
UserDataAddress : pointer;
end;

var
IPXResult : integer;
var
SPXInstalled : boolean;
var
SPXResult : integer;
var
SAPResult : integer;
SAPSocket : word;
SAPadECB : ^IPXECB;
SAPadPacket : ^SAPPacketType;
SAPWaitAddress,
SAPAdvertiseAddress : pointer;
var
Regs : Registers;


(* IPX *********************************************************************)

procedure SetDataSegment;
procedure PrepareIPXInterface;
procedure OpenSocket(var SocketNumber : word);
procedure CloseSocket(SocketNumber : word);
procedure GetLocalTarget(var InterNetAddress; var LocalTargetAddress; var TransportTime : integer);
procedure SendPacket(var AnECB);
procedure ListenForPacket(var AnECB);
procedure ScheduleIPXEvent(Delay : integer; var AnECB);
procedure CancelEvent(var AnECB);
procedure ScheduleSPecialEvent(Delay : integer; var AnECB);
procedure GetIntervalMarker(var IntervalMarker : word);
procedure GetInterNetworkAddress(var LocalNetworkAddress);
procedure RelinquishControl;
procedure DisconnectFromTarget(var ATargetAddress);


(* SPX *********************************************************************)

procedure CheckSPXInstallation;
procedure EstablishConnection(RetryCount : byte; MonitorConnection : boolean;
var AnECB; var ConnectionID : word);
procedure ListenForConnection(RetryCount : byte; MonitorConnection : boolean;
var AnECB);
procedure TerminateConnection(ConnectionNumber : word; var AnECB);
procedure AbortConnection(ConnectionNumber : word);
procedure GetConnectionStatus(ConnectionNumber : word; var AnECB; var Exists : boolean);
procedure SendSequencedPacket(ConnectionNumber : word; var AnECB);
procedure ListenForSequencedPacket(var AnECB);
procedure ESRPortal;
function ReverseWord(BackwardsWord : word) : word;

(***************************************************************************)


  3 Responses to “Category : Pascal Source Code
Archive   : TPNOV6.ZIP
Filename : IPXHDR.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/