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

⟦1ebe4ac35⟧ TextFile

    Length: 10412 (0x28ac)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

with Profile;
with Transport;
with Transport_Defs;
with Text_Io;

package Transport_Name is

    pragma Subsystem (Input_Output, Private_Part => Closed);
    pragma Module_Name (4, 3535);

    function Host_To_Network_Name (Host_Name : String)
                                  return Transport_Defs.Network_Name;

    function Host_To_Host_Id (Host_Name : String) return Transport_Defs.Host_Id;

    function Host_Id_To_Host (Host : Transport_Defs.Host_Id) return String;

    -- function Host_Id_To_Host (Network : Transport_Defs.Network_Name;
    --                           Host : Transport_Defs.Host_Id) return String;
    -- ... at end for upward-compatibility.

    Undefined : exception;

    type Host_Iterator is limited private;
    procedure Init  (Iter : in out Host_Iterator);
    procedure Next  (Iter : in out Host_Iterator);
    function  Value (Iter : Host_Iterator) return String;
    function  Done  (Iter : Host_Iterator) return Boolean;

    function Host_To_Machine_Type (Host_Name : String) return String;

    -- Host_to_Network_Name and Host_to_Host_Id begin by attempting to
    -- query a TCP/IP name server.  The object !Machine.Tcp_Ip_Name_Server
    -- is read as text: it must contain the Internet address of the server
    -- in decimal dotted notation.  The address is used to send a query in
    -- a UDP datagram.  If an answer is received, Host_to_Host_Id returns
    -- it, and Host_to_Network_Name returns "TCP/IP".  If any step of this
    -- process fails (for example, there is no Tcp_Ip_Name_Server file),
    -- the function instead attempts to resolve the name as follows:
    --
    -- Other name resolution operations are driven by a text file, namely
    -- !Machine.Transport_Name_Map.  The mapping from host_name to other
    -- values is changed by changing this file.  Each line of the file
    -- must contain the following, in the order given, separated by spaces:
    --
    --    a network_name,
    --    a host_id, in decimal notation xx.yy.zz, and
    --    a host_name, which must be an Ada simple identifier.
    --
    -- After the host name, each line may contain an optional machine_type:
    -- this identifies the operating system running on that host.
    -- See Ftp_Name_Map.Machine_Type.  If the machine_type is omitted,
    -- Host_to_Machine_Type will return the null string.
    --
    -- Comments, beginning with "--", may be added to the end of any line.

    function Local_Host_Name
                (Network : Transport_Defs.Network_Name) return String;


    -- Each user may keep maps from Host_Name to username, password
    -- and session for that host.  The maps are pointed to by the
    -- profile values Remote_Passwords (for usernames and passwords)
    -- and Remote_Sessions (for sessions).  See the documentation of
    -- package Profile for further details.

    function Host_To_Remote_Username
                (Host_Name : String;
                 Response  : Profile.Response_Profile := Profile.Get)
                return String;
    function Host_To_Remote_Password
                (Host_Name : String;
                 Response  : Profile.Response_Profile := Profile.Get)
                return String;
    function Host_To_Remote_Session
                (Host_Name : String;
                 Response  : Profile.Response_Profile := Profile.Get)
                return String;

    function Host_Id_To_Host (Network : Transport_Defs.Network_Name;
                              Host    : Transport_Defs.Host_Id) return String;

    -- A network object name consists of "!!", followed by a host
    -- name, followed by either "." or "!", followed by the name
    -- of an object within that host.

    function Is_Network_Object_Name (Name : String) return Boolean;
    -- Return true iff the name is a syntactically correct
    -- network object name.  The host_name need not be defined.

    function Network_Object_To_Host (Name : String) return String;
    -- If not Is_Network_Object_Name (Name) then raise Constraint_Error.
    -- Otherwise, return the host name part of a network object name,
    -- without the leading "!!" or trailing punctuation "!" or ".".
    -- The returned name is not neccessarily defined.

    function Network_Object_To_Rest (Name : String) return String;
    -- if not Is_Network_Object_Name (Name) then raise Constraint_Error.
    -- Otherwise, return the object name part of a network object name,
    -- beginning with "!" (even if the original punctuation was ".").
    -- The returned name does not neccessarily denote an extant object.

    package Service is
        -- A mapping from the name of a service to where it is available;
        -- that is, the Network(s) and Socket_Id(s) where its servers wait.

        -- This mapping is stored in the text object named
        File_Name : constant String := "!Machine.Transport_Services";

        -- Within this object, each non-empty text line contains
        --   * a Transport_Defs.Network_Name,
        --   * a Transport_Defs.Socket_Id,
        --   * a service name, and
        --   * optionally a machine name;
        -- in that order, separated by white space (blanks or tabs).
        -- Characters from "--" to the end of the line are a comment.  A
        -- Network_Name, Socket_Id, service name or machine name must not
        -- contain any white space or the character sequence "--".  The
        -- Transport_Defs.Socket_Id is in decimal dotted notation; that is, a
        -- sequence of non-negative decimal integers separated by periods.
        -- Each integer represents one or more bytes, as minimally required to
        -- represent that integer in binary form, most significant byte first.
        -- For example, 258 and 1.2 represent the same Socket_Id, which is
        -- expressed in Ada as (1,2).  A service name or a machine name should
        -- be a valid Ada identifier.  The case (upper or lower) of a service
        -- name or a machine name is not significant.

        -- A line signifies that the named service is available via the given
        -- network at the given socket in the given machine; if no machine
        -- name is given, the line signifies that the named service is
        -- available via the given network at the given socket in all machines
        -- not specifically named in other lines.

        function Normalize (Service_Name : String) return String;
        -- change to lower case, and strip leading or trailing white space.

        function Socket  (Service_Name, Host_Name : String)
                        return Transport_Defs.Socket_Id;
        function Network (Service_Name, Host_Name : String)
                         return Transport_Defs.Network_Name;
        -- Return the first defined Socket or Network associated with
        -- the given Service_Name and Host_Name.  If no such specific
        -- association is defined, return Socket (Service_Name) or
        -- Network (Service_Name), below.

        function Socket (Service_Name : String) return Transport_Defs.Socket_Id;
        function Network (Service_Name : String)
                         return Transport_Defs.Network_Name;
        -- Return the first defined Socket or Network associated with
        -- the given Service_Name, but no specific Host_Name.
        -- If no such association is defined, raise

        Undefined : exception;

        function Local_Socket
                    (Service_Name : String;
                     Network      : Transport_Defs.Network_Name := "TCP/IP")
                    return Transport_Defs.Socket_Id;
        -- Return the socket at which the given service is available in
        -- this machine as identified in the given Network.  That is:
        -- begin
        --     return Socket (Service_Name,
        --                    Transport_Name.Local_Host_Name (Network));
        -- exception
        --     when Transport_Name.Undefined =>
        --         return Socket (Service_Name);
        -- end;
        -- This function may raise Transport_Name.Service.Undefined.

        function Local_Network
                    (Service_Name : String;
                     Network      : Transport_Defs.Network_Name := "TCP/IP")
                    return Transport_Defs.Network_Name;
        -- Return the network via which the given service is available in
        -- this machine as identified in the given Network.  That is:
        -- begin
        --     return Network (Service_Name,
        --                     Transport_Name.Local_Host_Name (Network));
        -- exception
        --     when Transport_Name.Undefined =>
        --         return Network (Service_Name);
        -- end;
        -- This function may raise Transport_Name.Service.Undefined.


        -- A service may be available on multiple Socket/Network pairs;
        -- they may be found by iterating through all service definitions
        -- searching for definitions that match the service and host name:

        type Iterator is limited private;
        procedure Init   (Iter : in out Iterator);
        procedure Next   (Iter : in out Iterator);
        procedure Finish (Iter : in out Iterator); -- Done (Iter) becomes True.
        -- You are encouraged to Finish an Iterator when you're done using it,
        -- to release any global resource (actions, file handles) it may hold.

        function Done (Iter : Iterator) return Boolean;
        function Network (Iter : Iterator) return Transport_Defs.Network_Name;
        function Socket (Iter : Iterator) return Transport_Defs.Socket_Id;
        function Service_Name (Iter : Iterator) return String;
        function Host_Name (Iter : Iterator) return String;

        function Matches (Iter : Iterator; Service_Name, Host_Name : String)
                         return Boolean;
        -- Return true iff Service_Name (Iter) = Normalize (Service_Name)
        -- and Host_Name (Iter) = Normalize (Host_Name).

        function Matches (Iter : Iterator; Service_Name : String)  
                         return Boolean;
        -- Return true iff Service_Name (Iter) = Normalize (Service_Name)
        -- and Host_Name (Iter) = "".

    private
        type Iterator is
            record
                File : Text_Io.File_Type;
                Last : Natural;
                Line : String (1 .. 2048);
            end record;
    end Service;


end Transport_Name;