.IDENT "V1.0" ;++ ; Facility: ; Program to probe reachability of a remote node. ; ; (Note: this is a prime example of the kind of program ; which will break with long nodenames in Phase V!) ;-- .PSECT DATA,WRT,NOEXE NODE_TEXT: .BLKB 6 ; Buffer to receive node name NETCHAN: .BLKW 1 ; Channel for network assign failure NODE_DESC: .LONG 6,NODE_TEXT ; Descriptor for node name NODE_WORK: .LONG 6,NODE_TEXT ; PROMPT: .ASCID "Nodename: " ; Prompt text for LIB$GET_FOREIGN NCB_DESC: .LONG 0,0 ; Network Connect Block descriptor NCB_TEXT: .ASCII '123456""::"1="' ; Template NCB NCB_LENGTH = .-NCB_TEXT .PSECT CODE,NOWRT,EXE .ENTRY START,0 ;+ ; Prompt for node name ;- PUSHAL NODE_WORK ; Specify arguments for prompt PUSHAQ PROMPT PUSHAQ NODE_DESC CALLS #3,G^LIB$GET_FOREIGN ; Get node name BLBC R0,900$ ;+ ; Construct NODE""::"1=" string ;- MOVAB NCB_TEXT,R6 ; Get address of NCB default string MOVZWL NODE_WORK,R1 ; Get length of entered nodename SUBL3 R1,#6,R7 ; Get offset from start of "NCB" ADDL2 R7,R6 ; Get address of actual start of NCB MOVC3 R1,NODE_TEXT,(R6) ; Copy in actual node name MOVL R6,NCB_DESC+4 ; Set up descriptor SUBL3 R7,#NCB_LENGTH,NCB_DESC ; ... ;+ ; Attempt to contact NODE""::"1=". ;- $ASSIGN_S - DEVNAM = NCB_DESC - ; Assign channel to target task CHAN = NETCHAN ; (will never get filled) ;+ ; Exit with status ;- CMPL R0,#SS$_NOSUCHOBJ ; If "no such object" it's reachable BNEQ 900$ MOVL #SS$_NORMAL,R0 ; Emit success if it's reachable 900$: RET .END START