User Tools

Site Tools


cdc:nos2.source:nam5871:nvfteti

NVFTETI

Table Of Contents

  • [00007] PROC NVFTETI
  • [00008] NVFTETI - EDIT TERMINAL INPUT
  • [00012] EDIT TERMINAL INPUT.
  • [00060] PROC NVFTILP
  • [00061] PROC NVFTPSV
  • [00062] PROC NVFTPUV
  • [00063] PROC NVFTPVR
  • [00064] PROC NVFTVAA
  • [00065] PROC NVFUMQE
  • [00066] PROC SSBSBF
  • [00067] PROC SSTAQE
  • [00235] PROC UNPACK
  • [00236] UNPACK - UNPACK PARAMETERS.
  • [00240] UNPACK - UNPACK PARAMETERS.

Source Code

NVFTETI.txt
  1. *DECK NVFTETI
  2. USETEXT TEXTNVF
  3. USETEXT TXTANVF
  4. USETEXT TEXTSS
  5. USETEXT TXTAPSS
  6.  
  7. PROC NVFTETI;
  8. # TITLE NVFTETI - EDIT TERMINAL INPUT #
  9.  
  10. BEGIN # NVFTETI #
  11. #
  12. ** NVFTETI - EDIT TERMINAL INPUT.
  13. *
  14. * E. THAVIKULWAT 81/09/16
  15. *
  16. * THIS PROCEDURES' MAIN FUNCTION IS TO EDIT LOGIN RESPONSES FROM
  17. * THE TERMINAL. IT IS CALLED INTO EXECUTION BY PROCEDURE *NVFTDQE*.
  18. *
  19. * PROC NVFTETI
  20. *
  21. * ENTRY:
  22. * ABH IN *ABHBUF*
  23. * LOGIN RESPONSE IN *MSGBUF*
  24. *
  25. * EXIT:
  26. * ONE OF THE FOLLOWING:
  27. * 1) PROMPT REISSUED DUE TO IMPROPER LOGIN.
  28. * 2) NEW PROMPT ISSUED.
  29. * 3) CONNECTION SWITCHED TO APPROPRIATE APPLICATION.
  30. * 4) CONNECTION TERMINATED.
  31. *
  32. * NOTES:
  33. * 1) THE INTERNAL VALUES ASSIGNED TO EACH PROMPT, I.E.,
  34. * FAMILY = 5, USER = 4, PASSWORD = 3, PERSONAL ID = 2, AND
  35. * APPLICATION = 1, ALSO REFLECT THE MAXIMUM NUMBER OF EXPECTED
  36. * PARAMETERS WHEN USING THE ABBREVIATED FORMAT. PARAMETERS
  37. * IN EXCESS OF THE NUMBER EXPECTED FOR A PARTICULAR PROMPT
  38. * WILL BE IGNORED.
  39. * 2) FOR AN ABBREVIATED TYPE RESPONSE, IF ERROR IS IN THE
  40. * APPLICATION PARAMETER, THE FAMILY, USER, PERSONAL ID AND
  41. * PASSWORD WILL STILL BE VALIDATED PRIOR TO ISSUING AN ERROR
  42. * FOR THE APPLICATION NAME.
  43. * 3) SEE FURTHER NOTES IN INTERNAL PROCEDURE *UNPACK*.
  44. *
  45. * METHOD:
  46. * SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S ACN.
  47. * IF NO MATCH IS FOUND, IGNORE RESPONSE. CALL *UNPACK* TO
  48. * UNPACK THE RESPONSE INTO INDIVIDUAL PARAMETERS AND STORE THEM
  49. * INTO THE APPROPRIATE VOLUNTEERED FIELDS OF THE PTAC ENTRY. THEN
  50. * DETERMINE IF NEXT ACTION IS TO VALIDATE DATA OR ISSUE ANOTHER
  51. * PROMPT.
  52. #
  53.  
  54. #
  55. **** PROC NVFTETI - XREF LIST.
  56. #
  57.  
  58. XREF
  59. BEGIN
  60. PROC NVFTILP; # ISSUE LOGIN PROMPT #
  61. PROC NVFTPSV; # PROCESS SUCCESSFUL LOGIN #
  62. PROC NVFTPUV; # PROCESS UNSUCCESSFUL VALIDATION #
  63. PROC NVFTPVR; # PREPARE VALIDATE USER REQUEST #
  64. PROC NVFTVAA; # VALIDATE USER'S RIGHT TO ACCESS APPL #
  65. PROC NVFUMQE; # TRANSFER SM TO QUEUE #
  66. PROC SSBSBF; # STORE BITFIELD IN TABLE #
  67. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  68. END
  69.  
  70. #
  71. ****
  72. #
  73. DEF MXPARAM$ #5#; # MAXIMUM NUMBER OF LOGIN RESPONSES #
  74.  
  75. ITEM ADDR I; # ADDRESSING INFORMATION FOR ABH #
  76. ITEM CURRESP I; # CURRENT LOGIN RESPONSE BEING PROCESSED #
  77. ITEM ERRFLAG B; # ERROR FLAG #
  78. ITEM I I; # LOOP VARIABLE #
  79. ITEM MATCH B; # EXIT LOOP VARIABLE #
  80. ITEM NENTRY I; # NUMBER OF ENTRIES IN TABLE #
  81. ITEM PIDRESP C(20); # PERSONAL IDENTIFIER RESPONSE #
  82. ITEM PSUB I; # SUBSCRIPT FOR GOTO SWITCH #
  83. ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
  84. ITEM PTPRMT I; # PROMPT INDICATOR VARIABLE #
  85. ITEM VL I; # SUBSCRIPT FOR BASED ARRAY VLTINP #
  86.  
  87. #
  88. * THE FOLLOWING BUFFER IS USED TO ISSUE A LINE FEED TO A TERMINAL
  89. * WHEN THE TERMINAL INPUT DOES NOT CONTAIN A PASSWORD.
  90. #
  91. ARRAY NEWLINE[00:00] S(1);
  92. BEGIN
  93. ITEM LINEFEED C(00,00,01) = [" "];
  94. END
  95.  
  96. #
  97. * THE FOLLOWING BASED ARRAY POINTER POINTS TO THE LOGIN VOLUNTEERED
  98. * FIELDS OF THE PTAC ENTRY.
  99. #
  100. BASED ARRAY VLTINP[00:00] S(1);
  101. BEGIN
  102. ITEM VLT$NAME C(00,00,07); # VOLUNTEERED NAME #
  103. END
  104.  
  105. SWITCH PRMTSWT
  106. LLAPPL, # LABEL FOR APPLICATION PROMPT #
  107. LLPRID, # LABEL FOR PERSONAL ID PROMPT #
  108. LLPWRD, # LABEL FOR PASSWORD PROMPT #
  109. LLUSER, # LABEL FOR USER PROMPT #
  110. LLFAM; # LABEL FOR FAMILY PROMPT #
  111.  
  112. #
  113. * SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S ACN.
  114. * IF NO MATCH, IGNORE RESPONSE.
  115. #
  116. MATCH = FALSE;
  117. NENTRY = PTALNGTH / PTACSIZ$; # CALCULATE NUMBER OF ENTRIES #
  118. FOR PT = 0 STEP 1 WHILE (NOT MATCH AND PT LS NENTRY)
  119. DO
  120. BEGIN
  121. IF PTA$ACN[PT] EQ ABHADR[0]
  122. THEN # PTAC ENTRY FOUND #
  123. BEGIN
  124. IF PTA$STATE[PT] NQ PTACST"AWTRSP" # IF THE CONNECTION IS #
  125. THEN # NOT EXPECTING ANY INPUT#
  126. BEGIN # DATUM, IGNORE WHAT THE #
  127. GOTO ENDPRMT; # USER TYPED IN. #
  128. END
  129.  
  130. PTA$CNUM[PT] = 0; # CLEAR TIMER CANCELLATION NUM #
  131. UNPACK; # UNPACK LOGIN RESPONSE #
  132. PTPRMT = PTA$PROMPT[PT]; # GET PROMPT #
  133. #
  134. * IF *UNPACK* RETURNS AN ERROR AND IS THE APPLICATION PARAMETER
  135. * IN ERROR, THEN SET THE APPLICATION INVALID FLAG.
  136. #
  137. IF (ERRFLAG) AND (PTPRMT EQ AWTAPP$)
  138. THEN
  139. BEGIN
  140. PTA$INVAF[PT] = TRUE;
  141. END
  142. #
  143. * INTERNAL PROC *UNPACK* LEFT JUSTIFIES AND ZERO FILL ALL
  144. * PARAMETERS. THEREFORE, IF APPLICATION NAME IS ENTERED,
  145. * CONVERT ALL ZEROES TO BLANKS.
  146. #
  147. IF (PTA$VAF[PT]) AND (NOT PTA$INVAF[PT])
  148. THEN # APPLICATION NAME PRESENT #
  149. BEGIN # CONVERT ZEROES TO BLANKS #
  150. FOR I = 0 STEP 1 UNTIL 6
  151. DO
  152. BEGIN
  153. IF (C<I,1>PTA$VLTAPP[PT] EQ 0)
  154. THEN # FOUND A ZERO #
  155. BEGIN
  156. C<I,1>PTA$VLTAPP[PT] = " ";
  157. END
  158. END
  159. END
  160. #
  161. * DETERMINE APPROPRIATE ACTION DEPENDING ON PROMPT.
  162. #
  163. PSUB = PTA$PROMPT[PT] - 1;
  164. PTA$INLGTH[PT] = ABHTLC[0]; # CHAR LENGTH OF INPUT FOR MASK #
  165. IF (PTPRMT GQ AWTPWD$) AND (PTA$VPIDF[PT])
  166. THEN
  167. BEGIN
  168. PTA$PID[PT] = PIDRESP;
  169. END
  170. GOTO PRMTSWT[PSUB];
  171.  
  172. LLFAM: # RESPONSE TO FAMILY PROMPT #
  173. LLUSER: # RESPONSE TO USER PROMPT #
  174. IF CURRESP LS AWTPWD$
  175. THEN # FAMILY,USER,PASSWRD SPECIFIED #
  176. BEGIN
  177. NVFTPVR(PT); # PREPARE VALIDATE USER REQUEST #
  178. END
  179. ELSE # LOGIN NOT COMPLETE #
  180. BEGIN
  181. PTA$PROMPT[PT] = CURRESP; # DETERMINE NEXT PROMPT #
  182. NVFTILP(PT); # ISSUE NEXT PROMPT #
  183. END
  184.  
  185. GOTO ENDPRMT;
  186.  
  187. LLPWRD: # RESPONSE TO PASSWORD PROMPT #
  188.  
  189. NVFTPVR(PT); # PREPARE VALIDATE USER REQUEST #
  190. GOTO ENDPRMT;
  191.  
  192. LLPRID: # RESPONSE TO PERSONAL ID PRMPT #
  193.  
  194. IF (PTA$PID[PT] EQ PIDRESP) AND (PTA$SCINV[PT] EQ 0) AND
  195. ((PTA$AAVW[PT] LAN VAPMASK) NQ 0)
  196. THEN
  197. BEGIN # PROCESS SUCCESSFUL VALIDATION #
  198. NVFTPSV(PT);
  199. IF PTA$STATE[PT] EQ PTACST"AWTVAA"
  200. THEN
  201. NVFTVAA(PT);
  202.  
  203. END
  204. ELSE
  205. BEGIN # PROCESS UNSUCCESSFUL VALIDATN #
  206. IF (PTA$SCINV[PT] EQ 0)
  207. AND ((PTA$AAVW[PT] LAN VAPMASK) NQ 0)
  208. THEN
  209. PTA$INVPID[PT] = TRUE; # INVALID PERSONAL IDENTIFIER #
  210. NVFTPUV(PT);
  211. END
  212.  
  213. GOTO ENDPRMT;
  214.  
  215. LLAPPL: # RESPONSE TO APPLICATION PRMPT #
  216. IF PTA$INVAF[PT]
  217. THEN # INVALID APPLICATION NAME #
  218. BEGIN
  219. NVFTPUV(PT); # LOGOUT OR REISSUE PROMPT #
  220. END
  221. ELSE # APPLICATION NAME OKAY #
  222. BEGIN
  223. NVFTVAA(PT); # VALIDATE RIGHT TO ACCESS APPL #
  224. END
  225.  
  226. GOTO ENDPRMT;
  227.  
  228. ENDPRMT: # END OF CASE #
  229. MATCH = TRUE;
  230. END
  231.  
  232. END
  233.  
  234. CONTROL EJECT;
  235. PROC UNPACK;
  236. # TITLE UNPACK - UNPACK PARAMETERS. #
  237.  
  238. BEGIN # UNPACK #
  239. #
  240. ** UNPACK - UNPACK PARAMETERS.
  241. *
  242. * E. THAVIKULWAT 81/09/15
  243. *
  244. * THIS PROCEDURE IS INTERNAL TO PROCEDURE *NVFTETI* AND IS CALLED
  245. * ONLY BY *NVFTETI*. IT'S MAIN FUNCTION IS TO UNPACK LOGIN INPUT
  246. * FROM THE TERMINAL TO INDIVIDUAL PARAMETERS. THE PARAMETERS ARE
  247. * THEN STORED IN THE VOLUNTEERED FIELDS OF THE PTAC TABLE.
  248. *
  249. * PROC UNPACK
  250. *
  251. * ENTRY:
  252. * *MSGBUF* CONTAINS THE TERMINAL INPUT.
  253. *
  254. * EXIT:
  255. * ERRFLAG = TRUE IF PARAMETER > 7 CHARACTERS FOR A PROMPT OTHER
  256. * THAN PERSONAL ID, > 20 CHARACTERS FOR THE PERSONAL ID.
  257. * *RSPBUF* CONTAINS PARAMETERS.
  258. *
  259. * NOTES:
  260. * 1) PRECEDING, IMBEDDED, AND TRAILING BLANKS ARE IGNORED.
  261. * 2) THE CHARACTERS ). ARE CONSIDERED AS THE TERMINATOR
  262. * OF THE INPUT IF ENCOUNTERED PRIOR TO REACHING ACTUAL
  263. * END OF TEXT.
  264. * 3) CHARACTERS OTHER THAN TERMINATORS, BLANKS, A-Z,O-9, AND
  265. * * ARE CONSIDERED AS PARAMETER SEPARATORS.
  266. * 4) PARAMETER MUST CONTAIN 7 OR LESS CHARACTERS.
  267. * IF PARAMETER CONTAINS MORE THAN 7 CHARACTERS, REPLACE THE
  268. * 6TH AND 7TH CHARACTER IN *RSPBUF* WITH "..", AND IGNORE
  269. * THE REST OF THE CHARACTERS.
  270. * THE PERSONAL ID PARAMETER MUST CONTAIN 20 OR LESS CHARACTERS.
  271. * IF NOT THE 19TH AND 20TH CHARACTER ARE REPLACE WITH ".."
  272. * AND THE REMAINING CHARACTERS IGNORED.
  273. * 5) PARAMETERS ARE STORED LEFT JUSTIFIED WITH ZERO FILLED.
  274. * 6) NULL PARAMETER (CR, 2 SUCCESSIVE SEPARATORS, OR SEPARATOR
  275. * FOLLOWED BY A TERMINATOR) RESULTS IN A VALUE OF ALL ZEROES.
  276. * 7) MAXIMUM NUMBER OF PARAMETERS PROCESSED IS 5.
  277. * 8) SCANNING TERMINATES IF AN ERROR IS ENCOUNTERED.
  278. *
  279. * METHOD:
  280. * IF CHARACTER IS A-Z, 0-9, OR * THEN PACK IT INTO *RSPBUF*.
  281. * IF CHARACTER IS A BLANK, IGNORE CHARACTER.
  282. * IF CHARACTER IS A TERMINATOR, END SCAN.
  283. * IF CHARACTER IS A SEPARATOR, RESET APPROPRIATE COUNTERS AND
  284. * GO TO NEXT PARAMETER.
  285. #
  286.  
  287. DEF MXCHAR$ #7#; # MAXIMUM NUMBER OF CHARACTERS/PARAMETER #
  288. DEF ONEBLNK$ #" "#; # ONE SINGLE BLANK #
  289. DEF PIDMAXL$ #20#; # MAX NUMBER OF CHARACTERS FOR PID PARAM #
  290.  
  291.  
  292. ITEM CCHAR C(1); # CURRENT CHARACTER VARIABLE #
  293. ITEM ENDSCAN B; # EXIT LOOP INDICATOR #
  294. ITEM I I; # LOOP VARIABLE #
  295. ITEM MAXCHAR I; # MAXIMUM NUMBER OF CHARACTERS FOR PARAM #
  296. ITEM RSPCNT I; # CHARACTER COUNT VARIABLE #
  297.  
  298. #
  299. * INITIALIZE VARIABLES AND CLEAR *RSPBUF*.
  300. #
  301. RSPCNT = 0;
  302. ENDSCAN = FALSE;
  303. ERRFLAG = FALSE;
  304. CURRESP = PTA$PROMPT[PT];
  305. IF CURRESP LQ AWTPID$
  306. THEN # DECREMENT DUE TO SPECIAL PID PROCESSING #
  307. VL = MXPARAM$ - (CURRESP + 1);
  308. ELSE
  309. VL = MXPARAM$ - CURRESP;
  310. P<VLTINP> = LOC(PTA$VLTFAM[PT]);
  311. B<0,60>PIDRESP = 0;
  312. B<60,60>PIDRESP = 0;
  313. IF CURRESP EQ AWTPID$ # IF PERSONAL ID PROMPT #
  314. THEN
  315. BEGIN
  316. MAXCHAR = PIDMAXL$;
  317. PTA$VPIDF[PT] = TRUE;
  318. END
  319. ELSE
  320. BEGIN
  321. MAXCHAR = MXCHAR$;
  322. B<VL,1>PTA$VLTF[PT] = 1;
  323. END
  324.  
  325. #
  326. * UNPACK PARAMETERS.
  327. #
  328. FOR I = 0 STEP 1 WHILE (NOT ENDSCAN AND I LS ABHTLC[0])
  329. DO
  330. BEGIN
  331. CCHAR = C<I,1>MSG$CHAR[0]; # GET CHARACTER #
  332. IF (CCHAR GQ "A" AND CCHAR LQ "9")
  333. OR (CCHAR EQ "*")
  334. THEN # VALID CHARACTER #
  335. BEGIN
  336. IF RSPCNT GQ MAXCHAR
  337. THEN # PARAMETER LENGTH > MAX CHAR #
  338. BEGIN
  339. ERRFLAG = TRUE;
  340. IF RSPCNT EQ MAXCHAR
  341. THEN
  342. BEGIN
  343. IF CURRESP EQ AWTPID$ # LOOKING AT THE 21ST CHARACTER #
  344. THEN # REPLACE THE 19TH AND 20TH WITH .. #
  345. C<RSPCNT-2,2>PIDRESP = "..";
  346. ELSE # LOOKING AT THE 8TH CHARACTER #
  347. C<RSPCNT-2,2>VLT$NAME[VL] = "..";
  348. END
  349. END
  350. ELSE
  351. BEGIN
  352. IF CURRESP EQ AWTPID$ # PROCESSING PERSONAL ID #
  353. THEN
  354. C<RSPCNT,1>PIDRESP = CCHAR; # PACK CHARACTER IN BUFFER #
  355. ELSE
  356. C<RSPCNT,1>VLT$NAME[VL] = CCHAR; # PACK CHARACTER IN BUF #
  357. END
  358. RSPCNT = RSPCNT + 1; # INCREMENT CHARACTER COUNT #
  359. END
  360. ELSE # SPECIAL CHARACTER #
  361. BEGIN
  362. IF (CCHAR EQ ")" OR CCHAR EQ "." OR CCHAR EQ ONEBLNK$)
  363. THEN # TERMINATOR OR BLANK CHARACTER #
  364. BEGIN
  365. IF CCHAR NQ ONEBLNK$
  366. THEN # TERMINATOR CHARACTER #
  367. BEGIN
  368. ENDSCAN = TRUE; # EXIT LOOP #
  369. END
  370. END
  371. ELSE # SEPARATOR CHARACTER #
  372. BEGIN
  373. RSPCNT = 0; # RESET CHARACTER COUNT #
  374. CURRESP = CURRESP - 1; # PROCESS NEXT RESPONSE #
  375. IF CURRESP EQ AWTPID$ # RESET MAX PARAMETER LENGTH #
  376. THEN
  377. BEGIN
  378. MAXCHAR = PIDMAXL$;
  379. PTA$VPIDF[PT] = TRUE;
  380. END
  381. ELSE
  382. BEGIN
  383. MAXCHAR = MXCHAR$;
  384. VL = VL + 1;
  385. B<VL,1>PTA$VLTF[PT] = 1;
  386. END
  387. IF CURRESP LQ 0
  388. THEN # REACHED MAX NUMBER OF PARAMS #
  389. BEGIN # IGNORE REST OF INPUT #
  390. ENDSCAN = TRUE; # EXIT LOOP #
  391. END
  392. END
  393. END
  394. END
  395.  
  396. CURRESP = CURRESP - 1; # NEXT EXPECTED RESPONSE #
  397. END # END UNPACK #
  398.  
  399. END # END NVFTETI #
  400. TERM
cdc/nos2.source/nam5871/nvfteti.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator