User Tools

Site Tools


cdc:nos2.source:nam5871:cssroc

CSSROC

Table Of Contents

  • [00005] PROC CSSROC
  • [00006] CSSROC - RECOGNIZE OPERATOR COMMAND.
  • [00010] RECOGNIZE OPERATOR COMMAND.
  • [00046] PROC ABORT
  • [00047] PROC MESSAGE
  • [00048] PROC SSRRCS
  • [00049] PROC SSTAQE
  • [00050] PROC SSTRQE

Source Code

CSSROC.txt
  1. *DECK CSSROC
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. USETEXT TXCMDCS
  5. PROC CSSROC;
  6. # TITLE CSSROC - RECOGNIZE OPERATOR COMMAND. #
  7.  
  8. BEGIN # CSSROC #
  9. #
  10. ** CSSROC - RECOGNIZE OPERATOR COMMAND.
  11. *
  12. * A. LIM. 82/03/08.
  13. *
  14. * THIS PROCEDURE-S MAIN FUNCTION IS TO RECOGNIZE OPERATOR TYPEINS.
  15. * AT FIRST, AN OPERATOR TYPEIN ENTRY IS REMOVED FROM THE OPERATOR-
  16. * TYPEIN-QUEUE, THEN FORMAT THE TEXT PORTION OF THE ENTRY INTO A
  17. * COMMAND STRING, AND CALL COMMAND-RECOGNIZER TO VALIDATE THE
  18. * COMMAND. THIS PROCEDURE MAY GENERATE A MESSAGE TO THE OPERATOR
  19. * IN THE EVENT OF AN ERRONEOUS COMMAND ENTRY, OR IT MAY DISPATCH
  20. * THE RETURNED PARAMETERIZED COMMAND TO THE COMMAND PREPROCESSOR
  21. * FOR FURTHER REFINEMENT.
  22. *
  23. * PROC CSSROC
  24. *
  25. * ENTRY OPERATOR TYPEIN ENTRIES IN OPERATOR TYPEIN QUEUE(OPTQ).
  26. *
  27. * EXIT VALID COMMAND SENT TO VALID-COMMAND-QUEUE(VCQ), OR
  28. * TERMINAL TEXT SENT TO CONNECTION-TRAFFIC-QUEUE(CNQ).
  29. *
  30. * METHOD THIS PROCEDURE CONSISTS PRIMARY A LARGE LOOP, EACH
  31. * TIME THROUGH THE LOOP, AN OPERATOR TYPEIN ENTRY WILL
  32. * BE PROCESSED, AND IT TERMINATES WHEN OPTQ BECOMES EMPTY.
  33. *
  34. #
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. #
  42. **** PROC CSSROC XREF LIST
  43. #
  44. XREF
  45. BEGIN
  46. PROC ABORT; # MACREL- ABORT TASK MACRO #
  47. PROC MESSAGE; # MACREL- MESSAGE MACRO #
  48. PROC SSRRCS; # RECOGNIZE A COMMAND STRING #
  49. PROC SSTAQE; # ACCEPT A QUEUE ENTRY #
  50. PROC SSTRQE; # REMOVE A QUEUE ENTRY #
  51. END
  52. #
  53. ****
  54. #
  55.  
  56.  
  57. # DEFS FOR MESSAGE LENGTH INCLUDING ZERO BYTE TERMINATOR.(X 10) #
  58.  
  59. DEF LMSG20$ # 20 #;
  60. DEF LMSG30$ # 30 #;
  61. DEF LMSG40$ # 40 #;
  62.  
  63. DEF DF$ # 0 #; # MESSAGE OPTION FOR DAYFILE MESSAGE #
  64. DEF CSTSIZ$ # 31 #; # CST SIZE = 29 ENTRY + 1 TERMINATE ENTRY#
  65. DEF CSSIZ$ # 14 #; # CMD STRING SIZE= 139 + 1 TERMINATE CHAR#
  66.  
  67.  
  68. # THIS IS THE SWITCH LIST FOR ERROR CODE RETURNING FROM *SSRRCS* #
  69.  
  70. SWITCH ERRSWT # ERROR SWITCH BY ERROR CODE #
  71. LLNOERR, # 0- NO ERROR #
  72. LLPRMLNG, # 1- PARAMETER TOO LONG #
  73. LLEXPRD, # 2- EXPECTING PERIOD #
  74. LLEXPDCMA, # 3- EXPECTING PERIOD OR COMMA #
  75. LLUNRGCMD, # 4- UNRECOGNIZED COMMAND #
  76. LLINVCMPRM, # 5- INVALID COMBINATION OF PARMS #
  77. LLCMDMSPRM, # 6- COMMAND MISSING PARAMETER #
  78. LLPRMSH, # 7- PARAMETER LIST TOO SHORT #
  79. LLMSGLNG, # 8- INPUT MESSAGE TOO LONG #
  80. LLVALOUT; # 9- VALUE OUT-OF-RANGE #
  81.  
  82.  
  83. #
  84. * CST- COMMAND SYNTAX TABLE.
  85. *
  86. * THIS IS THE COMMAND SYNTAX TABLE FOR CS. IT IS INPUT TO
  87. * THE COMMAND RECOGNIZER TO DEFINE THE SYNTAX AND THE SEMANTICS
  88. * OF THE ALLOWABLE COMMANDS.
  89. * THE TABLE IS ORDERED(SCANNED TOP TO BOTTOM) AND CONTAINS FLAG
  90. * CHARACTERS TO DEFINE THE ORDER AND MEANING OF THE CHARACTERS
  91. * TO BE ENTERED TO SELECT THE ACTION TO BE PERFORMED.
  92. * EACH SYNTAX LINE IS TERMINATED BY AN END-OF-LINE($) TERMINATOR,
  93. * AND THE TABLE IS TERMINATED BY AN END-OF-LINE ENTRY.
  94. #
  95.  
  96. ARRAY CST[00:CSTSIZ$] S(CSSIZ$);
  97. BEGIN
  98. ITEM CST$LINE C(00,00,140) =
  99. ["CO0@NOP,<CONTROL_CO>,\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^[<AUT
  100. O_AU>@AU0^\\[ON!@ON0^[OFF@OFF^\$",
  101. "GO0@NP,GO,\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^\$",
  102. "DI0@NOP,<DISABLE_DI>,\![<TRUNK_TR>=@TR0?^[<LLINK_LL>=@LL0?^[
  103. <LINE_LI>=@LI0?^[<TERM_TE>=@TE0?^\[LD@LD0^\$",
  104. "DI0@NOP,<DISABLE_DI>,\![<SVC_SV>=@VC0?^\\![<NCIR_NC>=@NC0?^\
  105. $",
  106. "EN0@NOP,<ENABLE_EN>,\![<TRUNK_TR>=@TR0?^[<LLINK_LL>=@LL0?^[<
  107. LINE_LI>=@LI0?^[<TERM_TE>=@TE0?^\[LD@LD0^\$",
  108. "EN0@NOP,<ENABLE_EN>,\![<LINES_LIS>@LIS^[<TERMS_TES>@TES^[<LL
  109. INKS_LLS>@LLS^[<TRUNKS_TRS>@TRS^\\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^\$",
  110. "EN0@NOP,<ENABLE_EN>,\![<TERMS_TES>@TES^\\![<LINE_LI>=@LIN?^\
  111. $",
  112. "EN0@NOP,<ENABLE_EN>,\![<SVC_SV>=@VC0?^\\![<NCIR_NC>=@NC0?^\$
  113. ",
  114. "DU0@NOP,<DUMP_DU>,\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^\\[ON!@O
  115. N0^[OFF@OFF^\$",
  116. "LO0@NOP,<LOAD_LO>,\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^\\[<DUMP
  117. _DU>@ON0^[<NDMP_ND>@OFF^\$",
  118. "SE0@NOP,<SEND_SE>,\![<LINE_LI>=@LI0?^[<LLINK_LL>=@LL0?^[<NPU
  119. _NP>=@NP0?^[<TERM_TE>=@TE0?^[<NPUS_NPS>@NPS^[<HOST_HO>@HO0^\\![<MSG_MS>=
  120. @MS0&\$",
  121. "RE0,<REPORT_RE>,\![<NPU_NP>=@NP0?^[<NPUS_NPS>@NPS^\\[ON!@ON0
  122. ^[OFF@OFF^\$",
  123. "ST0,<STATUS_ST>,\![<NPU_NP>=@NP0?^[<CPLER_CP>=@CP0?^[<TRUNK_
  124. TR>=@TR0?^[<LLINK_LL>=@LL0?^[<LINE_LI>=@LI0?^[<TERM_TE>=@TE0?^[<NPUS_NPS
  125. >@NPS^\$",
  126. "ST0,<STATUS_ST>,\![<SVC_SV>=@VC0?^\$",
  127. "ST0,<STATUS_ST>,\![<CPLERS_CPS>@CPS^[<TRUNKS_TRS>@TRS^\\![<N
  128. PU_NP>=@NP0?^[<NPUS_NPS>@NPS^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$",
  129. "ST0,<STATUS_ST>,\![<LLINKS_LLS>@LLS^[<LINES_LIS>@LIS^\\![<NP
  130. U_NP>=@NP0?^[<NPUS_NPS>@NPS^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$",
  131. "ST0,<STATUS_ST>,\![<TERMS_TES>@TES^\\![<NPU_NP>=@NP0?^[<NPUS
  132. _NPS>@NPS^[<LINE_LI>=@LI0?^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$",
  133. "ST0,<STATUS_ST>,\![<TERMS_TES>@TES^\\![<LLINK_LL>=@LL0?^\$",
  134. "ST0,<STATUS_ST>,\![<SVCS_SVS>@VCS^\\![<NPU_NP>=@NP0?^[<NPUS_
  135. NPS>@NPS^[<LINE_LI>=@LI0?^\$",
  136. "TS0,<TST_TS>,\![<NPU_NP>=@NP0?^\\[<REQUEST_RE>@RE0^[<DROP_DR
  137. >@DR0^[<MSG_MS>=@MS0&\$",
  138. "AL0@NOP,<ALERT_AL>,\[CP=@CP1?^\\[BU=@BU0?^\\![<NPU_NP>=@NP0?
  139. ^[<NPUS_NPS>@NPS^\$",
  140. "END,END[^\@NAP?^\$",
  141. "HEL,<HELLO_LOGIN>^$",
  142. "BYE,<BYE_LOGOUT_GOODBYE>^$",
  143. "HI0,<HISTORY_HI>^\ALL@ALL^\$",
  144. "IN0,<INFO_IN>^$",
  145. "(",
  146. ")",
  147. "$"];
  148. END
  149.  
  150.  
  151. #
  152. * THE FOLLOWING ARE MESSAGE ARRAYS EITHER FOR OUTBOUND TERMINAL
  153. * TEXT OR DESTINED FOR SYSTEM DAYFILE.
  154. #
  155.  
  156. ARRAY PLGMSG[00:00] S(3);
  157. BEGIN
  158. ITEM PLG$MSG C(00,00,19) =
  159. ["PARAMETER TOO LONG."];
  160. ITEM PLG$ZERO U(01,54,06) = [0];
  161. ITEM PLG$ZERO1 U(02,00,60) = [0];
  162. END
  163.  
  164.  
  165. ARRAY EPDMSG[00:00] S(2);
  166. BEGIN
  167. ITEM EPD$MSG C(00,00,17) =
  168. ["EXPECTING PERIOD."];
  169. ITEM EPD$ZERO U(01,42,18) = [0];
  170. END
  171.  
  172.  
  173. ARRAY EPCMSG[00:00] S(3);
  174. BEGIN
  175. ITEM EPC$MSG C(00,00,26) =
  176. ["EXPECTING PERIOD OR COMMA."];
  177. ITEM EPC$ZERO U(02,36,24) = [0];
  178. END
  179.  
  180.  
  181. ARRAY URCMSG[00:00] S(3);
  182. BEGIN
  183. ITEM URC$MSG C(00,00,21) =
  184. ["UNRECOGNIZED COMMAND."];
  185. ITEM URC$ZERO U(02,06,54) = [0];
  186. END
  187.  
  188.  
  189. ARRAY ICPMSG[00:00] S(4);
  190. BEGIN
  191. ITEM ICP$MSG C(00,00,34) =
  192. ["INVALID COMBINATION OF PARAMETERS."];
  193. ITEM ICP$ZERO U(03,24,36) = [0];
  194. END
  195.  
  196.  
  197. ARRAY CMPMSG[00:00] S(3);
  198. BEGIN
  199. ITEM CMP$MSG C(00,00,26) =
  200. ["COMMAND MISSING PARAMETER."];
  201. ITEM CMP$ZERO U(02,36,24) = [0];
  202. END
  203.  
  204.  
  205. ARRAY IMLMSG[00:00] S(3);
  206. BEGIN
  207. ITEM IML$MSG C(00,00,23) =
  208. ["INPUT MESSAGE TOO LONG."];
  209. ITEM IML$ZERO U(02,18,42) = [0];
  210. END
  211.  
  212.  
  213. ARRAY PLSMSG[00:00] S(4);
  214. BEGIN
  215. ITEM PLS$MSG C(00,00,35) =
  216. [" CSSROC- PARAMETER LIST TOO SHORT."];
  217. ITEM PLS$ZERO U(03,30,30) = [0];
  218. END
  219.  
  220.  
  221. ARRAY VALMSG[00:00] S(3);
  222. BEGIN
  223. ITEM VAL$MSG C(00,00,19) =
  224. ["VALUE OUT-OF-RANGE."];
  225. ITEM VAL$ZERO1 U(01,54,06) = [0];
  226. ITEM VAL$ZERO2 U(02,00,60) = [0];
  227. END
  228.  
  229.  
  230. ITEM EC U; # ERROR CODE RETURNING FROM *SSRRCS* #
  231. ITEM ET U; # ERROR TEXT RETURNING FROM *SSRRCS* #
  232. ITEM I I; # DUMMY LOOP INDUCTION VAR #
  233. ITEM MAX U; # MAX NO OF CMD PARMS IN PARAMETER LIST #
  234. ITEM PCNT U; # PARM COUNT RETURNING FROM *SSRRCS* #
  235.  
  236.  
  237. CONTROL EJECT;
  238.  
  239. #
  240. * PROCESS ALL OPERATOR TYPEIN ENTRIES IN OPERATOR TYPEIN QUEUE.
  241. #
  242.  
  243. FOR I = 0 WHILE OPQL NQ 0
  244. DO
  245. BEGIN
  246. WCB$WORD[1] = 0; # CLEAR WC WORD 1 #
  247. HDR$WORD[1] = 0; # CLEAR HDRCMD WORD 1 #
  248. SSTRQE(P<OPTQ>,WCBUF[0],HDRCMD[0],PARMS[0]); # GET AN ENTRY #
  249. #
  250.   * IF OPERATOR TYPEIN IS HOP/BRK, SPECIAL CASE IT.
  251.   * I.E. DO NOT CALL COMMAND RECOGNIZER, INSTEAD BUILD
  252.   * OUR OWN ONE-WORD PARAMETER LIST, AND SEND THE VALID
  253.   * COMMAND TO *VCQ*.
  254.   #
  255. IF HDR$BOF[0]
  256. THEN
  257. BEGIN # BREAK OCCURRED #
  258. PAR$ELNAME[0] = "BRK";
  259. PAR$PCODE[0] = "VEB";
  260. PCNT = 1;
  261. HDR$OPORD[1] = HDR$OPORD[0];
  262. GOTO LLNOERR;
  263. END
  264. MAX = MCMDL$ - (WCB$WC[0] - 2); # MAX NO OF CMD IN PARM LIST #
  265. #
  266.   * CALL COMMAND RECOGNIZER WITH COMMAND SYNTAX TABLE, COMMAND
  267.   * STRING, STRING LENGTH IN CHARACTERS, AND MAXIMUM NUMBER OF
  268.   * COMMAND PARAMETERS ALLOWABLE IN PARAMETER LIST. IT RETURNS
  269.   * THE PARAMETER LIST, PARAMETER LIST COUNT, ERROR CODE AND
  270.   * ERROR TEXT IF ANY.
  271.   #
  272. SSRRCS(CST,PARMS[0],HDR$TXCCNT[0],PARMS[WCB$WC[0]-2],MAX,PCNT,
  273. EC,ET);
  274. WCB$IAF[1] = TRUE; # PRESET IAF TO TRUE #
  275. WCB$SMID[1] = SMID"TTEXT"; # SET SMID TO TERMINAL TEXT #
  276. HDR$OPORD[1] = HDR$OPORD[0]; # SET OPERATOR ORDINAL #
  277. GOTO ERRSWT[EC]; # ERROR SWITCH BY EC #
  278.  
  279. LLNOERR: # NO ERROR, BUILD VALID COMMAND ENTRY #
  280.  
  281. WCB$IAF[1] = FALSE; # TURN IAF OFF #
  282. WCB$SMID[1] = 0; # SET SMID TO 0 #
  283. WCB$WC[1] = WCB$WC[0] + PCNT; # CALCULATE WORD COUNT #
  284. HDR$SPCNT[1] = PCNT; # SYNTAX PARAMETER COUNT #
  285. HDR$APCNT[1] = 0; # ADDR PARAMETER COUNT #
  286. HDR$TXWCNT[1] = WCB$WC[0] - 2; # TEXT WORD COUNT #
  287. HDR$VERB[1] = PAR$ELNAME[WCB$WC[0]-2]; # COMMAND VERB #
  288. HDR$TXCCNT[1] = HDR$TXCCNT[0]; # TEXT LEN IN CHARS #
  289. SSTAQE(P<VCQ>,WCBUF[1],HDRCMD[1],PARMS[0]); # SEND VALID CMD #
  290. GOTO ENDCASE;
  291.  
  292. LLPRMLNG: # EC= "PARAMETER TOO LONG." #
  293.  
  294. WCB$WC[1] = LMSG30$/10 + 2;
  295. HDR$TXCCNT[1] = LMSG30$;
  296. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],PLGMSG[0]);
  297. GOTO ENDCASE;
  298.  
  299. LLEXPRD: # EC= "EXPECTING PERIOD." #
  300.  
  301. WCB$WC[1] = LMSG20$/10 + 2;
  302. HDR$TXCCNT[1] = LMSG20$;
  303. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],EPDMSG[0]);
  304. GOTO ENDCASE;
  305.  
  306. LLEXPDCMA: # EC= "EXPECTING PERIOD OR COMMA." #
  307.  
  308. WCB$WC[1] = LMSG30$/10 + 2;
  309. HDR$TXCCNT[1] = LMSG30$;
  310. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],EPCMSG[0]);
  311. GOTO ENDCASE;
  312.  
  313. LLUNRGCMD: # EC= "UNRECOGNIZED COMMAND." #
  314.  
  315. WCB$WC[1] = LMSG30$/10 + 2;
  316. HDR$TXCCNT[1] = LMSG30$;
  317. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],URCMSG[0]);
  318. GOTO ENDCASE;
  319.  
  320. LLINVCMPRM: # EC= "INVALID COMBINATION OF PARAMETERS."#
  321.  
  322. WCB$WC[1] = LMSG40$/10 + 2;
  323. HDR$TXCCNT[1] = LMSG40$;
  324. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],ICPMSG[0]);
  325. GOTO ENDCASE;
  326.  
  327. LLCMDMSPRM: # EC= "COMMAND MISSING PARAMETER." #
  328.  
  329. WCB$WC[1] =LMSG30$/10 + 2;
  330. HDR$TXCCNT[1] = LMSG30$;
  331. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],CMPMSG[0]);
  332. GOTO ENDCASE;
  333.  
  334. LLPRMSH: # EC= "PARAMETER LIST TOO SHORT." #
  335.  
  336. $BEGIN
  337. MESSAGE(PLSMSG[0], DF$); # SEND MESSAGE TO DAYFILE #
  338. ABORT; # AND ABORT CS #
  339. $END
  340.  
  341. LLVALOUT: # EC= "VALUE OUT-OF-RANGE #
  342.  
  343. WCB$WC[1] = LMSG30$/10 + 2;
  344. HDR$TXCCNT[1] = LMSG30$;
  345. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],VALMSG[0]);
  346. GOTO ENDCASE;
  347.  
  348. LLMSGLNG: # EC= "INPUT MESSAGE TOO LONG." #
  349.  
  350. WCB$WC[1] = LMSG30$/10 + 2;
  351. HDR$TXCCNT[1] = LMSG30$;
  352. SSTAQE(P<CNQ>,WCBUF[1],HDRCMD[1],IMLMSG[0]);
  353.  
  354. ENDCASE:
  355.  
  356. END # END PROCESSING OPTQ #
  357.  
  358. END # CSSROC #
  359.  
  360. TERM
cdc/nos2.source/nam5871/cssroc.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator