Google
 

Trailing-Edge - PDP-10 Archives - BB-KL11L-BM_1990 - galsrc/oprlog.mac
There are 36 other files named oprlog.mac in the archive. Click here to see a list.
	TITLE	OPRLOG	ORION MODULE FOR BUILDING THE ORION LOG FILE
	SUBTTL	Preliminaries

;	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1975, 1988.
;	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 THAT IS NOT SUPPLIED BY DIGITAL.

	SEARCH	GLXMAC,ORNMAC,QSRMAC,NEBMAC
	PROLOG(OPRLOG)

	ERRSET				;INITIALIZE ERROR TABLES
	EXTERNAL G$ARG1			;ARGUMENT 1
	EXTERNAL G$ARG2			;ARGUMENT 2
	EXTERNAL G$ARG3			;ARGUMENT 3
	EXTERNAL G$JOB			;JOB NUMBER FROM IPCF MESSAGE
	EXTERNAL NEBSTR			;[42]NEBULA MESSAGE TEXT TABLE
	EXTERNAL TABSRC			;[42]TABLE SEARCH ROUTINE
	EXTERNAL N$FBLK			;[43]FIND AN ARGUMENT BLOCK
	EXTERNAL .JBVER			;VERSION LOCATION INFO
;**;[55]At EXTERNAL .JBVER add 1 line  JCR  11/29/89
	EXTERNAL WDANHD			;[55]Node where request originated
;**;[60]At EXTERNAL WDANHD add 3 lines  JCR  2/1/90
	EXTERNAL G$NEBF			;[60]Remote Origin flag, used by $QWTO
	EXTERNAL G$NULA			;[60]Null ACK flag, used by $QWTO
	EXTERNAL G$REMN			;[60]Remote node name, used by $QWTO

;Version numbers

	LOGMAN==:61			;Maintenance edit number
	LOGDEV==:52			;Development edit number
	VERSIN (LOG)			;Generate edit number

	COMMENT \

	THIS MODULE IS CALLED BY EACH MESSAGE WITHIN ORION FOR THE
	PURPOSE OF LOGGING THE INFORMATION IN THE ORION LOG FILE.
	IF THE ORION STARTUP FILE HAS TURNED OFF LOGGING THEN NO LOG
	FILE WILL BE CREATED AND THE ROUTINES WILL JUST RETURN

\


	EXTERNAL GOODMS			;GOOD MESSAGE COUNT
	EXTERNAL G$NOW			;TIME OF DAY FIELD
	EXTERNAL JOBTXT			;JOB TEXT HEADER
	EXTERNAL GETJBT			;GET JOB DATA
	EXTERNAL G$OPRA			;OPR ADDRESS
	EXTERNAL JOBTER			;TERMINAL DATA
	EXTERNAL G$SND			;PID OF SENDER
	EXTERNAL JOBNAM			;PROGRAM NAME BEING RUN
	SUBTTL	Table of Contents


;		Table of Contents for OPRLOG
;
;
;			   Section			      Page
;   1. Preliminaries. . . . . . . . . . . . . . . . . . . . .    1
;   2. Table of Contents. . . . . . . . . . . . . . . . . . .    2
;   3. Revision history . . . . . . . . . . . . . . . . . . .    3
;   4. Required data for logging. . . . . . . . . . . . . . .    4
;   5. L$INIT . . . . . . . . . . . . . . . . . . . . . . . .    6
;   6. L$NEWL - ROUTINE TO RENAME THE OLD LOG FILE TO A BACKUP   7
;   7. L$OPNL . . . . . . . . . . . . . . . . . . . . . . . .    8
;   8. L$ABORT. . . . . . . . . . . . . . . . . . . . . . . .    9
;   9. L$REL. . . . . . . . . . . . . . . . . . . . . . . . .   10
;  10. L$CLOS . . . . . . . . . . . . . . . . . . . . . . . .   11
;  11. LOGCHK . . . . . . . . . . . . . . . . . . . . . . . .   12
;  12. L$CMD. . . . . . . . . . . . . . . . . . . . . . . . .   13
;  13. L$AOPR . . . . . . . . . . . . . . . . . . . . . . . .   14
;  14. L$DOPR . . . . . . . . . . . . . . . . . . . . . . . .   15
;  15. L$NTFY . . . . . . . . . . . . . . . . . . . . . . . .   17
;  16. L$SHWA . . . . . . . . . . . . . . . . . . . . . . . .   18
;  17. L$NRSW - Log a remote display message. . . . . . . . .   19
;  18. L$NLSW - Log a display message that originated from a remote node  20
;  19. L$SHWM . . . . . . . . . . . . . . . . . . . . . . . .   21
;  20. L$ERR. . . . . . . . . . . . . . . . . . . . . . . . .   22
;  21. L$KMJB . . . . . . . . . . . . . . . . . . . . . . . .   22
;  22. L$NERR - Log a NEBULA related command error message. .   23
;  23. L$WTO. . . . . . . . . . . . . . . . . . . . . . . . .   24
;  24. L$WTOR . . . . . . . . . . . . . . . . . . . . . . . .   24
;  25. L$ACK. . . . . . . . . . . . . . . . . . . . . . . . .   24
;  26. L$NACK . . . . . . . . . . . . . . . . . . . . . . . .   24
;  27. L$LOG. . . . . . . . . . . . . . . . . . . . . . . . .   25
;  28. L$NWTO - Log a REMOTE WTO message. . . . . . . . . . .   26
;  29. L$LWTO - Log locally a WTO message that originated remotely  27
;  30. L$RACK . . . . . . . . . . . . . . . . . . . . . . . .   28
;  31. L$LACK - Log an ACK message that came from a remote node   29
;  32. L$NEB - Log a NEBULA message . . . . . . . . . . . . .   30
;  33. LOGRTN . . . . . . . . . . . . . . . . . . . . . . . .   31
;  34. L$GSYS . . . . . . . . . . . . . . . . . . . . . . . .   32
;  35. L$SETF . . . . . . . . . . . . . . . . . . . . . . . .   33
SUBTTL	Revision history

COMMENT \

23			1-Feb-82
	Fix QAR 10-06813 at L$NACK

*****  Release 4.2 -- begin maintenance edits  *****

*****  Release 5.0 -- begin development edits  *****

