*DECK NVFCUPS USETEXT TEXTNVF USETEXT TXSMNVF USETEXT TEXTSS USETEXT TXTANVF USETEXT TXTAPSS USETEXT TXTSUSS PROC NVFCUPS; # TITLE - NVFCUPS - UPDATE PID STATUS # BEGIN # NVFCUPS # # ** NVFCUPS - UPDATE PID STATUS. * * C. BRION 83/04/21,83/10/19. * * THIS PROCEDURE IS RESPONSIBLE FOR PROCESSING THE LOGICAL LINK * STATUS SM FROM NIP. (CR/SLL/U SM ). * * PROC NVFCUPS * * ENTRY * CR/SLL/U SM IN MSGBUF. * * EXIT * 1) SETPIDA FUNCTION REQUEST MAY BE SENT TO THE CPMRQ. * 2) A HOP/LG SM MAY BE ISSUED TO REPORT PID STATUS CHANGE IN NHP LOGFILE. * 3) THE LLPID TABLE IS UPDATED. # # **** PROC NVFCUPS XREF LIST. # XREF BEGIN PROC NVFUMQE; # MAKE QUEUE ENTRY # END # **** # # * DEF, ITEM AND ARRAY DEFINITIONS. # DEF ACTIVE$ # 1 #; # ACTIVE LLINK STATUS # DEF INACTIVE$ # 0 #; # INACTIVE LLINK STATUS # ITEM NUMLL I; # NUMBER OF LLINKS FOR A PID # ITEM PORD I; # LOCAL PID ENTRY RWD # ITEM SAVACLL I; # SAVED NUMBER ACTIVE LLINKS # ITEM LLORD I; # LOCAL PATH RWD # # ** PIDMSG - PID NHP LOG FILE MESSAGE ARRAY. # ARRAY PIDMSG [00:00] S(5); BEGIN ITEM PUM$PFCSFC U(00,00,16) = [HOPLG]; ITEM PUM$MSG1 C(01,00,05) = ["PID: "]; ITEM PUM$PID C(01,30,03); ITEM PUM$MSG2 C(01,48,02) = [", "]; ITEM PUM$MSG3 C(02,00,10) = ["NHP PATH -"]; ITEM PUM$MSG4 C(03,00,11) = ["UNAVAILABLE"]; ITEM PUM$ZBYT U(04,06,54) = [0]; END # ** LLEPID - LOGICAL LINK ENTRY FROM PATHPID TABLE. # BASED ARRAY LLEPID [00:00] S(1); BEGIN ITEM LLE$WORD U(00,00,60); # WORD REFERENCE # ITEM LLE$DN U(00,00,08); # DESTINATION NODE OF LLINK # ITEM LLE$SN U(00,08,08); # SOURCE NODE OF LLINK # ITEM LLE$LLSTAT B(00,59,01); # LLINK STATUS # END CONTROL EJECT; # * SEARCH THE LLPID TABLE FOR A MATCH ON LOGICAL LINK. * NOTE THAT TABLE ONLY SEARCHED IF LLPID TABLE EXISTS. # IF LLPIDL NQ 0 THEN BEGIN FOR PORD = 0 STEP ((LLP$LLCNT[PORD] * PIDLLSIZ$) + 1) WHILE PORD LS LLPIDL DO BEGIN NUMLL = LLP$LLCNT[PORD] * PIDLLSIZ$; SAVACLL = LLP$ACLL[PORD]; FOR LLORD = 1 STEP PIDLLSIZ$ UNTIL NUMLL DO BEGIN P = P + PORD + LLORD; # * CHECK IF LLINK ENTRY ACTIVE AND INCOMING STATUS INACTIVE. * IF SO, MARK LLINK ENTRY INACTIVE AND DECREMENT NUMBER OF * LLINKS ACTIVE FOR THIS PID ENTRY. # IF CRSLDN[0] EQ LLE$DN[0] AND CRSLSN[0] EQ LLE$SN[0] THEN BEGIN IF LLE$LLSTAT[0] AND CRSLST[0] EQ INACTIVE$ THEN BEGIN LLE$LLSTAT[0] = FALSE; LLP$ACLL[PORD] = LLP$ACLL[PORD] - 1; END # * OTHERWISE CHECK IF LLINK ENTRY IS INACTIVE AND INCOMING * STATUS IS ACTIVE. * IF SO, SET LLINK ENTRY ACTIVE AND INCREMENT NUMBER OF * AVAILABLE LLINKS FOR THIS PID. # ELSE IF NOT LLE$LLSTAT[0] AND CRSLST[0] EQ ACTIVE$ THEN BEGIN LLE$LLSTAT[0] = TRUE; LLP$ACLL[PORD] = LLP$ACLL[PORD] + 1; END END END # * ISSUE SETPIDA FUNCTION REQUEST TO THE CPMRQ. * THIS DONE BY SETTING THE PARAMETER BLOCK AND MAKING * QUEUE ENTRY FOR THE CPMRQ. * ALSO SET UP HOP/LG MESSAGE. # P = LOC(MSGBUF[1]); LPI$WORD0[0] = 0; LPI$WORD1[0] = 0; LPI$FC[0] = SPIDAFC$; LPI$SIZE[0] = SPIDBUFS$; LPI$PID[0] = LLP$PNAME[PORD]; PUM$PID[0] = LLP$PNAME[PORD]; # * IF (NO LLINKS ACTIVE FOR PID PRIOR TO CURRENT STATUS SM AND * /AT LEAST 1 LLINK NOW ACTIVE) OR * (AT LEAST 1 LLINK ACTIVE PRIOR TO CURRENT STATUS SM AND * NO LLINKS NOW ACTIVE) * * ISSUE APPROPRIATE SETPIDA FUNCTION REQUEST TO CPMRQ # IF ((SAVACLL EQ 0 AND LLP$ACLL[PORD] NQ 0) OR (SAVACLL NQ 0 AND LLP$ACLL[PORD] EQ 0)) THEN BEGIN IF SAVACLL EQ 0 AND LLP$ACLL[PORD] NQ 0 THEN BEGIN # * AT LEAST 1 LLINK NOW ACTIVE MAKING PID AVAILABLE. * SET AVAILABLE STATUS IN FUNCTION REQUEST AND SET HOP/LG MSG. # LPI$NWST[0] = PIDOPST$; PUM$MSG4[0] = "AVAILABLE"; END ELSE BEGIN # * THE LAST ACTIVE LLINK FOR A PID HAS GONE INACTIVE MAKING * THE PID UNAVAILABLE. * SET UNAVAIALABLE STATUS IN FUNCTION REQUEST AND SET HOP/LG MSG. # LPI$NWST[0] = PIDINOP$; PUM$MSG4[0] = "UNAVAILABLE"; END # * GENERATE SETPIDA FUNCTION REQUEST Q ENTRY TO CPMRQ. * SEND HOP/LG SM MESSAGE TO OTQ. # NVFUMQE(P,LPIDBUF[0],APPTTX$,0,LPIDLEN$); NVFUMQE(P,PIDMSG[0],APPCMD,0,5); END END END END # NVFCUPS # TERM