*DECK NVFTETI
USETEXT TEXTNVF
USETEXT TXTANVF
USETEXT TEXTSS
USETEXT TXTAPSS
PROC NVFTETI;
# TITLE NVFTETI - EDIT TERMINAL INPUT #
BEGIN # NVFTETI #
#
** NVFTETI - EDIT TERMINAL INPUT.
*
* E. THAVIKULWAT 81/09/16
*
* THIS PROCEDURES' MAIN FUNCTION IS TO EDIT LOGIN RESPONSES FROM
* THE TERMINAL. IT IS CALLED INTO EXECUTION BY PROCEDURE *NVFTDQE*.
*
* PROC NVFTETI
*
* ENTRY:
* ABH IN *ABHBUF*
* LOGIN RESPONSE IN *MSGBUF*
*
* EXIT:
* ONE OF THE FOLLOWING:
* 1) PROMPT REISSUED DUE TO IMPROPER LOGIN.
* 2) NEW PROMPT ISSUED.
* 3) CONNECTION SWITCHED TO APPROPRIATE APPLICATION.
* 4) CONNECTION TERMINATED.
*
* NOTES:
* 1) THE INTERNAL VALUES ASSIGNED TO EACH PROMPT, I.E.,
* FAMILY = 5, USER = 4, PASSWORD = 3, PERSONAL ID = 2, AND
* APPLICATION = 1, ALSO REFLECT THE MAXIMUM NUMBER OF EXPECTED
* PARAMETERS WHEN USING THE ABBREVIATED FORMAT. PARAMETERS
* IN EXCESS OF THE NUMBER EXPECTED FOR A PARTICULAR PROMPT
* WILL BE IGNORED.
* 2) FOR AN ABBREVIATED TYPE RESPONSE, IF ERROR IS IN THE
* APPLICATION PARAMETER, THE FAMILY, USER, PERSONAL ID AND
* PASSWORD WILL STILL BE VALIDATED PRIOR TO ISSUING AN ERROR
* FOR THE APPLICATION NAME.
* 3) SEE FURTHER NOTES IN INTERNAL PROCEDURE *UNPACK*.
*
* METHOD:
* SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S ACN.
* IF NO MATCH IS FOUND, IGNORE RESPONSE. CALL *UNPACK* TO
* UNPACK THE RESPONSE INTO INDIVIDUAL PARAMETERS AND STORE THEM
* INTO THE APPROPRIATE VOLUNTEERED FIELDS OF THE PTAC ENTRY. THEN
* DETERMINE IF NEXT ACTION IS TO VALIDATE DATA OR ISSUE ANOTHER
* PROMPT.
#
#
**** PROC NVFTETI - XREF LIST.
#
XREF
BEGIN
PROC NVFTILP; # ISSUE LOGIN PROMPT #
PROC NVFTPSV; # PROCESS SUCCESSFUL LOGIN #
PROC NVFTPUV; # PROCESS UNSUCCESSFUL VALIDATION #
PROC NVFTPVR; # PREPARE VALIDATE USER REQUEST #
PROC NVFTVAA; # VALIDATE USER'S RIGHT TO ACCESS APPL #
PROC NVFUMQE; # TRANSFER SM TO QUEUE #
PROC SSBSBF; # STORE BITFIELD IN TABLE #
PROC SSTAQE; # ACCEPT QUEUE ENTRY #
END
#
****
#
DEF MXPARAM$ #5#; # MAXIMUM NUMBER OF LOGIN RESPONSES #
ITEM ADDR I; # ADDRESSING INFORMATION FOR ABH #
ITEM CURRESP I; # CURRENT LOGIN RESPONSE BEING PROCESSED #
ITEM ERRFLAG B; # ERROR FLAG #
ITEM I I; # LOOP VARIABLE #
ITEM MATCH B; # EXIT LOOP VARIABLE #
ITEM NENTRY I; # NUMBER OF ENTRIES IN TABLE #
ITEM PIDRESP C(20); # PERSONAL IDENTIFIER RESPONSE #
ITEM PSUB I; # SUBSCRIPT FOR GOTO SWITCH #
ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
ITEM PTPRMT I; # PROMPT INDICATOR VARIABLE #
ITEM VL I; # SUBSCRIPT FOR BASED ARRAY VLTINP #
#
* THE FOLLOWING BUFFER IS USED TO ISSUE A LINE FEED TO A TERMINAL
* WHEN THE TERMINAL INPUT DOES NOT CONTAIN A PASSWORD.
#
ARRAY NEWLINE[00:00] S(1);
BEGIN
ITEM LINEFEED C(00,00,01) = [" "];
END
#
* THE FOLLOWING BASED ARRAY POINTER POINTS TO THE LOGIN VOLUNTEERED
* FIELDS OF THE PTAC ENTRY.
#
BASED ARRAY VLTINP[00:00] S(1);
BEGIN
ITEM VLT$NAME C(00,00,07); # VOLUNTEERED NAME #
END
SWITCH PRMTSWT
LLAPPL, # LABEL FOR APPLICATION PROMPT #
LLPRID, # LABEL FOR PERSONAL ID PROMPT #
LLPWRD, # LABEL FOR PASSWORD PROMPT #
LLUSER, # LABEL FOR USER PROMPT #
LLFAM; # LABEL FOR FAMILY PROMPT #
#
* SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S ACN.
* IF NO MATCH, IGNORE RESPONSE.
#
MATCH = FALSE;
NENTRY = PTALNGTH / PTACSIZ$; # CALCULATE NUMBER OF ENTRIES #
FOR PT = 0 STEP 1 WHILE (NOT MATCH AND PT LS NENTRY)
DO
BEGIN
IF PTA$ACN[PT] EQ ABHADR[0]
THEN # PTAC ENTRY FOUND #
BEGIN
IF PTA$STATE[PT] NQ PTACST"AWTRSP" # IF THE CONNECTION IS #
THEN # NOT EXPECTING ANY INPUT#
BEGIN # DATUM, IGNORE WHAT THE #
GOTO ENDPRMT; # USER TYPED IN. #
END
PTA$CNUM[PT] = 0; # CLEAR TIMER CANCELLATION NUM #
UNPACK; # UNPACK LOGIN RESPONSE #
PTPRMT = PTA$PROMPT[PT]; # GET PROMPT #
#
* IF *UNPACK* RETURNS AN ERROR AND IS THE APPLICATION PARAMETER
* IN ERROR, THEN SET THE APPLICATION INVALID FLAG.
#
IF (ERRFLAG) AND (PTPRMT EQ AWTAPP$)
THEN
BEGIN
PTA$INVAF[PT] = TRUE;
END
#
* INTERNAL PROC *UNPACK* LEFT JUSTIFIES AND ZERO FILL ALL
* PARAMETERS. THEREFORE, IF APPLICATION NAME IS ENTERED,
* CONVERT ALL ZEROES TO BLANKS.
#
IF (PTA$VAF[PT]) AND (NOT PTA$INVAF[PT])
THEN # APPLICATION NAME PRESENT #
BEGIN # CONVERT ZEROES TO BLANKS #
FOR I = 0 STEP 1 UNTIL 6
DO
BEGIN
IF (C<I,1>PTA$VLTAPP[PT] EQ 0)
THEN # FOUND A ZERO #
BEGIN
C<I,1>PTA$VLTAPP[PT] = " ";
END
END
END
#
* DETERMINE APPROPRIATE ACTION DEPENDING ON PROMPT.
#
PSUB = PTA$PROMPT[PT] - 1;
PTA$INLGTH[PT] = ABHTLC[0]; # CHAR LENGTH OF INPUT FOR MASK #
IF (PTPRMT GQ AWTPWD$) AND (PTA$VPIDF[PT])
THEN
BEGIN
PTA$PID[PT] = PIDRESP;
END
GOTO PRMTSWT[PSUB];
LLFAM: # RESPONSE TO FAMILY PROMPT #
LLUSER: # RESPONSE TO USER PROMPT #
IF CURRESP LS AWTPWD$
THEN # FAMILY,USER,PASSWRD SPECIFIED #
BEGIN
NVFTPVR(PT); # PREPARE VALIDATE USER REQUEST #
END
ELSE # LOGIN NOT COMPLETE #
BEGIN
PTA$PROMPT[PT] = CURRESP; # DETERMINE NEXT PROMPT #
NVFTILP(PT); # ISSUE NEXT PROMPT #
END
GOTO ENDPRMT;
LLPWRD: # RESPONSE TO PASSWORD PROMPT #
NVFTPVR(PT); # PREPARE VALIDATE USER REQUEST #
GOTO ENDPRMT;
LLPRID: # RESPONSE TO PERSONAL ID PRMPT #
IF (PTA$PID[PT] EQ PIDRESP) AND (PTA$SCINV[PT] EQ 0) AND
((PTA$AAVW[PT] LAN VAPMASK) NQ 0)
THEN
BEGIN # PROCESS SUCCESSFUL VALIDATION #
NVFTPSV(PT);
IF PTA$STATE[PT] EQ PTACST"AWTVAA"
THEN
NVFTVAA(PT);
END
ELSE
BEGIN # PROCESS UNSUCCESSFUL VALIDATN #
IF (PTA$SCINV[PT] EQ 0)
AND ((PTA$AAVW[PT] LAN VAPMASK) NQ 0)
THEN
PTA$INVPID[PT] = TRUE; # INVALID PERSONAL IDENTIFIER #
NVFTPUV(PT);
END
GOTO ENDPRMT;
LLAPPL: # RESPONSE TO APPLICATION PRMPT #
IF PTA$INVAF[PT]
THEN # INVALID APPLICATION NAME #
BEGIN
NVFTPUV(PT); # LOGOUT OR REISSUE PROMPT #
END
ELSE # APPLICATION NAME OKAY #
BEGIN
NVFTVAA(PT); # VALIDATE RIGHT TO ACCESS APPL #
END
GOTO ENDPRMT;
ENDPRMT: # END OF CASE #
MATCH = TRUE;
END
END
CONTROL EJECT;
PROC UNPACK;
# TITLE UNPACK - UNPACK PARAMETERS. #
BEGIN # UNPACK #
#
** UNPACK - UNPACK PARAMETERS.
*
* E. THAVIKULWAT 81/09/15
*
* THIS PROCEDURE IS INTERNAL TO PROCEDURE *NVFTETI* AND IS CALLED
* ONLY BY *NVFTETI*. IT'S MAIN FUNCTION IS TO UNPACK LOGIN INPUT
* FROM THE TERMINAL TO INDIVIDUAL PARAMETERS. THE PARAMETERS ARE
* THEN STORED IN THE VOLUNTEERED FIELDS OF THE PTAC TABLE.
*
* PROC UNPACK
*
* ENTRY:
* *MSGBUF* CONTAINS THE TERMINAL INPUT.
*
* EXIT:
* ERRFLAG = TRUE IF PARAMETER > 7 CHARACTERS FOR A PROMPT OTHER
* THAN PERSONAL ID, > 20 CHARACTERS FOR THE PERSONAL ID.
* *RSPBUF* CONTAINS PARAMETERS.
*
* NOTES:
* 1) PRECEDING, IMBEDDED, AND TRAILING BLANKS ARE IGNORED.
* 2) THE CHARACTERS ). ARE CONSIDERED AS THE TERMINATOR
* OF THE INPUT IF ENCOUNTERED PRIOR TO REACHING ACTUAL
* END OF TEXT.
* 3) CHARACTERS OTHER THAN TERMINATORS, BLANKS, A-Z,O-9, AND
* * ARE CONSIDERED AS PARAMETER SEPARATORS.
* 4) PARAMETER MUST CONTAIN 7 OR LESS CHARACTERS.
* IF PARAMETER CONTAINS MORE THAN 7 CHARACTERS, REPLACE THE
* 6TH AND 7TH CHARACTER IN *RSPBUF* WITH "..", AND IGNORE
* THE REST OF THE CHARACTERS.
* THE PERSONAL ID PARAMETER MUST CONTAIN 20 OR LESS CHARACTERS.
* IF NOT THE 19TH AND 20TH CHARACTER ARE REPLACE WITH ".."
* AND THE REMAINING CHARACTERS IGNORED.
* 5) PARAMETERS ARE STORED LEFT JUSTIFIED WITH ZERO FILLED.
* 6) NULL PARAMETER (CR, 2 SUCCESSIVE SEPARATORS, OR SEPARATOR
* FOLLOWED BY A TERMINATOR) RESULTS IN A VALUE OF ALL ZEROES.
* 7) MAXIMUM NUMBER OF PARAMETERS PROCESSED IS 5.
* 8) SCANNING TERMINATES IF AN ERROR IS ENCOUNTERED.
*
* METHOD:
* IF CHARACTER IS A-Z, 0-9, OR * THEN PACK IT INTO *RSPBUF*.
* IF CHARACTER IS A BLANK, IGNORE CHARACTER.
* IF CHARACTER IS A TERMINATOR, END SCAN.
* IF CHARACTER IS A SEPARATOR, RESET APPROPRIATE COUNTERS AND
* GO TO NEXT PARAMETER.
#
DEF MXCHAR$ #7#; # MAXIMUM NUMBER OF CHARACTERS/PARAMETER #
DEF ONEBLNK$ #" "#; # ONE SINGLE BLANK #
DEF PIDMAXL$ #20#; # MAX NUMBER OF CHARACTERS FOR PID PARAM #
ITEM CCHAR C(1); # CURRENT CHARACTER VARIABLE #
ITEM ENDSCAN B; # EXIT LOOP INDICATOR #
ITEM I I; # LOOP VARIABLE #
ITEM MAXCHAR I; # MAXIMUM NUMBER OF CHARACTERS FOR PARAM #
ITEM RSPCNT I; # CHARACTER COUNT VARIABLE #
#
* INITIALIZE VARIABLES AND CLEAR *RSPBUF*.
#
RSPCNT = 0;
ENDSCAN = FALSE;
ERRFLAG = FALSE;
CURRESP = PTA$PROMPT[PT];
IF CURRESP LQ AWTPID$
THEN # DECREMENT DUE TO SPECIAL PID PROCESSING #
VL = MXPARAM$ - (CURRESP + 1);
ELSE
VL = MXPARAM$ - CURRESP;
P<VLTINP> = LOC(PTA$VLTFAM[PT]);
B<0,60>PIDRESP = 0;
B<60,60>PIDRESP = 0;
IF CURRESP EQ AWTPID$ # IF PERSONAL ID PROMPT #
THEN
BEGIN
MAXCHAR = PIDMAXL$;
PTA$VPIDF[PT] = TRUE;
END
ELSE
BEGIN
MAXCHAR = MXCHAR$;
B<VL,1>PTA$VLTF[PT] = 1;
END
#
* UNPACK PARAMETERS.
#
FOR I = 0 STEP 1 WHILE (NOT ENDSCAN AND I LS ABHTLC[0])
DO
BEGIN
CCHAR = C<I,1>MSG$CHAR[0]; # GET CHARACTER #
IF (CCHAR GQ "A" AND CCHAR LQ "9")
OR (CCHAR EQ "*")
THEN # VALID CHARACTER #
BEGIN
IF RSPCNT GQ MAXCHAR
THEN # PARAMETER LENGTH > MAX CHAR #
BEGIN
ERRFLAG = TRUE;
IF RSPCNT EQ MAXCHAR
THEN
BEGIN
IF CURRESP EQ AWTPID$ # LOOKING AT THE 21ST CHARACTER #
THEN # REPLACE THE 19TH AND 20TH WITH .. #
C<RSPCNT-2,2>PIDRESP = "..";
ELSE # LOOKING AT THE 8TH CHARACTER #
C<RSPCNT-2,2>VLT$NAME[VL] = "..";
END
END
ELSE
BEGIN
IF CURRESP EQ AWTPID$ # PROCESSING PERSONAL ID #
THEN
C<RSPCNT,1>PIDRESP = CCHAR; # PACK CHARACTER IN BUFFER #
ELSE
C<RSPCNT,1>VLT$NAME[VL] = CCHAR; # PACK CHARACTER IN BUF #
END
RSPCNT = RSPCNT + 1; # INCREMENT CHARACTER COUNT #
END
ELSE # SPECIAL CHARACTER #
BEGIN
IF (CCHAR EQ ")" OR CCHAR EQ "." OR CCHAR EQ ONEBLNK$)
THEN # TERMINATOR OR BLANK CHARACTER #
BEGIN
IF CCHAR NQ ONEBLNK$
THEN # TERMINATOR CHARACTER #
BEGIN
ENDSCAN = TRUE; # EXIT LOOP #
END
END
ELSE # SEPARATOR CHARACTER #
BEGIN
RSPCNT = 0; # RESET CHARACTER COUNT #
CURRESP = CURRESP - 1; # PROCESS NEXT RESPONSE #
IF CURRESP EQ AWTPID$ # RESET MAX PARAMETER LENGTH #
THEN
BEGIN
MAXCHAR = PIDMAXL$;
PTA$VPIDF[PT] = TRUE;
END
ELSE
BEGIN
MAXCHAR = MXCHAR$;
VL = VL + 1;
B<VL,1>PTA$VLTF[PT] = 1;
END
IF CURRESP LQ 0
THEN # REACHED MAX NUMBER OF PARAMS #
BEGIN # IGNORE REST OF INPUT #
ENDSCAN = TRUE; # EXIT LOOP #
END
END
END
END
CURRESP = CURRESP - 1; # NEXT EXPECTED RESPONSE #
END # END UNPACK #
END # END NVFTETI #
TERM