30	5.1003		4-Jan-82
	Move to new development area.  Add version vector.  Clean up
edit organization.  Update TOC.

31	5.1048		24-Oct-83
	Increase the size of the backup FD so increases in the size
will fit.  Set the sizes of the log fds to unique names to prevent confusion.

32	5.1217		14-May-85
	Rename the operator log with a byte size of 7.

*****  Release 5 -- begin maintenance edits  *****

35	Increment maintenance edit level for GALAXY 5.

*****	Release 6.0 -- begin development edits	*****

40	6.1037		26-Oct-87
	Move sources from G5: to G6:

41	6.1057		4-Nov-87
	Change PS: to BS: and PS:[SPOOL] to SPOOL: for Non PS: login feature.

42	6.1094		20-Nov-87
	Add new routines to log messages that originated from a remote node
in the cluster, that were processed on a remote node in the cluster and
that came back from a remote node in the cluster.

43	6.1136		9-Dec-87
	Change L$NEB to correctly pick up the node name of the node where
the remote message originated from.

44	6.1138		13-Dec-87
	Add routine L$RERR to log error messages that originated from a remote
ORION. Change routine L$LACK to display the node name properly.
	
45	6.1163		6-Jan-88
	Do a first pass at cleaning up the display of remote messages.

46	6.1196		27-Feb-88
	Allow block type .ORRFG to be a valid block type in display messages.

47	6.1198		27-Feb-88
	For remote error messages, include a final CR-LF in the last display
block.

50	6.1210		2-Mar-88
	Change L$NEB not to indicate "unknown message involving NEBULA" if
the message does not contain a .NDENM block since not all messages involving
NEBULA have this block.

51	6.1213		3-Mar-88
	Indicate the job user name instead of OPR or OPERATOR in log file
headers. Also, display the message text for OPRERR entries of remote OPR
requests.

52	6.1225		8-Mar-88
	Update copyright notice.

53	6.1269		18-Oct-88
	If the message is not found in NEBSTR then it must be in the new 
format if NEB%MS is lit.

54	6.1284		4-Oct-89
	Remove edit 53. 
	
55	6.1289		29-Nov-89
	Add support for sending WTORs remotely. If a WTO is to be forwarded
to a remote node, also log it locally. Clean up the remote displays.

56	6.1292		16-Dec-89
	Change routine L$KMES to log Kill WTORs that resulted from a remote
operator command.

57	6.1301		15-Jan-90
	Modify routine L$NEB to log the command text that the remote
operator typed. This text is contained in the new block Original
Command Text (.OCTXT).

60	6.1307		1-Feb-90
	Add support for the CLOSE LOG/CLUSTER-NODE command.

61	6.1312		22-Feb-90
	Save the remote node name in word WDANHD in routine L$NEB for
possible use by error handling.

\   ;End of Revision History
	SUBTTL	Required data for logging

	SYSPRM	SYSNSZ,5,15		;SIZE OF SYSTEM NAME BLOCK

	$DATA	LOGSNM,SYSNSZ		;SAVE 10 WORDS FOR SYSTEM NAME
	$DATA	LOGIDN,1		;SAVE LOG LINE IDENT
	$GDATA	LOGOPN,1		;LOG FILE OPEN FLAG (-1 OPEN)
	$DATA	LOGIFN,1		;LOG FILE IFN
	$DATA	LOGMOR,1		;MORE TEXT COMING 
;**;[55]At $DATA LOGMOR,1 remove 1 line  JCR  11/29/89

LOGFOB:	LOGFD				;LOG FILE FD ADDRESS
	EXP	7			;BYTE SIZE IS 7

LOGINT:: EXP	O.LENA			;ENABLE/DISABEL LOGGING VALUE

FRBBLK:	LOGFD				;OLD LOG FILE FD
	BACKUP				;NEW LOG FILE FD
	0,,0				;NO 
	0,,0				; ACCESS CHECK
	FR.NFO				;WANT NEW FILE ONLY

	EXTERN	NULTXT

EXTCNT:	EXP	-1			;FILE EXTENSION COUNTER
EXTPTR:	BLOCK	1			;FILE EXTENSION BYTE POINTER
BYTPTR:	BLOCK	1			;FILE EXTENSION BYTE POINTER
	;Define the primary operator log file FD

LOGFD::	LOGLN,,0			;FD BLOCK LENGTH
TOPS10<	DEFINE X(A),<SIXBIT/A/>		;DEFINE X MACRO FOR O$LOGN MACRO
	EXP	FSSSTR			;DEVICE FOR THE OPERATOR LOG
	EXP	O$LOGN			;FILENAME FOR THE LOG
	SIXBIT/LOG/			;.LOG EXTENSION
	3,,3				;SPOOL AREA
	LOGLN==.-LOGFD			;CALC THE BLOCK LENGTH
> ;END TOPS10 CONDITIONAL

TOPS20<	DEFINE X(A),<ASCIZ/SPOOL:'A'.LOG/> ;[41]
	O$LOGN				;GEN THE LOG FILE NAME
	LOGLN==.-LOGFD			;CALC THE BLOCK LENGTH
> ;END TOPS20 CONDITIONAL

	;Define the backup operator log file FD

BACKUP:	BACKLN,,0			;FD BLOCK LENGTH
TOPS10<	DEFINE X(A),<SIXBIT/A/>		;DEFINE X MACRO FOR O$LOGN MACRO
	EXP	FSSSTR			;DEVICE FOR THE OPERATOR LOG
	EXP	O$LOGN			;FILENAME FOR THE LOG
	SIXBIT/000/			;.000 EXTENSION
	3,,3				;SPOOL AREA
	BACKLN==.-BACKUP		;CALC THE BLOCK LENGTH
> ;END TOPS10 CONDITIONAL

TOPS20<	DEFINE X(A),<ASCIZ/SPOOL:'A'-LOG.000/> ;[41]
	O$LOGN				;GEN THE LOG FILE NAME
	BLOCK	<MXFSPC/5+1>-<.-BACKUP>	;Allocate to allow name to grow
					;  figure max words needed minus
					;  number of words already allocated
	BACKLN==.-BACKUP		;CALC THE BLOCK LENGTH
> ;END TOPS20 CONDITIONAL

	;Define the debugging operator log file FD

