*DECK NP$GET
USETEXT AIPDEF
USETEXT HEADER
USETEXT NP$GETS
USETEXT NP$MODE
*IF DEF,XFR
USETEXT NX$ACBF
*ENDIF
USETEXT NP$NWL
USETEXT NP$STAT
USETEXT NP$TAA
*IF,DEF,DEBUG
USETEXT NP$DB
*ENDIF
PROC NP$GET;
*IF DEF,IMS
#
*
* 1. PROC NAME AUTHOR DATE
* NP$GET J.C. LEE 78/10/10
*
* 2. FUNCTIONAL DESCRIPTION
* THIS ROUTINE IS CALLED BY NETGET AND NETGETF TO BUILD A GET
* REQUEST IN THE NWL WORKLIST FOR A BLOCK FROM A SPECIFIED
* CONNECTION OR LIST IF THERE IS DATA FOR THE APPLICATION QUEUED
* IN NIP, OR TO DELIVER A SUPERVISORY MESSAGE IF IT
* IS A GET REQUEST ON CONNECTION/LIST ZERO AND SMB IS NOT EMPTY.
*
* 3. METHOD USED
* SEE DOCUMENTATION ON NETGET AND NETPUT.
*
* 4. ENTRY CONDITIONS
* ACLN - APPLICATION CONNECTION / LIST NUMBER.
* BS - WORKLIST ENTRY SIZE.
* IAM - ROUTINE CURRENTLY EXECUTING.
* LOC$HA - ADDRESS OF HEADER AREA.
* LOC$TA - ADDRESS OF TEXT ARRAY.
* NEXT - NEXT AVAILABLE SPACE POINTER IN WORKLIST.
* OPCODE - OPCODE VALUE.
* SPACE$LEFT - NUMBER OF CELLS AVAILABLE IN WORKLIST.
*
* 5. EXIT CONDITIONS
* DEFER$GSM - TRUE FOR ADR=0 IF SMB IS EMPTY.
* I$FLAG - TRUE IF INPUT DATA QUEUED IN NIP
* S$FLAG - TRUE IF A NON-EMPTY SMB OR SM QUEUED IN NIP
* LTAA - RESET TO ZERO.
* NEXT - RESET TO INITIAL VALUE IF NWL IS SENT TO NIP.
* SPACE$LEFT - RESET TO INITIAL VALUE IF NWL IS SENT TO NIP.
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* AIPDEF NP$CRT NP$DB NP$GETS
* NP$MODE NP$NWL NP$STAT
*
* 7. ROUTINES CALLED
* NP$ERR - ERROR PROCESSOR.
* NP$GSM - DELIVER A SUPERVISORY MESSAGE TO APPLICATION.
* NP$SEND - SEND NWL TO NIP.
* NP$SN - UPDATE STATISTICS COUNTERS.
* NP$UCV - UPDATE NWL CONTROL VARIABLES
* NP$USI - UPDATE S AND I BITS IN NSUP WORD
*
* 8. DAYFILE MESSAGES
* NETWORK APPLICATION ABORTED, RC = 31.
* NP$GET: REQUEST INVALID BEFORE NETON.
*
* NETWORK APPLICATION ABORTED, RC = 42.
* NP$GET: PREVIOUS REQUEST INCOMPLETE.
*
*
#
*ENDIF
BEGIN
*CALL NP$CRT
#
ROUTINES CALLED
#
XREF
BEGIN
PROC NP$ERR; # ERROR PROCESSOR #
PROC NP$GSM; # DELIVER A SM TO APP #
PROC NP$SEND; # SEND NWL TO NIP #
*IF DEF,STAT
PROC NP$SN; # INCREMENT STATISTICS COUNTERS#
*ENDIF
PROC NP$UCV; # UPDATE CONTROL VARIABLES #
PROC NP$USI; # UPDATE S AND I BITS IN NSUP #
*IF,DEF,XFR
PROC NP$ITMG ; # INTERCEPT MESSAGE #
*ENDIF
END
#
LOCAL VARIABLES
#
ITEM I I;
*IF,DEF,STAT
ITEM NULLBLK B; # SEND NULL BLOCK TO APP FLAG #
*ENDIF
*IF,DEF,XFR
ITEM TEMP$HA U ; # TEMP LOCATION FOR TRUE ABH #
ITEM TEMP$TA U ; # TEMP LOACTION FOR TRUE TEXT #
*ENDIF
#**********************************************************************#
#
NP$GET EXECUTION BEGINS HERE
#
*IF DEF,STAT
#
UPDATE STATISTICS IF STAT IS TURNED ON
#
NP$SN(IAM); # INCREMENT STATISTICS COUNTER #
*ENDIF
IF NOT ACCEPTED
THEN
NP$ERR("31"); # REQUEST INVALID BEFORE NETON. #
IF DEFER$PRO
THEN
NP$ERR("42"); # PREVIOUS REQUEST INCOMPLETE. #
*IF DEF,DEBUG
#
SET UP PARAMETERS FOR DEBUG MESSAGE LOGGING
#
DB$OP = OPCODE; # NWL OP CODE #
*ENDIF
#
HA IS INITIALIZED TO CONTAIN A NULL BLOCK HEADER
#
*IF,DEF,XFR
TEMP$HA = LOC$HA ; # SAVE THE TRUE APPL ABH #
TEMP$TA = LOC$TA ; # AND THE TRUE APPL TEXT AREA #
MSGFORAP = FALSE; # ASSUMING MSG NOT FOR APPL. #
FOR I = I WHILE NOT MSGFORAP # LOOP TO GET UNTIL OBTAIN A #
DO # MESSAGE FOR APPLICATION #
BEGIN
*ENDIF
I = NEXT + 1;
ABH[I] = 0;
ABH$ADR[I] = ACLN;
P<HEADER> = LOC$HA; # HEADER ADDRESS #
ABHWORD[0] = ABH[I];
#
IF THERE IS DATA QUEUED IN NIP FOR THIS APPLICATION, THEN
BUILD A GET WORKLIST ENTRY FOR A NON-ZERO ACN, OR FOR A LIST
ZERO REQUEST WHEN AIP"S SMB DOES NOT CONTAIN SUPERVISORY MSG.
#
IF HEAD NQ FOOT AND # AIP HAS SUP MSG QUEUED #
ACLN EQ 0 # APP WILL ACCEPT SUP MSG #
THEN # DELIVERED QUEUED SUP MSG #
BEGIN
NP$GSM; # GET SUPERVISORY MESSAGE #
END
ELSE # NEED TO GET MSG FROM NIP #
BEGIN
*IF,DEF,STAT
NULLBLK = TRUE; # INIT FLAG TO RETURN NULL BLOCK#
*ENDIF
IF NOT AIPQONLY
THEN # OKAY TO SEND WORKLIST TO NIP #
BEGIN
IF (ACLN EQ 0 ) AND
(SD$FLAG NQ 0)
THEN # SENT GETSM WORKLIST ONLY #
BEGIN
DEFER$GSM = TRUE; # SET DEFERRED GET SUP MSG FLAG #
*IF,DEF,STAT
NULLBLK = FALSE; # NOT RETURNING NULL BLOCK #
*ENDIF
END
ELSE # CHECK IF NIP HAS DATA TO GET #
BEGIN
IF ( (LIST ) AND
(WD$FLAG ) ) OR
( (NOT LIST ) AND
(ACLN NQ 0 ) AND
(ID$FLAG NQ 0) )
THEN # SEND GET/GETL WORKLIST TO NIP #
BEGIN
N$GETAWL[0] = 1; # AWL RESPONSE TO PROCESS #
NWL$ID[NEXT] = AWLID;
NWL$OP[NEXT] = OPCODE;
ABH$TLC[I] = 4095;
IF TLMX LS 4095
THEN # BUF LESS THAN MAXIMUM SIZE #
BEGIN
ABH$TLC[I] = TLMX;
END
#
UPDATE NWL HEADER AND CONTROL VARIABLES
#
NP$UCV;
*IF,DEF,STAT
NULLBLK = FALSE;
*ENDIF
END
END
END
#
SEND WORKLIST TO NIP
#
NP$SEND; # SEND WORKLIST #
*IF,DEF,STAT
IF NULLBLK
THEN # RETURN NULL BLOCK TO APP #
BEGIN
NP$SN(TYPE"INB"); # UPDATE AIP STATISTICS #
END
*ENDIF
END
#
UPDATE I, S, AND D BITS IN NSUP WORD
#
NP$USI;
*IF,DEF,XFR
#
IF FILE TRANSFER CONNECTION IS OUTSTANDING AND BLOCK RETURNED
IS NOT A NULL BLOCK AND IBU BIT NOT ON, THEN INTERCEPT THIS
BLOCK.
#
P<HEADER> = LOC$HA ; # HEADER OF NEW MESSAGE #
IF NUMFILEXFR NQ 0
AND ABHABT[0] NQ 0 # NOT A NULL BLOCK #
AND ABHIBU[0] NQ 1 # NOT IBU #
AND ABHADR[0] EQ 0 # SUPERVISORY MSG ONLY #
THEN
BEGIN
NP$ITMG ; # INTERCEPT THIS MESSAGE #
LOC$HA = TEMP$HA ; # RESTORE THE APPLICATION ABH #
LOC$TA = TEMP$TA ; # RESTORE THE APPLICATION TA #
OPCODE = OP$GET ;
*IF DEF,STAT,1
IAM = TYPE"GET" ;
END
ELSE
MSGFORAP = TRUE ; # MSG GOTTEN IS FOR APPLICATION#
NWL$TA[NEXT] = LOC$TA ;
END # LOOP TO GET #
*ENDIF
IF NOT DEFER$GSM
THEN
LTAA = 0;
RETURN;
END # NP$GET #
TERM