Google
 

Trailing-Edge - PDP-10 Archives - bb-l014z-bm_tops20_v7_0_tsu03_1_of_3 - galsrc/nebula.mac
There are 23 other files named nebula.mac in the archive. Click here to see a list.
	TITLE NEBULA

	SUBTTL STORAGE ALLOCATION AND DEFINITIONS

;	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 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	NEBMAC			;CHECK NEBULA'S LIBRARY
	SEARCH	GLXMAC			;CHECK GALAXY'S LIBRARY
	SEARCH	QSRMAC			;CHECK QUASAR'S LIBRARY
	SEARCH	ORNMAC			;CHECK ORION'S LIBRARY
	SEARCH	GALCNF			;GET CONFIGURATION DATA
	SALL				;CLEAN LISTINGS
	PROLOG (NEBULA)			;GENERATE THE NECESSARY GALAXY SYMBOLS
NEBVEC:	BLDVEC	(NEBMAC,NMC,L)
	BLDVEC	(GLXMAC,GMC,L)
	BLDVEC	(QSRMAC,QMC,L)
	BLDVEC	(ORNMAC,OMC,L)
	BLDVEC	(NEBULA,NEB,L)


	NEBMAN==:6053			;MAINTENANCE EDIT NUMBER
	NEBDEV==:6036			;DEVELOPMENT EDIT NUMBER
	VERSIN (NEB)			;GENERATE EDIT NUMBER

	NEBWHO==0
	NEBVER==6
	NEBMIN==0

	NEBVRS==<VRSN.(NEB)>+NMCEDT+GMCEDT+QMCEDT+OMCEDT

	.JBVER==137

	LOC	.JBVER
	EXP	NEBVRS
	RELOC
	SUBTTL	Table of Contents