DEBFD:	DEBLN,,0			;FD BLOCK LENGTH
TOPS10<	DEFINE X(A),<SIXBIT/A/>		;DEFINE X MACRO FOR O$LOGN MACRO
	SIXBIT/DSK/			;SEND LOG FILE TO DSK:
	EXP	O$LOGN			;FILENAME FOR THE LOG
	SIXBIT/LOG/			;.LOG EXTENSION
	0,,0				;USERS AREA
	DEBLN==.-DEBFD			;CALC THE BLOCK LENGTH
> ;END TOPS10 CONDITIONAL

TOPS20<	DEFINE X(A),<ASCIZ/DSK:'A'.LOG/>
	O$LOGN				;GEN THE LOG FILE NAME
	DEBLN==.-DEBFD			;CALC THE BLOCK LENGTH
> ;END TOPS20 CONDITIONAL
	SUBTTL	L$INIT	Initialize the logfile

;THIS ROUTINE WILL SETUP THE NECESSARY DEFAULTS AND DO THE 
;RENAME OF THE OLD LOG FILE IF PRESENT.

L$INIT::SETZM	LOGOPN			;CLEAR LOG FILE OPEN FLAG
	MOVEI	S1,LOGFD		;GET THE LOG FILE FD ADDRESS
	SKIPE	DEBUGW			;DEBUGGING ???
	MOVEI	S1,DEBFD		;YES,,GET THE DEBUGGING FD ADDRESS
	MOVEM	S1,LOGFOB		;SAVE IT IN THE LOG FILE OPEN BLOCK

TOPS10<	MOVX	S1,%LDQUE		;GET THE SYSTEM QUEUE AREA
	GETTAB	S1,			;   FROM THE MONITOR
	  MOVE	S1,[3,,3]		;DEFAULT TO 3,,3
	MOVEM	S1,LOGFD+.FDPPN		;SET THE LOG FILE PPN
	SETOM	S1			;GET THE USERS
	GETPPN	S1,			;    PPN
	  JFCL				;BETTER SUCCEED !!!
	MOVEM	S1,DEBFD+.FDPPN		;SAVE THE PPN IN DEBUG FD
	MOVE	S1,LOGFD+.FDSTR		;GET THE STRUCTURE 
	MOVEM	S1,LOGSNM		;SAVE IT
	MOVE	S1,[5,,LOGSNM]		;GET DSKCHR PARMS
	DSKCHR	S1,			;GET THE PHYSICAL STRUCTURE NAME
	SKIPA	S1,LOGSNM		;FAILED,,GET THE ORIGIONAL STR NAME BACK
	MOVE	S1,LOGSNM+.DCSNM	;WIN,,GET THE REAL STRUCTURE NAME
	MOVEM	S1,LOGFD+.FDSTR		;SET IT IN THE LOG FD
	MOVEM	S1,BACKUP+.FDSTR	;SET IT IN THE BACKUP FD
	MOVE	S1,[POINT 6,BACKUP+.FDEXT]  ;GET THE OUTPUT FILE EXT POINTER
	MOVEM	S1,BYTPTR		;SAVE THE EXT BYTE POINTER
> ;END TOPS10 CONDITIONAL

TOPS20<	MOVX	S1,GJ%OFG+GJ%SHT	;PARSE-ONLY AND SHORT JFN 
	HRROI	S2,BACKUP+.FDFIL	;POINT TO THE LOG FILE FILE NAME
	GTJFN				;GET THE JFN
	$RETT				;FAILED,,JUST APPEND THE LOG FILE
	MOVE	S2,S1			;GET THE JFN IN S2
	HRROI	S1,BACKUP+.FDFIL	;POINT TO WHERE WE WANT THE FILE PUT
	MOVX	T1,<1B2+1B5+1B8+JS%PAF>	;WANT DEVICE+DIRECTORY+FILENAME
	JFNS				;GET IT
	ERJMP	.+2			;IF AN ERROR,,CONTINUE ONWARD
	MOVEM	S1,BYTPTR		;SAVE THE EXT BYTE POINTER
	MOVEI	S1,"."			;GET A PERIOD (FOR EXTENSION)
	IDPB	S1,BYTPTR		;SAVE IT
	MOVE	S1,S2			;GET THE JFN BACK
	RLJFN				;RELEASE IT
	JFCL				;IGNORE ANY ERROR
> ;END TOPS20 CONDITIONAL

	PUSHJ	P,L$NEWL		;RENAME THE OLD LOG FILE SPEC
	$RETT				;RETURN
	SUBTTL	L$NEWL - ROUTINE TO RENAME THE OLD LOG FILE TO A BACKUP

	;This routine renames the XXXXX.LOG operator log file to
	; XXXXX.nnn.

L$NEWL:	SKIPN	DEBUGW			;DEBUGGING ???
	SKIPN	BYTPTR			;ANY BYTE POINTER FOR FILE EXTENSIONS ?
	$RETF				;NO,,RETURN NOW

NEWL.1:	MOVE	S1,BYTPTR		;GET THE FILE EXTENSION BYTE PTR
	MOVEM	S1,EXTPTR		;SAVE IT
	AOS	S1,EXTCNT		;CREATE A NEW EXTENSION
	CAILE	S1,^D100		;CAN'T BE GREATER THEN 100
	JRST	NEWL.2			;YES,,TOO MANY LOG FILES !!!
	$TEXT	(SAVBYT,<^D3R0/S1/^0>)	;GEN THE FILE EXTENSION
	MOVEI	S1,5			;GET THE RENAME BLOCK LENGTH
	MOVEI	S2,FRBBLK		;GET THE RENAME BLOCK ADDRESS
	HRLI	S2,7			;Get the byte size
	PUSHJ	P,F%REN			;RENAME THE OPERATOR LOG FILE
	JUMPT	.RETT			;WIN,,RETURN
	CAXN	S1,ERFAE$		;WAS ERROR 'FILE ALREADY EXISTS' ???
	JRST	NEWL.1			;YES,,TRY NEXT FILE
