Google
 

Trailing-Edge - PDP-10 Archives - decnet_mcb_cusps_703a - 10,7/dcnmcb/netgen.mac
There are 8 other files named netgen.mac in the archive. Click here to see a list.
;
;  NETGEN - Network configurator program
;
	SEARCH	NGNMAC

; Version !!!

	XP	NGNVER,	4		; Major version number
	XP	NGNMIN,	1		; Minor version number
	XP	NGNWHO,	0		; Who did editing last(0=DEC)
	XP	NGNEDT,	50		; Edit number



	 IFNDEF FT.NET, FT.NET==-1

TOPS10 <IFNDEF FT.X25, <FT.X25==-1>>
TOPS20 <IFNDEF FT.X25, <FT.X25== 0>>

TOPS10 <IFE <FT.NET!FT.X25>,	<FT.NET==-1
				 FT.X25==-1>>

TOPS20 <IFE <FT.NET!FT.X25>,	<FT.NET==-1
				 FT.X25== 0>>


IFN FT.NET, INIGEN (NETGEN,NGN)		; Initialize GLXLIB assembly options
IFE FT.NET, INIGEN (X25GEN,NGN)		; Initialize GLXLIB assembly options
;
;
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  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.
;
;
;
;Base level set 22JUN81
;
;	EDIT	HISTORY - to change edit # search for occurance of "!!!"
;
; Edit #    Date	Description
;
;  1	   26JUN81	Change INCLUDE KDP command to allow multipoint
;			 control/tributary for inhouse use only.
;			Also, CHANGE command fixed so it doesn't try to
;			 change the phys addr of a multipt trib if "outhouse"
;			Also, don't allow INCLUDE/EXCLUDE MULTIDROP on kdp
;			 command if "outhouse"
;			Also, fix it so that the version and edit info really
;			 comes out in the prog header and the output files'
;			 .ident info.
;			Also, delete the code sections in the FINISH
;			 command that produce the DEV$DFs, CTL$DFs, and the
;			 UNT$DFs for the line printer and the card reader.
;			 They now have PRC$DFs and LLC$DFs.
;			Also, change the definition of RDB.sz in NETPAR to be
;			 <DL.blk+6+1>&<-2>
;  2	   15JUL81	FINISH command fixes
;			Fix $TEXT macro string for writing std RSX-Task
;			 header to avoid writing a blank line in CETAB if
;			 the standard task POSI is not to be included
;			 (ie, if node is a DN20)
;			At same place, always include DTR as a std rsx-task
;			 whether or not there are any non-std ones, and
;			 regardless of node type.  This is to prevent RSX11S
;			 from crashing when Session Control asks for a task.
;			Also, fix it so there are no blank lines between the
;			 CTL$DF sections for DTE, DMRs, DMCs
;  3	   07AUG81	Add vector, csr and priority definitions for line
;			 printer and card reader to NETPAR
;			Also fixed TSK$DF DTR in CETAB so it is never a comment
;			 line
;  4	   10AUG81	Put in LOG command - log and take commands check out
;
;  5	   31AUG81	Changes to handling of variables FLOWCT & NRLNUM:
;			 Add line "ND.fld = 3  ;NRD - Low Water Flow Count" to
;				NETPAR
;			 Delete or comment out all refs to variable FLOWCT
;				 and routine FLOCLC
;			 Make default #NRM pipes = 1
;			 Fix bug in formula that resets #NRM pipes in routines
;				incl/excl cr/lp, node type from
;					if NRLNUM.ne.0 add 1
;						to
;					if NRLNUM=0 add 1
;			 The two variables in NETPAR, NR.flw and ND.flw, were
;			 	being set to the value of FLOWCT - they are
;				seperate, with values of 4 and 10 respectively
;			 Make CHANGE FLOWCOUNT command inhouse only - it should
;				not be reset by the user
;			 Add user commands to change NETPAR parameters:
;				Inactivity Timer NTPACT (NS.act)
;				Delay Factor	 NTPDLY (NS.dly)
;				Rexmit Threshold NTPRET (NS.ret)
;				Round Trip Delay Est NTPWGT (NS.wgt)
;  6	   03SEP81	Additional changes to output files:
;			 CETAB:
;			  Standard Process LIB taken out
;			  For DN200s, add standard RSX driver TT
;			  Always include TSK$DF for NML
;			 NETPAR:
;			  literal XP.ibq set to 8 if dn20
;						20. if dn200
;			  add line 'macro' 39.,<POSI..>
;				to SC$obj macro, if dn200
;  7.	   08SEP81	Take out Delay Factor command after all
;
;  8.	   09SEP81	CETAB changes recommended by Lee Webber:
;			 Take out PRC$DF and LLC$DF for DTR - it has a TSK$DF
;			   NOTE - TAKE OUT TSK$DF DTR FOR FIELD TEST!!
;			 Take out PRC$DF KMC - no such process
;			 Include PRC$DF and LLC$DF for NRM/NRD only if
;				node type = dn200
;					AND
;				#nrm pipes (NRLNUM) > 0
;
;  9.	   17SEP81	Add range checks to following commands:
;				CHANGE	Inactivity Timer (range 0 - 30)
;					Retransmission Threshold (1 - 15)
;					Round Trip Delay Est. (1 - 255)
;
;  10.	   21SEP81	Rename the CHANGE ROUND TRIP DELAY command to be
;			 CHANGE DELAY WEIGHT, its real name in NSP.
;
;  11.	   02OCT81	Change the PDB for 'node name' command from $CTEXT
;			 to $FIELD - ctext allows special characters and
;			 embedded spaces, which are illegal for node name
;			Also add code to GETNOD to reject node names with
;			 any chars not in {0-9,a-z,A-Z}
;
;  12.	   02OCT81	Change all "_" to "-" in link specs. Affects:
;			  -parsing commands (chg phys addr KDP, excl kdp,
;				incl multipt drop, incl kdp)
;			  -retrieving parsed args
;			  -STNXDR, rtn to put multipt drop #s into prompts
;			  -information command (links, KDPs)
;			NOTE that for release version, only affects the
;			    INFORMATION command so that's all I did
;
;  13.	   05OCT81	Fix a blank line in CETAB
;
;  14.	   12OCT81	Change def of CCBLEN in FINMOD from 28. to 34.
;			Also change CE$buf macro in NETPAR\ these involve 
;			Also change BUF$DF macro to MEM$DF/changes to VNP36
;
;  15.	   04NOV81	Put in changes made to run in in TOPS10 environment
;
;  16.	   23NOV81	Various changes to CETAB and NETPAR, per Al Peckham:
;			 -inhouse range on node number changed to 2-255
;			 -NDT made a standard process in CETAB and included in
;			  SC$PRO macro in NETPAR
;			 -LLC processes deleted for DTE,DMC DMR,KDP
;			 -unneeded 0, denoting controller number, removed from
;			  SLT$DF for DMC and DMR
;			 -DTE's priority changed from 4 to 7 in CTL$DF
;			 -RSX task DTR deleted
;			 -in NETPAR, SC$PRO macro changed to include mapping
;			  for TOP (dn20 only) and NDT; TST removed
;
;  17.	   14Dec81	Inhouse only: always include line printer in NETPAR
;			 output - per Platukis
;
;  18.	   24Dec81	Change default value for sdb-size to 60 (from 80) and
;			 make the acceptable range include it. (inhouse only)
;
;  19.	   22Feb82	Changes needed for building load test tape:
;			 -Include a PRC$DF DMC when DMR included
;			 -Allow up to node # 255 but give msg saying 32 is
;			  max supported
;			 -Ensure that there are the same # of 16-byte buffers
;			  in CE$buf as there are RDB.sz-byte buffers in CE$cbb,
;			  and put in an arg specifying the minimum # of each
;
;  20.	   24Feb82	Get flow count out of NETPAR info display - release ver
;
;  21.	   05Mar82	Fix bug in calculating "cor" in MEM$DF (CETAB) - change
;			 "imul" to "imuli".
;			Include minimums mentioned in edit 19 inhouse only.
;
;  22.	   16Mar82	Don't duplicate PRC$DF DMC if both dmc & dmr included
;			Make edit 17. work right - had sense of inhs test wrong
;
;  23.	   23Mar82	For DN200, include 5 80.-byte buffers used by NRM, LE,
;			 and CR in CE$buf macro in NETPAR.MAC
;  24.	   25Mar82	Fix change-dlblk-size cmd test on a border condition
;  25.	   26Mar82	Get rid of spurious ";" in DN200's DMC UNT$DF
;  26.	   30Mar82	Delete msg for node # >32.
;			Change copyright date on output files.
;  27.	   31Mar82	Update copyright dates on modules.
;			Add START command to NETGEN repertoire.
;			Don't require explicit version info in 2 places
;  28.	    1Apr82	Add error message text for node type parsing
;			Change dispatch processing for NODE command
;  29.	    7Apr82	Fix up topmost COMMAND parsing loop so allocated
;			memory gets released for all subcommands, too.
;  30.	    16Apr82	First set of a bunch of changes and bug fixes:
;			 -Add DN200's 80-byte buffers to core calc
;			 -Change XP.t1 to 60. (L. Webber)
;			 -   "   XP.t3 to 10. (    "    )
;			 -   "   XP.t4 to 60. (    "    )
;			 -Get blank line out of DN200's CETAB
;			 -Range on max-data-link-cost to 1-1022. (Webber)
;			 -Range on max-net-diameter 2-30. (Webber)
;			 -Make DPCALC save and restore P1 - destroying it
;			  screwed up # of phys links if incl then excl kdps
;			 -Change BLKCLC - make it use Phase III overheads, so
;			  data-link-block-size defaults to 290.
;			 -Get rid of CSR,VEC & PRI defs for LE & CR if unused
;			 -NSP Inactivity Timer default 30., range 0-60.
;			 -NSP Total # of Ports default to 10.
;  31.	    20Apr82	Next set of a bunch of changes and bug fixes:
;			 -Don't automatically include a LPT or CR if DN200
;			 -Make CHANGE DELAY-WEIGHT command inhouse
;			 -Make CHANGE INACTIVITY-TIMER	    user-settable
;			       CHANGE TOTAL-NUMBER-OF-PORTS       "
;			 -Change NODE NUMBER command to NODE ADDRESS - fix
;			  parsing for it and for INFO NODE-ADDRESS/NAME
;			 -Make PASSWORD RECEIVE inhouse, since DECnet-20 does
;			  not check receive passwords
;			 -Change err msg on exclude cr
;  32.	    21Apr82	Next set:
;			 -New command: CHANGE CONNECT-TIMER, user-settable,
;			   to change the SC outgoing connect timer
;			 -Consistency checks before write output files:
;			   Warning messages for "non-fatal" stuff (files
;			   written anyway):
;				Node address defaulted
;				Node name defaulted
;				Password (for) transmit defaulted
;				More than 8 lines (besides the DTE) on a DN20
;				Data link block size defaulted
;				No LPT or CR included on a DN200
;			   Error messages for "fatal" stuff - output files NOT
;			   written:
;				Node address > # of nodes in net
;				No DTE on a DN20
;				No lines besides DTE on a DN20
;				No DMC or DMR on a DN200
;				More than 1 DMC/DMR line on a DN200
;  
;  33.	    22Apr82	Add failure returns to FINMOD routines:
;			NONAM, NONUM, CHDLB, PSWX, DTEIN.
;			Add call to initialize dialog at start of NETGEN
;
;  34.	    23Apr82	Add code to FINISH command so file names are
;			displayed on TTY:
;
;  35.	    27Apr82	Improve some error messages.
;			Have startup code patch locations in entry
;			vector so program can't be reSTARTed or
;			REENTERed.  Otherwise, one can ^C out during a
;			parse, and the parser never seems to get things
;			back in order again when a START or REENTER is
;			done.
;
;  36.	    03May82	At FINISH command:
;			 -Add check to ensure NSP buffer size at least 34. less
;			  than Data Link Block Size
;			 -Delete PRC$DFs for XNM, NME from CETAB (A.P.'s code
;			  compression for field test 2)
;			 -Add code to calculate # RDBs, #s of other buffers,
;			  and XPT buffer quotas
;  37.	    07May82	At FINISH command, change calc of XP buffer quotas per
;			  Platukis & Webber
;			Add NML priveledged access control stuff:
;			 -new command
;			  Access-Control Account string
;			 		 Password string
;			 		 User I.D. string
;			 		'string's default to null
;			 -new INFO heading to cover them
;			 -NMLACC.MAC file to link into NMXLLC at system build
;			  (DN20SYS.CTL) to supply this info
;  38.	    27May82	At FINISH, add event filter definition macro NM$FLT
;			  Peckham
;  39.	    02Jun82	At FINISH, fix output of NMLACC.MAC file.
;			Eliminate LLKNUM ('number of logical links' not used)
;			Eliminate NTPMXL ('maximum cost' outmoded)
;			Change some defaults.
;			  Peckham, Platukis
;  40.	    18Jun82	Massive changes too numerous to mention.
;			  Peckham, Brandt
;  41.	    21Jun82	Change default NPTNN to (290-5)/2.
;			Fix range of "Number of DUPS on KDP" from 0-3 to 1-4.
;			Fix controller default for common INCLUDE/EXCLUDE
;			defaulter (it was getting the two cases reversed).
;			Change node address limit from 2-255 to 1-255.
;			  Peckham
;  42.      23Jun82	Fix Version comparison in restore.
;			Use CCBNUM, RDBNUM if not defaulted.
;			Use NTPEBQ, NTPIBQ, NTPLBQ, NTPOPN values.
;			Change inhouse syntax to include more parameters.
;  43.      25Jun82	Fix rounding of block size in DIALOG.
;			Add buffer size check in FINMOD.
;  44.      09Jul82	Fix SC mappings for DN20/DN200.
;			Add incremental save file update code in RESTORE.
;  45.      09Jul82	Add dn20 mapping for TOP
;  46.	    09Aug82	Alter restore updating to do previous updates
;			 before later ones (in case updates are cumulative).
;			Set new defaults in initialization and dialog;
;			 warn of non-defaulting in restore updating.
;			   DEFINE EXECUTOR BUFFER SIZE 576 (from 290)
;			   DEFINE EXECUTOR MAXIMUM ADDRESS 255 (from 142)
;			Set new defaults in initialization, dialog,
;			 and restore updating:
;			   DEFINE EXECUTOR MAXIMUM HOPS 16 (from 6)
;			   DEFINE EXECUTOR MAXIMUM VISITS 32 (from 12)
;			Change buffer shrink count from 0 to 50
;			 in initialization and restore updating.
;			Make the default RDBNUM be the minimum RDBs necessary
;			 to satisfy the initial line RDB demands
;			 (plus the buffer shrink count).
;			Make BLKCLC produce an even number.
;			Fix dialog D.NNUM which changes MAXIMUM ADDRESS
;			 to set NTPBLK to the maximum of BLKCLC result and 576.
;			Make DSR parameter in MEM$DF zero.
;			Make COR calculation for MEM$DF more readable.
;			Remove NTPEBQ and NTPIBQ setup from SETDFL and put
;			 into initialization and NODE TYPE command processing.
;			Change NTPLBQ to be the constant 50 for now.
;			Put CIRCUIT COSTs for DTE,DMC,DMR,KDP as last parameter
;			 in UNT$DF for the devices.
;			Make the following commands available:
;			   DEFINE EXECUTOR MAXIMUM VISITS num
;			   DEFINE EXECUTOR ROUTING TIMER num
;			Change parameter parse blocks (i.e. DN500) to allow
;			 special processing.
;			When MAXIMUM HOPS is set, set MAXIMUM VISITS minimum.
;			When MAXIMUM VISITS is set, set MAXIMUM HOPS maximum.
;			When MAXIMUM ADDRESS is set, set BUFFER SIZE minimum.
;			When BUFFER SIZE is set, set MAXIMUM ADDRESS maximum.
;			Put defaults in parameter parse blocks (i.e. DN500)
;			 for better visability and set from them.
;			When ADDRESS is set, set MAXIMUM ADDRESS minimum
;			 and BUFFER SIZE minimum.
;			When MAXIMUM ADDRESS is set, set ADDRESS maximum.
;			When BUFFER SIZE is set, set ADDRESS maximum.
;			Fix PD.BUF to handle BUFFER SIZE limits correctly.
;			Insert warnings in Restore processing to make
;			 ADDRESS, MAXIMUM ADDRESS, and BUFFER SIZE consistent.
;			Set DMCDUP and DMRDUP duplex data bases
;			 and cause to be initialized in restore update code.
;			Rework subcommand PDB chaining (from $CRLF $ACTION)
;			 to be table driven through ISCRLF.
;			Add INCLUDE (DMC/DMR) question for duplex.
;			Add dialog DMC/DMR question for duplex.
;			Use DMCDUP and DMRDUP to set duplex in UNT$DF.
;			Add LIST KNOWN LINE CHARACTERISTICS command.
;			Move Baud Rate display from CIRCUIT to LINE.
;			Include DMC.xb and XP$mxa in NETPAR file.
;			Fix DTE number dialog question to set the number.
;			Add DEFINE PROCESS DTE TRANSMIT BUFFERS num
;			 and insert number in DMCPXB data base item.
;			Use DMCPXB for DMC.xb NETPAR item.
;			Call STKDPN from D.KDP2 to fix dialog prompt bug.
;			Add XPTMXA data for XP$mxa macro generation.
;
;	Version 4.1
;
;  1	    03Nov82	Re-write to include X.25 and produce X25GEN.
;
;  2	    23Nov82	For TOPS10:
;			  Conditionalize SEARCH MONSYM.
;			  Add FLDBx. definitions.
;			  Rename DEVNAM to DEVTXT (conflict with UUO name).
;			Add SC$NMT macro to NETPAR generation.
;  3	    06Dec82	Change CBBLST and BUFLST in FINMOD
;			for X.25 buffer requirements.
;			Remove SIZE keyword from X.25 parameters in NETPRS.
;			Merge CIRCUIT COST parameter into X.25 parameters.
;			Add NOT APPLICABLE code for X.25 vs DDCMP circuit
;			parameters in NETPRM (routines CIRDEV, LINDEV).
;			Fix up DEFINE CIRCUIT and add DEFINE LINE.
;			Conditional out NRM and NRD info in NETPAR
;			if not DN200.
;
;  4	    07dec82	Fix X.25 conditional jump to NX25C in FINMOD
;			(this produced extraneous ".endm" in NETPAR).
;			Eliminate KNOWN EVENTS in DEFINE/PURGE.
;
;  5	    08dec82	Fix DEFINE KNOWN CIRCUITS for no crash in NETPRS.
;			Instituted convention in NETPRS of $ACTION routine
;			on all $KEY PDBs except those for coded parameter
;			keyword sets.  This is to allow the differentiation
;			of these keyword sets on KDEF and KPRV routines.
;			Change default number of DESTINATIONS from 20 to 4.
;			Insure MAXIMUM DESTINATIONS is not exceeded in FNDDST.
;
;  6        18Jan83     Fix DEFINE KNOWN LINES command. In NETPRS, DXIPDB
;                       argument is DSPTAB macro missing at label DFHTAB.
;
;  7        18Jan83     Fix DEFINE CIRCUIT for PVCs. At label DC3PDB in NETPRS,
;                       should be $KEY instead of $KEYDSP.
;
;  8.       24Jan83     Fix DESTINATION NODE parameter in FINMOD at label LDX:.
;                       Text and decimal parsing reversed from DSNODE in $TEXT
;
;                       macro.
;  9.       24Jan83     Add object type 31. for Gateway module in SC$PRO and
;                       SC$OBJ macros (FINMOD). This will appear for node
;                       type DN20 but require virtually no space.
;
;  10.      26Jan83     Change X25 large buffer size and defaults.
;
;  11.      27Jan83     Change defaults for Maximum Retransmits and
;                       Retransmit Timer for X.25 Frame Level.
;
;  12.      23Feb83     Fix PVC DEFINE/PURGE command: for TYPE, must call
;                       P$NEXT; for DTE need to define a purge action;
;                       CIRFLD should call FNDCIR, not FNDENT.
;
;  13.      23Feb83     Window and packet size reversed in PVC macro definition
;
;  14.      23Feb83     Calculate the maximum data size for line entity rather
;                       that allowing it to be set.
;
;  15.      23Feb83     Add DEFINE MODULE X25-SERVER MAXIMUM DESTINATONS and
;			CIRCUITS commands.
;
;  16.      23Feb83     In DESTINATION dialog, increment XTPDST if exceeded.
;
;  17.      01Mar83     In EXCLUDE KDP, the initial value for the unit number
;                       not set correctly (KDPEX in NETDEV).
;  18.      01Mar83     PURGE DESTINATION command does not compress the data
;                       base correctly (NETPRM @ DELDST).
;  19.      01Mar83     Make FL.BLK equal to RDB.SZ
;
;  20.      08Mar83     Fix display of known lines to compute the right block
;			block size for LAPB lines.
;
;  21.	    17Mar83	Change X25-PROTOCOL timers to have range 0-255 instead
;			of 1-255.
;  22.      20 Mar83    Add support for the X25-PROTOCOL GROUP/KNOWN GROUPS
;			parameters.
;  23.      25Mar83     Fix output of object for destination. $TEST macro 
;			used I2 instead of I1 to access object number. (LDX in
;			FINMOD.
;  24.      07Apr83     Don't list module MCB-Executive unless privileged.
;  25.      08Apr83     Do not include the DCP process in CETAB  if there are
;			no XPT KDPs. Add a variable DCPNUM to count the number
;			of KDP XPT lines. Add routines ADDDCP and DELDCP to
;			maintain these counters.
;  26.	    19Apr83     Excluding a KDP device must set the default protocol
;			type (LNTYPE).
;  27.      09Sep83     Including a LAPB KDP followed by including a DMR
;            		line fails.  The code for specifying DUPLEX (DL1111:)
;		 	is executed for DMx devices but it checks LNTYP which
;			is defined only for KDPs.  Remove the check.
;  28.	    19Jan84	Fix CALL MASK and VALUE for X25 to produce the correct
;			octal bytes.
;  29.      13Jul84	Fix the code to produce the macro TSK$DF XNM in
;			CETAB.MAC for TOPS-10 DN20 X.25 Network Management
;			module. Keep TSK$DF NML for TOPS-20.
;			Fix typo in the DXMPDB parsing node macro $ALTERNATE.
;  30.      26Jul84	Condition out references to Phase II and RJE support.
;  31.      31Jul84	Fix the Module X25-Server subaddress range to be from
;			0 to 99.
;  32.      17Oct84	Remove the break masks in the $FIELD macros parsing
;			the circuit and line names in NETPRS.MAC.
;  33.      18Oct84	Fix code in NETCNF.MAC to keep the default
;			configuration file name null if there is no node name
;			for building the file name with.
;
;  34.	    26Nov84	Remove PHASE-II keyword for DEFINE EXECUTOR RECEIVE/
;			TRANSMIT PASSWORD commands.  Turn on these commands
;			for the field as well as the DEFINE LOGGING FILE EVENT
;
;  35.	    06Jan85	Updated all copyright notices.  Include a patch that
;			fixed multiple definitions of label ENTNO1 in module
;			NETPRM that was causing incorrect code to be generated
;			by MACRO.  Include a rewrite of routine CHKNAM to
;			disallow node names not beginning with an alphabetic
;			character.
;
;  36.	    07Jan85	Remove all visible references to DN200's in TOPS20
;			NETGEN by removing parse table entries for
;			INCLUDE/EXCLUDE card-reader/lpt and INFORMATION
;			card-reader/lpt/node-type; set PDN200 to zero.
;
;  37.	    17Jan85	Insert Transmit Password query into START dialog
;
;  38.	    15Jul85	Merge NETGEN & X25GEN
;
;  39.	    25Jul85	Continue merge of NETGEN & X25GEN by:
;			Fixing INCLUDE KDP test for X25 nodes; removing
;			node type question in START dialog; prompting for
;			the node type at program startup; removing the set
;			node type command; replacing the information node
;			type command.
;
;  40.	     4Sep85	More work on merging NETGEN & X25GEN: use switches
;			to select between NETGEN, X25GEN, and both.  Turn
;			on FT.NET for NETGEN, FT.X25 for X25GEN, and turning
;			on both will produce the merged version.  Default for
;			TOPS-20 is NETGEN and both for TOPS-10.  Also beef up
;			error handling after prompting for node type at program
;			startup.
;


TOPS10	<
COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION  1984,1986.  ALL RIGHTS RESERVED.
\>;end TOPS10

	SUBTTL	Macros and miscellaneous

TOPS20 <

; Macro - $ERET
;
; Function - To print an error message and return.
;
; Parameters -
;
;	TEXT	Error message text to be printed before system error text
;	FORK	Process handle that system error is to be printed for
;	VECTOR	Where to return after printing error, if none .. return

Define $ERET (TEXT,FORK,VECTOR)
<	HRROI	S1,[ASCIZ \TEXT\]	;; Point to text string
 IFNB <FORK>,<MOVE S2,FORK>		;; Get fork handle if given
 IFB  <FORK>,<MOVX S2,.FHSLF>		;;  else point to this fork
 IFNB <VECTOR>,<$CALL ERRPRT		;; If vector given, print error
		JRST VECTOR>		;; and jump where specified
 IFB  <VECTOR>,<JRST ERRPRT>		;; If no vector, return after printing
    >;End $ERET definition
  > ;End if TOPS20

; Global externals

	PARSET				; Define parser semantic externals
	EXTERNAL PARSER			; Syntactic parser
	EXTERNAL TAKFDB			; TAKE command
	EXTERNAL P$NPRO			; Flag "No processing" in $ACTION
;
; Constants
;
	XP	PDLSIZ,	2000		; Size of the stack
;
; OTHER EQUATED SYMBOLS
;
PDLL==2000				;PUSH-DOWN LIST LENGTH
	SUBTTL	GLXLIB initialization blocks

; Initialization block

IB::	$BUILD	IB.SZ			; Size of initialization block
IFN FT.NET, $SET (IB.PRG,,'NETGEN')	;  Program name
IFE FT.NET, $SET (IB.PRG,,'X25GEN')	;  Program name
	 $SET	(IB.FLG,,1b0)		;  Open terminal
	$EOB
PRGPRM:					; Program prompt
IFN FT.NET, ASCIZ /NETGEN>/
IFE FT.NET, ASCIZ /X25GEN>/
	SUBTTL	Startup and initialization

ENTVEC:	JRST	START
	JRST	START
VERSION::VRSN. (NGN)			; Set value of edit level/version

TOPS10 <LOC	137			; Set up .JBVER
	VRSN.	(NGN)
	RELOC>

RETRY:	EXP	-1			; Retry count

START:	TOPS20 <RESET>			; Clear up everything
	AOSE	RETRY
	 JRST [	$TEXT	,<?Can't reSTART or REENTER>
		$HALT			; Back to EXEC
		JRST	START]		; On CONTINUE tell it again, Sam
	MOVE	P,[IOWD PDLSIZ,PDL]	; Start up the stack

	MOVX	S1,IB.SZ		; Size of initialization block
	MOVEI	S2,IB			; Addrs of initialization block
	$CALL	I%INIT			; Initialize GLXLIB

TOPS20 <SKIPE	S1,PUSFRK		; Ck for a fork previously made
	 JRST	[KFORK			;  Kill it
		  ERJMP .+1		;  Ignore errors
		 JRST .+1]
	SETZM	PUSFRK			; Clear PUSH fork handle
    >;End if TOPS20

TOPS20<	$TEXT	,<TOPS-20^A>	>
TOPS10<	$TEXT	,<TOPS-10^A>	>
	$TEXT	,< Network Configurator for^A>
	$CALL	TXTTYP
	$TEXT	,<, Version ^V/VERSION/
>					; An extra CRLF

	$CALL	NOPRV			; Set no privledged commands
	CALL	NGINIT##		; Initialize the default
	CALL	NGIN2##			;   configuration

IFN <FT.NET&FT.X25>,<
STAR01:	MOVEI	S1,PAR.SZ		;
	MOVEI	S2,PAB.NT##		; Prompt for node type right away
	$CALL	PARSER			;
	JUMPT	STAR02			;
	$TEXT	,<^M^J?^T/@PRT.EM(S2)/^M^J>	; Print error message
	JRST	STAR01			; And try again
STAR02:	MOVE	S1,PRT.CM(S2)		;
	ADDI	S1,COM.SZ		; Point to what we parsed
	$CALL	P$SETUP			;
	$CALL	P$KEYW			;
	MOVEM	S1,NODTYP##		; Set node type
	SETZM	NOTSTA##		; Flag as typed in
>;end IFN FT.NET&FT.X25

	$TEXT	(,<
[Type START to begin configuration dialog]
>)

	SETZM	SCMND
	SETZM	STEMP
	JRST COMMAND			; Start command processing
TXTTYP:	SKIPE	PDN20
	 JRST [	SKIPE	PDN200
		 JRST [	SKIPE	PX25
			 JRST [	$TEXT	,< DN20, DN200, or X25^A>
				$RET]
			$TEXT	,< DN20 or DN200^A>
			$RET]
		SKIPE	PX25
		 JRST [	$TEXT	,< DN20 or X25^A>
			$RET]
		$TEXT	,< DN20^A>
		$RET]
	SKIPE	PDN200
	 JRST [	SKIPE	PX25
		 JRST [	$TEXT	,< DN200 or X25^A>
			$RET]
		$TEXT	,< DN200^A>
		$RET]
	SKIPE	PX25
	 JRST [	$TEXT	,< X25^A>
		$RET]
	$TEXT	,< *no*>
	$RET
	SUBTTL	Command processing routine (COMMAND)

Comment &

	This is the top level command processing routine.  It does the call
to the syntactic PARSER and then vectors to the appropriate service routine
depending on the value of the first keyword in the command string.

    &

COMMAND:
	MOVX	S1,PAR.SZ		; Size of the parser arg block
	SKIPN	S2,STEMP		; Address of parser argument block
	 MOVEI	S2,PARBLK
	$CALL	PARSER			; Parse a command
	JUMPT	CMMD.1			; Success in parsing a command

	MOVE	T1,PRT.FL(S2)		; Get PARSER flags
	TXNE	T1,P.ENDT		; End of TAKE file?
	 JRST	[SETZM TAKFLG		;  Clear TAKE file processing flag
		 JRST COMMAND]		;  Go get next command
	$CALL	DSPCMD			; Optionally display the command
	MOVE	T1,PRT.CF(S2)		; Get COMND flags
	TXNE	T1,CM%ESC		; Escape last character?
	 $TEXT	,<>			;  Yes .. move to new line
	$TEXT	,<?^T/@PRT.EM(S2)/>	; Output error message
	JRST	COMMAND			; Go get a good command

CMMD.1:	MOVE	S1,PRT.CM(S2)		; Get address of command page
	MOVEM	S1,PPAGE		; Save page address for releasing
	MOVE	T1,PRT.FL(S2)		; Get flags from PARSER
	$CALL	LOGGIT
	$CALL	DSPCMD			; Display TAKE command if needed
	TXNN	T1,P.TAKE		; TAKE command?
	TXNE	T1,P.NPRO		; No processing for command?
	 JRST	CMMD.4			;  Already done in ACTION routine
	MOVE	S2,COM.PB(S1)		; Get offset to parser blocks
	ADD	S1,S2			; Make address to start of blocks
	$CALL	P$SETUP			; Start semantic parsing
	SKIPN	S1,STEMP		; Get parser block
	 MOVEI	S1,PARBLK
	SKIPE	PAR.SM(S1)
	 $CALL	@PAR.SM(S1)		; Call semantic routine.
	JUMPF	CMMD.4			; Try again if failure.
	SETZM	STEMP			; otherwise finished with sub-command.
	SKIPN	S1,SCMND		; If in sub-command sequence
	 MOVEI	S1,PARSEM		; then
	SETZM	SCMND			; cancel current routine
	$CALL	(S1)			; before calling it.
CMMD.4:	MOVE	S1,PPAGE		; Get page address of command
	$CALL	M%RPAG			; Return it to memory manager
	JRST	COMMAND			; Go get another command
;
;   NPARSE - Set up sub-command for next parse
;
;*******BLAH, BLAH, BLAH....
;
SCMND:	BLOCK	1			; Sub-command list pointer
STEMP:	BLOCK	1

NPARSE::MOVEM	S1,STEMP
	POP	P,SCMND
	SKIPE	S2,PAR.PV(S1)		; If blocks to set
	 JRST [	SKIPE	S1,0(S2)	;  If there is a entity block
		 MOVEM	S1,ENTBLK##	;   then set it.
		SKIPE	S1,1(S2)	;  If there is a parameter block
		 MOVEM	S1,PRMBLK##	;   then set it.
		SKIPE	S1,2(S2)	;  If there is a qualifier block
		 MOVEM	S1,QUABLK##	;   then set it.
		JRST	.+1]
	$RETT
;

PARBLK::$BUILD	PARSIZ
	$SET	PAR.PM,,PRGPRM		; Program Prompt
	$SET	PAR.TB,,TOPPDB		; First PDB in command syntax
	$EOB

PARSEM:	$CALL	P$KEYW##		;  No, Get keyword value
	CAIN	S1,.DMY			; Check for dummy keyword
	 JRST	PARSEM			;  Yes .. go get next keyword
	PJRST	@CMDVEC(S1)		; Vector to processing routine

CMDVEC:	$BUILD	(TOPMAX)		; Top level keyword dispatch table
TOPS20 < $SET	(.PUS,,<JRST PUSHR>)	;  Push to new exec
		>
	 $SET	(.HLP,,<JRST HELP>)	;  Get help on a command
	$set	(.DEF,,<JRST KDEF##>)	;DEFINE
	 $SET	(.EXC,,<JRST EXCLU##>)	;EXCLUDE
	 $SET	(.EXI,,<JRST EXIT>)	;EXIT
	 $SET	(.FIN,,<JRST FINISH##>)	;FINISHED
	 $SET	(.INC,,<JRST INCLU##>)	;INCLUDE
	 $SET	(.INF,,<JRST INFO>)	;INFORMATION
	$set	(.LIS,,<JRST KLIS##>)	;LIST
	$set	(.log,,<jrst log>)	;log input
;	 $SET	(.NOD,,<JRST NOD##>)	;NODE
	$set	(.PRV,,<JRST KPRV>)	;WHEEL
	$set	(.PUR,,<JRST KPUR##>)	;PURGE
	 $SET	(.RES,,<JRST RESTR##>)	;RESTORE
	 $SET	(.SAV,,<JRST SAVER##>)	;SAVE
	 $SET	(.STR,,<JRST DIALOG##>)	; START dialog
	$EOB
; Routine - DSPCMD
;
; Function - This routine checks whether a take command is to be displayed.
;	If it is, then the prompt and the command are output onto the terminal.
;
; Parameters -
;
;	S1/	Address of command page
;	T1/	Flag word from PARSER

DSPCMD:	$CALL	CHKDSP			; Check if need to display
	 JUMPF	.RETT			;  Return o.k.
	MOVE	T2,COM.CM(S1)		; Get text offset
	ADDI	T2,1(S1)		; Point to start of string
	$TEXT	,<^T/@PARBLK+1/^T/(T2)/^A> ; Output the command
	$RET

; Routine - CHKDSP
;
; Function - This routine is the called by DSPCMD to see if command is
;	to be displayed.

CHKDSP:	TXNE	T1,P.TAKE		; Take command itself
	 JRST	CHKD.1			;  Yes..set flag and return false
	TXC	T1,P.CTAK!P.ERRO	; From take and an error
	TXCN	T1,P.CTAK!P.ERRO	; Both were set
	 $RETT				;  Yes..display the text
	TXNN	T1,P.DSPT		; Display take command
	 $RETF				;  Return false
	$RETT				; O.k. return true

CHKD.1:	SETOM	TAKFLG			; In take command
	$RETF				; Return false
	SUBTTL	Semantic service routines;
; Routine - LOG
;
; Function - This routine establishes logging to the specified file.
;
; Parameters -
;
LOG:	$CALL	P$OFILE##		; Get output file spec
	MOVEM	S1,LOGFOB		; Set FD address in FOB
	MOVEI	S1,7			; Set the byte size
	MOVEM	S1,LOGFOB+1		; ...
	MOVEI	S1,2			; Length of the FOB
	MOVEI	S2,LOGFOB		;   and its address
	$CALL	F%OOPN##		; Open the output file
	MOVEM	S1,LOGIFN		; Save the file IFN
	JUMPT	.POPJ##			; Leave if all ok
	SETZM	LOGIFN			; Assure this cleared
TOPS20 <$ERET	(<Cannot open log file>)>
TOPS10 <$TEXT ,<Cannot open log file> 
	$RETT>
; Routine - LOGGIT
;
; Function - This routine outputs TTY input buffer to the log file
;
; Parameters -
;	S1/	Command code

LOGGIT:	PUSH	P,S1			; Save S1
	PUSH	P,S2			;   and S2
	SKIPN	LOGIFN			; Don't log if not enabled
	JRST	LOGX			;   ...
	SKIPE	TAKFLG			;   or from take file
	JRST	LOGGQ			;     then omit following checking

	CAIN	S1,.HLP			;   or helps
	JRST	LOGX			;     ...
	CAIE	S1,.TAK			; Don't log takes
	CAIN	S1,.LOG			;   or logs
	JRST	LOGX			;     ...
	CAIE	S1,.PUS			; Don't log pushes
	CAIN	S1,.EXI			; Don't log exits
	JRST	LOGX			;   ...

LOGGQ:	HRRZ	S2,PPAGE		; Locate the text string
	ADD	S2,COM.CM(S2)		;   add in offset
	ADDI	S2,1			;     ...
	HRLI	S2,(POINT 7,)		; Build the byte pointer to string
	PUSH	P,S2			; Save two copies
	PUSH	P,S2			;   of the pointer
	SETZ	S1,			; Initialize string length counter

	ILDB	S2,(P)			; Get next byte from string
	SKIPE	S2			; Quit on a null
	AOJA	S1,.-2			; Else count it and scan on
	POP	P,S2			; Pop off used pointer
	POP	P,S2			; Recover good pointer
	HRL	S2,S1			; Set length in left of string pointer
	MOVE	S1,LOGIFN		; Get file IFN
	$CALL	F%OBUF##		; Output the string
	JUMPF	LOGERR			; Catch any error here
	MOVE	S1,LOGIFN		; Then
	$CALL	F%CHKP##		;   checkpoint the file
	JUMPF	LOGERR			;      But, if any problem ...
	JRST	LOGX			; All is ok, so leave

LOGERR:	$TEXT	,<?Logging error>
LOGX:	POP	P,S2			; Restore caller's
	POP	P,S1			;   S1 and S2
;	SETZM	QFLAG			; Clear quotation flag
	$RETT				;      and leave

;
; Keyword routine - HELP
;
; Function - To display a general help message for NETGEN

HELP:
TOPS20<	 $TEXT ,<^M^J ^W/IB+IB.PRG/-20^A>	>
TOPS10<	 $TEXT ,<^M^J ^W/IB+IB.PRG/-10^A>	>

	$TEXT	,< is the tool that produces configuration files for a^A>
	$CALL	TXTTYP

TOPS20<	$TEXT ,<^M^J DECnet-20^A>>
TOPS10<	$TEXT ,<^M^J DECnet-10^A>>

	$TEXT ,< node. Using its commands, you can display and/or
 change network node type, parameters and communications configuration.
 ^W/IB+IB.PRG/ allows recognition (use of ESC key) and help text (use of ? key)
 to aid your selection of legal options.>

	$TEXT ,<
 Typically, you will use ^W/IB+IB.PRG/ to:>

	MOVEI	S1,3
	SETZ	S2,
HEL.1:	SKIPE	PRVLDG(S1)
	 AOS	S2
	SOJG	S1,HEL.1
	SOJLE	S2,HEL.3
	SETO	S2,
	MOVEI	S1,NDN20##
HEL.2:	SKIPE	PRVLDG(S1)
	 JRST [	MOVE	T2,[
			[ITEXT(DN20  (task-to-task node))]
			[ITEXT(DN200 (remote job entry station))]
			[ITEXT(X25   (X25 network support))]]-1(S1)
		AOJLE	S2,[$TEXT ,<
	-select node type: ^I/(T2)/ - (default)>
			JRST	.+1]
		$TEXT ,<		       or  ^I/(T2)/>
		JRST	.+1]
	CAIE	S1,NX25##
	 AOJA	S1,HEL.2

HEL.3:	$TEXT ,<
	-include synchronous communication line(s)>

	$TEXT ,<
	-optionally, change parameter settings to tailor your config-
	 uration to suit local needs

	-write the configuration files CETAB.MAC and NETPAR.MAC,
	 which will be used by later steps in the Network Installation
	 Procedure.>
	$RETT
;
; Keyword routine - KPRV
;
; Function - To enable privledged commands

	KEYFLG==:CM%FW
PRVLDG::EXP	0			; Ones if privledged

IFN FT.NET,<PDN20:: EXP	-1>		;  DN20 node permitted
IFE FT.NET,<PDN20:: EXP	 0>		;  DN20 node not permitted
PDN200::EXP	0			;  DN200 node not permitted
IFN FT.X25,<PX25::  EXP -1>		;  X.25 node permitted
IFE FT.X25,<PX25::  EXP	 0>		;  X.25 node not permitted


KPRV:	$CALL	P$KEYW##		; If no keyword
	JUMPF	YESPRV			; then asking for special privledges.
	SETOM	PRVLDG(S1)		; otherwise enable node type.
	JRST	NEWPRV
NOPRV:	TXZA	S1,-1			; Disable privledged commands
YESPRV:	SETO	S1,			; Enable privledged commands
	MOVEM	S1,PRVLDG
NEWPRV:	$SAVE	<P1>
	MOVEI	P1,DEFPDB##		;  and
	$CALL	PDBCHK			;  make them
	MOVEI	P1,PURPDB##		;  recognizable.
	$CALL	PDBCHK
	MOVEI	P1,LISPDB##
	$CALL	PDBCHK
;	$CALL	NTYCHK
	$RETT
;
;*******BLAH, BLAH, BLAH...
;
PDBCH1:	MOVE	P1,S1			; Set next PDB.
PDBCHK:	$SAVE	<P1,P2,P3,P4>
	MOVX	T1,CM%NOR		; (mask for keyword disabling)
	MOVEI	S1,1(P1)		; Get PDB and
	$CALL	P$PNXT##		;  if there is
	JUMPT	PDBCH1			;  then go to it.
	LOAD	S2,1+.CMFNP(P1),CM%FNC	; Get  function code
	CAXE	S2,.CMKEY		;  and if keyword list
	 $RETT				;  then
	LOAD	P2,1+.CMDAT(P1)		;  get pointer to TBLUK block
	LOAD	P3,(P2),LHMASK		;  and length of block.
	SKIPN	P4,P3			; If there are no keywords
	 $RETT				;  then finish the search.
TABCH1:	ADDI	P2,1			; For each keyword:
	LOAD	S1,(P2),LHMASK		;  Get keyword argument
	ANDCAM	T1,(S1)			;   and turn off no-recognize.
	LOAD	S2,(P2),RHMASK
	LOAD	P1,(S2),RHMASK		;  Get next PDB
	LOAD	S2,(S2),LHMASK		;   and possible parameter block.
	JUMPE	S2,TABCH2		;  If
	CAIN	S2,DEFSKP##		;   parameter block given
	 JRST	TABCH2			;   then
	LOAD	TF,(S2),PRSPRV		;   get privledged bit.
	ANDCM	TF,PRVLDG		;  Determine if
	JUMPT	TABCH3			;   not allowed.
	LOAD	T2,(S2),PRSTYP		;  Determine
	JUMPE	T2,TABCH6		;   node type preference
	SKIPN	PRVLDG(T2)		;   and quit
	 JRST	TABCH3			;   if not enabled.
TABCH6:	LOAD	TF,PRSFLG(S2)		;  If allowed
	TXNN	TF,PRSENT!PRSQUA 	;   and not a parameter block
	 JRST	TABCH4			;   then
TABCH2:	$CALL	PDBCHK			;  Check all sub-keywords
	JUMPT	TABCH4			;   and if all of them are privledged,
TABCH3:	SUBI	P4,1			;  One more privledged keyword...
	HLRZ	S1,0(P2)		;  Get keyword argument
	IORM	T1,0(S1)		;   and turn on no-recognize.
TABCH4:	SOJG	P3,TABCH1
	SKIPN	P4			; If all keywords privledged
	 $RETF				;  then prefix keyword is privledged.
	$RETT
TOPS20 <
; Keyword Routine - PUSHR
;
; Function - To push to a new EXEC.  The EXEC that is mapped into the inferior
;	process is the same one that is running as the TOP-PROCESS.

PUSHR:	SKIPE	PUSFRK			; Check for a fork already created
	 JRST	PUSCNT			;  Go continue the fork
	MOVX	S1,CR%CAP		; Give it same capabilites
	SETZ	S2,			; No ACs
	CFORK				; Create a fork
	 JRST	[$ERET <Can't create an inferior fork>]
	MOVEM	S1,PUSFRK		; Save fork handle
	HRRO	S1,PPAGE		; Scratch area to write EXEC filename
	MOVEI	S2,1			; JFN of TOPPROCESS EXEC
	SETZB	T1,T2			; Clear format control
	JFNS				; Get file name
	 ERJMP	[$ERET <Can't read TOPprocess EXEC filename>,,PUSKIL]
	HRRO	S2,PPAGE		; Point to the file name
	MOVX	S1,GJ%OLD+GJ%SHT
	GTJFN
	 JRST	[$ERET <Can't get JFN of EXEC>,,PUSKIL]
	HRL	S1,PUSFRK		; Put process handle in left half
	GET				; MAP in the EXEC
	 ERJMP	[$ERET <Can't map in EXEC>,,PUSKIL]
	TDZA	S2,S2			; Start at primary entry address
PUSCNT:	 MOVEI	S2,1			;  Start at re-enter address
	MOVE	S1,PUSFRK		; Get fork of push process again
	SFRKV				; Start the fork
	 ERJMP	[$ERET <Can't start sub-fork>]
	WFORK				; Wait for the fork to pop
	RFSTS				; Get the fork status
	LOAD	S1,S1,RF%STS		; Get termination code
	CAIN	S1,.RFFPT		;  Was it an error?
	 JRST	[$ERET <Fork terminated abnormally>,PUSFRK,PUSKIL]
	$RETT				; Successful return

PUSKIL:	MOVE	S1,PUSFRK		; Get inferior fork handle
	SETZM	PUSFRK			; Clear fork handle
	KFORK				; Kill it
	 ERJMP	[$ERET <Failure while killing fork>]
	$RETF
    > ;End if TOPS20
;
	SUBTTL	Error output routine

; Routine - ERRPRT
;
; Function - To print out a text error message and the last error
;	that occured at monitor level for this job.
;
; Parameters -
;
;	S1/	Byte pointer to error message string
;	S2/	Process handle

ERRPRT:	$TEXT	,<?^T/(S1)/^M^J?^E/[-2]/>
	$RETF
	SUBTTL	Command syntax tables

TOPPDB:	$INIT	(TOP.1)			; Top level initialization
					; (Note this must be in alpha order)
TOP.1:	$KEYDSP	(TOP.2)			; First key word
TOP.2:	$STAB
	 DSPTAB	(DEFPDB##,.DEF,<Define>)
	 DSPTAB	(CRLF,.DMY,<E>,CM%NOR!CM%INV)
	 DSPTAB	(CRLF,.DMY,<En>,CM%NOR!CM%INV)
	 DSPTAB	(CRLF,.DMY,<Ena>,CM%NOR!CM%INV)
	 DSPTAB	(CRLF,.DMY,<Enab>,CM%NOR!CM%INV)
	 DSPTAB	(CRLF,.DMY,<Enabl>,CM%NOR!CM%INV)
	 DSPTAB	(ENAPDB,.PRV,<Enable>,CM%INV)
	 DSPTAB (EXCPDB##,.EXC,<Exclude>)
	 DSPTAB	(EXIPDB,.EXI,<Exit>)
	 DSPTAB (FINPDB,.FIN,<Finished>)
	 DSPTAB (HLPPDB,.HLP,<Help>)
	 DSPTAB (INCPDB##,.INC,<Include>)
	 DSPTAB (INFPDB,.INF,<Information>)
	 DSPTAB	(LISPDB##,.LIS,<List>)
	 DSPTAB	(LOGPDB,.LOG,<Log>)
;NODKEY:	 DSPTAB (NODPDB,.NOD,<Node>,KEYFLG)
	 DSPTAB	(PURPDB##,.PUR,<Purge>)
TOPS20 < DSPTAB (CFMPDB,.PUS,<Push>)>
	 DSPTAB (RESPDB,.RES,<Restore>)
	 DSPTAB (SAVPDB,.SAV,<Save>)
	 DSPTAB (STRPDB,.STR,<Start>)
	 DSPTAB (TAKFDB,.KYTAK,<Take>)
	$ETAB

ENAPDB:	$KEYDSP	(ENATAB,$ALTERNATE(CRLF))
ENATAB:	$STAB
	DSPTAB	(CRLF,NDN20##,<DN20>)
	DSPTAB	(CRLF,NDN200##,<DN200>)
	DSPTAB	(CRLF,NX25##,<X25>)
	$ETAB
;for  PUSH command
;
TOPS20 <
CFMPDB:	$CRLF >
; EXIT	*	*	*	*	*	*	*	*

IFN FT.NET,<				; NETGEN version
EXIPDB:	$NOISE	(EXI.1,from NETGEN)
>;end IFN FT.NET
IFE FT.NET,<				; X25GEN version
EXIPDB:	$NOISE	(EXI.1,from X25GEN)
>;end IFE FT.NET
EXI.1:	$CRLF	(<$ACTION EXIT>)

EXIT:	$CALL	P$NPRO			; No processing needed on command
	$HALT				; Go to EXEC level
	$RETT				; Success

CRLF::	$CRLF
;
; LOG
;
LOGPDB:	$NOISE	(LOG.1,TTY input to file)
LOG.1:	$OFILE	(CRLF,name of output file to record TTY input)
;
; HELP 	*	*	*	*	*	*	*	*
;
IFN FT.NET,<
HLPPDB:	$NOISE	(CRLF,with NETGEN)
>;end IFN FT.NET
IFE FT.NET,<
HLPPDB:	$NOISE	(CRLF,with X25GEN)
>;end IFE FT.NET
;
; FINISHED	*	*	*	*	*	*	*
;
FINPDB:	$NOISE	(CRLF,with configuration)
;
; INFORMATION	*	*	*	*	*	*	*
;
INFPDB:	$NOISE	(INF.1,about)
INF.1:	$KEYDSP	(INFTAB,$DEFAULT(Node))
INFTAB:	$STAB
;	 DSPTAB	(CRLF,CDR.I,<Card-Reader>)
;	 DSPTAB	(CRLF,LPT.I,<Line-Printer>)
	 DSPTAB	(CRLF,NOD.I,<Node>)
	 DSPTAB	(CRLF,NTP.I,<Node-type>)
	$ETAB
;
; INFORMATION COMMAND.
;
INFO:	$CALL	P$KEYW##
	PJRST	@INFVEC(S1)

	EXT	<NODNAM,NTPSLF,LPTNUM,CR1NUM>
INFVEC:	$BUILD	MAX.I
	 $SET	NTP.I,,<[
		$TEXT ,<   Node type is:     ^A>
		MOVE	S1,NODTYP##
		CAIN	S1,NDN20##
		 $TEXT	,<DN20^A>
		CAIN	S1,NDN200##
		 $TEXT	,<DN200^A>
		CAIN	S1,NX25##
		 $TEXT	,<X.25^A>
		SKIPE NOTSTA##
		 $TEXT ,< (default)^A>
		$TEXT ,< >
		$RETT]>
	 $SET	NOD.I,,<[
		$TEXT  ,<   Node name is:     ^T/NODNAM/^A>
		SKIPE	NONSTA##
		$TEXT  ,< (default)^A>
		$TEXT  ,<^M^J   Node address is:  ^D/NTPSLF/^A>
		SKIPE	NTDSLF##
		$TEXT  ,< (default)^A>
		$TEXT  ,< >
		$RETT]>
;		$CALL	@INFVEC+NTP.I
;		$CALL	@INFVEC+LPT.I
;		PJRST	@INFVEC+CDR.I
	 $SET	CDR.I,,<[
		$TEXT ,<   CR11s:            ^D/CR1NUM/^A>
		SKIPE	CR1STA##
		 $TEXT ,< (default)^A>
		$TEXT ,< >
		$RETT]>
	 $SET	LPT.I,,<[
		$TEXT ,<   Line printers:    ^D/LPTNUM/^A>
		SKIPE	LPTSTA##
		 $TEXT ,< (default)^A>
		$TEXT ,< >
;		MOVSI	T3,-NUMLPT##
;	I.LP2:	SKIPL	LPTUSE##(T3)
;		$TEXT ,<    Line Printer #^D/T3/ is an LP11>
;		AOBJN	T3,I.LP2
		$RETT]>
	$EOB
;NODE	*	*	*	*	*	*	*	*

NODPDB:	$KEYDSP	(NODTAB,$DEFAULT(Type))
NODTAB:	$STAB
	 DSPTAB	(NTYPDB,0,<type>)
	$ETAB

;type

NTYPDB::				; Accessed from DIALOG
	$NOISE	(NTY.1,is)
NTY.1:	$KEYDSP	(NTYTAB)
NTYTAB:	$STAB
NTY20:	 DSPTAB	(CRLF,NDN20##,<DN20>,KEYFLG)
;NTY200:	 DSPTAB	(CRLF,NDN200##,<DN200>,KEYFLG)
NTYX25:	 DSPTAB (CRLF,NX25##,<X25>,KEYFLG)
	$ETAB
;
;*******BLAH, BLAH, BLAH....
;
COMMENT /
NTYLST:	EXP	NTY20,NTY200,NTYX25,[0]

NTYCHK:	$SAVE	<T1,T2,T3,T4>
	MOVX	TF,CM%NOR	; Get mask
	LOAD	T1,NODKEY,LHMASK ; Make NODE keyword
	IORM	TF,(T1)		;  unavailable.
	MOVEI	S2,2
	MOVEI	T4,NTYLST
NTY.2:	SKIPN	T3,@0(T4)
	 $RETT
	LOAD	T2,T3,LHMASK	; Make keyword
	IORM	TF,(T2)		;  unavailable.
	LOAD	S1,(T3),LHMASK	; If node type
	SKIPT	PRVLDG(S1)	; is supported
	 AOJA	T4,NTY.2	; then
	ANDCAM	TF,(T2)		;  make keyword available.
	SOSG	S2		; If more than one
	 ANDCAM	TF,(T1)		;  then make NODE keyword available.
	AOJA	T4,NTY.2
/;END COMMENT
;
;SAVE	*	*	*	*	*	*	*	*

SAVPDB::
	$NOISE	(SAV.1,configuration on)
SAV.1:	$OFILE	(CRLF,,<$PDEFAULT(SRNAM##),$PREFILL(SRFIL##)>)

;RESTORE	*	*	*	*	*	*	*

RESPDB:	$NOISE	(RES.1,configuration from)
RES.1:	$IFILE	(CRLF,,<$PREFILL(SRFIL##),$PDEFAULT(SRNAM##)>)

; START	*	*	*	*	*	*	*	*

STRPDB:	$NOISE	(CRLF,dialog for performing configuration)
	SUBTTL	Utility Routines
;
;   $SAVEC - save C-registers (T1-T4,P1-P2)
;
.SAVE6::ADD	P,[6,,6]
	DMOVEM	C1,-5(P)
	DMOVEM	C3,-3(P)
	DMOVEM	C5,-1(P)
	$CALL	@-6(P)
	PORTAL	.+3
	PORTAL	.+1
	AOS	-7(P)
	DMOVE	C1,-5(P)
	DMOVE	C3,-3(P)
	DMOVE	C5,-1(P)
	SUB	P,[7,,7]
	POPJ	P,
	SUBTTL	Local writeables

PDL:	BLOCK	PDLSIZ			; Stack

LOGIFN:	EXP	0			; No input logging, initially
LOGFOB:	BLOCK	2			; File block
PPAGE:	BLOCK	1			; Address of command page
TOPS20 <
PUSFRK:	BLOCK	1			; Fork handle of fork for PUSH.
    > ;End if TOPS20
TAKFLG:	BLOCK	1			; Flag non-zero if processing take file

	END	<3,,ENTVEC>