;		Table of Contents for NEBULA
;
;
;			   Section			      Page
;   1. STORAGE ALLOCATION AND DEFINITIONS . . . . . . . . . .    1
;   2. Table of Contents. . . . . . . . . . . . . . . . . . .    3
;   3. REVISION HISTORY . . . . . . . . . . . . . . . . . . .    4
;   4. SYMBOL DEFINITONS. . . . . . . . . . . . . . . . . . .    5
;   5. RANDOM STORAGE AREA. . . . . . . . . . . . . . . . . .    6
;   6. RESIDENT JOB DATA BASE . . . . . . . . . . . . . . . .    7
;   7. PID AND INTERRUPT DEFINITION . . . . . . . . . . . . .    8
;   8. NEBULA STARTUP AND SCHEDULER . . . . . . . . . . . . .    9
;   9. NEBENV - CHECK THE NEBULA ENVIRONMENT. . . . . . . . .   10
;  10. NBINIT - GET NODE NAME, NODE NUMBER, AND SIZE OF NEBULA  11
;  11. WAIQSR - WAIT FOR QUASAR TO STARTUP. . . . . . . . . .   12
;  12. WAIORN - WAIT FOR ORION TO STARTUP . . . . . . . . . .   13
;  13. INTINI - . . . . . . . . . . . . . . . . . . . . . . .   14
;  14. NEBULA INTERRUPT HANDLERS. . . . . . . . . . . . . . .   15
;  15. NBSCS - TOPOLOGY CHANGE DECTECTED INTERRUPT HANDLER. .   16
;  16. NODINT - . . . . . . . . . . . . . . . . . . . . . . .   17
;  17. BLDLST - INITIALIZES PACKN TABLE . . . . . . . . . . .   18
;  18. GTNDAT - PICK UP THE NODE NAMES AND NUMBERS. . . . . .   19
;  19. STLAS - START UP THE LISTENERS AND SENDERS . . . . . .   20
;  20. STAINF - STARTUP A LISTENER AND SENDER TO A NODE . . .   21
;  21. BLDSRV - BUILD THE SRV: DEVICE NAME. . . . . . . . . .   22
;  22. STLIS - START UP THE LISTENER. . . . . . . . . . . . .   23
;  23. BLDDCN - BUILD THE DCN: DEVICE NAME. . . . . . . . . .   24
;  24. STSEN - START UP A SENDER. . . . . . . . . . . . . . .   25
;  25. CLUSTER TOPOLOGY CHANGE DETECTED . . . . . . . . . . .   26
;  26. KILNOD - DELETE A NODE FROM THE NODE DATA BASE . . . .   27
;  27. KILINF - KILL A NODE'S LISTENER AND SENDER . . . . . .   28
;  28. UPDQUE - UPDATE A NODE'S QUEUES. . . . . . . . . . . .   29
;  29. DELTIM - DELETE THE TIMER LIST AND TURN OFF TIMERS . .   30
;  30. UPDREM - CLEAN UP REMOTE QUEUE FOR SENDER/LISTENER CRASH   31
;  31. UPDIBH - CLEAN UP IBH QUEUE FOR SENDER/LISTENER  . . .   32
;  32. UPDMSG - CLEAN UP MESSAGE QUEUE FOR SENDER/LISTENER  .   33
;  33. BLDNEN - BUILD AN ENTRY IN THE NODE TABLE. . . . . . .   34
;  34. CHKDEC - INFERIOR FORK HAS A DECNET CONNECTION . . . .   35
;  35. CHKQUE - IPCF MESSAGE PROCESSING . . . . . . . . . . .   36
;  36. NTDSM - PROCESS A "TO NEBULA DISMOUNT" MESSAGE . . . .   37
;  37. SNDACK - SEND A TO NEBULA DISMOUNT ACK TO MOUNTR . . .   38
;  38. NTMTS. . . . . . . . . . . . . . . . . . . . . . . . .   39
;  39. NFDAK - PROCESS A "FROM NEBULA DISMOUNT ACK" MESSAGE .   40
;  40. NCDSM. . . . . . . . . . . . . . . . . . . . . . . . .   41
;  41. NDISPY . . . . . . . . . . . . . . . . . . . . . . . .   42
;  42. NSHOW - PROCESS OPR SHOW MESSAGES. . . . . . . . . . .   43
;  43. NLIST - PROCESSES EXEC "INFORMATION OUTPUT" MESSAGE. .   44
;  44. NKILL - ROUTINE PROCESS AN EXEC CANCEL MESSAGE . . . .   45
;  45. N$FNDB - ROUTINE TO FIND ANY BLOCK IN AN IPCF MESSAGE.   46
;  46. NSCLU - PROCESSES THE "SHOW CLUSTER-GALAXY" MESSAGE. .   47
;  47. NDRCF - ENABLE/DISABLE REPORT-CONNECTION-FAILURES. . .   48
;  48. NDDCA - ENABLE/DISABLE DECNET-CONNECTION-ATTEMPTS. . .   49
;  49. SETPAG - SETUP MESSAGE HEADER FOR SHOW ACK MESSAGES. .   50
;  50. SETHDR - BUILDS DISPLAY BLOCK FOR SHOW ACK MESSAGES. .   51
;  51. BDBHDR - BUILD DISPLAY BLOCK HEADER. . . . . . . . . .   52
;  52. FNDNBK - FIND THE NODE BLOCK IN AN IPCF MESSAGE. . . .   53
;  53. CHKLEN - CHECK THE VALIDITY OF AN IPCF MESSAGE . . . .   54
;  54. QSREMM - SEND OR QUEUE REMOTE MESSAGES TO A SINGLE REMOTE NODE   55
;  55. QMREMM - SEND OR QUEUE REMOTE MESSAGES TO MULTIPLE REMOTE NODES  56
;  56. QRIBHM - SEND/QUEUE RESPONSES TO IBH MESSAGE TO REQUESTING NODE  57
;  57. SETPAR - SETUP PARAMETERS FOR ROUTINE QUEMSG . . . . .   58
;  58. SEPALL - SET UP PARAMETERS FOR ROUTINE QUEMSG. . . . .   59
;  59. BLDHAD - BUILD THE HEADER AND DISPLAY BLOCKS FOR ACK MESSAGE   60
;  60. MOVERR - PLACE ERROR REASON IN TEXT BLOCK. . . . . . .   61
;  61. QUEMSG - SEND OR QUEUE A MESSAGE . . . . . . . . . . .   62
;  62. ORNACK - SEND AN ERROR ACK TO ORION. . . . . . . . . .   63
;  63. BLDACK . . . . . . . . . . . . . . . . . . . . . . . .   64
;  64. TXTMOV - MOVE TEXT FROM ONE LOCATION TO ANOTHER. . . .   65
;  65. BLDHDR - BUILD THE MESSAGE HEADER FOR ACK MESSAGE. . .   66
;  66. EREXEC - SEND AN ERROR MESSAGE TO THE EXEC . . . . . .   67
;  67. DEPCHR - INSERT AN ASCII CHARACTER IN AN EXEC ERROR MESSAGE  68
;  68. SETTIM - SETUP A TIMER FOR DECNET MESSAGE. . . . . . .   69
;  69. CLRTIM - CLEAR A TIMER UPON MESSAGE RESPONSE BEING RECEIVED  70
;  70. REMTIM - CLEAR A TIMER . . . . . . . . . . . . . . . .   71
;  71. PROTIM - TIMER HAS GONE OFF, COMMUNICATION LOST TO REMOTE NODE   72
;  72. SNDMSG - SEND MESSAGES TO AVAILABLE SENDERS. . . . . .   73
;  73. SENMSG - NOTIFY A SENDER OF A MESSAGE AVAILABLE. . . .   74
;  74. CONSTS - CONNECTION FAILURE STATUS . . . . . . . . . .   75
;  75. GETMSG -PICK UP A MESSAGE FROM A LISTENER. . . . . . .   76
;  76. PROMSG - PROCESS DECNET LISTENER MESSAGES DISPATCHER .   77
;  77. LFDAK - PROCESS A "FROM NEBULA DISMOUNT ACK" MESSAGE .   78
;  78. LSIBHM - PROCESS IN BEHALF OF MESSAGES FROM LISTENERS.   79
;  79. EINFO - PROCESS AN IN BEHALF OF EXEC INFO OUTPUT MESSAGE   80
;  80. EKILL - PROCESS AN IN BEHALF OF EXEC CANCEL MESSAGE. .   81
;  81. NSRCL - PROCESS REMOTE SHOW CLUSTER-STATUS MESSAGE . .   82
;  82. NSEACK - BUILD AN ACK MESSAGE REMOTELY . . . . . . . .   83
;  83. RSPMSG - RESPONSE TO A MESSAGE . . . . . . . . . . . .   84
;  84. SENREM - SEND A MESSAGE FROM A REMOTE NODE TO ORION. .   85
;  85. REXSHW - RESPONSE TO AN EXEC REQUEST . . . . . . . . .   86
;  86. RNEBAK - RESPOND TO A NEBULA ACK MESSAGE . . . . . . .   87
;  87. NRMACK - PROCESS A NEBULA ACK RESPONSE MESSAGE . . . .   88
;  88. RESTAR - PROCESS CRASHED INFERIOR FORKS. . . . . . . .   89
;  89. INFSTS - DETERMINE THE STATUS OF AN INFERIOR FORK. . .   90
;  90. SNDORN - SEND AN IPCF MESSAGE TO ORION OR QUASAR . . .   91
;  91. N$SEND - ROUTINE TO SEND AN IPCF MESSAGE TO AN EXEC. .   92
;  92. XFRMSG - TRANSFER IPCF MESSAGE FROM ONE BUFFER TO ANOTHER  93
;  93. ADDMQE - ADD A MESSAGE TO A SENDER'S MESSAGE QUEUE . .   94
;  94. FNDMQE - FIND AND RETURN A MESSAGE QUEUE ENTRY . . . .   95
;  95. RELMQE - RETURN A MESSAGE QUEUE ENTRY TO MEMORY MANAGER  96
;  96. BLDMQE - BUILD A MESSAGE QUEUE ENTRY . . . . . . . . .   97
;  97. ADDIBH - ADD AN IN BEHALF OF QUEUE ENTRY . . . . . . .   98
;  98. FNDIBH - FIND AN IN BEHALF OF QUEUE ENTRY. . . . . . .   99
;  99. RELIBH - RETURNS AN IN BEHALF OF QUEUE ENTRY . . . . .  100
; 100. ADDGRQ - ADD A REMOTE QUEUE ENTRY TO THE GLOBAL REMOTE QUEUE  101
; 101. FNDGRQ - FIND A GLOBAL REMOTE QUEUE ENTRY. . . . . . .  102
; 102. RELGRQ - RETURNS A GLOBAL REMOTE QUEUE ENTRY . . . . .  103
; 103. FNDNRQ - FIND A NODE'S REMOTE QUEUE ENTRY. . . . . . .  104
; 104. RELNRQ - RETURNS A NODE'S REMOTE QUEUE ENTRY . . . . .  105
; 105. SNAMNT - SEARCH NODE TABLE BY NODE NAME. . . . . . . .  106
; 106. SNUMNT - SEARCH NODE TABLE BY NODE NUMBER. . . . . . .  107
; 107. LISTEN - MESSAGE SERVER FOR A REMOTE NODE. . . . . . .  108
; 108. LISSET - INITIALIZE THE LISTENER'S GLXLIB AND CAPABILITIES  109
; 109. LOPLNK - OPEN A DECNET SRV: DEVICE . . . . . . . . . .  110
; 110. LISINT - SET UP THE LISTENER'S INTERRUPT SYSTEM. . . .  111
; 111. ACCEPT - VALIDATE A DECNET CONNECTION REQUEST. . . . .  112
; 112. MSGFSN - DECNET MESSAGE FROM SENDER IS AVAILABLE . . .  113
; 113. GETSMG - PICK UP MESSAGE FROM SENDER AND PLACE ON MESSAGE QUEUE 114
; 114. MSGTTF - TOP FORK READY FOR A MESSAGE FROM A LISTENER.  115
; 115. XFRTOP - MOVE MESSAGE FROM MESSAGE QUEUE TO MESSAGE BUFFER  116
; 116. ADDLME - ADD A LISTENER MESSAGE QUEUE ENTRY. . . . . .  117
; 117. RELLME - DELETE AN ENTRY FROM THE LISTENER MESSAGE QUEUE  118
; 118. LISCHK - LISTENER CHECKSUM AND ACK MESSAGE . . . . . .  119
; 119. SENACK - SEND AN ACK MESSAGE TO THE REMOTE SENDER. . .  120
; 120. INLCRH - ROUTINE TO INDICATE LISTENER CONTROLLED CRASH  121
; 121. SENDER - MESSAGE ROUTER TO A REMOTE NODE . . . . . . .  122
; 122. SENSET - INITIALIZE THE SENDER'S GLXLIB AND CAPABILITIES  123
; 123. SENINT - SET UP THE SENDER'S INTERRUPT SYSTEM. . . . .  124
; 124. SOPLNK - OBTAIN A CONNECTION TO THE LISTENER . . . . .  125
; 125. SGTLNK - OBTAIN DECNET JFN AND OPEN IT . . . . . . . .  126
; 126. SCKLNK - CHECK THE STATUS OF THE SENDER'S LINK . . . .  127
; 127. FNDCER - DETERMINE THE DECNET CONNECTION ERROR . . . .  128
; 128. SENCON - INDICATE TO TOP FORK THAT SENDER HAS A CONNECTION  129
; 129. MSGTLI - SEND A MESSAGE TO THE LISTENER. . . . . . . .  130
; 130. CHKSUM - CHECKSUM DECNET MESSAGES. . . . . . . . . . .  131
; 131. MSGFLI - PICKUP ACK MESSAGE FROM THE LISTENER. . . . .  132
; 132. SSNDMG - SEND A MESSAGE TO A LISTENER. . . . . . . . .  133
; 133. REPCON - ENABLE DECNET-CONNECTION-ATTEMPTS . . . . . .  134
; 134. INSCRH - ROUTINE TO INDICATE SENDER CONTROLLED CRASH .  135
; 135. NEBDDT - ROUTINE TO LOAD DDT IF DEBUGGING. . . . . . .  136
; 136. KASNOD - RESET A NODE'S DATA BASE. . . . . . . . . . .  137
; 137. STINFO - START AN INFO% JSYS FAILURE TIMER . . . . . .  138
; 138. IEPROC - INFO% JSYS ERROR TIMER EVENT PROCESSOR. . . .  139
; 139. TOPTMR - TOPOLOGY CHANGE TIMER . . . . . . . . . . . .  140
; 140. NEBTMR - NEBULA ACK MESSAGE TIMER. . . . . . . . . . .  141
; 141. NACKTM - NEBULA ACK MESSAGE TIMER PROCESSOR. . . . . .  142
; 142. NODPAR - PICK UP THE ENVIRONMENT OF A REMOTE NODE. . .  143
; 143. CHKSTS - CHECK FOR DECNET AND RELEASE 7 MONITOR. . . .  144
; 144. FNDPNE - ADD AN ENTRY TO THE PACKN TABLE IF NECESSARY.  145
; 145. SRHPNE - CHECK IF A NODE HAS AN ENTRY IN THE PACKN TABLE  146
; 146. USNERR - SET UP ARGUMENT WORDS FOR ACK MESSAGE PROCESSING 147
; 147. REASON - MESSAGE ERROR TABLE . . . . . . . . . . . . .  148
; 148. EXPTAB - EXPAND THE PACKN TABLE. . . . . . . . . . . .  149
; 149. UTILITY ROUTINES FOR SHOW CLUSTER-GALAXY-LINK-STATUS .  150
; 150. GETPAG - GET A PAGE FOR OUTGOING IPCF MESSAGE. . . . .  151
; 151. RELPAG - RELEASE OUTGOING IPCF PAGE. . . . . . . . . .  151
; 152. TABLES FOR ERROR CODES REPORTED. . . . . . . . . . . .  152
; 153. COMMON STOPCODES . . . . . . . . . . . . . . . . . . .  153
SUBTTL	REVISION HISTORY

