*DECK NETDBG USETEXT AIPDEF USETEXT NP$DB USETEXT NP$MODE USETEXT NP$NWL PROC NETDBG ((OPT1),(OPT2),DBSTAT); *IF,DEF,IMS # *1DC NETDBG * * 1. PROC NAME AUTHOR DATE * NETDBG J. P. YOUNG 77/04/08 * * 2. FUNCTIONAL DESCRIPTION * PROCESSES THE NETDBG CALL FROM AN APPLICATION. THE DEBUG * OPTIONS ARE SET AS SPECIFIED WHEN AIP IS COMPILED WITH * *DEFINE,DEBUG. OTHERWISE STATUS IS RETURNED INDICATING THE * DEBUG OPTION IS NOT AVAILABLE (STATUS = 1). * * 3. METHOD USED * MOST OF THE LOGIC IN THIS PROCEDURE IS CONDITIONALLY COMPILED. * WHEN *DEFINE,DEBUG IS NOT USED, STATUS IS SET EQUAL TO 1 AND * CONTROL IS RETURNED TO CALLER. WHEN *DEFINE,DEBUG IS USED, * DB$SM IS SET TRUE IF OPT1 = 0 OR FALSE OTHERWISE. DB$DM IS * SET TRUE IF OPT2 = 0 OR FALSE OTHERWISE. STATUS IS SET EQUAL * TO ZERO. THE CALL TO NETDBG IS LOGGED ON FILE ZZZZZDN. * WHEN DEBUG OPTION IS DEFINED A TWO WORD ENTRY IS WRITTEN TO * THE DEBUG LOG FILE. * WORD 0 * 2 * 0 4 * I-------------------------I----------------I * I I I * I SECONDS SINCE DEADSTART I MILLISECONDS I * I I I * I-------------------------I----------------I * * WORD 1 * 2 4 5 * 0 1 2 4 2 3 * I--------I--------I-----I---------I----I--------I * I I I I I I I * I DB$SMF I DB$DMF I I DB$CAL I I DB$OPC I * I I I I I I I * I--------I--------I-----I---------I----I--------I * * DB$SMF - SUPERVISORY MESSAGE LOGGING * =1 IF ON * DB$DMF - DATA MESSAGE LOGGING * =1 IF ON * DB$CAL - CALLING ADDRESS * DB$OPC - NETDBG OPCODE (=20) * * * 4. ENTRY CONDITIONS * OPT1 = 0 LOG SUPERVISORY MESSAGES, EXCEPT FC/ACK * NOT 0 NO LOGGING OF SUPERVISORY MESSAGES * OPT2 = 0 LOG DATA MESSAGES AND FC/ACK * NOT 0 NO LOGGING OF DATA MESSAGES * * 5. EXIT CONDITIONS * DBSTAT = 0 DEBUG OPTION AVAILABLE * = 1 DEBUG OPTION NOT AVAILABLE (I.E. AIP LOADED WAS * NOT COMPILED WITH *DEFINE,DEBUG) * DB$SM AND DB$DM (COMMON BLOCK NP$DB) ARE SET TRUE OR FALSE * AS REQUESTED * * 6. COMDECKS CALLED AND SYMPL TEXTS USED. * AIPDEF NP$CRT * NP$DB NP$DBA NP$MODE NP$NWL * * 7. PROCEDURES/FUNCTIONS CALLED * NP$PIOE - PROCESS I/O ERROR ON DEBUG LOG FILE * NP$RTIM - RETURNS CURRENT TIME FROM DEADSTART IN SECONDS * AND MILLISECONDS * NP$WRTW - WRITES WORDS TO FILE - NOS DATA TRANSFER MACRO * NP$ERR - DAYFILE ERROR MESSAGE AND ABORT. * * 8. DAYFILE/DIAGNOSTIC MESSAGES * NETWORK APPLICATION ABORTED, RC = 34. * NETDBG: REQUEST INVALID BEFORE NETON. * # *ENDIF BEGIN *CALL NP$CRT # PARAMETERS # # # ITEM OPT1; # LOG SUPERVISORY MESSAGE OPTION # ITEM OPT2; # LOG DATA MESSAGE OPTION # ITEM DBSTAT; # DEBUG AVAILABILITY STATUS RETURNED # XREF BEGIN PROC NP$PIOE; # PROCESS I/O ERROR # PROC NP$WRTW; # WRITES WORDS TO DEBUG LOG # PROC NP$RTIM; # REAL TIME # PROC NP$ERR; # DAYFILE ERROR. # END *IF,DEF,DEBUG CONTROL LIST; # NETDBG USES VARIABLE NSUPWRD.# # LOCAL VARIABLES # ITEM TIMEWD U; # REAL TIME SINCE DEADSTART # ARRAY DBGLOG P(2); # LOG NETDBG CALL # *CALL NP$DBA *ENDIF #**********************************************************************# # NETDBG EXECUTION BEGINS HERE # ENTRY PROC QTDBG((OPT1),(OPT2),DBSTAT); # QTRM ENTRY PT FOR PROC # # # # INITIALIZE STATUS # *IF,-DEF,DEBUG DBSTAT = 1; *ENDIF *IF,DEF,DEBUG DBSTAT = 0; *ENDIF IF NOT ACCEPTED THEN NP$ERR("34"); # REQUEST INVALID BEFORE NETON. # *IF,DEF,DEBUG # SET DEBUG OPTIONS # IF OPT1 EQ 0 THEN DB$SM = TRUE; ELSE DB$SM = FALSE; IF OPT2 EQ 0 THEN DB$DM = TRUE; ELSE DB$DM = FALSE; # FORMAT LOG FILE ENTRY # P = LOC(NETDBG); # GET CALL ADDRESS # NP$RTIM(TIMEWD); # REAL TIME SINCE DEADSTART # DB$TIME[0] = TIMEWD; DB$SMF[0] = DB$SM; DB$DMF[0] = DB$DM; DB$CAL[0] = CALLADDR[0]; DB$OPC[0] = OP$DBG; NP$WRTW (DB$FET,DBGLOG,2); # NSUPWRD BASED ARRAY POINTER TO THE USER COMMUNICATION WORD WAS SET BY NETON. THE ARRAY IS LOCATED IN NP$NWL COMDECK. UPDATE MSGCNT IN NSUP COMMUNICATION WORD. # MSGCNT[0] = MSGCNT[0] + 1; # CHECK FOR I/O ERROR IN DEBUG LOG FILE # IF FET$AT[0] NQ 0 THEN # I/O ERROR HAS OCCURRED ON FILE# BEGIN NP$PIOE(DB$FET); # PROCESS I/O ERROR # END *ENDIF END # NETDBG # TERM # NETDBG #