?? LEFT := 1, RIGHT := 110 ??
?? PUSH (LISTEXT := ON) ??

{                                                                                                        }
{   Interlayer Connection                                                                                }
{                                                                                                        }
{     The  interlayer  connection provides the foundation for intralayer connection descriptions on a    }
{     connection route.  Each layer requiring connection state data store on a route is identified in    }
{     a structure keyed by interface layer name.  It follows, during connection establishment a place    }
{     holder is reserved for each requiring layer's state  information.   The  interlayer  connection    }
{     also provides the basis for access control, rudimentary validation criteria, and task selection    }
{     criteria for incoming network events destined for a connection end point.                          }
{                                                                                                        }
{     ------------------                                                                                 }
{                                                                                                        }
{     A  connection  route  is  the  path downward through layers from an interface layer through XNS    }
{     transport or channel connection.  The path is 'chosen' by the end user -- the  user's  selection   }
{     of interface layer and protocol for a Service  Access Point.  The actual downward path is          }
{     traversed via procedure  call  to  a  lower  layer  based on knowledge inherent in the selection.  }
{     The upward path is traversed via procedure call to a higher layer event processor which was        }
{     identified to the lower layer during interface / SAP selection or connection establishment.  The   }
{     interface layer is upper boundary and XNS transport or channel connection is lower boundary to a   }
{     connection.                                                                                        }
{                                                                                                        }
{     ------------------                                                                                 }
{                                                                                                        }
{     The interlayer connection is the container for the control information required to  synchronize    }
{     access  to the connection among tasks.  The responsibilty for managing access to the connection    }
{     is delegated exclusively to the boundary layers.  This responsibilty includes acquiring access,    }
{     resolving access contention, and releasing access.  The upper  boundary  (interface  layer)  is    }
{     responsible for the management on user requests and the lower boundary is the responsible layer    }
{     on incoming network events.  Intermediate layers and  the layer  opposite the  boundary stimuli    }
{     have access to the interlayer connection when entered.                                             }
{                                                                                                        }
{     The  timer  evaluation / reaction  process  deviates from the 'boundary layer rule' in that the    }
{     process assumes the role of a boundary layer.  Layers, which  evaluate  and  react  to  timers,    }
{     follow  the  preceding  direction.  It must be noted, in the case of inventory shortages, timer    }
{     reactors  should  postpone  the reaction rather than impeding the process and prohibiting other    }
{     access to the connection.                                                                          }
{                                                                                                        }
{     The  boundary layer at the  point  of  stimuli  is  responsible  for  creating  the  interlayer    }
{     connection  (i.e.,  the interface layer at user request and the lower boundary layer at network    }
{     event.  Individual layers are responsible for 'creating' and 'destroying' their own  connection    }
{     state  data store.  The timer process is responsible for destroying an interlayer connection --    }
{     an interlayer connection continues to exist as long as a layer connection exists.  The duration    }
{     of layer connection existance is dependent on features provided by the layer.                      }
{                                                                                                        }
{     ------------------                                                                                 }
{                                                                                                        }
{     The identifier contained in the interlayer connection provides the  rudimentary  selection  and    }
{     validation  key.   Further  validation  of  authenticity  of  user  request or network event is    }
{     performed by the respective boundary layer.  This validation does not guarantee authenticity of    }
{     request parameters or protocol at any other layer.                                                 }
{                                                                                                        }
{     ------------------                                                                                 }
{                                                                                                        }
{     The data sender, data receiver and supervisory receiver requestor descriptions provide:            }
{       1. a subset of the information necessary to direct the processing of  an  incoming  network      }
{          event to an appropriate task -- the other information is the event itself; and                }
{       2. a  subset  of  the  information necessary for an interface layer to control user request      }
{          rates -- the remaining knowledge is inherent in the specific features of the interfaces.      }
{                                                                                                        }
{                                                                                                        }
{     The selection of an appropriate task at instance of network event is based on the  lower  layer    }
{     protocols (3a - 4, CC), the presence or absence of outstanding user requests, and whether the job  }
{     containing the task is in memory.  Assuming the investigation of protocol  determines  that  an    }
{     event  is  destined  for  a connection end point and that the job is in memory, the appropriate    }
{     task is selected as follows:                                                                       }
{           IF (XNS transport packet type IS data) OR (Channel Connection PDU) THEN                      }
{             IF data receiver is active THEN                                                            }
{               SEND network event to data receiver task.                                                }
{             ELSEIF data sender is active THEN                                                          }
{               SEND network event to data sender task.                                                  }
{             ELSE                                                                                       }
{               SEND network event to system task.                                                       }
{             IFEND                                                                                      }
{           ELSEIF XNS transport packet type IS system THEN                                              }
{             IF data sender is active THEN                                                              }
{               SEND network event to data sender task.                                                  }
{             ELSEIF data receiver is active THEN                                                        }
{               SEND network event to data receiver task.                                                }
{             ELSE                                                                                       }
{               SEND network event to system task.                                                       }
{             IFEND                                                                                      }
{           ELSEIF XNS transport packet type IS expedited or disconnect THEN                             }
{             IF data receiver is active THEN                                                            }
{               SEND network event to data receiver task.                                                }
{             ELSEIF data sender is active THEN                                                          }
{               SEND network event to data sender task.                                                  }
{             ELSE                                                                                       }
{               SEND network event to system task.                                                       }
{             IFEND                                                                                      }
{           IFEND                                                                                        }
{                                                                                                        }
{     NOTE: task  selection  at network event instance may not be appropriate at processing instance.    }
{           Therefore, the event may  require  redirection  at  the  initial  processing  task.   The    }
{           redirection may occur within either boundary layer.                                          }
{                                                                                                        }
{     Network events not destined for a connection end point are directed to a network  system  task.    }
{     Network  events  destined  for a connection end point, but the appropriate job / task is not in    }
{     memory are directed to a network system task.  Conversly, network events which are directed to     }
{     a system task are multicast datagrams, datagrams which must be relayed, datagrams whose  packet    }
{     (protocol)  type  is  not   'sequenced  packet',   sequenced packet datagrams whose destination    }
{     connection identifier is not known or zero (0), and  those  events  which  would  otherwise  be    }
{     directed to a job / task which is not in memory.                                                   }
{                                                                                                        }
{                                                                                                        }
{     The  data  sender  and data receiver requestor descriptions are utilized by interface layers to    }
{     limit the outstanding user requests to one (1) data  sender  and  one  (1)  data  receiver  per    }
{     connection.   The  interface layer is the sole manager of requestor descriptions (i.e., request    }
{     inactive <--> request active).   Dependent  on  request  style  and  current  connection state,    }
{     request  completion  is communicated via returned parameters or upward via event processors and    }
{     and layer events.
{                                                                                                        }
?? POP ??

  TYPE
    nlt$cl_connection = record
      nextt: ^nlt$cl_connection,
      access_control: ALIGNED [0 MOD 8] nlt$cl_connection_access,
      notify_system_task: boolean,
      identifier: nlt$cl_connection_id,
      message_receiver: nlt$cl_requestor,
      message_sender: nlt$cl_requestor,
      application_layer: nlt$cl_application_layer,
      layers_active: nlt$cl_layers,
      layer_connections: ^nlt$cl_layer_connections,
      device_ids: nlt$device_ids,
      CASE queue_on_connection: boolean OF
      = TRUE =
        connection_queue: nlt$connection_queue,
        input_queue: nat$received_message_list,
        active_receiver: ^nlt$udp_active_receiver,
      = FALSE =
        next_assignable_cc_sequence#: nlt$cc_sequence_number,
      CASEND,
    recend;

  TYPE
    nlt$cl_connection_access = record
      notify_system_task: boolean,
*IF $true(osv$unix)
      fill: 0 .. 7fffffff(16),
*ELSE
      fill: 0 .. 0ffffffff(16),
*IFEND
      task_id: ost$global_task_id,
    recend;

  TYPE
    nlt$cl_connection_id = nat$connection_id;

  TYPE
    nlt$cl_requestor = record
      active: boolean,
      task: ost$global_task_id,
    recend;


{                                                                                                        }
{   Layer Connections                                                                                    }
{     The  layer connections SEQuence can be viewed as an 'array' of bound records.  Layer name being    }
{     the key identifying the successor intralayer connection.   Based on  the  layers  active  field    }
{     of  the  interlayer  connection and the stimuli (upward, downward nature of invokation or timer    }
{     expiration), a given layer can determine the basic state of its layer connection data store and    }
{     in turn perform the steps corresponding to the intersection of stimuli and state.                  }
{                                                                                                        }

  TYPE
    nlt$cl_layer_connections = SEQ ( * );

*copyc nat$connection_id
*copyc nat$received_message_list
*copyc nlt$cc_sequence_number
*copyc nlt$cl_layer_name
*copyc nlt$connection_queue
*copyc nlt$device_ids
*copyc nlt$udp_active_receiver
*copyc ost$global_task_id
