*DECK BLDLLCB USETEXT AHEADER USETEXT APPSTAT USETEXT FREETAB USETEXT LLCB USETEXT MSGIDX USETEXT NBT USETEXT NHEADER USETEXT NIPDEF USETEXT PARAMS USETEXT PT USETEXT AT USETEXT SUPMSG USETEXT TNT USETEXT KDIS USETEXT KSTTAB USETEXT DUMPFLG USETEXT PIT PRGM BLDLLCB; # BUILD LOGICAL LINK CONTROL BLOCK # STARTIMS; # *1DC BLDLLCB * * 1. PROC NAME AUTHOR DATE * BLDLLCB E.T. WAN 81/03/28 * * 2. FUNCTIONAL DESCRIPTION * THIS ROUTINE BUILDS A LOGICAL LINK CONTROL BLOCK AND UPDATES * ITS HEADER. * ALSO, INFORM NVF ABOUT THE NEW LINK (FOR LID/PID) * * 3. METHOD USED * CALL MGETS TO GET BUFFER SPACE FOR THE LOGICAL LINK CONTROL * BLOCK AND UPDATE LIST POINTERS TO THE LLCB. * FILL IN THE HEADER OF THE LLCB. * SEARCH FOR MATCHING HOST NODE IN NBT WITH * DESTINATION NODE OF LOGICAL LINK. IF MATCHING * NBT ENTRY FOUND, THEN FILL IN LLCB ENTRY * INFORMATION. IF MATCHING ENTRY NOT FOUND * AND IN DEBUG MODE - ABORT NIP. UPDATE * K-DISPLAY STATUS INFORMATION IF NECESSARY. * UPDATE THE NUMBER OF LOGICAL LINKS IN THE TERMINAL NODE TABLE. * * 4. ENTRY PARAMETERS * PARAMS1 NETWORK BLOCK HEADER ADDRESS * PARAMS2 ADDRESS OF LOGICAL LINK CONTROL BLOCK * WHICH WILL LINK TO THE NEW CONTROL BLOCK * WITH ITS FORWARD POINTER. * IF NO SUCH A LLCB EXISTS, PARAMS2 IS ZERO. * * 5. EXIT PARAMETERS * * 6. COMDECKS CALLED * AHEADER * LLCB * NBT * NHEADER * NIPDEF * PARAMS * PT * SUPMSG * TNT * KDIS * OSSIZE * * 7. ROUTINES AND OVERLAYS CALLED * MGETS GET BUFFER SPACE * BLINK LINK A MESSAGE TO AN APPLICATION * OSCHAPP SCHEDULE APPLICATION * MGROW ALLOCATE EXTENDED BUFFER * OMSG OUTPUT DAYFILE MESSAGE * DAYTIME GET TIME IN DISPLAY * XTRACE TRACE CALLS * KADD ADD LINE TO STATUS DISPLY * KPUT UPDATE VALUE ON STATUS DISPLAY LINE * * 8. DAYFILE MESSAGES * "NIP INTERNAL ERROR - BLDLLCB" * * THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY SUBROUTINE * OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO * LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM. * * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY *CALL OSSIZE * * THIS OVERLAY IS CALLED BY NPREGLL. * # STOPIMS; # **** EXTERNAL ENTRY POINTS # XREF BEGIN PROC MGETS; # GET BUFFER SPACE # PROC BLINK ; PROC OSCHAPP ; LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL # PROC XTRACE; # RECORD TRACE # PROC MGROW ; # GROW TNT BUFFER # PROC MCLRIL ; # CLEAR INTERLOCK # PROC MSETIL ; # REQUEST INTERLOCK ROUTINE # PROC OMSG; # DAYFILE MESSAGE # PROC RELCONN ; # RELEASE CONNECTIONS # PROC BLDKWL; # FORMAT KWL TO ADD LLK TO STATUS DISPLAY # PROC DAYTIME ; CONTROL IFEQ DEBUG,1 ; PROC ABORT ; CONTROL FI ; END # * LOCAL VARIABLES # ITEM I; # LOOP CONTROL VARIABLE # ITEM IDXTN; # TNT WORD INDEX # ITEM INDX I ; ITEM BUFADDR ; ITEM NEWLLCB; # NEW LLCB # ITEM DTIME ; ITEM FOUND B ; ITEM KLGL U ; # POINTER TO STATUS DISPLAY BUFFER # ITEM KN U ; # INDEX INTO THE STATUS DISPLAY BUFFER # BEGIN # BLDLLCB # CONTROL IFEQ DEBUG,1 ; XTRACE("BLLCB") ; CONTROL FI; IF SHUTDOWN THEN GOTO RJMAIN; P = PARAMS1; # LOCATION OF NETWORK HEADER # P = P + NBHSIZE; # LOCATION OF REG/LL SM # IDXTN = SN[0]; # TNT ENTRY INDEX # MGETS(LLCBSIZE,NEWLLCB,TRUE); # GET SPACE FOR LLCB # IF IDXTN GR TNTBS[0] - TNTHSIZE THEN BEGIN # NEED TO GROW TNT # MSETIL(0) ; # REQUEST INTERLOCK TO ALL PIP # MGROW(P,IDXTN + TNTHSIZE,TRUE); PTTNT[0] = P ; # UPDATE THE POINTER TABLE # MCLRIL ; # CLEAR INTERLOCK REQUESTED # END # NEED TO GROW TNT # IF TNTNLL[IDXTN] NQ 0 # LLCB EXISTED BEFORE NEWLLCB IS CREATED # THEN BEGIN P = PARAMS2; # MOVE TO PREVIOUS LLCB # LLCBFP[0] = NEWLLCB; # LINK FORWARD PTR TO NEW LLCB # END ELSE BEGIN TNTTN[IDXTN] = SN[0]; # INSERT TERMINAL NODE # TNTLLAD[IDXTN] = NEWLLCB; # INSERT ADDRESS OF NEWLLCB # END; P = NEWLLCB; # MOVE TO NEW LLCB # IF ATACBA[NVFAN] NQ 0 THEN BEGIN # NVF ALREADY NETTED ON # # GET A BUFFER FOR MESSAGE TO INFORM NVF # MGETS( LCRSLL + ABHSIZE + BLKHSIZE , BUFADDR , TRUE ) ; # SET UP APPLICATION HEADER # P = BUFADDR + BLKHSIZE ; ABHABT[0] = APPCMD ; ABHACT[0] = CT60TRANS ; ABHTLC[0] = LCRSLL ; # SET-UP THE MESSAGE ITSELF # P = BUFADDR + ABHSIZE + BLKHSIZE ; # # PFCSFC[0] = CRSLL ; P = P ; # # CRSLDN [0] = SN[0] ; # DESTINATION NODE NUMBER # CRSLSN [0] = DN[0] ; # SOURCE NODE NUMBER # CRSLST [0] = 1 ; # LOGICAL LINK UP SIGNAL # # AND LINK MESSAGE TO NVF # BLINK ( BUFADDR,ATACBA[NVFAN]) ; # QUEUE TO NVF # OSCHAPP (ATACBA[NVFAN]) ; END # NVF ALREADY NETTED ON # # * FILL IN LOGICAL LINK CONTROL BLOCK HEADER. LLCB BLOCK SIZE HAS * BEEN FILLED IN BY MGETS. # LLCBID[0] = LLCBIDVALUE; # ID # # IF THIS NEW LLCB IS THE ONLY ONE IN THE LLCB RING THEN # # PARAMS2 MUST BE ZERO (NO PREVIOUS LLCB ), FORWARD POINTER # # AND BACKWARD POINTER ARE ZERO. # # IF THE NEW LLCB IS TO BE LINKED TO THE EXISTING RING # # FP IS ZERO AND BP IS PARAMS2, THE PREVIOUS LLCB # LLCBBP[0] = PARAMS2 ; # BACKWARD POINTER # LLCBFP[0] = 0 ; # FORWARD POINTER # LLCBHN[0] = DN[0]; # HOST NODE # LLCBTN[0] = SN[0]; # TERMINAL NODE # # LOOK FOR THE NBT THAT HAS THE HOST NUMBER MATCHING THE DN # FOUND = FALSE ; FOR I=0 STEP NBTFETNO WHILE (I LQ NBTMAXID) AND NOT FOUND DO BEGIN IF NBTHN[I] EQ DN[0] THEN BEGIN FOUND = TRUE ; INDX = I ; END END CONTROL IFEQ DEBUG,1 ; IF NOT FOUND THEN BEGIN D27M2[0] = "BLDLLCB"; OMSG(DFMSG27,0); # DAYFILE "NIP INTERNAL ERROR" # ABORT(0,0) ; END CONTROL FI ; I = INDX ; # * THE CORRESPONDING NBT ENTRY WAS FOUND. # LLCBNBTE[0] = NBTINDX[I]; # GET INDEX OF CORRECT NBT ENTRY # LLCBCS[0] = REGC; # CS INDICATOR # LLCBNS[0] = REGN; # NS INDICATOR # LLCBHH[0] = REGH; # HOST TO HOST FLAG # LLCBNPC[0] = 0; # NUMBER OF PRU CONNECTIONS # LLCBHRL[0] = HRL; # HOST REGULATION # LLCBNRL[0] = REGB; # NPU REGULATION # LLCBNC[0] = 0; # NUMBER OF CONNECTIONS # LLCBCMTC[0] = 0; # CURRENT MESSAGE TRANSFER COUNT # LLCBLMTC[0] = 0; # LAST MESSAGE TRANSFER COUNT # LLCBPITIDX[0] = NBTPIP[I]; # SAVE PIP NUM IN LLCB # DAYTIME(DTIME); LLCBCRTM[0] = DTIME ; IF KDST[0] THEN # STATUS DISPLAY ON, ADD LLK ENTRY TO DISPLAY # BLDKWL(KST"LLK",DN[0],SN[0],KADDIDVALUE); TNTNLL[IDXTN] = TNTNLL[IDXTN] + 1; # INCREMENT LINK NUMBER # GOTO RJMAIN; # RETURN TO CALLING PROGRAM # END # BLDLLCB # TERM