Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/demos/cblmir.cbl
There are no other files named cblmir.cbl in the archive.
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLMIR.
AUTHOR. PETER MIERSWA.
INSTALLATION. DIGITAL MARLBORO.
REMARKS.
	THIS TASK ACTS AS A PASSIVE TASK TO ECHO ANY MESSAGE IT RECEIVES.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NETLN PIC S9(10) COMP VALUE 0.
01 N-TYPE PIC S9(10) COMP VALUE 0.
01 DESC PIC X(40) DISPLAY-7 VALUE SPACE.
01 WAIT PIC S9(10) COMP VALUE 0.
01 RETCOD PIC S9(10) COMP VALUE 0.
01 EOM PIC S9(10) COMP VALUE 0.
01 N-COUNT PIC S9(10) COMP VALUE 0.
01 DATA-RECORD PIC X(80) DISPLAY-7.
01 N-CODE PIC S9(10) COMP VALUE 0.
PROCEDURE DIVISION.
START.

* OPEN THE NETWORK FILES *

	MOVE "SRV:.MIRROR" TO DESC.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.

MAIN-LOOP.
	MOVE -1 TO NETLN.
	CALL NFGND USING NETLN,1,RETCOD.
	IF RETCOD EQUALS 1 GO TO DO-NFACC.
	IF RETCOD EQUALS 2 OR 5 GO TO DO-NFCLS.
	IF RETCOD EQUALS 3 GO TO DO-NFRCI.
	IF RETCOD EQUALS 4 GO TO DO-NFRCV.
	DISPLAY "?ERROR IN NFGND, RETURN CODE = ",RETCOD.
	STOP RUN.

DO-NFACC.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,1,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	ACCEPTING CONNECTION FROM".
	DISPLAY "	NODE: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,2,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	OBJECT TYPE: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,3,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	OBJECT DESCRIPTOR FORMAT: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,4,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	OBJECT DESCRIPTOR: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,5,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	USERID: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,6,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	PASSWD: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,7,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	ACCOUNT: ",DATA-RECORD.
	MOVE SPACES TO DATA-RECORD.
	CALL NFINF USING NETLN,8,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "	OPTIONAL DATA: ",DATA-RECORD.
	CALL NFACC USING NETLN,0,DATA-RECORD,RETCOD.
	GO TO MAIN-LOOP.


DO-NFRCV.
	MOVE SPACES TO DATA-RECORD.
	CALL NFRCV USING NETLN,80,DATA-RECORD,1,0,RETCOD.
	CALL NFSND USING NETLN,80,DATA-RECORD,1,RETCOD.
	GO TO MAIN-LOOP.


DO-NFCLS.
	CALL NFCLS USING NETLN,0,0,0,DATA-RECORD,RETCOD.
	MOVE "SRV:.MIRROR" TO DESC.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.
	GO TO MAIN-LOOP.

DO-NFRCI.
	CALL NFRCI USING NETLN,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "Interrupt message => ",DATA-RECORD.
	GO TO MAIN-LOOP.