DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦0ecfc853d⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Telnet_Protocol, pragma Module_Name 4 2506, pragma Subsystem Network, seg_012b44

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Byte_Defs;
with Transport;
with Transport_Defs;

package Telnet_Protocol is

    pragma Subsystem (Network);
    pragma Module_Name (4, 2506);

    type Connection_Id is private;

    pragma Consume_Offset (5);

    procedure Open (Connection : out Connection_Id;
                    Remote : Transport.Connection_Id);
    -- Allocate Telnet resources (including space to store
    -- option values), and bind them to the given Remote.
    -- Initially, all options for both owners are disabled.
    -- Does not affect the Transport connection.

    procedure Close (Connection : Connection_Id);
    -- Release Telnet resources.
    -- Closes the Transport connection.

    function Remote (Connection : Connection_Id) return Transport.Connection_Id;
    -- Return the ID of the associated Transport connection.

    function Image (Connection : Connection_Id) return String;
    -- Return a unique name for a connection.


    ---- OPTION NEGOTIATION ----
    type Option is (Transmit_Binary, Echo, Suppress_Go_Ahead);

    type Owner is (Local, Remote);

    type Desired_Option_States is (On, Off, Dont_Care);
    subtype Current_Option_States is Desired_Option_States range On .. Off;

    procedure Offer (Connection : Connection_Id;
                     For_Option : Option;
                     For_Owner : Owner;
                     To_State : Desired_Option_States := Off);
    -- Initiate negotiation of an option value.
    -- To_State indicates the desired option value.

    procedure Request (Connection : Connection_Id;
                       For_Option : Option;
                       For_Owner : Owner;
                       To_State : Desired_Option_States := Off;
                       Success : out Boolean;
                       Max_Wait : Duration := Duration'Last);
    -- Initiate negotiation of an option value.
    -- To_State indicates the desired option value.
    -- Wait until the remote Telnet implementation either
    -- accepts or rejects the option, or Max_Wait expires.
    -- If the option is accepted, return Success = True,
    -- otherwise return Success = False.

    function State_Of (Connection : Connection_Id;
                       For_Option : Option;
                       For_Owner : Owner) return Current_Option_States;
    -- Return the current state of the option.


    ---- DATA I/O ----

    type Signal_Type is (None, New_Line, Synch, Break,
                         Interrupt_Process, Abort_Output, Are_You_There,
                         Erase_Character, Erase_Line, Go_Ahead);

    procedure Transmit (Connection : Connection_Id;
                        Status : out Transport_Defs.Status_Code;
                        Data : Byte_Defs.Byte_String;
                        Count : out Natural;
                        Signal : Telnet_Protocol.Signal_Type := None;
                        Max_Wait : Duration := Duration'Last);

    procedure Transmit (Connection : Connection_Id;
                        Status : out Transport_Defs.Status_Code;
                        Data : String;
                        Count : out Natural;
                        Signal : Telnet_Protocol.Signal_Type := None;
                        Max_Wait : Duration := Duration'Last);

    procedure Transmit (Connection : Connection_Id;
                        Status : out Transport_Defs.Status_Code;
                        Signal : Telnet_Protocol.Signal_Type;
                        Max_Wait : Duration := Duration'Last);
    -- Transmit the given Data, followed by the given Signal.
    -- Stuff NUL's after CR's, and double 255's.
    -- Shave off high-order bits if not transmitting binary.


    procedure Receive (Connection : Connection_Id;
                       Status : out Transport_Defs.Status_Code;
                       Data : out Byte_Defs.Byte_String;
                       Count : out Natural;
                       Signal : out Telnet_Protocol.Signal_Type;
                       Max_Wait : Duration := Duration'Last);

    procedure Receive (Connection : Connection_Id;
                       Status : out Transport_Defs.Status_Code;
                       Data : out String;
                       Count : out Natural;
                       Signal : out Telnet_Protocol.Signal_Type;
                       Max_Wait : Duration := Duration'Last);
    -- Receive some information.  Stop when either
    -- (1) a non-OK Status is received, or
    -- (2) a non-None Signal is received, or
    -- (3) some Data are received, or
    -- (4) Max_Wait expires.
    -- Return the number of Data bytes received in Count.
    -- Strip NUL's after CR's, and un-double 255's.
    -- Echo data if the Echo option is enabled.

    -- Receive will not return both data (Count > 0)
    -- and a signal (Signal /= None) in the same call.

    -- NOTE: only one Receive can be made at a time and
    --       that at one Receive must be pending for forward
    --       progress.

    ---- EXCEPTIONS ----
    Not_Connected : exception;
    Receive_Data_Error : exception;

    pragma Consume_Offset (4);

    procedure Caller_Will_Take_Responsibility_For_Echo
                 (Connection : Connection_Id;
                  Caller_Will_Take_Responsibility : Boolean := True);

end Telnet_Protocol;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=21 rec1=00 rec2=01 rec3=02e
        [0x01] rec0=17 rec1=00 rec2=02 rec3=030
        [0x02] rec0=16 rec1=00 rec2=03 rec3=07a
        [0x03] rec0=16 rec1=00 rec2=04 rec3=006
        [0x04] rec0=15 rec1=00 rec2=05 rec3=060
        [0x05] rec0=0f rec1=00 rec2=06 rec3=000
    tail 0x2170e64d282b14dd7ce32 0x42a00088462060003