TITLE ORION - DRIVER FOR THE OPERATOR INTERFACE PROGRAM
SUBTTL Cliff Romash/Murray Berkowitz/PJT/CTK/LWS 12-SEP-85
;
;
;
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1975,1976,1977,1978,1979,
;1980,1981,1982,1983,1984,1986,1987. ALL RIGHTS RESERVED.
;
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
; AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE
; AND WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS
; SOFTWARE OR ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR
; OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON. NO TITLE TO
; AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE
; WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT
; BY DIGITAL EQUIPMENT CORPORATION.
;
; DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY
; DIGITAL.
SEARCH GLXMAC,ORNMAC,QSRMAC
PROLOG(ORION)
ERRSET ;SETUP ALL ERROR ROUTINES EXTERNAL
PARSET ;PARSER ROUTINES
.REQUIR OPRCMD ;LOAD FOR AUTO TAKE FILES
EXTERNAL TABSRC ;TABLE SEARCH
EXTERNAL ARGRTN ;SETUP ARGUMNET IN MESSAGE
EXTERNAL BLDOBJ ;BUILD AN OBJECT
EXTERNAL CMDEND ;FINISH COMMAND AND SEND TO QUASAR
; INTERNAL CHKWHL ;CHECK FOR WHEEL ROUTINE
INTERNAL GETJOB ;GET JOB INFO
INTERNAL SNDAOP ;SEND MESSAGE TO ALL OPRS
INTERNAL SHWMTX ;COMMON DISPLAY MSG BUILDING ROUTINES
INTERNAL OPRSPT
INTERNAL FINSHW
INTERNAL WTOPTR
INTERNAL OPRMES
INTERNAL SPDOPR
ENTRY OPRENB ;OPR ENABLED FOR NODE
;** OPR/ORION's VERSION is defined in ORNMAC.MAC
%%.OPR==:%%.OPR ;REFERENCE ORNMAC'S AND
OPRVRS==:OPRVRS ;AND OPR/ORION'S VERSIONS
LOC 137
EXP OPRVRS
RELOC
COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1971,1987. ALL RIGHTS RESERVED.
\;END COPYRIGHT MACRO

COMMENT \
THIS MODULE IS THE MAIN LOOP FOR ORION. IT RECEIVES ALL IPCF MESSAGES
AND DISPATCHES TO THE CORRECT PROCESSING ROUTINE. IT ALSO CONTAINS
ALL THE CODE TO INITIALIZE THE NEEDED GLX MODULES.
\
SUBTTL Constants and declarations
XP PDLEN,^D200 ;Size or our PDL

SUBTTL GETNAM Get user name
;THIS ROUTINE WILL GET USER NAME FOR A GIVEN JOB
;CALL S1/ JOB NUMBER
TOPS10<
GETNAM: HRLZ S2,S1 ;PLACE JOB NUMBER IN LEFT HALF
HRRI S2,.GTNM1 ;GET THE USER NAME
GETTAB S2, ;GETTAB IT
JRST GETJ.3 ;ERROR..RETURN
MOVEM S2,JOBUSN ;SAVE IN USER NAME
HRLZ S2,S1 ;JOB NUMBER IN LEFT HALF
HRRI S2,.GTNM2 ;SECOND HALF OF NAME
GETTAB S2, ;GET IT
JRST GETJ.3 ;ERROR..RETURN
MOVEM S2,JOBUSN+1 ;SAVE THE USER NAME SECOND PART
$RET ;RETURN
>;END TOPS10

SUBTTL TTYNOD Check for terminals on node
; This routine checks for any terminals on a node specified.
; For TOPS-10, it checks for any terminals on the node.
; For TOPS-20, it checks that the node specified is the host
; node since there is no terminal concentration currently.
; Calls: None
; Needs: None
; Uses: T regs. (TOPS-10 only)
; Args: S1 / Node name/number
; Returns: True if terminals exist, false otherwise.
TTYNOD:
TOPS10<
; Need to set up an argument block for NODE. uuo using the T registers
MOVEI T1,4 ;Length of argument block
MOVE T2,S1 ;Get the node name
SETZM T3 ;For no good reason, this MUST be 0!
HRRZI T4,.TYTTY ;Check for terminal lines
MOVE S1,[XWD .NDRCI,T1] ;Set it up
NODE. S1, ;Try it out
$RETF ;Someone's lying
HLRZ S1,T4 ;Get the number of terminals
SKIPLE S1 ;Do we have any?
$RETT ;Yes
$RETF ;No
> ; End of TOPS10
TOPS20<
CAME S1,G$HOST ;Only allow the system name as node
$RETF ;Confused operator
$RETT
> ; End of TOPS20

SUBTTL Operator privilege checking routines
;The routines on the following pages are called to check various
;operator capabilities from Orions command processing level. The
;following capabilies are defined:
;WHEEL capability
; OPR can do anything to any node. This also includes
; full file access. For TOPS10 the full file
; access PPN implies wheel.
;SYSTEM capability
; OPR can do anything to any node with this capabilility.
;HOST capability
; OPR can do anything to the host node.
;REMOTE capability
; OPR can do anything to the node where the terminal is
; physically connected. (Excluding the host system)

SUBTTL OPRENB Operator enabled for a node
;This routine checks to see if an OPR has sufficient privileges
;to perform a function for a specified node.
;Accepts S1/ Node name or number or -1 for all nodes
;Returns TRUE OPR has sufficient privileges
; FALSE OPR doesn't have enough privs
;If all nodes are specifed [-1] then system privs are required.
;If the specified node is the host then host or system privs are required.
;If the specified node is not the host, then the operator must be
;physically connected to the node and have remote privileges.
OPRENB: MOVE S2,S1 ;Save the node name
MOVE S1,G$OPRA ;Get the OPR data base address
CAME S2,[-1] ;All nodes?
JRST OPRE.2 ;No, try for host or remote
;Need system privs.
OPRE.1: $CALL O$SYSTEM ;Check for privs
JUMPF E$OSY ;Failed, do not return
$RET ;Return passing true up
;Here to try for host privs.
OPRE.2: CAME S2,G$HOST ;On the host name or
CAMN S2,G$HSTN ; number
SKIPA ;Yes
JRST OPRE.3 ;Go try for remote
;Need host privs.
$CALL O$HOST ;Check for privs.
JUMPF E$OHS ;Failed, do not return
$RET ;Return passing true up
;Here to try for remote
OPRE.3: $SAVE <P1> ;Need an ac here
MOVE P1,OPR.ND(S1) ;Get node data address
CAME S2,NOD.NM(P1) ;On node name or
CAMN S2,NOD.NU(P1) ; number?
SKIPA
JRST OPRE.1 ;Try for system just for grins
;Need remote privs.
$CALL O$REMOTE ;Check for privs
JUMPF E$ORS ;Failed, do not return
$RET ;Return passing true up