COMMENT \

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

6000	6.1140		13-Dec-87
	Create NEBULA as the cluster GALAXY message router.

6001	6.1142		17-Dec-87
	Add support for the SHOW STATUS TAPE and SHOW STATUS DISK 
commands.

6002	6.1144		17-Dec-87
	If an OPENF% fails due to node name not assigned, then retry
every 5 seconds up to 5 minutes before crashing.

6003	6.1145		17-Dec-87
	When debugging, use the first six characters of the user name
rather than "NEBULA" in the listener and sender names.

6004	6.1146		17-Dec-87
	Add support for the SHOW STATUS STRUCTURE command

6005	6.1154		30-Dec-87
	Change routine SGTLNK to check for error NSPX24 rather than error
NSPX25 if an OPENF% fails.

6006	6.1155		31-Dec-87
	Clean up the display of the response to the SHOW CLUSTER command.

6007	6.1160		5-Jan-88
	Cause routine NTMTS to increment the current block pointer correctly.

6010	6.1161		5-Jan-88
	Cause routine NFDAK to correctly point to the error block.

6011	6.1170		21-Jan-88
	Clear the timer when a response to a message has been received.

6012	6.1175		7-Feb-88
	Add support for the EXEC commands INFORMATION OUTPUT/DESTINATION