;**;[60]At NEWL.1:+13L change 3 lines  JCR  2/1/90
	$QWTO	(<Can't rename file ^F/LOGFD/>,<Current LOG file will be appended>,,<$WTFLG(WT.SJI),$WTACK(.MSCOD(MI))>);[60]
	$RETF				;[60]No, return

NEWL.2:	$QWTO	(<Too many operator LOG files>,<Current LOG file will be appended>,,<$WTFLG(WT.SJI),$WTACK(.MSCOD(MI))>);[60]
	$RETF				;RETURN

SAVBYT:	
TOPS10<	SKIPE	S1			;SKIP IF NULL
	SUBI	S1,40	>		;CONVERT TO SIXBIT ON TOPS10
	IDPB	S1,EXTPTR		;SAVE THE BYTE
	$RETT				;RETURN
	SUBTTL	L$OPNL	Open the log file

;THIS ROUTINE WILL OPEN UP ORIONS LOG FILE TO LOG
;ALL MESSAGES TO AND FROM ORION

L$OPNL:: SKIPE	LOGOPN			;IS LOG FILE OPEN
	PJRST	E$LAO			;LOG FILE ALREADY OPEN
	MOVEI	S1,FOB.MZ		;SIZE OF FOB WITHOUT IN BEHALF
	MOVEI	S2,LOGFOB		;ADDRESS OF FILE OPEN BLOCK
	$CALL	F%AOPN			;OPEN IN APPEND MODE
	SKIPT				;MAKE SURE OPENED O.K.
	  PJRST	L$ABORT			;ABORT THE LOG FILE
	MOVEM	S1,LOGIFN		;SAVE IFN FOR FILE
	SETOM	LOGOPN			;LOG FILE OPEN FLAG
	$CALL	L$GSYS			;GET SYSTEM NAME
	MOVE	S1,LOGIFN		;GET THE IFN
	MOVX	S2,FI.SIZ		;LOAD FUNCTION CODE
	$CALL	F%INFO			;GET FILE SIZE
	SKIPE	S1			;FILE ALREADY EXIST?
	$TEXT	(LOGRTN,<^M^L^A>)	;YES - SEPARATE NEW LOG FROM OLD LOG
	MOVEI	T1,LOGFD		;ASSUME NOT DEBUGGING
	SKIPE	DEBUGW			;ARE WE?
	MOVEI	T1,DEBFD		;YES - POINT TO THE DEBUGGING FD
	$TEXT	(LOGRTN,<
	^H/G$NOW/ ORION version ^V/.JBVER/ beginning log file
	in ^F/(T1)/ for system ^T/LOGSNM/
>)
	PJRST	REQCHK			;REQUEST FIRST CHECKPOINT
					;AND RETURN
SUBTTL	L$ABORT	Abort the logfile

;This Routine will abort the Log File processing and continue on


L$ABORT: $CALL	.SAVE1			;SAVE AN AC
	SETZ	P1,0			;CLEAR IT
	EXCH	P1,LOGOPN		;GET THE VALUE AND RESET LOG FILE
	SETZM	LOGOPN			;CLEAR THE LOG OPEN FLAG
	$CALL	E$LFE			;LOG FILE ERRORS
	$CALL	ERRALL##		;GENERATE ERROR AND RETURN
	SKIPN	P1			;WAS LOG FILE OPEN
	$RETF				;RETURN FALSE
	MOVE	S1,LOGIFN		;GET THE IFN
	$CALL	F%REL			;CLOSE THE FILE
	JUMPT	.RETF			;O.K. JUST RETURN
	PJRST	L$ABORT			;LOG THIS ERROR ALSO AND RETURN
SUBTTL	L$REL	Release the logfile

;THIS ROUTINE WILL CLOSE THE LOG 

L$REL:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE ERRORS
	MOVE	S1,LOGIFN		;GET THE LOG FILE IFN
	$CALL	F%REL			;CLOSE THE FILE
	SKIPT				;SKIP IF O.K.
	  PJRST	L$ABORT			;ABORT LOG FILE
	SETZM	LOGOPN			;LOG FILE CLOSED
	$RETT				;RETURN
	SUBTTL	L$CLOS	Close the logfile

	;This routine closes the XXX.LOG file and renames it to XXX.nnn and
	;   Then re-opens the XXX.LOG file to continue logging.

;**;[60]At L$CLOS::+0L replace 2 lines with 1 line  JCR  2/1/90
L$CLOS::SKIPN	LOGINT			;[60]Logging enabled?
	PJRST	E$LNI##			;LOGGING NOT ENABLED
	SKIPN	LOGOPN			;IS LOG FILE OPEN
	$RETT				;IGNORE IT
	PUSHJ	P,L$CHKP		;CHECKPOINT THE LOG FILE
	PUSHJ	P,L$REL			;RELEASE THE OLD LOG FILE
	PUSHJ	P,L$NEWL		;RENAME THE OLD LOG FILE
	SKIPF				;WIN ???
;**;[60]At L$CLOS::+8L change 1 line  JCR  2/1/90
	$QWTO	(<Operator log file ^F/LOGFD/>,<  Has been renamed to ^F/BACKUP/>,,<$WTFLG(WT.SJI),$WTACK(.MSCOD(MI))>);[60]
	PUSHJ	P,L$OPNL		;OPEN THE NEW LOG FILE
	$RETT				;AND RETURN


L$CHKP::$CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,LOGIFN		;GET THE IFN
	$CALL	F%CHKP			;CHECKPOINT THE FILE
	JUMPF	L$ABORT			;ABORT ON ERROR
REQCHK:	MOVX	S1,<%CHKTM*^D60*^D1000>	;GET CHECKPOINT INTERVAL
	MOVEI	S2,L$CHKP		;CALL ME AGAIN
	$CALL	REQTIM##		;FROM CHKTIM
					;FALL INTO COMMON EXIT
SUBTTL	LOGCHK	Check the logfile status

;THIS ROUTINE WILL CHECK IF LOGGING IS ENABLED AS WELL AS IF THE LOG
;FILE IS OPEN ALREADY.

LOGCHK:	SKIPE	LOGINT			;LOGGING ENABLED?
	SKIPN	LOGOPN			;LOG FILE OPEN
	$RETF				;NO..RETURN FALSE
	$RETT				;YES..RETURN O.K.
SUBTTL	L$CMD	Log an operator command

;THIS ROUTINE WILL LOG ALL COMMAND MESSAGES THAT COME FROM A VALID OPR

L$CMD:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE ERRORS
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT##		;GET JOB DATA
	MOVE	S1,G$OPRA		;GET OPER ADDRESS
	MOVE	S1,OPR.ND(S1)		;NODE ADDRESS
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRCMD from ^I/@JOBTXT/ node ^N/NOD.NM(S1)/ running ^W/JOBNAM/>) ;[51]
	MOVE	S1,COM.CM(MI)		;GET OFFSET FOR TEXT
	ADDI	S1,ARG.DA(MI)		;GET ADDRESS OF TEXT
	$TEXT	(LOGRTN,<		=^7/[76]/^T/(S1)/^A>)
	$RETT				;GOOD RETURN..


