home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 100s / rfc120.txt < prev    next >
Text File  |  1997-06-23  |  37KB  |  900 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                         NETWORK PL1 SUBPROGRAMS
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                              April 21, 1971
  24.  
  25.                             Mark Krilanovich
  26.  
  27.                          Computer Research Lab
  28.  
  29.                         University of California
  30.  
  31.                        Santa Barbara, California
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                                                 [Page 1]
  59.  
  60. RFC 120                 NETWORK PL1 SUBPROGRAMS
  61.  
  62.  
  63.                                 PREFACE
  64.  
  65.    The subroutines described in this document have been implemented at UCSB
  66.    and make the Network (via the NCP) accessible to PL1 programs executing
  67.    in the 360/75.  They are callable from within any PL1 main program or
  68.    subroutine compiled at UCSB.
  69.  
  70.  
  71.    A  set  of  assembly-language  written  subprograms  is  provided  to
  72.    facilitate  the use of the Network by PL1 programmers.  They serve as
  73.    an interface between the user and the Network Control Program  (NCP),
  74.    which supervises all Network operations at this site.
  75.  
  76.  
  77.    A concept  fundamental  to  PL1  Network  operations  is  that  of  a
  78.    completion code variable.  Associated with each socket that is not in
  79.    the closed state is a  unique  variable,  called  a  completion  code
  80.    variable.   This  variable  serves  two  purposes:  it identifies the
  81.    local socket referenced, and upon  completion  of  the  operation  it
  82.    contains  a  completion code to indicate the outcome of the operation
  83.    to the programmer.  It may be used at any time for any purpose  other
  84.    than  Network  operations.   Its  value at the beginning of a Network
  85.    operation is immaterial;  rather, it is the variable itself  that  is
  86.    important.   In  all  Network  operations, whenever a completion code
  87.    variable is called  for,  the  only  acceptable  attributes  for  the
  88.    variable are BINARY FIXED(31,0)ALIGNED.
  89.  
  90.    In general, the subprograms will initiate the  operation,  and  enter
  91.    the WAIT state (consume no CPU time) until notified by the NCP of the
  92.    completion of the operation.  For  such  operations,  the  programmer
  93.    supplies  a  time  limit,  with  attributes BINARY FIXED(31,0), which
  94.    specifies, in tenths of a second, the  maximum  length  of  time  the
  95.    subprogram  is  to  wait for the operation to complete.  If this time
  96.    limit is exceeded, a completion code  is  supplied  to  indicate  the
  97.    error,  and  control  is  returned  to  the calling program, with the
  98.    operation still pending.
  99.  
  100.    In those operations requiring a socket to be specified by its  socket
  101.    identifier,   the  following  format  is  used.   The  identifier  is
  102.    specified as a BINARY FIXED(31,0) array, singly dimensioned  with  at
  103.    least  two  elements,  and  with a lower subscript bound of one.  The
  104.    first element is taken to be the site number, and the second  element
  105.    the  socket  number.   A  socket number may have any value, positive,
  106.    negative, or zero.  Since negative numbers are represented internally
  107.    in two's complement form, for the purposes of the gender of a socket,
  108.    a socket number is even or odd  according  to  whether  its  absolute
  109.    value is even or odd, respectively.
  110.  
  111.  
  112.  
  113.  
  114.                                                                 [Page 2]
  115.  
  116. RFC 120                 NETWORK PL1 SUBPROGRAMS
  117.  
  118.  
  119.    Following is a description  of  each  subprogram,  its  function  and
  120.    calling sequence.
  121.  
  122. (1)  OPEN
  123.  
  124.      By invoking this subprogram, the user requests that  the  specified
  125.      local  socket be removed from the closed state and thus be prepared
  126.      to  participate  in  data  transfer.   There  are  three   distinct
  127.      operations  that can be performed by this subprogram, and these are
  128.      described below:
  129.  
  130.      (A)  CONNECT
  131.  
  132.           By initiating this  operation,  the  user  requests  that  the
  133.           specified local socket be logically connected to the specified
  134.           foreign socket, and that data transfer between the two sockets
  135.           be enabled.  The subprogram will wait until the foreign socket
  136.           either  accepts  or  rejects  the  connection  attempt.   This
  137.           operation  is  valid  only  when  the  socket is in the closed
  138.           state.
  139.  
  140.           The calling sequence is as follows:
  141.  
  142.                CALL @OPEN(cmpcd, time,lclsck,fgnsck,ws);
  143.  
  144.           where
  145.  
  146.                'cmpcd' is the completion code variable to be associated
  147.                     with the local socket.
  148.                'time' is the length of time the subprogram is to wait
  149.                     for the completion of the operation.
  150.                'lclsck' is the socket identifier of the local socket.
  151.                'fgnsck' is the socket identifier of the foreign socket.
  152.                'ws' is a workspace which has the same attributes as a
  153.                     socket identifier, and, if the operation if
  154.                     successful, will become associated with the local
  155.                     socket for the life of the connection.  In response
  156.                     to certain future operations, information may be
  157.                     returned to the programmer in this workspace.
  158.  
  159.           The  following  completion  codes  are   possible   for   this
  160.           operation:
  161.  
  162.                0,  The operation was successful and the connection has
  163.                    been established
  164.                4,  The specified completion code variable is already
  165.                    assigned to a socket;  the operation was suppressed
  166.                8,  The specified local socket is not in the closed
  167.  
  168.  
  169.  
  170.                                                                 [Page 3]
  171.  
  172. RFC 120                 NETWORK PL1 SUBPROGRAMS
  173.  
  174.  
  175.                    state;  the operation was suppressed
  176.               12,  All communication paths to the specified foreign site
  177.                    are in use;  the operation was suppressed
  178.               16,  Local resources are insufficient to support another
  179.                    connection;  the operation was suppressed
  180.               20,  The connection attempt was rejected by the foreign
  181.                    process
  182.               24,  The specified local socket is not local to UCSB;  the
  183.                    operation was suppressed
  184.               28,  The specified foreign site is invalid;  the operation
  185.                    was suppressed
  186.               32,  An addressing or protection exception was encountered
  187.                    with respect to the specified workspace;  the
  188.                    operation was suppressed
  189.               36,  Either hardware at the foreign site is inoperative or
  190.                    the NCP's counterpart at the foreign site does not
  191.                    exist or has failed
  192.               40,  Local and foreign sockets are both either send or
  193.                    receive sockets;  the operation was suppressed
  194.               44,  By operator command, all Network operations were
  195.                    terminated;  the socket will be closed
  196.               60,  An NCP control transmission error occured;  the
  197.                    operation was suppressed
  198.              252,  The specified time limit was exceeded;  the operation
  199.                    was initiated but not completed
  200.  
  201.      (B)  LISTEN
  202.  
  203.           This operation is a request for notification of any connection
  204.           attempt  directed  toward  the  specified  local  socket.  The
  205.           subprogram waits until such a call is received, at which  time
  206.           the  calling  process'  socket  identifier  is returned to the
  207.           calling program.   This  operation  is  valid  only  when  the
  208.           designated  local  socket is in the closed state.  The calling
  209.           sequence is as follows:
  210.  
  211.                CALL @OPEN(cmpcd, time,lclsck,ws);
  212.  
  213.           where
  214.  
  215.                'cmpcd' is the completion code variable to be associated
  216.                     with the local socket.
  217.                'time' is the length of time the subprogram is to wait
  218.                     for the completion of the operation.
  219.                'lclsck' is the socket identifier of the local socket.
  220.                'ws' is a workspace which, if the operation is
  221.                     successful, will contain the socket identifier of
  222.                     the calling socket, and will become associated with
  223.  
  224.  
  225.  
  226.                                                                 [Page 4]
  227.  
  228. RFC 120                 NETWORK PL1 SUBPROGRAMS
  229.  
  230.  
  231.                     the local socket for the life of the connection.
  232.                     'ws' has the same attributes as a socket identifier.
  233.  
  234.           The  following  completion  codes  are   possible   for   this
  235.           operation:
  236.  
  237.                0,  The operation was successful and a call has been
  238.                    received
  239.                4,  The specified completion code variable is already
  240.                    assigned to a socket;  the operation was suppressed
  241.                8,  The specified local socket is not in the closed
  242.                    state;  the operation was suppressed
  243.               12,  Local resources are insufficient to support another
  244.                    connection;  the operation was suppressed
  245.               16,  The specified local socket is not local to UCSB;  the
  246.                    operation was suppressed
  247.               20,  An addressing or protection exception was encountered
  248.                    with respect to the specified workspace;  the
  249.                    operation was suppressed
  250.               44,  By operator command, all Network operations were
  251.                    terminated;  the socket will be closed
  252.              252,  The specified time limit was exceeded;  the operation
  253.                    was initiated but not completed
  254.  
  255.      (C)  ACCEPT
  256.  
  257.           This operation accepts  connection  with  the  foreign  socket
  258.           whose  call  caused successful completion of a previous LISTEN
  259.           operation by the specified local socket.  After completion  of
  260.           this  operation,  data may be transferred to or from the local
  261.           socket, depending on its gender.  This operation is valid only
  262.           when  the  last  operation  referencing the local socket was a
  263.           LISTEN  operation.   The  subprogram  will  wait   until   the
  264.           operation is completed.
  265.  
  266.           The calling sequence is as follows:
  267.  
  268.                CALL @OPEN(cmpcd, time);
  269.  
  270.           where
  271.  
  272.                'cmpcd' is the completion code variable associated with
  273.                     the local socket by a previous LISTEN operation.
  274.                 'time' is the length of time the subprogram is to wait
  275.                     for the completion of the operation.
  276.  
  277.           The  following  completion  codes  are   possible   for   this
  278.           operation:
  279.  
  280.  
  281.  
  282.                                                                 [Page 5]
  283.  
  284. RFC 120                 NETWORK PL1 SUBPROGRAMS
  285.  
  286.  
  287.                0,  The operation was successful, and the connection is
  288.                    established
  289.                4,  The specified local socket is in the closed state
  290.                    (the NCP may have received an abort notification from
  291.                    the foreign process);  the operation was suppressed
  292.                8,  The previous operation specifying the designated
  293.                    local socket was not a LISTEN;  the operation was
  294.                    suppressed
  295.               12,  All communication paths to the specified foreign site
  296.                    are in use;  the socket has been returned to the
  297.                    closed state
  298.              252,  The specified time limit was exceeded;  the operation
  299.                    was initiated but not completed
  300.  
  301. (2)  CLOSE
  302.  
  303.      This operation is a request that  the  specified  local  socket  be
  304.      returned to the closed state.  If the last operation involving this
  305.      socket was a LISTEN, this operation refuses  the  foreign  process'
  306.      connection  attempt.   If  the  last  operation  was a CONNECT, the
  307.      attempt is aborted.  If a connection is established,  any  data  in
  308.      transit  from  the  local  socket  is  allowed to reach the foreign
  309.      socket and to be either received or flushed before the local socket
  310.      is  closed.   The  subprogram  will  wait until the socket has been
  311.      returned to the closed state.
  312.  
  313.      The calling sequence is as follows:
  314.  
  315.           CALL @CLOSE(cmpcd,time);
  316.  
  317.      where
  318.  
  319.           'cmpcd' is the completion code variable associated with the
  320.                local socket.
  321.           'time' is the length of time the subprogram is to wait for the
  322.                completion of the operation.
  323.  
  324.      The following completion codes are possible for this operation:
  325.  
  326.           0,  The operation was successful, and the socket has been
  327.               returned to the closed state
  328.           8,  The specified completion code variable is not currently
  329.               assigned to a socket;  the operation was suppressed
  330.          12,  The specified local socket is in the process of being
  331.               closed;  the operation was suppressed, but the local
  332.               socket will be closed
  333.          36,  Either hardware at the foreign site is inoperative, or the
  334.               NCP's counterpart at the foreign site does not exist or
  335.  
  336.  
  337.  
  338.                                                                 [Page 6]
  339.  
  340. RFC 120                 NETWORK PL1 SUBPROGRAMS
  341.  
  342.  
  343.               has failed
  344.          44,  By operator command, all Network operations were
  345.               terminated;  the socket will be closed
  346.          60,  An NCP control transmission error occured;  the operation
  347.               was aborted
  348.          64,  A transmission error occured;  the operation was aborted,
  349.               but the socket will be closed
  350.         252,  The specified time limit was exceeded;  the operation was
  351.               initiated but not completed
  352.  
  353. (3)  SEND
  354.  
  355.      This operation causes data to be sent to the foreign  socket.   The
  356.      subprogram  will  wait  until  the  data  has  been received by the
  357.      foreign socket, or until it has been queued locally by the NCP.
  358.  
  359.      The calling sequence is as follows:
  360.  
  361.           CALL @WRITE(cmpcd, bfr,len,time[,offset]);
  362.  
  363.      where
  364.  
  365.           'cmpcd' is the completion code variable associated with the
  366.                local socket.
  367.           'bfr' is the data to be sent, and must be a singly dimensioned
  368.                array, either DECIMAL or BINARY, FIXED or FLOAT.
  369.           'len' is the number of bits of data to be sent.  If 'len' is
  370.                non-positive, no operation is performed.  'len' has the
  371.                attribute BINARY FIXED(31,0).
  372.           'time' is the length of time the subprogram is to wait for the
  373.                completion of the operation.
  374.           'offset' is the bit offset from the first bit of 'bfr' at
  375.                which data transmission is to begin, and must have the
  376.                attributes BINARY FIXED(31,0).  If not specified,
  377.                'offset' defaults to zero.
  378.  
  379.      The following completion codes are possible for this operation:
  380.  
  381.           0,  The operation was successful, and the data has been sent
  382.           4,  The specified local socket is not a SEND socket;  the
  383.               operation was suppressed
  384.           8,  The specified completion code variable is not assigned to
  385.               a socket;  the operation was suppressed
  386.          12,  A previous SEND operation is in progress;  the operation
  387.               was suppressed
  388.          16,  The connection is not fully open;  the operation was
  389.               suppressed
  390.          20,  The foreign socket terminated the connection before
  391.  
  392.  
  393.  
  394.                                                                 [Page 7]
  395.  
  396. RFC 120                 NETWORK PL1 SUBPROGRAMS
  397.  
  398.  
  399.               completion of the SEND operation;  not all data was
  400.               transmitted
  401.          36,  Either hardware at the foreign site is inoperative, or the
  402.               NCP's counterpart at the foreign site does not exist or
  403.               has failed
  404.          44,  By operator command, all Network operations were
  405.               terminated;  the socket will be closed
  406.          52,  One or more interrupts were received from the foreign
  407.               socket;  the operation was suppressed
  408.          56,  An addressing exception was encountered with respect to
  409.               the data buffer;  the operation was suppressed
  410.          60,  An NCP control transmission error occured;  the operation
  411.               was suppressed
  412.          64,  A transmission error occured;  the operation was aborted,
  413.               and the socket will be closed
  414.         252,  The specified time limit was exceeded;  the operation was
  415.               initiated but not completed
  416.  
  417. (4)  RECEIVE
  418.  
  419.      This operation causes data to be received from the foreign  socket.
  420.      The subprogram will wait until the reception of data is complete.
  421.  
  422.      The calling sequence is as follows:
  423.  
  424.           CALL @READ(cmpcd,bfr,len,time[,offset]);
  425.  
  426.      where
  427.  
  428.           'cmpcd' is the completion code variable associated with the
  429.                local socket.
  430.           'bfr' is the variable into which the data is to be placed, and
  431.                must be a singly dimensioned array, DECIMAL or BINARY,
  432.                FIXED or FLOAT.
  433.           'len' is the number of bits of data to be received.  If 'len'
  434.                is non-positive, no operation is performed.  'len' has
  435.                the attribute BINARY FIXED(31,0).
  436.           'time' is the length of time the subprogram is to wait for the
  437.                completion of the operation.
  438.           'offset' is the bit offset from the first bit of 'bfr' at
  439.                which the first bit of data is to be placed, and must
  440.                have the attributes BINARY FIXED(31,0).  If not
  441.                specified, 'offset' defaults to zero.
  442.  
  443.      The following completion codes are possible for this operation:
  444.  
  445.           0,  The operation was successful and the data has been
  446.               received
  447.  
  448.  
  449.  
  450.                                                                 [Page 8]
  451.  
  452. RFC 120                 NETWORK PL1 SUBPROGRAMS
  453.  
  454.  
  455.           4,  The specified local socket is not a receive socket;  the
  456.               operation was suppressed
  457.           8,  The specified completion code variable is not assigned to
  458.               a socket;  the operation was suppressed
  459.          12,  A previous RECEIVE operation is in progress;  the
  460.               operation was suppressed
  461.          16,  The connection is not fully open;  the operation was
  462.               suppressed
  463.          20,  The foreign socket terminated the connection before
  464.               completion of the RECEIVE operation;  data is
  465.               unpredictable
  466.          36,  Either hardware at the foreign site is inoperative, or the
  467.               NCP's counterpart at the foreign site does not exist or
  468.               has failed
  469.          44,  By operator command, all Network operations were
  470.               terminated;  the socket will be closed
  471.          24,  An addressing or protection exception was encountered with
  472.               respect to the data buffer;  the operation was suppressed
  473.          52,  One or more interrupts were received from the foreign
  474.               socket;  the operation was suppressed
  475.          60,  An NCP control transmission error occured;  the operation
  476.               was aborted, and the socket will be closed
  477.         252,  The specified time limit was exceeded;  the operation was
  478.               initiated but not completed
  479.  
  480. (5)  CHECK
  481.  
  482.      This operation causes the status of the specified local  socket  to
  483.      be  returned.  There is no completion code variable associated with
  484.      this operation, since it is always successful  and  the  socket  is
  485.      identified  by  its  socket number.  This operation is valid at any
  486.      time and is always completed immediately.
  487.  
  488.      The calling sequence is as follows:
  489.  
  490.           CALL @CHECK(lclsck,stat,mnem,fgnsck,deficit);
  491.  
  492.      where
  493.  
  494.           'lclsck' is the socket identifier of the local socket.
  495.           'stat' is a code for the status, and has the attribute BINARY
  496.                FIXED(31,0).
  497.           'mnem' is a mnemonic for the status, and has the attribute
  498.                CHARACTER, of any fixed length greater than or equal to
  499.                eight.  If 'mnem' is longer than eight bytes, it will be
  500.                padded to the right with blanks.
  501.           'fgnsck' is the socket identifier of the foreign socket, or
  502.                zero.
  503.  
  504.  
  505.  
  506.                                                                 [Page 9]
  507.  
  508. RFC 120                 NETWORK PL1 SUBPROGRAMS
  509.  
  510.  
  511.           'deficit' is the send/receive deficit in bits, or zero, and
  512.                has the attributes BINARY FIXED(31,0).
  513.  
  514.           'lclsck' is the only argument the programmer need define;
  515.               the others are output from the subprogram.
  516.  
  517.      Following are  the  possible  status  codes,  together  with  their
  518.      mnemonics and interpretations.
  519.  
  520.           'STAT'  'MNEM'        MEANING
  521.            ----    ----
  522.              0    OPEN       A connection is fully established.  No
  523.                              SEND/RECEIVE operation is in progress.
  524.                              'fgnsck' is the socket identifier of the
  525.                              connected socket.  'deficit' is the number
  526.                              of bits queued locally at the socket by the
  527.                              NCP and available to satisfy a future
  528.                              RECEIVE operation, or awaiting output as
  529.                              the result of a previous SEND operation.
  530.  
  531.              1    LISTEN     A LISTEN has been issued.
  532.  
  533.              2    CONNECT    A CONNECT has been issued.  'fgnsck' is the
  534.                              socket identifier of the foreign socket.
  535.  
  536.              3    DECISION   A LISTEN has been completed.  'fgnsck' is
  537.                              the socket identifier of the calling
  538.                              socket.
  539.  
  540.              4    CALL(S)    One or more calls have been received for
  541.                              the local socket.  No LISTEN or CONNECT has
  542.                              been issued.
  543.  
  544.              5    I/O        A connection is fully established.  A
  545.                              SEND/RECEIVE operation is in progress.
  546.                              'fgnsck' is the socket identifier of the
  547.                              connected socket.  'deficit' is the number
  548.                              of bits yet to be sent or received.
  549.  
  550.              6    CLOSED     The socket is in the closed state.
  551.  
  552.              7    <--DRAIN   The foreign socket is attempting to close
  553.                              the connection.  The NCP has data yet to be
  554.                              read by the local socket.  'fgnsck' is the
  555.                              socket identifier of the connected socket.
  556.                              'deficit' is the number of bits yet to be
  557.                              received.
  558.  
  559.  
  560.  
  561.  
  562.                                                                [Page 10]
  563.  
  564. RFC 120                 NETWORK PL1 SUBPROGRAMS
  565.  
  566.  
  567.              8    DRAINED    The foreign socket is attempting to close
  568.                              the connection.  The NCP is awaiting
  569.                              arrival at the foreign site of data
  570.                              currently in transit.  'fgnsck' is the
  571.                              socket identifier of the connected socket.
  572.  
  573.              9    CLOSING    The local socket has issued a CLOSE.  The
  574.                              NCP is in the process of returning the
  575.                              local socket to the closed state.  'fgnsck'
  576.                              is the socket identifier of the connected
  577.                              socket.
  578.  
  579.             10    DRAIN-->   The local socket has issued a CLOSE.  The
  580.                              NCP is completing the last SEND operation
  581.                              before returning the local socket to the
  582.                              closed state.  'fgnsck' is the socket
  583.                              identifier of the connected socket.
  584.                              'deficit' is the number of bits the NCP has
  585.                              yet to transmit.
  586.  
  587. (6)  IDENTIFY
  588.  
  589.      This operation is used to identify a local socket by its completion
  590.      code  variable.   The operation is valid at any time, and is always
  591.      completed immediately.  Since it is always successful, there are no
  592.      completion  codes  for  the  operation,  and  the  contents  of the
  593.      completion code variable are not changed.
  594.  
  595.      The calling sequence is as follows:
  596.  
  597.           CALL @ID(cmpcd,lclsck);
  598.  
  599.      where
  600.  
  601.           'cmpcd' is the completion code variable to be associated with
  602.                the local socket
  603.           'lclsck' is set to the socket identifier of the local socket
  604.                if the completion code variable is associated with a
  605.                socket, or to zero otherwise.
  606.  
  607. (7)  SIGNAL
  608.  
  609.      This operation is used to convey a signal to the  foreign  process.
  610.      The  significance  of the signal is completely user-dependent.  The
  611.      effect is that  the  next  time  the  foreign  socket  attempts  to
  612.      initiate  a  RECEIVE  or  SEND  operation,  the  operation  will be
  613.      suppressed, and a completion code supplied indicating that a signal
  614.      had  been  received.  The subprogram will wait until the signal has
  615.  
  616.  
  617.  
  618.                                                                [Page 11]
  619.  
  620. RFC 120                 NETWORK PL1 SUBPROGRAMS
  621.  
  622.  
  623.      been sent to the foreign NCP.  This operation is  valid  only  when
  624.      the socket is fully open.
  625.  
  626.      The calling sequence is as follows:
  627.  
  628.           CALL @ID(cmpcd,time);
  629.  
  630.      where
  631.  
  632.           'cmpcd' is the completion code variable associated with the
  633.                local socket.
  634.           'time' is the length of time the subprogram is to wait for
  635.                completion of the operation.
  636.  
  637.      The following completion codes are possible for this operation:
  638.  
  639.           0,  The operation was successful, and the signal has been sent
  640.           4,  The specified completion code variable is not assigned to
  641.               a socket;  the operation was suppressed
  642.           8,  The connection is not fully open; the operation was
  643.               suppressed
  644.  
  645.    Certain of the Network subprograms are  intended  for,  although  not
  646.    restricted  to,  use  with the On-Line System Network operators.  The
  647.    following is a general description of these operators:
  648.  
  649.    In all  Network  operations  involving  the  On-Line  System  Network
  650.    operators, there are certain conventions concerning the format of the
  651.    data sent and received.  The data is grouped in 'messages' consisting
  652.    of  three  fields,  op code, length, and text, in that order.  The op
  653.    code is one byte in length and is a code which indicates how the text
  654.    field  is to be interpreted.  The length field is two bytes long, and
  655.    gives the length, in bits, of the  text  field,  which  contains  the
  656.    actual  data.   (The  op code and length fields together are termed a
  657.    header.)
  658.  
  659.    The following op codes are presently defined:
  660.  
  661.      op code        meaning
  662.  
  663.         0     The op code is a NOP.  No text field exists, and the
  664.               contents of the length field are unpredictable.  (This op
  665.               code is used mainly as a delimiter.)
  666.  
  667.         1     The text field contains EBCDIC characters, one character
  668.               per byte.  The On-Line System Network operators consider
  669.               the characters as intended for display as soon as the
  670.               text field has been received.
  671.  
  672.  
  673.  
  674.                                                                [Page 12]
  675.  
  676. RFC 120                 NETWORK PL1 SUBPROGRAMS
  677.  
  678.  
  679.         2     The text contains codes for keypushes, one byte per key.
  680.               The On-Line operators consider the text as intended for
  681.               execution as soon as the text field has been received.
  682.  
  683.         3     The same as for an op code of 2, except that the On-Line
  684.               operators consider that the execution of the keys will be
  685.               delayed until all data for that receive operation has
  686.               been received.
  687.  
  688.    The standard format of data sent or received by  the  On-Line  System
  689.    operators is a string of messages, with the last message indicated by
  690.    a header with a NOP op code, called a trailer.  These conventions are
  691.    the  default  situation; any of them may be overridden by appropriate
  692.    programming.
  693.  
  694.    Following are descriptions of those subprograms intended for use with
  695.    the On-Line System operators.
  696.  
  697. (8)  WRITE TO ON-LINE CONSOLE
  698.  
  699.      This subprogram causes data, assumed to be  characters  represented
  700.      by  their EBCDIC codes, to be sent from the specified local socket.
  701.      The characters are sent  in  a  standard  message,  preceded  by  a
  702.      header, and optionally followed by a trailer.  The subprogram waits
  703.      for the data to be received by the foreign socket, or to be  queued
  704.      locally  by  the  NCP.  This operation is valid only when the local
  705.      socket is a send socket, and is fully open.
  706.  
  707.      The calling sequence is as follows:
  708.  
  709.           CALL @WTOLC(cmpcd,bfr,len,level,across,down,time);
  710.  
  711.      where
  712.  
  713.           'cmpcd' is the completion code variable associated with the
  714.                local socket.
  715.           'bfr' is the character string to be sent, and must have the
  716.                attribute STRING, either CHARACTER or BIT, of any length,
  717.                fixed or varying.
  718.           'len', in absolute value, is the number of characters to be
  719.                sent.  If 'len' is positive or zero, the end of the data
  720.                is indicated by a trailer;  if 'len' is negative, no
  721.                trailer is sent.  'len' has the attributes BINARY
  722.                FIXED(31,0).
  723.           'level' indicates the mode of typing.  The absolute value of
  724.                'level', if non-zero, is the shift level on which to
  725.                type, and must be less than or equal to nine.  If greater
  726.                than nine, one is used.  If 'level' is positive, 'across'
  727.  
  728.  
  729.  
  730.                                                                [Page 13]
  731.  
  732. RFC 120                 NETWORK PL1 SUBPROGRAMS
  733.  
  734.  
  735.                and down are relative to the current typing location.  If
  736.                'level' is negative, the carriage is positioned to the
  737.                upper left-hand corner before typing begins, thus making
  738.                'across' and 'down' absolute coordinates.  If 'level' is
  739.                zero, the typing is in case one characters, and a
  740.                carriage return precedes the positioning for 'across' and
  741.                'down'.  If the characters to be displayed are case one
  742.                characters, the header sent will have an op code which
  743.                indicates characters to be displayed as soon as they are
  744.                received;  otherwise, the op code will indicate buttons
  745.                to be executed as soon as received.  'level' has the
  746.                attributes BINARY FIXED(31,0).
  747.           'across' is the number of spaces to be moved horizontally
  748.                across the display tube before beginning to type.
  749.                'across' can have any value, positive, negative, or zero,
  750.                and has the attributes BINARY FIXED(31,0).
  751.           'down' is the number of lines to be moved vertically down the
  752.                display tube before beginning to type.  'down' can have
  753.                any value, positive, negative, or zero, and has the
  754.                attributes BINARY FIXED(31,0).
  755.           'time' is the length of time the subprogram is to wait for the
  756.                completion of the operation.
  757.  
  758.      The completion codes for this operation are the same as for SEND.
  759.  
  760. (9)  READ FROM ON-LINE CONSOLE
  761.  
  762.      This subprogram receives data, assumed to be characters represented
  763.      by  their  EBCDIC  codes,  from  the  foreign socket in one or more
  764.      standard  messages.   The  subprogram  will  wait  for  the   data,
  765.      optionally  followed  by  a  trailer,  to  be received by the local
  766.      socket.  This operation is valid only when the local  socket  is  a
  767.      receive socket and is fully open.
  768.  
  769.      The calling sequence is as follows:
  770.  
  771.           CALL @RFOLC(cmpcd,bfr,len,time);
  772.  
  773.      where
  774.  
  775.           'cmpcd' is the completion code variable associated with the
  776.                local socket.
  777.           'bfr' is the variable into which the data is to be placed, and
  778.                has the attribute CHARACTER, of any fixed length.  If the
  779.                length of 'bfr' is greater than the amount of data
  780.                received, 'bfr' will be padded to the right with blanks.
  781.           'len', in absolute value, is the maximum number of characters
  782.                to be placed in 'bfr'.  If the length fields of the
  783.  
  784.  
  785.  
  786.                                                                [Page 14]
  787.  
  788. RFC 120                 NETWORK PL1 SUBPROGRAMS
  789.  
  790.  
  791.                header(s) received total more data than 'len', the excess
  792.                data will be received, but will not be placed into 'bfr',
  793.                and will not be accessible to the program.  If 'len' is
  794.                positive or zero, data will be received until a trailer
  795.                is encountered.  If 'len' is negative, a single message,
  796.                exclusive of trailer, will be received.  'len' has the
  797.                attributes BINARY FIXED(31,0).
  798.           'time' is the length of time the subprogram is to wait for the
  799.                completion of the operation.
  800.  
  801.      The completion codes  for  this  operation  are  the  same  as  for
  802.      RECEIVE.
  803.  
  804. (10)  WRITE TO ON-LINE CONSOLE WITH REPLY
  805.  
  806.      This  subprogram  combines  the  functions  of  'WRITE  TO  ON-LINE
  807.      CONSOLE'  and  'READ  FROM  ON-LINE CONSOLE'.  The subprogram first
  808.      sends a string of data to the foreign  socket  from  the  specified
  809.      send  socket, waits for it to be received by the foreign socket (or
  810.      queued locally by the NCP), and then waits  for  a  reply  directed
  811.      toward  the  specified receive socket.  The operation is valid only
  812.      when the sockets have the correct gender and both are fully open.
  813.  
  814.      The calling sequence is as follows:
  815.  
  816.           CALL @WTOLCR(cmpcd, bfr, len, level, across, down, time,
  817.                        cmpcd2, bfr2, len2);
  818.  
  819.      where
  820.  
  821.           'cmpcd' is the completion code variable associated with the
  822.                local send socket.
  823.           'bfr' is as in 'WRITE TO ON-LINE CONSOLE'.
  824.           'len' is as in 'WRITE TO ON-LINE CONSOLE'.
  825.           'level' is as in 'WRITE TO ON-LINE CONSOLE'.
  826.           'across' is as in 'WRITE TO ON-LINE CONSOLE'.
  827.           'down' is as in 'WRITE TO ON-LINE CONSOLE'.
  828.           'time' is the length of time the subprogram is to wait for
  829.                completion, individually, of the transmission and
  830.                reception of data.
  831.           'cmpcd2' is the completion code variable associated with the
  832.                local receive socket.
  833.           'bfr2' is as 'bfr' in 'READ FROM ON-LINE CONSOLE'.
  834.           'len2' is as 'len' in 'READ FROM ON-LINE CONSOLE'.
  835.  
  836.      The completion codes for the send socket are the same  as  for  the
  837.      SEND operation, and the completion codes for the receive socket are
  838.      the same as for the RECEIVE operation.
  839.  
  840.  
  841.  
  842.                                                                [Page 15]
  843.  
  844. RFC 120                 NETWORK PL1 SUBPROGRAMS
  845.  
  846.  
  847. (11)  ERASE
  848.  
  849.       This subprogram causes data constituting an On-Line System command
  850.       to  erase  the  display  tube  to be sent from the specified local
  851.       socket.  The data is sent in a single standard message,  including
  852.       an  op  code  indicating  characters  to  be displayed as they are
  853.       received, and optionally  including  a  trailer.   The  subprogram
  854.       waits  for the data to be received by the foreign socket, or to be
  855.       queued locally by the NCP.  This operation is valid only when  the
  856.       local socket is a send socket, and is fully open.
  857.  
  858.       The calling sequence is as follows:
  859.  
  860.            CALL @ERASE(cmpcd,delay1,delay2,time);
  861.  
  862.       where
  863.  
  864.            'cmpcd' is the completion code variable associated with the
  865.                 local socket.
  866.            'delay1', in absolute value, is the length of time, in tenths
  867.                 of a second, the subprogram is to pause (in the WAIT
  868.                 state) before sending the erase.  If 'delay1' is
  869.                 positive or zero, a trailer will be sent after the
  870.                 erase;  if negative, no trailer will be sent.  'delay1'
  871.                 has the attributes BINARY FIXED(31,0).
  872.            'delay2', is the length of time, in tenths of a second, the
  873.                 subprogram is to pause after sending the erase and
  874.                 before returning control to the calling program, and has
  875.                 the attributes BINARY FIXED(31,0).
  876.            'time' is the length of time the subprogram is to wait for
  877.                 the completion of the operation.
  878.  
  879.       The completion codes for this operation are the same as for SEND.
  880.  
  881.  
  882.           [ This RFC was put into machine readable form for entry ]
  883.            [ into the online RFC archives by Rune Skaarsmoen 6/97 ]
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.                                                                [Page 16]
  899.  
  900.