and CANCEL PRINT/DESTINATION.

6013	6.1180		13-Feb-88
	Clean up the creation of error messages that caused IQN crashes.

6014	6.1181		15-Feb-88
	On encountering any errors forwarding INFORMATION OUTPUT/DESTINATION
and CANCEL PRINT/DESTINATION messages, send an error message to the EXEC
with the same format that the EXEC expects error messages from QUASAR.

6015	6.1183		16-Feb-88
	HALTF% is Cluster GALAXY is not enabled.

6016	6.1192		23-Feb-88
	Correct various timing problems encountered that involve CLUDGR not
fully initialized and the monitor's CI node data base not being fully 
initialized. Add the NEBULA ACK/NEBULA ACK RESPONSE message mechanism.

6017	6.1194		23-Feb-88
	Change routine SENMSG to use the correct AC when picking up the message
address when setting the message response timer.

6020	6.1200		29-Feb-88
	If a DECnet OPENF% fails, then check for error NSPX13 (Access not
permitted. If this is the error, then try again.

6021	6.1201		29-Feb-88
	Sender OPENF% failures can be due to a variety of transcient DECnet
problems, as can listener MTOPR% failures. For all OPENF% failures, retry
up to five minutes. For MTOPR% failures, CLOSF% the link and re-open the
link. If there is no success after the retries, then inform ORION and
HALTF%, but do not stopcode.

6022	6.1202		29-Feb-88
	If a cluster topology change occurs and if no listener or sender
to a node has been started, do not cause routine RESTAR to erronously
send a WTO message to ORION stating that that node's sender and listener
has been restarted.

6023	6.1203		29-Feb-88
	Correct the response message format to the command:
OPR>SHOW CLUSTER/NODE:FOO/CLUSTER-NODE:FOO

6024	6.1209		2-Mar-88
	If a REMOTE DISMOUNT message cannot be sent to a remote node, then
indicate this in the remote queue entry with monitor error NSPX18 so that
MOUNTR can display the reason in its WTO message to ORION.

6025	6.1221		6-Mar--88
	More of edit 6024. MOUNTR also requires bit RQ%TER set in order to
display the error string.

6026	6.1225		8-Mar-88
	Update copyright notice.

6027	6.1239		26-Apr-88
	If communication is lost to a remote NEBULA and if there is an
outstanding response to a dismount message from that NEBULA, then indicate
error SCLX08 (Unexpected state - no communication) in the TO NEBULA DISMOUNT
ACK message that is sent to MOUNTR. 
 Also, if NEBULA receives an unknown IPCF message, then log that fact with
ORION.

6030	6.1241		27-Apr-88
	More of edit 6030. MOUNTR also requires bit RQ%TER set in order to
display the error string.

6031	6.1244		30-Apr-88
	Update timer word MSGTIM during every scheduling pass rather than
only when an IPCF message is received. 

6032	6.1245		3-May-88
	Clear the SAB index word (SAB.SI) when sending a message to an EXEC,
otherwise, the message may be sent to QUASAR if the previous IPCF message
had been sent to QUASAR.

6033	6.1247		5-May-88
	Add support for the SHOW STATUS NETWORK-NODE and SHOW PARAMETERS
NETWORK-NODE commands.

6034	6.1248		6-May-88
	Cause NEBULA to wait for ORION to be running. If NEBULA starts up
before ORION does, then the first message NEBULA receives from ORION is
rejected.

6035	6.1252		10-May-88
	Change routines RESTAR and CHKDEC to first check if there are any
remaining remote nodes in the cluster. If there are not, then have them
return. This prevents NTI crashes from occurring in the case where a node
has left the cluster and there are no longer any remote nodes in the cluster.

6036	6.1256		13-May-88
	Cause NEBULA to wait for QUASAR to be running. If NEBULA starts up
before QUASAR does, then NEBULA rejects all messages from QUASAR since
QUASAR is not in its system PID table.

6037	6.1269		18-Oct-88
1. Implement the /CLUSTER-NODE switch with the rest of the OPR commands.
2. Include the PASSWORD in the connect initiate message.  This is used to
determine whether the node is running Field Image Galaxy or post FI.  Since
FI Galaxy don't support these OPR commands there is no need to send the
command to the node.
3. If the message is not defined in MSGTAB, then assume it is in the new
format.  Since ORION should have already verify the message we can make
this assumption.  The new message format is exactly the same as the ORION
message to QUASAR, except bit NEB%MS 1B0 will be lit.
4. Remember the number of responses associated with a Cluster command.

6040	6.1275		9-Mar-89
	When processing the ENABLE/DISABLE REPORT-CONNECTION-FAILURES
messages, if there are currently no known remote nodes in the cluster,
then do not return an error message. Instead, set the REPORT-CONNECTION-
FAILURES FLAG (RCFFLG) to indicate ENABLE or DISABLE REPORT for future
nodes that may join the cluster and indicate this to ORION.

6041	6.1282		26-Sep-89
	Have routine LSIBH0 also check SET (.OMSET), ENABLE PRINT-LOGFILES
(.OMELT), DISABLE PRINT-LOGFILES (.OMDLT) messages for multiple units
when determining the number of responses to expect.

6042	6.1282		2-Nov-89
	Change routines NDRCF and NDDCA check if the specified node name is
the local node name. If it is, then return an error message to the operator.

6043	6.1289		29-Nov-89
	Add support for process NULL ACK (.OMNAK) messages. Also, allow WTO
and WTOR messages to be forwarded even if the "in behalf of" queue entry
is not found.

6044	6.1292		16-Dec-89
	Correct the range determination of messages that can affect more
than one object.

6045	6.1301		15-Jan-90
	Remove the Original Command Text (.ORTXT) block from those messages
that are not sent to a remote ORION.

6046	6.1302		16-Jan-90
	Remove the valid maximum argument count check when validating
a message syntax. 

6047	6.1303		16-Jan-90
	Change routine NSCLU to notify the local ORION if node FOO is unknown
in the command SHOW CLUSTER/NODE:FOO/CLUSTER:*

6050	6.1308		9-Feb-90
	If there is no "in behalf of" queue entry for a display message and
if the node that the display message is to be sent to is no longer in the
cluster, simply drop the message rather than crashing with "node table
inconsistency".

6051	6.1310		13-Feb-90
	Add JUMPF LSIBHM if there is no object block in the message.

6052	6.1312		1-Mar-90
	Add support for the /CLUSTER-NODE: switch to the ENABLE/DISABLE
DECNET-CONNECTION-ATTEMPTS and REPORT-CONNECTION-FAILURES commands.

6053	6.1315		27-Apr-90
	Define routine NWTOX in support of remote broadcasting of WTO and
WTOR messages.

\   ;End of Revision History
	SUBTTL	SYMBOL DEFINITONS

PDSIZ==^D200				;SIZE OF THE PUSH DOWN STACK
MAXNOD==7				;MAXIMUM NUMBER OF REMOTE NODES
DBSIZ==2				;SIZE OF SENDER/LISTENER DATA BASE
M==13					;INCOMING IPCF MESSAGE ADDRESS
MO==14					;OUTGOING IPCF MESSAGE
LIS==15					;LISTENER DATA BASE ADDRESS
SEN==16					;SENDER DATA BASE ADDRESS
NNMFLD==17B35				;NODE NUMBER FIELD
VERNUM==700				;MINIMUM VALID MONITER VERSION NUMBER
INFBSZ==6				;INFO% JSYS BLOCK SIZE
SCSCN==4				;SCS% CHANNEL NUMBER
SCSLEN==1+.SQDTA+SQ%CDT			;SIZE OF SCS% EVENT BLOCK
CNFLEN==1+3*<MAXNOD+1>			;ASCIZ NODE NAME BLOCK LENGTH
MSGLN==^D200				;[6012]LENGTH OF EXEC ERROR MESSAGE
TIMOUT==<^D5*^D60*^D1000>/^D333		;TIMEOUT VALUE FOR REMOTE NODE RESPONSE
TOPTRY==<^D3*^D60*^D1000>/^D333		;[6016]TIME IN WHICH TO CHECK TOPOLOGY
TIMUP==5*^D60*^D1000			;[6016]MIN MONITOR UPTIME FOR NO RECHECK
IEMAX==5				;[6016]MAX TIMER TRIES ON INFO% ERROR
	SUBTTL	RANDOM STORAGE AREA

PDL:	BLOCK PDSIZ			;PUSH DOWN STACK
NODNAM:	BLOCK 1				;THE LOCAL NODE NAME (SIXBIT)
NODNUM: BLOCK 1				;THE LOCAL NODE NUMBER
RENNUM:	BLOCK 1				;NUMBER OF REMOTE NODES
NBSCHD:	BLOCK 1				;NEBULA SCHEDULING FLAG
NEBSIZ: BLOCK 1				;THE NUMBER OF PAGES IN NEBULA
LOCACK:	BLOCK 1				;LOCAL ACK CODE FOR IBH MESSAGES
MSGTIM:	BLOCK 1				;TIME AN IPCF MESSAGE WAS PICKED UP
TIMCTR: BLOCK 1				;MAKE UNIQUE UDT FOR TIMEOUT QUEUES
TIMBLK:	BLOCK .TIDAT+1			;SIZE OF THE TIMER EVENT QUEUE ENTRY
BYTPTR:	BLOCK 1				;SAVE AREA FOR A BYTE POINTER
G$ERR:	BLOCK 1				;ERROR DETECTED DURING IPCF PROCESSING
G$SND:	BLOCK 1				;PID OF IPCF MESSAGE SENDER
G$MSG:	BLOCK MSGLN			;[6012]EXEC ERROR MESSAGE BUFFER
RCFFLG:	BLOCK 1				;REPORT-CONNECTION-FAILURES FLAG
DCAFLG:	BLOCK 1				;DECNET-CONNECTION-ATTEMPTS FLAG
STFLAG: EXP  -1                         ;NEBULA NOT RESTARTABLE FLAG
BLDTAB: EXP  -1				;NODE TABLE BEING BUILT AT STARTUP
SAB:	BLOCK SAB.SZ			;IPCF SENDER ADDRESS BLOCK
SCSBLK:	EXP   2				;SCS% INTERRUPT ENABLED BLOCK SIZE
	XWD   .SIPAN,SCSCN		;ASSOCIATE SCS EVENTS WITH CHAN SCSCN
SCSEBK:	BLOCK SCSLEN			;SCS% EVENT BLOCK
REMHDR: BLOCK 1				;GLOBAL REMOTE QUEUE HEADER WORD
REMTRL: BLOCK 1				;GLOBAL REMOTE QUEUE TRAILER WORD
IBQHDR:	BLOCK 1				;IN BEHALF OF QUEUE HEADER WORD
IBQTRL: BLOCK 1				;IN BEHALF OF QUEUE TRAILER WORD
REMORG:	BLOCK 1				;MESSAGE ORIGINATED FROM A REMOTE NODE
REMFLG:	BLOCK 1				;PROCESS THE MESSAGE REMOTELY
LOCFLG:	BLOCK 1				;PROCESS THE MESSAGE LOCALLY
BLKADR:	BLOCK 1				;.WTTXT BLOCK ADDRESS, USED BY BLDHAD
NODDAT: BLOCK 3				;NODE NAME PASSED AS OPTIONAL DATA
EXESND: BLOCK 1				;[6012]MESSAGE FROM EXEC FLAG
EXESHW:	BLOCK 1				;[6012]EXEC SHOW/KILL RESPONSE FLAG
STABLK:	BLOCK 1				;[6013].CMTXT BLOCK ADDRESS
;**;[6037]At STABLK +1L add 1 line  JYCw  Oct-18-88
PASSWD:	BLOCK 2				;[6037]PASSWORD block
NMFFLG:	BLOCK 1				;[6037]New message format flag
;THE G$ARGX WORDS MUST BE CONTIGUOUS. ENSURE THIS BY DEFINING THEM WITH
;A MACRO

DEFINE CONCAT (X) <
G$ARG'X': BLOCK 1			;;DEFINE THE ERROR WORD
>

DEFINE	G$ARGX (A) <
 IRP A,<IFE MAXNOD-A,<STOPI>
 CONCAT A >				;;SETUP THE ERROR WORD
>

G$ARGX	<1,2,3,4,5,6,7>			;SETUP THE ERROR BLOCK

;      STORAGE USED BY NTDSM 

NTSMSG:	BLOCK 1				;NUMBER OF NODES TO SEND MESSAGE TO
NNIMSG: BLOCK 1				;NUMBER OF NODES IN IPCF MESSAGE
FIRNOD: BLOCK 1				;ADDRESS OF FIRST NODE
LLWSIZ: BLOCK 1				;SIZE OF LINK LIST BLOCK IN MSG QUEUE
MQMADR: BLOCK 1				;ADDRESS OF MESSAGE IN MESSAGE QUEUE
STRLEN: BLOCK 1				;LENGTH OF STRUCTURE NAME BLOCK
IBLADR: BLOCK 1   			;INVARIANT BLOCK ADDRESS

;	STORAGE USED BY TOPCHN 

CURNUM: BLOCK 1				;CURRENT NUMBER OF NODES
                                            
;MACRO USED BY NSCLU

DEFINE	$ASCII(MSG),<
	PUSHJ	P,ASCOUI		;;CALL THE IN-LINE ASCII OUTPUTTER
	CAI	[ASCIZ+MSG+]		;;AIM AT THE MESSAGE
>;END $ASCII DEFINE

NEBACK:	5,,.NACKM			;[6016]NEBULA ACK MESSAGE HEADER WORD
	EXP 0,0,0,0			;[6016]NEBULA ACK MESSAGE HEADER
NEBRSP:	5,,.NACKR			;[6016]NEBULA ACK RESPONSE MSG HDR WORD
	EXP 0,0,0,0			;[6016]NEBULA ACK RESPONSE MSG HEADER
	SUBTTL	RESIDENT JOB DATA BASE

SREADY:	BLOCK 1				;SENDER IS AVAILABLE FLAG
LREADY:	BLOCK 1				;LISTENER HAS MESSAGE FLAG
IREADY: BLOCK 1				;AN INFERIOR FORK HAS DECNET CONNECTION
TRMFRK: BLOCK 1				;AN INFERIOR FORK HAS TERMINATED
SCSFLG: BLOCK 1				;A CLUSTER TOPOLOGY CHANGE DETECTED
ASZNAM:	BLOCK CNFLEN			;ASCIZ NODE NAMES FROM CNFIG% .CFCND
SWINFO:	BLOCK .CFILN			;STATIC SOFTWARE INFORMATION
INFBLK: BLOCK INFBSZ			;INFO% SOFTWARE INFORMATION BLOCK

;NNMTBL AND NDNTBL ARE USED DURING CLUSTER TOPOLOGY CHANGE PROCESSING BY
;ROUTINE TOPCHN. NODSEN AND NODMQ ARE USED DURING IPCF MESSAGE PROCESSING
;BY ROUTINES SETPAR, SEPALL AND QUEMSG. THESE TWO SETS OF TABLES MUST NOT
;BE USED CONCURRENTLY.

NNMTBL: NODSEN: BLOCK 2+MAXNOD		;NODE NUMBER TABLE
NDNTBL: NODMQ:	BLOCK MAXNOD		;REMOTE (SIXBIT) NODE NAME TABLE
NODTBL:	BLOCK   MAXNOD*.NNNSZ		;NODE TABLE
RECHEK: BLOCK	1			;[6016]RECHECK NODE NAME TABLE
NDLKST:	BLOCK	1			;PREVIOUSLY AND CURRENTLY KNOWN NODES 
NDLKNM:	BLOCK	1			;NUMBER OF ENTRIES IN PACKN TABLE
NDLKFR:	BLOCK	1			;NUMBER OF FREE ENTRIES IN PACKN TABLE
	SUBTTL	PID AND INTERRUPT DEFINITION

INTVEC==:LEVTAB,,CHNTAB

IB:	$BUILD	IB.SZ			;
	  $SET	(IB.PRG,,%%.MOD)	;PROGRAM 'NEBULA'
	  $SET  (IB.FLG,IP.STP,1)	;STOPCODES TO ORION
	  $SET(IB.FLG,IB.SYS,NEB.JP)	;SET SYSTEM PROCESS
	  $SET	(IB.PIB,,PIB)		;SET UP PIB ADDRESS
	  $SET	(IB.INT,,INTVEC)	;SETUP INTERRUPT VECTOR ADDRESS
	$EOB				;

PIB:	$BUILD	PB.MNS			;
	  $SET	(PB.HDR,PB.LEN,PB.MNS)	;PIB LENGTH,,0
	  $SET	(PB.FLG,IP.PSI,1)	;PSI ON
	  $SET	(PB.FLG,IP.RSE,1)	;RETURN ON SEND ERROR
	  $SET	(PB.FLG,IP.SPB,1)	;SEE IF IPCF SENDER WAS PRIVILEGED
	  $SET	(PB.FLG,IP.JWP,1)	;JOB-WIDE PID
	  $SET	(PB.INT,IP.CHN,2)	;IPCF INTERRUPT CHANNEL
	  $SET	(PB.INT,IP.SPI,SP.NEB)	;SET UP SYSTEM PID
	  $SET	(PB.SYS,IP.BQT,-1)	;MAXIMUM SEND/RECEIVE IPCF QUOTA
	  $SET	(PB.SYS,IP.MNP,^D5)	;NUMBER OF PIDS
	$EOB				;


LEVTAB:	EXP	LEV1PC			;INTRPT LEVEL 1 PC ADDRESS
	EXP	LEV2PC			;INTRPT LEVEL 2 PC ADDRESS
	EXP	LEV3PC			;INTRPT LEVEL 3 PC ADDRESS

CHNTAB:	XWD	1,LISMSG		;LISTENER HAS A MESSAGE
	XWD	1,SNDREA		;SENDER IS READY FOR A MESSAGE
	XWD	1,NBIPCF		;IPCF HAS A MESSAGE
	XWD	1,INFRDY		;INFERIOR FORK HAS DECNET CONNECTION
	XWD	1,NBSCS			;SCS DETECTED A CLUSTER TOPOLOGY CHANGE
	BLOCK	^D31			;INFERIOR FORK TERMINATED ON CHANNEL 19
					;ALL OTHER CHANNELS 0

LEV1PC:	BLOCK	1			;LEVEL 1 INTERRUPT PC
LEV2PC:	BLOCK	1			;LEVEL 2 INTERRUPT PC
LEV3PC:	BLOCK	1			;LEVEL 3 INTERRUPT PC
	SUBTTL	NEBULA STARTUP AND SCHEDULER

;SET UP NEBULA

NEBULA:	RESET%				;THE USUAL
SINGLE<	HALTF%>				;[6015]QUIT IF CLUSTER GALAXY NOT ENABLED
	MOVE	P,[IOWD PDSIZ,PDL]	;SET UP THE STACK.
	AOSE	STFLAG			;RESTARTING?
	$STOP	(NNR,NEBULA NOT RESTARTABLE)
	MOVEI	S1,IB.SZ		;GET THE INITIALIZATION BLOCK SIZE.
	MOVEI	S2,IB			;ADDRESS OF THE INITIALIZATION BLOCK
	$CALL	I%INIT			;SET UP GLXLIB
	$CALL	NEBENV			;CHECK THE NEBULA ENVIRONMENT
	$CALL	NBINIT			;GO SETUP CONSTANTS AND CAPABILITIES
	$CALL	WAIQSR			;[6036]WAIT FOR QUASAR TO START UP
	$CALL	WAIORN			;[6034]WAIT FOR ORION TO START UP
	$CALL	INTINI			;SET UP THE INTERRUPT SYSTEM.
	$CALL	NODINT			;INITIALIZE THE NODE DATA BASE
	$CALL	BLDLST			;SETUP AND BUILD THE PACKN TABLE
	SKIPE	RENNUM			;ANY REMOTE NODES?
	$CALL	STLAS			;YES, START UP THE LISTENERS/SENDERS

MAIN:	SETZM	NBSCHD			;SLEEP AFTER THIS PASS
	$CALL	I%NOW			;[6031]PICK UP THE CURRENT TIME
	MOVEM	S1,MSGTIM		;[6031]SAVE FOR LATER

	SKIPE	SCSFLG			;CLUSTER TOPOLOGY CHANGE OCCURRED?
	$CALL	TOPCHN			;YES, UPDATE THE NODE DATA BASE

	SKIPE	TRMFRK			;HAS A SENDER OR LISTENER CRASHED?
	$CALL	RESTAR			;YES, FIND OUT WHICH ONE

	SKIPE	IREADY			;INFERIOR FORK HAS A DECNET CONNECTION?
	$CALL	CHKDEC			;YES, FIND OUT WHICH ONE

	$CALL	CHKQUE			;CHECK FOR IPCF MESSAGES

	SKIPE	SREADY			;IS A SENDER AVAILABLE?
	$CALL	SNDMSG			;YES, FIND OUT WHICH SENDER 

	SKIPE	LREADY			;DOES A LISTENER HAVE A MESSAGE?
	$CALL	GETMSG			;YES, PICK IT UP

	SKIPE	NBSCHD			;TIME FOR ANOTHER SCHEDULING PASS?
	JRST	MAIN			;YES, GO CHECK AGAIN

	SETZ	S1,			;SLEEP TILL WE'RE NEEDED
	$CALL	I%SLP			;DON'T WAKE UP UNTIL NEEDED
	JRST	MAIN			;CHECK OUT WHAT HAPPEN
	SUBTTL	NEBENV - CHECK THE NEBULA ENVIRONMENT

;NEBENV is called during NEBULA startup to determine if the local node
;has the following environment:
; DECnet enabled
; A monitor of release 7 or later
; Cluster GALAXY enabled
;
;If any of these attributes are not present, then NEBULA crashes.
;
;Call is:      No arguments
;Returns true: Only if DECnet is enabled for this node, the monitor is
;              release 7 or later, and the Cluster GALAXY option is enabled.
;Crashes:      If cannot obtain the static software information, DECnet is
;              not enabled, or the monitor is pre-release 7.

NEBENV:	$SAVE	<T1,T2>			;CONFG% JSYS CHANGES THESE AC
	MOVEI	S2,SWINFO		;PICK UP ARGUMENT BLOCK ADDRESS
	MOVEI	S1,.CFILN		;PICK UP THE LENGTH OF THE ARG BLOCK
	MOVEM	S1,.CFLEN(S2)		;PLACE IT IN THE ARGUMENT BLOCK
	MOVEI	S1,.CFINF		;PICK UP THE FUNCTION
	CNFIG%				;GET THE SOFTWARE INFORMATION
	 ERJMP	[$STOP	(COS, CAN'T OBTAIN STATIC SOFTWARE INFORMATION)]

	MOVEI	S1,SWINFO		;PICK UP ARGUMENT BLOCK ADDRESS
	MOVE	S2,.CFISO(S1)		;PICK UP THE STATIC SOFTWARE OPTIONS
	TLNN	S2,(CF%DCN)		;IS DECNET INSTALLED?
	$STOP	(DNI, DECNET NOT INSTALLED)	;NO, TERMINATE NOW
	HLRZ	S2,.CFIVR(S1)		;PICK UP THE VERSION NUMBER
	CAIGE	S2,VERNUM		;RELEASE 7 OR LATER?
	$STOP	(IMV, INVALID MONITOR VERSION)

	$RETT				;NEBULA IS IN THE CORRECT ENVIRONMENT
	SUBTTL	NBINIT - GET NODE NAME, NODE NUMBER, AND SIZE OF NEBULA

;NBINIT is called during NEBULA startup. This routine determines the
;name and cluster node number of this node (the local node). 
;In addition, the size of NEBULA in pages is also determined. This is 
;required when mapping a sender or listener.
;Also, the seed for the local ACK codes used in the in behalf of queue
;is determined and saved.
;
;Call is: No arguments
;Returns: Node name and number, NEBULA size determined and saved

;PICK UP THE NODE NAME AND NUMBER OF THE LOCAL NODE

NBINIT:	$CALL 	I%HOST			;PICK UP THE HOST NAME AND NUMBER
	MOVEM	S1,NODNAM		;SAVE THE SIXBIT NODE NAME
	MOVEM	S2,NODNUM		;SAVE THE NODE NUMBER

;PICK UP AND SAVE THE SIZE OF NEBULA IN PAGES

	SKIPE	DEBUGW			;DEBUGGING?
	SKIPN	116			;AND ARE SYMBOLS DEFINED?
	JRST	NBIN.1			;IF NO TO EITHER, THEN SKIP THIS
	HLRO	S1,116			;GET AOBJN LENGTH
	MOVMS	S1			;GET ABSOLUTE VALUE
	HRRZ	S2,116			;GET SYMBOL TABLE START ADDRESS
	ADDI	S1,-1(S2)		;CALCULATE THE SYMBOL TABLE LENGTH
	SKIPA				;SKIP OVER NORMAL CALCULATIONS
NBIN.1:	HLRZ	S1,.JBSA##		;GET THE PROGRAM END ADDRES