DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦0f7122eaf⟧ TextFile

    Length: 16697 (0x4139)
    Types: TextFile
    Names: »V«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Io_Exceptions;
with Mac_Types;
package Tcp is


    type B_16 is range 0 .. 65535;
    subtype B_32 is Mac_Types.Longint;

    subtype Ip_Addr is B_32;     -- IP address is 32-bits

    type Wdsentry is
        record
            Length : B_16;      -- length of buffer
            Ptr : Mac_Types.Ptr;    -- pointer to buffer
        end record;

    type Rdsentry is
        record
            Length : B_16;      -- length of buffer
            Ptr : Mac_Types.Ptr;    -- pointer to buffer
        end record;

    type Stream_Ptr is private;

    subtype Ip_Port is B_16;

-- ICMPMsgType
    Netunreach : constant := 0;
    Hostunreach : constant := 1;
    Protocolunreach : constant := 2;
    Portunreach : constant := 3;
    Fragreqd : constant := 4;
    Sourceroutefailed : constant := 5;
    Timeexceeded : constant := 6;
    Parmproblem : constant := 7;
    Missingoption : constant := 8;
    Lasticmpmsgtype : constant := 65535;

    type Icmpreport is
        record
            Streamptr : Stream_Ptr;
            Localhost : Ip_Addr;
            Localport : Ip_Port;
            Remotehost : Ip_Addr;
            Remoteport : Ip_Port;
            Reporttype : B_32;   -- ICMPMsgType
            Optionaladdlinfo : B_16;
            Optionaladdlinfoptr : B_32;
        end record;


-- typedef OSErr (*OSErrProcPtr)(...);
-- typedef Ptr (*PtrProcPtr)();
-- typedef Boolean (*BooleanProcPtr)();
-- typedef void (*voidProcPtr)();


-- TCPEventCode
    Tcpclosing : constant := 1;
    Tcpulptimeout : constant := 2;
    Tcpterminate : constant := 3;
    Tcpdataarrival : constant := 4;
    Tcpurgent : constant := 5;
    Tcpicmpreceived : constant := 6;
    Lastevent : constant := 65535;


-- TCPTerminationReason
    Tcpremoteabort : constant := 2;
    Tcpnetworkfailure : constant := 3;
    Tcpsecprecmismatch : constant := 4;
    Tcpulptimeoutterminate : constant := 5;
    Tcpulpabort : constant := 6;
    Tcpulpclose : constant := 7;
    Tcpserviceerror : constant := 8;
    Lastreason : constant := 65535;

-- typedef pascal void (*TCPNotifyProc) (
--  stream_ptr tcpStream,
--  unsigned short eventCode,
--  Ptr userDataPtr,
--  unsigned short terminReason,
--  struct ICMPReport *icmpMsg);

-- typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb);

    subtype Tcp_Port is B_16;

-- ValidityFlags
    Timeoutvalue : constant := 16#80#;
    Timeoutaction : constant := 16#40#;
    Typeofservice : constant := 16#20#;
    Precedence : constant := 16#10#;