LOGHDR:	ITEXT	(<^C/G$NOW/ ^W/LOGIDN/ ^I/@JOBTXT/ running ^W/JOBNAM/
	>)
SUBTTL	L$AOPR	Log an OPR signon

;THIS ROUTINE WILL LOG THE SIGNON OF AN OPR

L$AOPR:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT			;GE JOB INFO
	MOVE	S1,G$OPRA		;GET OPR ADDRESS
	MOVE	S2,OPR.ND(S1)		;GET NODE ADDRESS
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRHEL OPR signon from ^W/JOBNAM/ version ^V/OPH.VN+.OHDRS(MI)/ (PID=^O/G$SND/)
		^I/@JOBTXT/ node ^N/NOD.NM(S2)/>)
	$RETT				;GOOD RETURN..
SUBTTL	L$DOPR	Log the deletion of an OPR

;THIS ROUTINE WILL LOG THE DELETION OF AN OPR

L$DOPR:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,G$OPRA		;[51]GET OPR ADDRESS
	MOVE	S1,OPR.JB(S1)		;[51]PICK UP THE JOB NUMBER
	$CALL	GETJBT##		;[51]GET JOB DATA
	MOVE	S1,G$OPRA		;GET OPR ADDRESS
	MOVE	S2,OPR.ND(S1)		;GET NODE ADDRESS
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRDEL OPR deleted ^I/OPRDAT/>)
	$RETT				;GOOD RETURN..

OPRDAT:	ITEXT	(<^I/@JOBTXT/ node ^N/NOD.NM(S2)/ (PID=^O/OPR.PD(S1)/)>) ;[51]]
SUBTTL	L$NTFY	Log a notify message

;THIS ROUTINE WILL LOG THE NOTIFY MESSAGE

L$NTFY:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRNFY/]	;NOTIFY MESSAGE
	MOVEM	S1,LOGIDN		;SAVE IDENTIFIER
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT			;GET SENDERS INFO
	$TEXT	(LOGRTN,<^I/LOGHDR/^A>)	;PUT OUT THE HEADER
	LOAD	S1,.OHDRS+JBI.JB(MI)	;GET JOB NUMBER OF SENDER
	$CALL	GETJBT			;GET JOB INFO
	$TEXT	(LOGRTN,<	For: ^I/@JOBTXT/
		^T/.OHDRS+JBI.SZ+ARG.DA(MI)/>)
	$RETT				;CHECKPOINT AND RETURN
SUBTTL	L$SHWA	Log a standard ACK from QUASAR

;THIS ROUTINE WILL LOG AN ACK FROM QUASAR

L$SHWA:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
;**;[55]At L$SHWA::+2L replace 3 lines with 2 lines  JCR  11/29/89
	SKIPN	LOGMOR			;[55]Check if expecting more from msg
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRSHA ^A>) ;[55]No, log the header
	PJRST	SHWM.1			;YES..PROCESS THE MESSAGE
	SUBTTL	L$NRSW - Log a remote display message

;L$NRSW LOGS A DISPLAY MESSAGE THAT ORIGINATED FROM A REMOTE NODE IN THE
;CLUSTER

L$NRSW::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE ANY ERRORS
;**;[55]At L$NRSW:+2L change 1 line  JCR  11/29/89
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRSHA - Request originated from node ^N/.OHDRS+ARG.DA(MO)/ ^A>);[55]
	MOVE	T1,.OARGC(MO)		;[42]PICK UP THE NUMBER OF ARG BLOCKS
	SOS	T1			;[42]DISREGARD THE FIRST DISPLAY BLOCK
	LOAD	T2,.OHDRS(MO),AR.LEN	;[42]PICK UP THE LENGTH OF DISPLAY BLK
	ADDI	T2,.OHDRS(MO)		;[42]POINT TO SECOND DISPLAY BLOCK
	PJRST	SHWM.2			;[42]GO LOG THE MESSAGE
;**;[55]At L$NRSW::+10L delete 8 lines  JCR  11/29/89
SUBTTL	L$SHWM	Log an OPR display message

L$SHWM:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
;**;[55]At L$SHWM::+2L replace 5 lines with 3 lines  JCR  11/29/89
	SKIPN	LOGMOR			;[55]Check if expecting more from msg
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRSHM ^A>) ;[55]No, log the header
SHWM.1:	MOVE	T1,.OARGC(MO)		;[55]Get the argument count
	MOVEI	T2,.OHDRS+ARG.HD(MO)	;ADDRESS OF FIRST ARGUMENT
SHWM.2:	LOAD	S1,ARG.HD(T2),AR.TYP	;GET THE TYPE FIELD
	CAIE	S1,.ORDSP		;IS IT DISPLAY
	JRST	SHWM.4			;NO CHECK FOR TEXT
	$TEXT	(LOGRTN,<^M^J	^A>);POSITION DATA
	MOVEI	S1,ARG.DA+1(T2)		;ADDRESS OF THE TEXT
SHWM.3:	$TEXT	(LOGRTN,<^T/(S1)/^A>)	;DUMP THE BLOCK
SHWM3A:	LOAD	S2,ARG.HD(T2),AR.LEN	;[46]GET LENGTH OF BLOCK
	ADD	T2,S2			;BUMP TO NEXT BLOCK
	SOJG	T1,SHWM.2		;GET THE NEXT BLOCK
	SETZM	LOGMOR			;CLEAR LOGMOR FLAG
	MOVX	S1,WT.MOR		;GET THE MORE BIT
	TDNE	S1,.OFLAG(MO)		;WAS IT SET
	SETOM	LOGMOR			;YES..SET FLAG
