-- InrFriends.mesa last edited by LSK on: 17-Feb-84 14:17:01
-- Function: friendly definitions for INRImpl module.

DIRECTORY
System USING [NetworkNumber, HostNumber, NetworkAddress, nullNetworkNumber],
Driver USING [Network],
DriverTypes USING [DeviceType];

InrFriends: DEFINITIONS =
  BEGIN
  
  HopCount: TYPE = CARDINAL;
  
  RoutingTableEntry: TYPE = LONG POINTER TO RoutingTableObject;
  RoutingTableObject: TYPE = RECORD [
      next: RoutingTableEntry,
      destNetwork: System.NetworkNumber, -- ultimate destination network.
      delay: HopCount,  --measured in hops to the remote net
      timeUnits: CARDINAL, -- if zero then this entry is discarded
      route: System.HostNumber,  --of INR on adjacent net
      network: Driver.Network,  --access to driver
      changed: BOOLEAN]; -- true if the tuple's hop countwas changed or if this is a new tuple.
  
  DriverDetails: TYPE = RECORD [
    driverType: DriverTypes.DeviceType,
    driverNetwork: System.NetworkNumber,
      << the network number of the specific driver.  Can be 
      System.nullNetworkNumber for anonymous networks (phone lines, X25, etc) >>
    via: System.NetworkAddress,
      << the network address of the next INR towards the destination network.
      Can be System.nullNetworkAddress if we are directly attached to <destNet>.
      The socket field is always null, the net field will be the same as the
      driverNetwork field unless the user sets <allwaysDetermineViaNet> 
      to TRUE. >>
    lineNumber: CARDINAL,
      << the RS232C line number.  Valid iff driverType = phoneNet >>
    clientData: LONG UNSPECIFIED
      << the same client data that was supplied as part of the PhoneNetwork 
      or X25 create calls >>
    ];
    
  Method: TYPE = {byNetNumber, byDistance};
  
  localDelay: HopCount = 0;  <<If a destNet has <delay> = localDelay then
    we are directly attached to that destination network >>
  
  nullNetNumber: System.NetworkNumber = System.nullNetworkNumber;
  
  EnumerateRoutes: PROCEDURE [previousNet: System.NetworkNumber,
    previousDelay: HopCount, method: Method,
    alwaysDetermineViaNet: BOOLEAN ← FALSE] RETURNS [net: System.NetworkNumber,
    delay: HopCount, details: DriverDetails];
    << Stateless enumerator starts with nullNetworkNumber and zeroHopCount.
    Ends with nullNetworkNumber.  If allwaysDetermineViaNet is TRUE than the INR
    will attempt to determine the network number of the next INR towards
    the destination net even if the immediate route is over an anonymous net
    (phone line or x25 virtual circuit between two INRs.  There is a 
    performance cost if alwaysDetermineViaNet is TRUE. >>
    
  GetRouteInfo: PROCEDURE [net: System.NetworkNumber] RETURNS [delay: HopCount,
    details: DriverDetails];
    << Returns full info on specific network.  Can raise 
    Router.NoTableEntryForNet. >>
    
  END.

<<

LOG

10-Oct-83 13:16:29	LSK 	Created file from Inr.
14-Oct-83 19:11:46	LSK	Added fancy EnumerateRoutes
16-Oct-83 14:08:41	LSK	Added GetRouteInfo
17-Feb-84 14:16:57	LSK	Added <changed> to the routing table object
 
 >>