home *** CD-ROM | disk | FTP | other *** search
- /*
- * Name: GVM EXEC
- * for the DIALed GOPHER service virtual machine
- * (not to be confused with GOPHERD service machine)
- * Author: Rick Troth, Rice Univ, I/S VM Systems Support
- * Date: 1992-Mar-06, and prior
- *
- * Note:
- * This EXEC has been tested with VM/SP R5.
- * It is not guaranteed to work with anything else,
- * and probably *will not* work with VM/XA and ESA.
- *
- * Similarity between the names PVM and GVM is intentional.
- */
-
- host = "localhost"
- port = 70
- tube = 420
-
- Address "COMMAND"
-
- /* Find my VMBLOK */
- Parse Value Diag(08,'QUERY USERID') With userid . '15'x .
- 'CP QUERY USERID'
- Parse Value Diag(08,'LOCATE' userid) With . . vmbaddr . '15'x .
- 'CP LOCATE' userid
- If rc ^= 0 Then Exit rc
- vmbaddr = strip(vmbaddr)
-
- 'CP DEFINE GRAF' tube
- /* Trap I/O traces and wait for someone to DIAL */
- 'IUCVTRAP ON ALL'
- 'CP SET CPCONIO IUCV'
- 'CP TRACE I/O RUN'
- Do Forever /* or at least until we get DIALed to */
- 'IUCVTRAP GRAB (WAIT'
- Parse Pull . "I/O" iodevice .
- If x2d(iodevice) = x2d(tube) Then Leave
- End /* Do While */
- 'CP TRACE END'
- 'CP SET CPCONIO OFF'
- 'IUCVTRAP OFF'
-
- Do i = 0 to 99
- slaveid = "GOPHER" || Right(i,2,"0")
- Parse Value Diagrc(08,'QUERY USER' slaveid),
- With 1 rc 10 . 17 rs '15'x .
- If rc = 45 Then Leave
- End
- /* Change my userid to slaveid */
- 'CP STCP' d2x(x2d(vmbaddr)+272) c2x(left(slaveid,4)) c2x(right(slaveid,4))
-
- /* Now fire-up another server */
- 'CP AUTOLOG' userid 'ALL'
-
- Parse Value Diag(08,'QUERY VIRTUAL' tube) With . . "ON" . graf '15'x .
-
- 'EXEC GOPHER' host port '(TUBE' tube
- Say "GOPHER returned" rc
-
- 'CP DETACH' tube
- /* 'CP HOST RESET' graf 'HOLD' */
- 'CP SLEEP 1 SEC'
- Say 'CP DISABLE' graf
- 'CP DISABLE' graf
- 'CP SLEEP 1 SEC'
- Say 'CP ENABLE' graf
- 'CP ENABLE' graf
- 'CP LOGOFF'
-
- /* The TRACE string we're looking for is: *
- * "*** EF8818 I/O 0420 ==> EF0C40 CSW 0400" */
-