.SBTTL NINIT, once only init routine .TITLE NTSUBS , DPACP network routines .PSECT NTSUBS .IDENT /M002/ ;+ ; ; NINIT ; DPACP initialize network routine, called once only. ; ; PURPOSE ; Initializes this task as a network task, ; falls into the NTCON routine. ; On errors in the initialization, the CNFLG bit in ; NTFLG is cleared. ; ; INPUTS ; None ; OUTPUTS ; R0-R5 preserved ; ; AUTHOR ; Daniel McCoy Informatics Inc. Palo Alto, Ca. ; ; REVISIONS Last Change - 2/26/78 - DSM ; DATE PERSON STATEMENT OF CHANGES ; 2/26/79 DSM Updated to version two ; 12/18/78 DSM First coding ; ; NOTES ; Uses DECNET-11M version 2 ;- ; .MCALL OPNW$E,SPAW$E,CONW$E .NINIT:: OPNW$E OPN ; Make this task known to the network BCS OBAD ; Check for bad directive CMPB #IS.SUC,NTSTAT ; Test for success BNE OERR ; Error ; ; Fall through to connect .PAGE .SBTTL NTCON, network connect routine ;+ ; ; NTCON ; DPACP Connect to auxiliary task on master node routine. ; ; PURPOSE ; An attempt is made to connect to the auxiliary task on the ; master system. The CNFLG bit in the NTFLG word is conditionally ; set/cleared depending on the success of the connect. ; ; INPUTS ; None ; OUTPUTS ; R0-R5 Preserved ; ; AUTHOR ; Daniel McCoy Informatics Inc. Palo Alto, Ca. ; ; REVISIONS Last Change - 2/26/79 - DSM ; DATE PERSON STATEMENT OF CHANGES ; 2/26/79 DSM Updated ; 12/18/78 DSM First coding ; ; NOTES ; Uses DECNET-11M version 2 ;- ; .NTCON:: CONW$E CON ; Connect to task on master system BCS CBAD ; Check for bad directive CMPB #IS.SUC,NTSTAT ; Test for success BNE CNER ; Error BIS #CNFLG,NTFLG ; Set connected flag RETURN ; Return to caller CNER: OERR: CBAD: OBAD: ; Errors just clear the connect flag BIC #CNFLG,NTFLG ; Clear connected flag RETURN ; .PAGE .SBTTL NSND, send packet to auxiliary task ;+ ; ; .NSND ; Sends a packet to auxiliary task through DECNET ; ; INPUTS ; Packet ready to send in .RQPK ; ; OUTPUTS ; Returned in .RTPK ; R0-R5 Preserved ; ; AUTHOR ; Daniel McCoy Informatics Inc. Palo Alto, Ca. ; ; REVISIONS LAST CHANGE - 26-FEB-79 - DSM ; DATE PERSON STATEMENT OF CHANGES ; 2/23/79 DSM Changed error handling ; 1/10/79 DSM First coding ; ; NOTES ; If no DECNET connection is currently oen, calls .NTCON to try ; to open one. ; If no connection can be made, returns with 'path lost to partner' ; in the return packet. ; ;- ; .MCALL SNDW$E,RECW$E ; .NSND:: BIT #CNFLG,NTFLG ; Check to see if we are connected BNE 10$ CALL .NTCON BIT #CNFLG,NTFLG ; Did it work? BEQ NOCON ; Go somewhere if we can't connect 10$: SNDW$E SND ; Send the packet BCS SBAD ; Bad directive? CMPB #IS.SUC,NTSTAT ; Send OK? BNE SERR ; Error ; RECW$E REC ; Get the return status BCS RBAD ; Bad directive? CMPB #IS.SUC,NTSTAT ; Receive OK? BNE RERR ; Error ; RETURN ; Everything worked ; ; Report errors SERR: RERR: ERR: SBAD: RBAD: BAD: ; Errors just fall through to "no connection" code NOCON: MOV NTSTAT,.RTPK+Y.STAT+2 ; Return network error MOVB #IE.NFW,.RTPK+Y.STAT ; Return error code CLRB .RTPK+Y.STAT+1 ; Clear the rest of CLR .RTPK+Y.FIDP ; the status info CLR .RTPK+Y.FNBP RETURN ; .END