*DECK CSSAEN
USETEXT TEXTCS;
USETEXT TEXTSS;
USETEXT TXTSMCS;
USETEXT TXTAPSS;
USETEXT TXTSUSS;
USETEXT TXCMDCS;
PROC CSSAEN;
# TITLE CSSAEN - ACTION ENABLE COMMAND #
BEGIN # CSSAEN #
#
** CSSAEN - ACTION ENABLE COMMAND.
*
* C. BRION 82/05/18.
*
* THIS PROCEDURE PROCESSES THE RESOLVED ENABLE COMMAND AND SENDS
* THE APPROPRIATE SUPERVISORY MESSAGE TO AN NPU OR NPUS AND THE
* COMMAND TEXT IS LOGGED VIA A SUPERVISION EVENT.
*
* PROC CSSAEN
*
* ENTRY:
* HDRCMD = ONE WORD ARRAY THAT COMPRISES THE COMMAND HEADER WORD.
*
* PARMS = ARRAY THAT CONTAINS THE COMMAND TEXT STRING, THE SYNTAX
* PARAMETER LIST AND THE ADDRESS PARAMETER LIST.
*
* EXIT:
* AN ENABLE SUPERVISORY MESSAGE WILL HAVE BEEN SENT TO THE APPRO-
* PRIATE NPU(S).
*
* A SUPERVISION EVENT IS SENT IN ORDER TO LOG THE COMMAND.
*
* A NULL TERMINAL TEXT IS SENT TO THE ORIGIN OPERATOR IN ORDER TO
* CAUSE THE READY.. MESSAGE.
*
#
#
**** PROC CSSAEN XREF LIST.
#
XREF
BEGIN
PROC SSBEBF; # SS-EXTRACT BIT FLD #
PROC SSBSBF; # SS-STORE BIT FLD #
FUNC SSDCDA; # CONVERT DCD TO ASCII #
PROC MOVE; # MACREL MOVE CHARACTERS #
PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
END
#
****
#
#
#
DEF NPINDX # HDR$TXWCNT[0] + 3 # ; # INDEX FOR NPU #
#
* ENABLST - LIST OF ENABLE ELEMENTS.
#
STATUS ENABLST
TERM,
TERMS,
LINE,
LINES,
TRUNK,
TRUNKS,
LLINK,
LLINKS,
SVC;
#
* ITEMS
#
ITEM ELINDX U; # ELEMENT INDEX #
ITEM MOVECNT U; # WORD COUNT FOR MOVE #
ITEM ELMID S:ENABLST; # ELEMENT ID #
ITEM FINAPIX U;
ITEM BEGAPIX U;
ITEM I,Y U;
ITEM NPUORD U;
ITEM DORD,DBIT U;
ITEM AORD,ABIT U;
ITEM SINGCHAR U;
#
* BLDENSM - BUILD ENABLE SM SWITCH.
#
SWITCH BLDENSM:ENABLST
BLDTERM:TERM,
BLDTERMS:TERMS,
BLDLINE:LINE,
BLDLINES:LINES,
BLDTRUNK:TRUNK,
BLDTRUNKS:TRUNKS,
BLDLLINK:LLINK,
BLDLLINKS:LLINKS,
BLDSVC:SVC;
ARRAY IGNOREMSG S(7) ;
BEGIN
ITEM IGMSGW U(00,00,60) ;
ITEM IGMSG1 C(00,00,26) =[" COMMAND IGNORED- VERSION "] ;
ITEM IGMSG2 U(02,36,24) ;
ITEM IGMSG3 C(03,00,30) =
[" CCP UNABLE TO ACTION COMMAND "] ;
ITEM IGMSG4 U(06,00,60) =[0] ;
END
#
* INITIALIZE LOCAL VARIABLES AND THE OUTGOING SM HEADER AND BODY
* STORAGE AREAS.
#
ABHWORD[1] = 0;
WCB$WORD[1] = 0;
SPMSG0[1] = 0;
PFC[1] = ENB; # SET ENABLE SM PFC #
ELINDX = HDR$TXWCNT[0] + 1; # SET PARAMETER INDEX FOR #
# ELEMENT TO NOP KEYWORD #
#
* IF THE NOP KEYWORD IS PRESENT IN THE SYNTAX PARAMETER LIST, THEN
* THE ELEMENT INDEX MUST BE MOVED.
#
IF PAR$PCODE[ELINDX] EQ "NOP"
THEN
ELINDX = ELINDX + 1;
#
* ELINDX IS SET TO POINT TO THE COMMAND ELEMENT THAT IS TO BE
* ENABLED. EITHER ONE OF A TERMINAL, TERMINALS ON A LINE, TERMINALS
* ON A NPU, LINE, LINE ON A NPUS, TRUNK, TRUNKS ON A NPU, A
* LOGICAL LINK, OR A ARCHETYPE SVC MAY BE THE ELEMENT TYPE TO
* BE ENABLED.
*
* SET THE LOCAL ELEMENT IDENTIFIER BASED ON THE VALUE OF THE ELE-
* MENT KEYWORD.
*
* NOTE THAT ONLY THE SECOND CHARACTER OF THE KEYWORD IS UNIQUE AND
* IS CHECKED FOR THE "SINGLE" TYPE OF ELEMENT.
*
#
IF PAR$PCHR2[ELINDX] EQ "E" # TERMINAL (S) #
THEN
ELMID = ENABLST"TERM";
ELSE IF PAR$PCHR2[ELINDX] EQ "I" # LINE (S) #
THEN
ELMID = ENABLST"LINE";
ELSE IF PAR$PCHR2[ELINDX] EQ "R" # TRUNK (S) #
THEN
ELMID = ENABLST"TRUNK";
ELSE IF PAR$PCHR2[ELINDX] EQ "C" # ARCHETYPE SVC #
THEN
ELMID = ENABLST"SVC";
ELSE # MUST BE LOGICAL LINK (S) #
ELMID = ENABLST"LLINK";
#
* NOW, CHECK TO SEE IF THE ENABLE COMMAND IS FOR A GROUP OF ELEMENT
* TYPE TERMINALS, LINES, OR TRUNKS BY CHECKING THE THIRD CHARACTER
* OF THE KEYWORD.
*
* IF MULTIPLE IS INDICATED, SIMPLY BUMP THE ELMID VALUE TO SET THE
* APPROPRIATE INTERNAL IDENTIFIER.
#
IF PAR$PCHR3[ELINDX] EQ "S"
THEN
ELMID = ELMID + 1;
#
* SET THE BEGINNING AND ENDING ADDRESS PARAMETER LIST INDEX VALUES
* SO AS TO INDICATE THE LOCATION OF THE ADDRESS PARAMETERS IN THE
* PARMS ARRAY.
#
BEGAPIX = HDR$TXWCNT[0] + HDR$SPCNT[0];
IF HDR$APCNT[0] EQ 0
THEN
BEGIN
FINAPIX = BEGAPIX;
END
ELSE
BEGIN
FINAPIX = HDR$TXWCNT[0] + HDR$SPCNT[0] + HDR$APCNT[0] - 1;
END
#
* SEARCH THE ADDRESS PARAMETER LIST FOR EACH OCCURRENCE OF THE NPU
* ORDINAL KEYWORD "NOR". AFTER EACH NPU ORDINAL KEYWORD, THE
* APPROPRIATE ELEMENT ADDRESS PARAMETER VALUE WILL BE FOUND.
*
* SET UP THE COMMON OUTGOING SM FIELDS AND BRANCH TO THE PROPER
* CASE TO BUILD THE ENABLE SM BASED ON THE PREVIOUSLY DETERMINED
* INTERNAL ELEMENT IDENTIFIER.
#
FOR I = BEGAPIX STEP 1 UNTIL FINAPIX
DO
BEGIN
IF PAR$PCODE[I] EQ "NOR" OR
PAR$PCODE[NPINDX] EQ "NPS"
THEN
BEGIN
GOTO BLDENSM[ELMID];
BLDTERM: # BUILD ENABLE TERMINAL SM #
#
* CONVERT THE TERMINAL NAME (DISPLAY CODE) PARAMETER VALUE TO THE
* ASCII FORMAT FOR INSERTION INTO THE SM TO THE NPU.
#
DORD = ELINDX;
DBIT = 0;
AORD = 1;
ABIT = 4;
FOR Y = 1 STEP 1 UNTIL 7
DO
BEGIN
SSBEBF(PARMS[0],DORD,DBIT,6,SINGCHAR); # EXTRACT 6 BITS #
SINGCHAR = SSDCDA(SINGCHAR);
SSBSBF(CSSM[1],AORD,ABIT,8,SINGCHAR); # STORE 8 BITS #
END
ENBP[1] = PAR$ELADDR[I+1]; # SET LINE NUMBER IN SM #
SFC[1] = TE;
ABHTLC[1] = NENBTE;
WCB$SMID[1] = SMID"ENBTE";
WCB$WC[1] = LENBTE + 2;
GOTO SENDSM;
BLDTERMS: # ENABLE TERMINALS SM #
#
* TERMINALS ON A LINE OR ON A NPU MAY BE REQUESTED. IF ON A LINE,
* THEN THE PORT NUMBER OF THE LINE MUST BE SET IN THE SM. OTHER-
* WISE, THE PORT NUMBER MUST BE ZERO.
#
IF PAR$PCODE[ELINDX+1] EQ "LI0"
THEN
ENBP[1] = PAR$ELADDR[I+1];
SFC[1] = TE;
ABHTLC[1] = NENBTE;
WCB$SMID[1] = SMID"ENBTE";
WCB$WC[1] = LENBTE + 2;
GOTO SENDSM;
BLDLINE: # ENABLE LINE OR LINES #
BLDLINES:
#
* IF SINGLE LINE TO BE ENABLED THEN THE PORT NUMBER OF THE LINE
* MUST BE SET IN THE SM. OTHERWISE, THE PORT NUMBER IS ZERO WHICH
* MEANS THAT ALL LINES ON THE NPU ARE TO BE ENABLED.
#
SFC[1] = LI;
IF PAR$PCHR3[ELINDX] NQ "S"
THEN
ENBP[1] = PAR$ELADDR[I+1];
ABHTLC[1] = NENBLI;
WCB$SMID[1] = SMID"ENBLI";
WCB$WC[1] = LENBLI + 2;
GOTO SENDSM;
BLDTRUNK: # ENABLE TRUNK OR TRUNKS #
BLDTRUNKS:
#
* IF ONLY A SINGLE TRUNK IS TO BE ENABLED, THEN THE PORT OF THE
* TRUNK ON THE NPU MUST BE SET IN THE SM.
#
SFC[1] = TR;
IF PAR$PCHR3[ELINDX] NQ "S"
THEN
ENBP[1] = PAR$ELADDR[I+1];
IF PAR$PCODE[ELINDX+1] EQ "LD0"
THEN
BEGIN # LD PARAM SPECIFIED #
IF V24FLAG
THEN
# RUNNING WITH 2.4 CCP #
ENBLDF[1] = TRUE ; # SET LAOD FLAG #
ELSE
BEGIN # NOT RUNNING WITH 2.4 CCP #
ABHWORD[1] = 0 ;
ABHADR[1] = AUDGR4$ ;
ABHTLC[1] = 6 ;
IGMSG2[0] = CCPVERS ; # STORE VERSION TO MSG #
WCB$WC[1] = 8 ;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],IGMSGW[0]) ;
RETURN ;
END
END # LD PARAM IS SPECIFIED #
ABHTLC[1] = NENBTR;
WCB$SMID[1] = SMID"ENBTR";
WCB$WC[1] = LENBTR + 2;
GOTO SENDSM;
BLDLLINK: # ENABLE LLINK OR LLINKS #
BLDLLINKS:
#
* IF A SINGLE LOGICAL LINK IS TO BE ENABLED, THEN THE NODE NUMBERS
* OF THE LOGICAL LINK MUST BE SET IN THE SM FOR THE NPU.
#
SFC[1] = LL;
IF PAR$PCHR3[ELINDX] NQ "S"
THEN
BEGIN
ENBN1[1] = PAR$LLNID1[I+1];
ENBN2[1] = PAR$LLNID2[I+1];
END
ABHTLC[1] = NENBLL;
WCB$SMID[1] = SMID"ENBLL";
WCB$WC[1] = LENBLL + 2;
GOTO SENDSM;
BLDSVC: # ENABLE ARCHETYPE SVC #
#
CONVERT THE DISPLAY CODE ARCHETYPE NAME TO ASCII
#
DORD = ELINDX; # BITFIELD START POSITION #
DBIT = 0;
AORD = 1;
ABIT = 4;
FOR Y = 1 STEP 1 UNTIL 5
DO
BEGIN
SSBEBF(PARMS[0],DORD,DBIT,6,SINGCHAR); # EXTRACT BITFIELD #
SINGCHAR = SSDCDA(SINGCHAR);
SSBSBF(CSSM[1],AORD,ABIT,8,SINGCHAR); # STORE BITFIELD #
END
ENBP[1] = PAR$ELADDR[I+1]; # SET PORT NUMBER IN SM #
FOR Y = ELINDX STEP 1 UNTIL BEGAPIX
DO
BEGIN
IF PAR$PCODE[Y] EQ "NC0" # FOUND NCIR PARAMETER CODE #
THEN
ENBNC[1] = PAR$NCIR[Y]; # SET NO. OF SVCS TO ENABLE #
END
ENBBL[1] = X"2020"; # INSERT TWO BLANKS #
SFC[1] = VC;
ABHTLC[1] = NENBVC; # LENGTH IN CHAR #
WCB$SMID[1] = SMID"ENBVC";
WCB$WC[1] = LENBVC + 2;
GOTO SENDSM;
SENDSM:
#
* SET UP THE ABH WORD. IF -NPUS- WAS SPECIFIED, THEN FOR EACH
* NPU THAT IS SUPERVISED, SEND THE ENABLE REQUEST. IF -NPUS-
* WAS NOT SPECIFIED, THEN SEND THE MESSAGE TO THE NPU.
#
ABHABT[1] = APPSUP;
ABHBT[1] = APPSUP;
ABHACT[1] = ACTCSNP$;
IF PAR$PCODE[NPINDX] EQ "NPS"
THEN
BEGIN
FOR Y=0 STEP 1 WHILE Y LS CSNPCNT
DO
BEGIN
IF NPU$STAT[Y] EQ SUPSTAT"SUP"
THEN
BEGIN
IF HDR$OPORD[0] EQ HOPORD$ OR
HDR$OPORD[0] EQ NPU$CNOP[I]
THEN
BEGIN
ABHDN[1] = NPU$NID[Y];
ABHSN[1] = NPU$HID[Y];
SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
END
END
END
END
ELSE
BEGIN
NPUORD = PAR$ORD[I];
ABHDN[1] = NPU$NID[NPUORD];
ABHSN[1] = NPU$HID[NPUORD];
SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
END
END # IF PAR$PCODE EQ NOR #
END # FOR I LOOP #
#
* THE COMMAND MUST BE LOGGED BY MOVING THE COMMAND TEXT AND OPER-
* ATOR TERMINAL NAME INTO THE CMDTEXT MESSAGE ARRAY AND QUEUING
* IT TO THE EVENT QUEUE AS A CMDTXT ENTRY.
#
WCB$WORD[1] = 0;
WCB$SMID[1] = SMID"CMDTXT";
ABHWORD[1] = 0;
CMD$TNAM[0] = OC$TNAM[HDR$OPORD[0]];
#
* MOVE THE COMMAND TEXT.
#
P<MSCMD> = LOC(CMD$TEXT[0]); # SET UP FOR TEXT MOVE #
MOVECNT = HDR$TXWCNT[0];
MOVE(MOVECNT,PARMS[0],MSCMD[0]);
WCB$WC[1] = HDR$TXWCNT[0] + 4;
ABHTLC[1] = (HDR$TXWCNT[0] + 2) * 10;
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CMDLINE[0]);
#
* THE NULL TERMINAL TEXT TO ALLOW THE READY.. MESSAGE TO BE SENT
* NEEDS TO BE GENERATED.
#
ABHWORD[1] = 0;
WCB$WORD[0] = 0;
WCB$WC[1] = 2;
WCB$SMID[1] = SMID"TTEXT";
ABHADR[1] = HDR$OPORD[0];
ABHTLC[1] = 0;
WCB$IAF[1] = TRUE;
SSTAQE(P<CNQ>,WCBUF[1],ABH[1],CSSM[1]);
END # CSSAEN #
TERM