*DECK NXBLINK
USETEXT NIPDEF
USETEXT BPIPBUF
USETEXT DBGBUF
USETEXT DRHDR
USETEXT PT
USETEXT NBT
USETEXT SYSTIME
USETEXT SUPMSG
USETEXT STATTAB
USETEXT AHEADER
USETEXT NHEADER
USETEXT MSGIDX
USETEXT PARAMS
USETEXT OVERLAY
USETEXT INPARUT
USETEXT KDIS
PROC NXBLINK(BUFADDR,PIPINDEX);
STARTIMS;
#
*1DC NXBLINK
* 1. PROC NAME AUTHOR DATE
* NXBLINK L.T.NGUYEN 82/06/16
*
* 2. FUNCTIONAL DESCRIPTION:
*
* LOG MESSAGE INTO TRACE FILE, AND LINK IT TO APPROPRIATE
* PIPOUT.
*
* 3. METHOD USED:
* UPDATE STATISTIC.
* LOG MESSAGE TO TRACE FILE
* LINK TO PIP OUT.
*
* 4. INPUT MASSAGE:
* BUFADDR - ADDRESS OF BUFFER TO BE LOGGED AND LINKED.
* PIPINDEX- INDEX TO CORRECT PIPOUT IN NBT.
*
* 5. EXIT PARAMS:
* NONE.
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED
* NIPDEF BPIPBUF DBGBUF
* DRHDR NBT SYSTIME
* SUPMSG STATTAB NHEADER
*
* 7. ROUTINES CALLED
* OPITRCE INITIALIZE NIP DEBUG LOG FILE
* OPRETN RETURN FILE
* TWRITE - COPY BUFFER INTO TRACE FILE.
* XTRACE - RECORD FOR EASY TRACE.
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
* THIS ROUTINE IS CALLED BY NFOB AND NLOBCH.
*
#
STOPIMS;
#
XREF
#
XREF PROC OPITRCE; # INITIALIZE NIP DEBUG LOG FILE #
XREF PROC OPRETN; # RETURN FILE #
XREF PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
XREF PROC TWRITE ;
XREF PROC XTRACE ;
#
INPUT PARAMS
#
ITEM BUFADDR ;
ITEM PIPINDEX ;
ITEM INBUF ;
CONTROL EJECT ;
BEGIN # NXBLINK #
P<DRHDRWD> = 0 ;
OUTREL = TRUE ; # LATER ON WE HAVE TO EMPTY BUFFERS #
CONTROL IFEQ DEBUG,1;
XTRACE("NXBLK") ;
TIMESECS[0] = RTSECS[0]; # REAL TIME NETWORK HAS BEEN UP #
BPIPOTW[BPIPOTP] = TIMEWORD[0]; # STORE TIME IN DEBUG BUFFER #
BPIPOTP = BPIPOTP + 1; # INCREMENT BUFFER OFFSET PTR #
IF BPIPOTP GR 999
THEN # END OF BUFFER REACHED #
BPIPOTP = 0; # RESET OFFSET PTR TO START #
#
COPY OUTBOUND DATA BLOCKS TO DEBUG BUFFER
#
P<TRAP> = 0;
FOR TRAPINDEX = 0 STEP 1 UNTIL BLKBS[BUFADDR] - 1
DO
BEGIN
BPIPOTW[BPIPOTP] = WORD[BUFADDR+TRAPINDEX];
BPIPOTP = BPIPOTP + 1; # INCREMENT BUFFER OFFSET PTR #
IF BPIPOTP GR 999
THEN # END OF BUFFER REACHED #
BPIPOTP = 0; # RESET OFFSET PTR TO START #
END # TRACE COPY #
CONTROL FI;
BLKID[BUFADDR] = POBIDVALUE ; # NON MOVABLE BUFFER #
BACKPTR[BUFADDR] = 0 ; # ID FOR PIP OUTBOUND #
NEXTPTR[BUFADDR] = 0 ;
CONTROL IFEQ ZZDN,1;
P<NHEADER> = BUFADDR + BLKHSIZE ; # NETWORK BLOCK HEADER #
P<SUPMSG> = P<NHEADER> + NBHSIZE ;
IF BT[0] NQ NETCMD # NOT COMMAND BLOCK #
OR PFC[0] NQ NPU # NOT NS DUMP/LOAD MESSAGE #
OR PFCSFC[0] EQ NPUIN
THEN
BEGIN
IF KNAMLB[0]
THEN # FLAG SET TO LOG NETWORK TRAFFIC #
BEGIN
TWRITE(BPFET,BUFADDR,BLKBS[BUFADDR]); # LOG MSG #
MSGCNT = MSGCNT + 1; # INCREMENT COUNT OF MESSAGES #
IF BPAT[0] NQ 0
THEN # I/O ERROR HAS OCCURRED ON DEBUG LOG FILE#
BEGIN
OPRETN(BPFET); # RETURN BAD FILE #
OPITRCE(ZNRF1,0); # REINITIALIZE DEBUG LOG FILE #
END
END
END
CONTROL FI;
CONTROL IFEQ STAT,1; # STATISTICS ON #
P<NHEADER> = BUFADDR + BLKHSIZE ;
IF BT[0] LQ NETMSG
OR BT[0] EQ NETQBLK
OR BT[0] EQ NETQMSG
THEN
BEGIN
ST$ODB = ST$ODB + 1; # INC *N/W OUTBOUND BLOCK #
ST$ODC = ST$ODC + CC[0] ; # INC *N/W OUT DATA CHAR #
END
ELSE
BEGIN
ST$ONB = ST$ONB + 1; # INC *N/W OUT NON-DATA BLOCK #
ST$ONC = ST$ONC + CC[0] ; # INC *N/W OUT NON-DATA CHAR #
END
CONTROL FI;
# LINK MESSAGE TO PIP OUTBOUND CHAIN #
INBUF = NBTIN[PIPINDEX]; # CURRENT IN PTR OF OUTBOUND BUF #
IF INBUF NQ 0
THEN
NEXTPTR[INBUF] = BUFADDR;
ELSE # NO CHAIN #
NBTFIRST[PIPINDEX] = BUFADDR;
NBTIN[PIPINDEX] = BUFADDR;
END # NXBLINK #
TERM