*DECK BLDACNB
USETEXT NIPDEF
USETEXT ACNT
USETEXT ACNB
USETEXT ACB
USETEXT AT
USETEXT MSGIDX
USETEXT NCNB
USETEXT OVERLAY
USETEXT PARAMP
USETEXT PT
USETEXT KDIS
USETEXT KHDRX
USETEXT SUPMSG
USETEXT SYSTIME
PROC BLDACNB; # BUILD ACNB #
STARTIMS;
#
*1DC BLDACNB
* 1. PROC NAME AUTHOR DATE
* BLDACNB C. BITTNER 81/03/12
*
* 2. FUNCTIONAL DESCRIPTION
* CREATE ACNB AND UPDATE ASSOCIATED HEADER AND ENTRY
* PARAMETERS. ALSO UPDATE ACNT ENTRY.
*
* 3. METHOD
* ALLOCATE A CONNECTION NUMBER.
* CHECK IF APPLICATION CONNECTION TABLE (ACNT) IS FULL.
* IF FULL, REQUEST FOR AN EXTENDED BUFFER (CALLING MGETS)
* AND UPDATE ACNT ADDRESS IN ACB. UPDATE ACNT HEADER
* AND INITIALIZE ENTRY PARAMETERS. REQUEST A
* BUFFER FOR THE APPLICATION CONNECTION BLOCK(ACNB).
* FILL IN INFORMATION FOR ACNB AND LINK TO ACNT AND NCNB.
* UPDATE TOTAL NUMBER OF CONNECTIONS CURRENTLY HELD BY
* THIS APPLICATION IN THE ACB.
*
* 4. ENTRY PARAMETERS
* PARAMP1 - ADDRESS OF SM BUFFER (TEXT) ICN/TE/R
* PARAMP2 - ACB ADDRESS
*
* 5. EXIT PARAMETERS
* PARAMP3 - ACNB ADDRESS
* PARAMP4 - ACNT ADDRESS
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED
* ACNT NIPDEF
* ACNB ACB
* AT
* MSGIDX NCNB
* PARAMP PARAMS
* PT SUPMSG
* SYSTIME
*
* 7. ROUTINES AND OVERLAYS CALLED
* MGROW - EXPAND BUFFER
* MGETS - ALLOCATE A BUFFER
* HALLOCN - ALLOCATE CONNECTION NUMBER
* OMSG - OUTPUT DAYFILE MESSAGE
* OVLCALL - LOAD AND EXECUTE OVERLAY
* RDUMP - DUMP NIP
* XTRACE - RECORD PROCEDURE CALL
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
* "NIP INTERNAL ERROR - BLDACNB"
* THIS PROCEDURE IS CALLED BY PRIMARY OVERLAY STRTCON VIA
* HCSTTP.
*
*
#
STOPIMS;
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC HALLOCN ;
PROC KPUT ;
PROC MGETS; # ALLOCATE A BUFFER #
PROC MGROW; # EXPAND BUFFER #
PROC OMSG; # DAYFILE MESSAGE #
PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
PROC ABORT ;
PROC XTRACE; # RECORD PROCEDURE CALLS #
END
#
INTERNAL VARIABLES
#
ITEM ACNBADDR; # ACNB ADDRESS #
ITEM ACNTINDX; # INDEX INTO ACNT #
ITEM FLAG; # FLAG RET IF MOVE SUCCESSFUL - MGROW #
ITEM INDX; # INDUCTION LOOP VARIABLE #
ITEM SIZE ;
ITEM ACNX; # APPLICATION CONNECTION NUMBER #
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("BACNB") ;
CONTROL FI;
P<ACB> = PARAMP2;
HALLOCN(P<ACB>,ACNX); # ALLOCATE NEW CONNECTION NUMBER #
ACBNCN[0] = ACBNCN[0] + 1 ; # UPDATE NUMBER OF CONN TO APP#
IF KDIS$RT
AND ACBKNDX[0] NQ 0
AND ACBKNDX[0] GQ KDAPPST[0]
AND ACBKNDX[0] LQ KDAPPND[0]
THEN
KPUT(KHDRNP[0],ACBKNDX[0]-KDAPPST[0],KPAPNCN,ACBNCN[0]);
P<ACNT> = ACBACNT[0]; # BASE ACNT #
ACNTINDX = ACNX + ACNTHSIZE - ACNTMINACN[0]; # ACNT INDX #
# BUILD ACNB #
IF PARAMP1 EQ 0
THEN
SIZE = ACNBSIZE + ACNBAPEN ;
ELSE
SIZE = ACNBSIZE ;
MGETS(SIZE,ACNBADDR,TRUE); # ALLOCATE ACNB BUFFER #
P<ACNB> = ACNBADDR; # BASE ACNB #
ACNBID[0] = ACNBIDVALUE; # SET ID OF ACNB #
ACNBAN[0] = ACNTAN[0]; # APPLICATION NUMBER #
ACNBACN[0] = ACNX; # APPLICATION CONNECTION NUMBER #
ACNBD[0] = ATT[ACNBAN[0]]; # DATA TRUNCATION FLAG #
ACNBH[0] = ATH[ACNBAN[0]]; # HALF DUPLEX FLAG #
ACNBTLO[0] = ATDIS[ACNBAN[0]]; # TEMP LIST OFF FLAG #
ACNBTIMERP[0] = ACBTIMERP[0]; # SET APP SPECIFIED TIMEOUT FLAG #
ACNBTIMERF[0] = ACBTIMERP[0]; # SET APP SPECIFIED TIMEOUT FLAG #
IF ACNBTIMERP[0]
THEN # APP SPECIFIED TIMEOUT INTERVAL #
BEGIN
ACNBTIMER[0] = ACBTIMER[0]; # SAVE TIMEOUT INTERVAL IN ACNB #
ACNBINACT[0] = RTSECS[0] + ACNBTIMER[0]; # TIMEOUT RTIME VALUE#
END
ELSE # USE NETWORK TIMEOUT INTERVAL #
BEGIN
ACNBINACT[0] = RTSECS[0] + INACTVAL; # TIMEOUT RTIME VALUE #
END
ACNBINTR[0] = 0 ; # CLEAR INTERUPT CHARACTER #
IF PARAMP1 NQ 0 # REQUEST TRIGGERED FROM NETWORK SIDE #
THEN
BEGIN
P<SUPMSG> = PARAMP1 ;
P<SMNIP> = PARAMP1; # BASE SM TEXT ICN/TE/R #
IF PFCSFC[0] EQ ICNTE
THEN
ACNBABL[0] = ICNABL[0]; # SET ABL FROM ICN/TE/R #
ACNBNCNB[0] = NCNBADD; # LINK NCNB ADDRESS #
P<NCNB> = NCNBADD;
CONTROL IFEQ DEBUG,1;
IF P<NCNB> EQ 0
THEN
BEGIN
D27M2[0] = "BLDACNB";
OMSG(DFMSG27,0); # DAYFILE "NIP INTERNAL ERROR" #
ABORT(0,0) ;
END
CONTROL FI;
NCNBACNB[0] = P<ACNB>; # LINK ACNB ADDRESS #
ACNBDT[0] = NCNBDT[0]; # DEVICE TYPE #
ACNBTC[0] = NCNBTC[0]; # TERMINAL CLASS #
END
ACNTACNB[ACNTINDX] = ACNBADDR; # LINK ACNB ADDR IN ACNT #
# SET EXIT PARAMETERS #
PARAMP3 = ACNBADDR; # ACNB ADDRESS #
PARAMP4 = P<ACNT>; # ACNT ADDRESS #
RETURN ;
END
TERM