-- TOSFlags
    Lowdelay : constant := 16#01#;
    Throughput : constant := 16#02#;
    Reliability : constant := 16#04#;

    type Other_Options is array (1 .. 40) of Mac_Types.Byte;

    type Tcpopenpb is
        record
            Fill1 : Mac_Types.Longint;
            Fill2 : Mac_Types.Longint;
            Fill3 : Mac_Types.Longint;
            Iocompletion : Mac_Types.Procptr;  -- TCPIOCompletionProc;
            Ioresult : Mac_Types.Integer;
            Ionameptr : Mac_Types.Stringptr;
            Iovrefnum : Mac_Types.Integer;
            Iocrefnum : Mac_Types.Integer;
            Cscode : Mac_Types.Integer;
            Tcpstream : Stream_Ptr;
            Ulptimeoutvalue : Mac_Types.Byte;
            Ulptimeoutaction : Mac_Types.Byte;
            Validityflags : Mac_Types.Byte;
            Commandtimeoutvalue : Mac_Types.Byte;
            Remotehost : Ip_Addr;
            Remoteport : Tcp_Port;
            Localhost : Ip_Addr;
            Localport : Tcp_Port;
            Tosflags : Mac_Types.Byte;
            Precedence : Mac_Types.Byte;
            Dontfrag : Boolean;
            Timetolive : Mac_Types.Byte;
            Security : Mac_Types.Byte;
            Optioncnt : Mac_Types.Byte;
            Options : Other_Options;
            Userdataptr : Mac_Types.Ptr;
        end record;
    type Tcpopenpbptr is access Tcpopenpb;

    type Tcpsendpb is
        record
            Fill1 : Mac_Types.Longint;
            Fill2 : Mac_Types.Longint;
            Fill3 : Mac_Types.Longint;
            Iocompletion : Mac_Types.Procptr;  -- TCPIOCompletionProc;
            Ioresult : Mac_Types.Integer;
            Ionameptr : Mac_Types.Stringptr;
            Iovrefnum : Mac_Types.Integer;
            Iocrefnum : Mac_Types.Integer;
            Cscode : Mac_Types.Integer;
            Tcpstream : Stream_Ptr;
            Ulptimeoutvalue : Mac_Types.Byte;
            Ulptimeoutaction : Mac_Types.Byte;
            Validityflags : Mac_Types.Byte;
            Pushflag : Boolean;
            Urgentflag : Boolean;
            Wdsptr : Mac_Types.Ptr;
            Sendfree : Mac_Types.Longint;
            Sendlength : B_16;
            Userdataptr : Mac_Types.Ptr;
        end record;
    type Tcpsendpbptr is access Tcpsendpb;

    type Tcpreceivepb is
        record  -- for receive and return rcv buff calls
            Fill1 : Mac_Types.Longint;
            Fill2 : Mac_Types.Longint;
            Fill3 : Mac_Types.Longint;
            Iocompletion : Mac_Types.Procptr;  -- TCPIOCompletionProc;
            Ioresult : Mac_Types.Integer;
            Ionameptr : Mac_Types.Stringptr;
            Iovrefnum : Mac_Types.Integer;
            Iocrefnum : Mac_Types.Integer;
            Cscode : Mac_Types.Integer;
            Tcpstream : Stream_Ptr;
            Commandtimeoutvalue : Mac_Types.Byte;
            Filler : Mac_Types.Byte;
            Markflag : Boolean;
            Urgentflag : Boolean;
            Rcvbuff : Mac_Types.Ptr;
            Rcvbufflen : B_16;
            Rdsptr : Mac_Types.Ptr;
            Rdslength : B_16;
            Secondtimestamp : B_16;
            Userdataptr : Mac_Types.Ptr;
        end record;
    type Tcpreceivepbptr is access Tcpreceivepb;

    type Histobucket is
        record
            Value : B_16;
            Counter : Mac_Types.Longint;
        end record;

    Numofhistobuckets : constant := 7;
    type Histobuckets is array (1 .. Numofhistobuckets) of Histobucket;

    type Tcpconnectionstats is
        record
            Datapktsrcvd : Mac_Types.Longint;
            Datapktssent : Mac_Types.Longint;
            Datapktsresent : Mac_Types.Longint;
            Bytesrcvd : Mac_Types.Longint;
            Bytesrcvddup : Mac_Types.Longint;
            Bytesrcvdpastwindow : Mac_Types.Longint;
            Bytessent : Mac_Types.Longint;
            Bytesresent : Mac_Types.Longint;
            Numhistobuckets : B_16;
            Sentsizehisto : Histobuckets;
            Lastrtt : B_16;
            Tmrsrtt : B_16;
            Rttvariance : B_16;
            Tmrrto : B_16;
            Sendtries : Mac_Types.Byte;
            Sourchquenchrcvd : Mac_Types.Byte;
        end record;
    type Tcpconnectionstatsptr is access Tcpconnectionstats;

    type Tcpstatuspb is
        record
            Fill1 : Mac_Types.Longint;
            Fill2 : Mac_Types.Longint;
            Fill3 : Mac_Types.Longint;
            Iocompletion : Mac_Types.Procptr;  -- TCPIOCompletionProc;
            Ioresult : Mac_Types.Integer;
            Ionameptr : Mac_Types.Stringptr;
            Iovrefnum : Mac_Types.Integer;
            Iocrefnum : Mac_Types.Integer;
            Cscode : Mac_Types.Integer;
            Tcpstream : Stream_Ptr;
            Ulptimeoutvalue : Mac_Types.Byte;
            Ulptimeoutaction : Mac_Types.Byte;
            Unused : Mac_Types.Longint;
            Remotehost : Ip_Addr;
            Remoteport : Tcp_Port;
            Localhost : Ip_Addr;
            Localport : Tcp_Port;
            Tosflags : Mac_Types.Byte;
            Precedence : Mac_Types.Byte;
            Connectionstate : Mac_Types.Byte;
            Sendwindow : B_16;
            Rcvwindow : B_16;
            Amtunackeddata : B_16;
            Amtunreaddata : B_16;
            Securitylevelptr : Mac_Types.Ptr;
            -- HEMS-HEMP stats
            Sendunacked : Mac_Types.Longint;
            Sendnext : Mac_Types.Longint;
            Congestionwindow : Mac_Types.Longint;
            Rcvnext : Mac_Types.Longint;
            Srtt : Mac_Types.Longint;
            Lastrtt : Mac_Types.Longint;
            Sendmaxsegsize : Mac_Types.Longint;
            Connstatptr : Tcpconnectionstatsptr;
            Userdataptr : Mac_Types.Ptr;
        end record;
    type Tcpstatuspbptr is access Tcpstatuspb;

    type Tcpparam is
        record
            Tcprtoa : Mac_Types.Longint;
            Tcprtomin : Mac_Types.Longint;
            Tcprtomax : Mac_Types.Longint;
            Tcpmaxsegsize : Mac_Types.Longint;
            Tcpmaxconn : Mac_Types.Longint;
            Tcpmaxwindow : Mac_Types.Longint;
        end record;
    type Tcpparamptr is access Tcpparam;

    type Tcpstats is
        record
            Tcpconnattempts : Mac_Types.Longint;
            Tcpconnopened : Mac_Types.Longint;
            Tcpconnaccepted : Mac_Types.Longint;
            Tcpconnclosed : Mac_Types.Longint;
            Tcpconnaborted : Mac_Types.Longint;
            Tcpoctetsin : Mac_Types.Longint;
            Tcpoctetsout : Mac_Types.Longint;
            Tcpoctetsindup : Mac_Types.Longint;
            Tcpoctetsretrans : Mac_Types.Longint;
            Tcpinputpkts : Mac_Types.Longint;
            Tcpoutputpkts : Mac_Types.Longint;
            Tcpduppkts : Mac_Types.Longint;
            Tcpretranspkts : Mac_Types.Longint;
        end record;
    type Tcpstatsptr is access Tcpstats;


