B From:	MERC::"uunet!WKUVX1.BITNET!MacroMan" 24-MAR-1993 03:59:57.90 To:	MACRO32@WKUVX1.BITNET  CC:	2 Subj:	Re: Trapping OPCOM messages in Detached proc  2 In article <1993Mar23.154622.1@scsvxb.unocal.com>,"  ucisrcy@scsvxb.unocal.com writes:K >      I'd like to know if anybody out there has attempted to intercept and 0 > process OPCOM messages via a detached process.   yep!  F > If so, and you would like to share the code (or at least the general& procedure) with me, I'd appreciate it!  M the code I did is part of a commercial product.  However, similar things have F appeared on DECUS VAX SIG symposium tapes; there's no secret about the general technique:  N The key is VMS's pseudoterminal driver.  (I/O User's Reference Manual, Part I,O Chapter 9 or so.)  Create a pseudoterminal, associate a mailbox with it, enable L it as an opcom terminal ($SNDOPR system service), set it for nobroadcast and" broadcast mailbox ($QIOW SETMODE).  M The opcom messages then get sent to the associated malbox.  You read them and  do what you want with them.   I All of this worked the way the documentation said it would; there were no 
 surprises.  N btw, using the broadcast mailbox is much better than reading the messages fromH the "backside" of the pseudoterminal directly.  When you get them in theM mailbox they'll be neatly packaged, one broadcast message per mailbox message M (with imbedded CRLFs for multiple lines).  If you read them directly from the L backside of the pty there is no good way to figure out the boundaries of the	 messages.   L Either way, you will have to parse the messages to extract data like type ofK request, associated username, request number, and so on, out of them.  This   is non-trivial but quite doable.  M It is possible to steal the pointer to the OPCOM process's mailbox; this gets K you the "binary" messages before OPCOM broadcasts them everywhere.  However K a lot of the info you need will still be in free-form text, and you will be H using an undocumented interface besides... I looked at this approach and rejected it.  G >      We have a large operations group that is based on an IBM system.    My sympathies. :-)  =         --- Jamie Hanrahan, Kernel Mode Systems, San Diego CA O drivers, internals, networks, applications, and training for VMS and Windows NT M uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and J Chair, Programming and Internals Working Group, U.S. DECUS VMS Systems SIGB Internet:  jeh@cmkrnl.com  Uucp: uunet!cmkrnl!jeh  CIS: 74140,2055