;[**]At SHWM3A:+7L remove 2 lines  JCR  11/29/89
	$RETT				;GOOD RETURN..
SHWM.4:	CAIE	S1,.CMTXT		;WAS IT JUST TEXT
	JRST	SHWM.5			;[46]CHECK FOR REMOTE BLOCK
	MOVEI	S1,ARG.DA(T2)		;ADDRESS OF TEXT
	JRST	SHWM.3			;OUTPUT THE TEXT
SHWM.5:	CAIN	S1,.ORRFG		;[46]REMOTE FLAG WORDS BLOCK?
	JRST	SHWM3A			;[46]YES, IGNORE THIS BLOCK	
	$STOP(IDM,<Invalid Display Message Type ^D/S1/>) ;[46] 
SUBTTL	L$ERR	Log a command error message


L$ERR:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
L$ERR1:	MOVE	S1,[SIXBIT/OPRERR/]	;[51]OPR ERROR MESSAGE
	HRRZ	S2,G$ERR		;GET CODE VALUE
	CAIL	S2,GOODMS		;GOOD MESSAGE?
	MOVE	S1,[SIXBIT/OPRMSG/]	;WRITE AS OPR MESSAGE
	MOVEM	S1,LOGIDN		;SAVE IDENTIFIER
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT##		;GET THE JOB DATA
	SKIPE	G$NERR##		;[42]A NEBULA RELATED ERROR?
	$RET				;[42]YES, RETURN NOW
	MOVEI	S2,NULTXT		;NUL ITEXT BLOCK
ERR.1:	SKIPGE	S1,G$ERR##		;GET ERROR CODE
	JRST	ERR.2			;PROCESS AS ITEXT
	$TEXT	(LOGRTN,<^I/LOGHDR/^I/(S2)/	--^T/@TXTTBL(S1)/-->)
	$RETT				;GOOD RETURN..
ERR.2:	$TEXT	(LOGRTN,<^I/LOGHDR/^I/(S2)/	--^I/@TXTTBL(S1)/-->)
	$RETT				;GOOD RETURN..

L$KMES:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRCMS/]	;GET LINE ID
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	MOVEI	S2,[ITEXT(< 		WTOR code = ^O/.MSCOD(MI)/>
	)]
;**;[56]At L$KMES::+6L replace 1 line with 4 lines  JCR  12/16/89
	JUMPE	FLAG,ERR.1		;[56]Process message now if local
	MOVEI	S2,[ITEXT(<	-- Request originated from node ^N/WDANHD/ --^M^J	 		WTOR code = ^O/.MSCOD(MI)/>
	)]				;[56]
	JRST	ERR.1			;[56]Process the message

SUBTTL	L$KMJB	Log a kill message for job on LOGOUT

L$KMJB:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRKMJ/]	;KILLED MESSAGE FOR JOB
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	MOVE	S1,G$ERR		;GET THE ERROR CODE
	$TEXT	(LOGRTN,<^C/G$NOW/ ^W/LOGIDN/ ^I/@TXTTBL(S1)/>)
	$RETT				;GOOD RETURN..
	SUBTTL	L$NERR - Log a NEBULA related command error message

L$NERR::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE ANY ERRORS
	$CALL	L$ERR1			;[51]PICK UP HEADER INFORMATION
	LOAD	S2,.OHDRS(MO),AR.LEN	;[51]PICK UP DISPLAY BLOCK LENGTH
	ADDI	S2,.OHDRS(MO)		;[51]POINT TO THE NEXT DISPLAY BLOCK
;**;[55]At L$NERR::+6L change 4 lines  JCR  11/29/89
	ADDI	S2,ARG.SZ		;[55]Point pass header and UDT words
	$TEXT	(LOGRTN,<^I/LOGHDR/	^I/L$NE.1/	--^T/0(S2)/--^M^J>) ;[55]
	$RETT				;[55]Return to the caller
L$NE.1:	ITEXT	(<-- Request originated from node ^N/.OHDRS+ARG.DA(MO)/ --^M^J	^A>) ;[55]

SUBTTL	L$RERR	Log a command error message from a remote ORION

L$RERR:: $CALL	LOGCHK			;[45]CHECK THE LOG STATUS
	JUMPF	.RETT			;[45]IGNORE ANY ERRORS
;**;[55]At L$RERR::+2L replace 3 lines with 6 lines  JCR  11/29/89
	MOVE	S1,[SIXBIT/OPRREM/]	;[55]Indicate a remote error
	MOVEM	S1,LOGIDN		;[55]Save the line id
	$CALL	REMDSP			;[55]Log the remote display block
	ADDI	T2,ARG.SZ		;[55]Point pass header and UDT words
	$TEXT	(LOGRTN,<^M^J		--^T/0(T2)/-->) ;[55]
	$RET				;[55]Return to the caller
SUBTTL	L$WTO	Log a WTO message


L$WTO:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRWTO/]	;WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;SAVE LINE ID
WTOLOG:	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT##		;GET THE JOB DATA
	$TEXT	(LOGRTN,<^I/LOGHDR/^T/ARG.DA+.OHDRS+1(MO)/^A>)
	$RETT				;GOOD RETURN..




SUBTTL	L$WTOR	Log a WTOR message


L$WTOR:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRWTR/]	;WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT##		;GET THE JOB DATA
	$TEXT	(LOGRTN,<^I/LOGHDR/		WTOR code = ^O/.MSCOD(MI)/
	^T/ARG.DA+.OHDRS+1(MO)/^A>)
	$RETT				;GOOD RETURN..



SUBTTL	L$ACK	Log an ACK message


L$ACK:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRACK/]	;WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	PJRST	WTOLOG			;LOG THE WTO MESSAGE


SUBTTL	L$NACK	Log a null ACK message

L$NACK:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	LOAD	S1,G$JOB		;GET JOB NUMBER
	$CALL	GETJBT##		;GET THE JOB INFO
	MOVE	S1,[SIXBIT/OPRACK/]	;WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	$TEXT	(LOGRTN,<^I/LOGHDR/>)	;JUST THE HEADER
	$RETT				;GOOD RETURN..
SUBTTL	L$LOG	Log a LOG message 