-- Opens the MacTCP driver.
-- Can raise Device_Error, Timeout_Error
    procedure Open_Tcp_Driver;

-- Creates a new TCP stream in preparation for initiating a connection.
-- A buffer must be provided for storing incoming data waiting to be processed
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Create_Stream (A_Stream : out Stream_Ptr;
                                     Connectionbuffer : Mac_Types.Ptr;
                                     Connbufferlen : Natural;
                                     Notify_Proc : Mac_Types.Procptr;
                                     Userdataptr : Mac_Types.Ptr);

-- If TCPWaitForConnection is called asynchronously, this command retrieves the
-- result of the call.  It should be called when the above command completes.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Finish_Tcp_Wait_For_Connection (Pb : in out Tcpopenpbptr;
                                                  Remotehost : out Ip_Addr;
                                                  Remoteport : out Tcp_Port;
                                                  Localhost : out Ip_Addr;
                                                  Localport : out Tcp_Port);

-- Waits for a connection to be opened on a specified port from a specified address.
-- It completes when a connection is made, or a timeout value is reached.  This call
-- may be made asynchronously.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Wait_For_Connection (A_Stream : Stream_Ptr;
                                           Timeout : Mac_Types.Byte;
                                           Remotehost : in out Ip_Addr;
                                           Remoteport : in out Tcp_Port;
                                           Localhost : out Ip_Addr;
                                           Localport : in out Tcp_Port;
                                           Async : Boolean;
                                           Userdataptr : Mac_Types.Ptr;
                                           Returnblock : out Tcpopenpbptr);

