home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Rice_CMS / gopher24 / gvm.exec < prev    next >
Encoding:
Text File  |  1992-04-18  |  2.0 KB  |  73 lines

  1. /*
  2.  *        Name: GVM EXEC
  3.  *              for the DIALed GOPHER service virtual machine
  4.  *              (not to be confused with GOPHERD service machine)
  5.  *      Author: Rick Troth, Rice Univ, I/S VM Systems Support
  6.  *        Date: 1992-Mar-06, and prior
  7.  *
  8.  *        Note:
  9.  *              This EXEC has been tested with VM/SP R5.
  10.  *              It is not guaranteed to work with anything else,
  11.  *              and probably  *will not*  work with VM/XA and ESA.
  12.  *
  13.  *              Similarity between the names PVM and GVM is intentional.
  14.  */
  15.  
  16. host = "localhost"
  17. port = 70
  18. tube = 420
  19.  
  20. Address "COMMAND"
  21.  
  22. /* Find my VMBLOK */
  23. Parse Value Diag(08,'QUERY USERID') With userid . '15'x .
  24. 'CP QUERY USERID'
  25. Parse Value Diag(08,'LOCATE' userid) With . . vmbaddr . '15'x .
  26. 'CP LOCATE' userid
  27. If rc ^= 0 Then Exit rc
  28. vmbaddr = strip(vmbaddr)
  29.  
  30. 'CP DEFINE GRAF' tube
  31. /* Trap I/O traces and wait for someone to DIAL */
  32. 'IUCVTRAP ON ALL'
  33. 'CP SET CPCONIO IUCV'
  34. 'CP TRACE I/O RUN'
  35. Do Forever      /* or at least until we get DIALed to */
  36.     'IUCVTRAP GRAB (WAIT'
  37.     Parse Pull . "I/O" iodevice .
  38.     If x2d(iodevice) = x2d(tube) Then Leave
  39.     End /* Do While */
  40. 'CP TRACE END'
  41. 'CP SET CPCONIO OFF'
  42. 'IUCVTRAP OFF'
  43.  
  44. Do i = 0 to 99
  45.     slaveid = "GOPHER" || Right(i,2,"0")
  46.     Parse Value Diagrc(08,'QUERY USER' slaveid),
  47.         With 1 rc 10 . 17 rs '15'x .
  48.     If rc = 45 Then Leave
  49.     End
  50. /* Change my userid to slaveid */
  51. 'CP STCP' d2x(x2d(vmbaddr)+272) c2x(left(slaveid,4)) c2x(right(slaveid,4))
  52.  
  53. /* Now fire-up another server */
  54. 'CP AUTOLOG' userid 'ALL'
  55.  
  56. Parse Value Diag(08,'QUERY VIRTUAL' tube) With . . "ON" . graf '15'x .
  57.  
  58. 'EXEC GOPHER' host port '(TUBE' tube
  59. Say "GOPHER returned" rc
  60.  
  61. 'CP DETACH' tube
  62. /* 'CP HOST RESET' graf 'HOLD' */
  63. 'CP SLEEP 1 SEC'
  64. Say 'CP DISABLE' graf
  65. 'CP DISABLE' graf
  66. 'CP SLEEP 1 SEC'
  67. Say 'CP ENABLE' graf
  68. 'CP ENABLE' graf
  69. 'CP LOGOFF'
  70.  
  71. /* The TRACE string we're looking for is:                             *
  72.  * "*** EF8818 I/O   0420 ==> EF0C40  CSW 0400"                       */
  73.