L$LOG:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRLOG/]	;WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;SAVE LINE ID
	PJRST	WTOLOG			;LOG THE MESSAGE
	SUBTTL	L$NWTO - Log a REMOTE WTO message

L$NWTO::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE THE ERRORS
	MOVE	S1,[SIXBIT/OPRWTO/]	;[42]WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;[42]SAVE LINE ID
	PJRST	REMLOG			;[42]GO FINISH LOGGING THE MESSAGE
	SUBTTL	L$LWTO - Log locally a WTO message that originated remotely

L$LWTO::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE ANY ERRORS
	MOVE	S1,[SIXBIT/OPRWTO/]	;[42]PICK UP THE LOG TYPE
	MOVEM	S1,LOGIDN		;[42]SAVE LINE ID
;**;[55]At L$LWTO::+4L replace 1 line with 2 lines  JCR  11/29/89
	$CALL	REMDSP			;[55]Log the remote display block
	PJRST	SHWM.2			;[55]Log the rest of the message

;**;[55]At L$LWTO:+4L add 16 lines  JCR  11/29/89
	SUBTTL	L$LWTR - Log locally a WTOR message that originated remotely

L$LWTR::$CALL	LOGCHK			;[55]Check the LOG status
	JUMPF	.RETT			;[55]Ignore any errors
	MOVE	S1,[SIXBIT/OPRWTR/]	;[55]WTOR type message
	MOVEM	S1,LOGIDN		;[55]Save line ID
	LOAD	S1,G$JOB		;[55]Pick up the job number
	$CALL	GETJBT##		;[55]Get the job data
	LOAD	S1,.OHDRS+ARG.HD(MO),AR.LEN ;[55]Pick up display block length
	ADDI	S1,.OHDRS(MO)		;[55]Point to second display block
	$TEXT	(LOGRTN,<^I/LOGHDR/       ^I/REMD.1/ ^I/REMD.2/^M^J			WTOR code = ^O/.OFLAG(MI)/ ^A>) ;[55]
	MOVE	T1,.OARGC(MO)		;[55]Pick up the argument count
	SOS	T1			;[55]Already displayed the 1st block
	LOAD	T2,.OHDRS+ARG.HD(MO),AR.LEN ;[55]Pick up display block length
	ADDI	T2,.OHDRS(MO)		;[55]Point to 2nd display block
	PJRST	SHWM.2			;[55]Finish logging the message
SUBTTL	L$RACK	Log a REMOTE ACK message 

L$RACK::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE ANY ERRORS
	MOVE	S1,[SIXBIT/OPRACK/]	;[42]WTO TYPE MESSAGE
	MOVEM	S1,LOGIDN		;[42]SAVE LINE ID
REMLOG:	LOAD	S1,G$JOB		;[42]GET JOB NUMBER
	$CALL	GETJBT##		;[42]GET THE JOB DATA
;**;[55]At REMLOG:+2L replace 1 line with 6 lines  JCR  11/29/89
	LOAD	S1,.OFLAG(MI)		;[55]Pick up the flag word
	TXNN	S1,WT.SUP		;[55]Suppress remote origin display?
	JRST	REML.1			;[55]No, log as remote
	$TEXT	(LOGRTN,<^I/LOGHDR/	-- Request acted on by node ^N/WDANHD/ --^M^J	^T/ARG.DA+.OHDRS+1(MO)/^A>) ;[55]
	$RETT				;[55]And return
REML.1:	$TEXT	(LOGRTN,<^I/LOGHDR/	-- Request originated from node ^N/WDANHD/ --^M^J	^A>);[55]
	LOAD	S1,.OHDRS+ARG.HD(MO),MS.CNT ;[42]PICK UP THE BLOCK'S LENGTH
	ADDI	S1,.OHDRS(MO)		;[42]ADDRESS OF THE SECOND BLOCK
	$TEXT	(LOGRTN,<^T/ARG.DA+1(S1)/^A>) ;[45]PICK UP ITS TEXT
	$RETT				;[42]RETURN THE CALLER
	SUBTTL	L$LACK - Log an ACK message that came from a remote node

L$LACK::$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE ANY ERRORS
	MOVE	S1,[SIXBIT/OPRACK/]	;[42]PICK UP HEADER TYPE
	MOVEM	S1,LOGIDN		;[42]SAVE FOR OUTPUT
;**;[55]At L$LACK::+4L replace 15 lines with 18 lines  JCR  11/29/89
	$CALL	REMDSP			;[55]Log the remote display block
	PJRST	SHWM.2			;[55]Finish logging the message
	SUBTTL	REMDSP - Log a Remote Block

REMDSP:	LOAD	S1,G$JOB		;[55]Pick up the job number
	$CALL	GETJBT##		;[55]Pick up header information
	LOAD	S1,.OHDRS+ARG.HD(MO),AR.LEN ;[55]Pick up display block length
	ADDI	S1,.OHDRS(MO)		;[55]Point to second display block
	$TEXT	(LOGRTN,<^I/LOGHDR/       ^I/REMD.1/ ^I/REMD.2/ ^A>) ;[55]
	MOVE	T1,.OARGC(MO)		;[55]Pick up the argument count
	SOS	T1			;[55]Already displayed the first block
	LOAD	T2,.OHDRS+ARG.HD(MO),AR.LEN ;[55]Pick up display block length
	ADDI	T2,.OHDRS(MO)		;[55]Point to the second display block
	$RET				;[55]Return to the caller

REMD.1:	ITEXT	(<^T/ARG.DA+1+.OHDRS(MO)/>)     ;[55]
REMD.2: ITEXT	(<processed at ^C/ARG.DA(S1)/>) ;[55]
	SUBTTL	L$NEB - Log a NEBULA message

;L$NEB is called to log the receipt of a message that involves NEBULA.
;
;Call is: S1/Message code address
;         MI/Message address

L$NEB::	$CALL	LOGCHK			;[42]CHECK THE LOG STATUS
	JUMPF	.RETT			;[42]IGNORE THE ERRORS
	$TEXT	(LOGRTN,<^C/G$NOW/ NEBMSG ^A>)
	
	MOVEI	S2,NEBSTR		;[42]PICK UP THE NEBULA TEXT TABLE
	$CALL	TABSRC			;[42]PICK UP THE TEXT STRING