-- Attempts to initiate a connection with a host specified by host and port.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Open_Connection (A_Stream : Stream_Ptr;
                                       Timeout : Mac_Types.Byte;
                                       Remotehost : Ip_Addr;
                                       Remoteport : Tcp_Port;
                                       Localhost : out Ip_Addr;
                                       Localport : in out Tcp_Port;
                                       Userdataptr : Mac_Types.Ptr);

-- This routine should be called when a TCPSendData call completes.  It returns the
-- error code generated upon completion of the CallTCPSend.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Finish_Tcp_Send (Pb : in out Tcpsendpbptr);

-- Sends data through an open connection stream.  Note that the connection must be
-- open before any data is sent. This call may be made asynchronously.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Send_Data (A_Stream : Stream_Ptr;
                                 Timeout : Mac_Types.Byte;
                                 Push : Boolean;
                                 Urgent : Boolean;
                                 Wdsptr : Mac_Types.Ptr;
                                 Async : Boolean;
                                 Userdataptr : Mac_Types.Ptr;
                                 Returnblock : out Tcpsendpbptr);

--
-- Can raise Device_Error, Timeout_Error
    procedure Low_Finish_Tcp_No_Copy_Rcv (Pb : in out Tcpreceivepbptr;
                                          Urgent : out Boolean;
                                          Mark : out Boolean);

--
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_No_Copy_Rcv (A_Stream : Stream_Ptr;
                                   Timeout : Mac_Types.Byte;
                                   Urgent : out Boolean;
                                   Mark : out Boolean;
                                   Rdsptr : Mac_Types.Ptr;
                                   Numentry : B_16;
                                   Async : Boolean;
                                   Userdataptr : Mac_Types.Ptr;
                                   Returnblock : out Tcpreceivepbptr);

--
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Bfr_Return
                 (A_Stream : Stream_Ptr; Rdsptr : Mac_Types.Ptr);

-- If the below is called asynchronously, this routine returns the data that was
-- received from the remote host.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Finish_Tcp_Recv (Pb : in out Tcpreceivepbptr;
                                   Urgent : out Boolean;
                                   Mark : out Boolean;
                                   Rcvlen : out B_16);

-- Attempts to pull data out of the incoming stream for a connection. If data is
-- not present, the routine waits a specified amout of time before returning with
-- a timeout error.  This call may be made asynchronously.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Recv_Data (A_Stream : Stream_Ptr;
                                 Timeout : Mac_Types.Byte;
                                 Urgent : out Boolean;
                                 Mark : out Boolean;
                                 Rcvbuff : Mac_Types.Ptr;
                                 Rcvlen : in out B_16;
                                 Async : Boolean;
                                 Userdataptr : Mac_Types.Ptr;
                                 Returnblock : out Tcpreceivepbptr);

-- Gracefully closes a connection with a remote host.  This is not always possible,
-- and the programmer might have to resort to CallTCPAbort, described next.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Close (A_Stream : Stream_Ptr; Timeout : Mac_Types.Byte);

-- Should be called if a CallTCPClose fails to close a connection properly.
-- This call should not normally be used to terminate connections.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Abort (A_Stream : Stream_Ptr);

--
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Status (A_Stream : Stream_Ptr;
                              Thestatus : out Tcpstatuspb);

-- Deallocates internal buffers used to hold connection data. This should be
-- called after a connection has been closed.
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Release (A_Stream : Stream_Ptr;
                               Recvptr : out Mac_Types.Ptr;
                               Recvlen : out Mac_Types.Longint);

--
-- Can raise Device_Error, Timeout_Error
    procedure Low_Tcp_Global_Info
                 (Tcpparam : out Tcpparamptr; Tcpstat : out Tcpstatsptr);

-- Returns the IP address of the local computer.
-- Can raise Device_Error, Timeout_Error
    procedure Get_My_Ip (Ipnum : out Ip_Addr);

-- Kills any pending calls to the TCP driver
-- Can raise Device_Error, Timeout_Error
    procedure Low_Kill_Tcp (Pb : Tcpopenpbptr);
    procedure Low_Kill_Tcp (Pb : Tcpsendpbptr);
    procedure Low_Kill_Tcp (Pb : Tcpreceivepbptr);

    Device_Error : exception renames Io_Exceptions.Device_Error;
    Timeout_Error : exception;

private

    type Stream_Ptr is new Mac_Types.Longint;

end Tcp;