;**;[53]At L$NEB:+5L change 1 line JYCW Oct-18-88
;**;[54]At L$NEB:+5L change 1 line  JCR  10/3/89
	JUMPF	L$NEB0			;[54]If can't find, then unknown
	PUSH	P,S2			;[43]SAVE THE STRING ADDRESS
	MOVE	S1,MI			;[43]PICK UP THE MESSAGE ADDRESS
	MOVEI	S2,.NDENM		;[43]CHECK FOR THE NODE BLOCK
	$CALL	N$FBLK			;[43]FIND THE NODE ARGUMENT BLOCK
	POP	P,S2			;[43]RESTORE THE STRING ADDRESS
	JUMPF	L$NEB1			;[50]OUTPUT NOW IF NO NODE NAME BLOCK
	MOVE	S1,ARG.DA(S1)		;[43]PICK UP THE NODE NAME
;**;[61]At L$NEB:+15L add 1 line  JCR  2/22/90
	MOVEM	S1,WDANHD		;[61]Save for possible later use
	SKIPA				;[43]SKIP OVER UNKNOWN MSG TYPE
L$NEB0:	MOVEI	S2,[ITEXT(<Unknown message type involving NEBULA detected>)]
L$NEB1:	$TEXT	(LOGRTN,<^I/0(S2)/ >)	;[50]OUTPUT THE DISPLAY LINE
;**;[57]At L$NEB1:+1L replace 1 line with 9 lines  JCR  1/15/90
	MOVEI	S1,.OCTXT		;[57]Pick up the block type
	$CALL	FNDBLK##		;[57]Find the block in the message
	JUMPF	.RETT			;[57]Not there, so return now
	$TEXT	(LOGRTN,<		=^7/[76]/^T/ARG.DA(S1)/^A>) ;[57]
	HLLZ	S1,ARG.HD(S1)		;[57]Pick up the block length
	MOVNS	S1			;[57]Negate it
	ADDM	S1,.MSTYP(MI)		;[57]Adjust total message length
	SOS	.OARGC(MI)		;[57]Adjust the argument count
	$RETT				;[57]Return to the caller

;**;[53]At L$NEB1:+2L add routine L$NEB2L (5 lines) JYCW Oct-18-88
;**;[54]At L$NEB1:+2L remove 5 lines  JCR  10/3/89
;**;[55]At L$NEB1:+3L add routine L$NULL  JCR  11/29/89
	SUBTTL	L$NULL - Log a NEBULA NULL ACK message

L$NULL::$CALL	LOGCHK			;[55]Check the log status
	JUMPF	.RETT			;[55]Ignore any errors
	MOVE	S1,[SIXBIT/NULACK/]	;[55]NULL ACK message type
	MOVEM	S1,LOGIDN		;[55]Save line id
	LOAD	S1,G$JOB		;[55]Get the job number
	$CALL	GETJBT##		;[55]Get the job data
	$TEXT	(LOGRTN,<^I/LOGHDR/	--  NEBULA Null ACK for node ^N/.OHDRS+ARG.DA(MO)/ --^M^J^A>);[55]
	$RETT				;[55]Return to the caller
SUBTTL	LOGRTN	Text Output routine for logfile writing

;This routine is called with a character to write in S1


LOGRTN:	MOVE	S2,S1			;PUT CHARACTER IN S2
	MOVE	S1,LOGIFN		;GET THE LOG FILE IFN
	$CALL	F%OBYT			;OUTPUT THE BYTE
	$RETIT				;RETURN IF O.K.
	  PJRST	L$ABORT			;ABORT LOG FILE
SUBTTL	L$GSYS	Log the system name

TOPS10<

L$GSYS:	MOVEI	T3,SYSNSZ		;NUMBER OF WORDS IN SYSNAM - 1
	MOVS	T1,[%CNFG0]		;ADR OF FIRST WORD
GSYS.1:	MOVS	T2,T1			;GET THE GETTAB ADR
	GETTAB	T2,			;GET THE WORD
	  JFCL				;IGNORE THIS
	MOVEM	T2,LOGSNM(T1)		;SAVE NAME
	CAILE	T3,(T1)			;DONE?
	AOJA	T1,GSYS.1		;NO, LOOP
>  ;END TOPS10

TOPS20<

L$GSYS:	MOVX	S1,'SYSVER'		;NAME OF GETTAB FOR SYSNAME
	SYSGT				;GET IT
	HRLZ	T1,S2			;GET TABLE#,,0
	MOVEI	T2,SYSNSZ		;AND LOAD LOOP COUNTER
GSYS.1:	MOVS	S1,T1			;GET N,,TABLE#
	GETAB				;GET THE ENTRY
	  MOVEI	S1,0			;USE ZERO IF LOSING
	MOVEM	S1,LOGSNM(T1)		;STORE THE RESULT
	CAILE	T2,(T1)			;DONE ENUF?
	AOJA	T1,GSYS.1		;NO, LOOP
>;END TOPS20


GSYS.2:	MOVE	S1,[POINT 7,LOGSNM]	;SET UP BYTE POINTER

GSYS.3:	ILDB	T1,S1			;GET A CHARACTER
	CAIE	T1,.CHTAB		;A TAB?
	CAIN	T1," "			;A SPACE?
	JRST	GSYS.3			;YES TO EITHER
	SKIPA	S2,[POINT 7,LOGSNM]	;SET UP STORAGE BYTE POINTER

GSYS.4:	ILDB	T1,S1			;GET A CHARACTER
	IDPB	T1,S2			;PUT A CHARACTER
	JUMPN	T1,GSYS.4		;LOOP UNTIL END OF STRING
	POPJ	P,			;RETURN
SUBTTL	L$SETF	Log a setup failure message


L$SETF:: $CALL	LOGCHK			;CHECK THE LOG STATUS
	JUMPF	.RETT			;IGNORE THE ERRORS
	MOVE	T1,S1			;ADDRESS OF THE TEXT
	MOVE	S1,G$OPRA		;GET OPR ADDRESS
	MOVE	S2,OPR.ND(S1)		;GET NODE ADDRESS
	$TEXT	(LOGRTN,<^C/G$NOW/ OPRSFL OPR setup failure  ^I/OPRDAT/
		Reason: ^T/(T1)/>)
	$RETT				;GOOD RETURN..

	END				;END OPRLOG