From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  3-NOV-1989 22:58
To:	MRGATE::"ARISIA::EVERHART"
Subj:	** VAX/VMS V5.2 ** MONITOR ETHERNET Patch

Received: From hac2arpa.hac.com ([192.48.33.2]) by CRVAX.SRI.COM with TCP; Fri,  3 NOV 89 18:45:57 PDT
Received: by hac2arpa.hac.com (5.59/SMI-DDN)
	id AA18065; Fri, 3 Nov 89 18:48:10 PST
Date: Fri, 3 Nov 89 18:48:10 PST
From: MNK@RDAC.hac.com
Message-Id: <8911040248.AA18065@hac2arpa.hac.com>
Received: by DnaMail (v1.1); Fri Nov  3 18:47:52 1989 PDT
To: "info-vax@sri.com"@hac2arpa.hac.com@ARPA.DECNET
Subject: ** VAX/VMS V5.2 ** MONITOR ETHERNET Patch


	***** VAX/VMS V5.2 ***** (MONITOR ETHERNET Patch)

I just recently posted a patch for MONITOR that was valid for VAX/VMS
V5.0 through V5.1-1.  I've been told that it breaks under V5.2.  I've
re-coded the patch to work on either V5.0 through V5.1-1 or V5.2; all
you have to do is uncomment three DEFINE commands in the patch that
match your version of VAX/VMS.

On a side note, in order to do this new patch I would normally have used
the V5.2 micro-fiche (which I did to some extent).  However, the files
MONDAT.LIS and MONITOR.MAP are MISSING from the micro-fiche.  Has anyone
else noticed this or can anyone tell me where they are?

---------------------------------------------------------------------------
MONITOR has some classes it can monitor that have been disabled in the
The classes are:

	ETHERNET, JDEVICE, VMS1, VMS2, and VMS3

Patches have been posted in the past to enable these classes on V4.4 and
later V4.6/7 of VAX/VMS.  The code in NI_FIND_COUNTER has some bugs that
only show up if the counter specified is not present.  The DEBNA under
V4.x no longer returned the counter NMA$C_CTLIN_LBE and now under V5.x
none of the ethernet controllers returns this counter.  If a counter is
not found the display will end up displaying all zeros (0's).  This
patch makes NI_FIND_COUNTER return success and a value of 0 if the
counter specified is not found so that MONITOR ETHERNET will work.

To make all this work, extract the following patch into a file called
MONITOR.PAT.  Then do the following:

$ set default sys$login			! Pick some directory
$ edit monitor.pat			! Uncomment three DEFINE commands

	uncomment appropiate lines (ones with "!!!!!")

$ copy sys$system:monitor.exe sys$login	! Create a copy of monitor.exe
$ @monitor.pat				! Patch your copy
$ define monitor sys$login:monitor.exe	! define logical name for CLI
$ set proc/priv=phy_io			! Need PHY_IO privilege
$ define ni$device ETA0:		! Your ethernet device name
					! (not needed for XEA0: or XQA0:)
$ monitor ethernet			! Monitor Ethernet

Mike
----------------------------------------------------------------------------
Michael Kimura			Internet:	mnk@rdac.hac.com
Hughes Aircraft Company (RSG)	BITnet:		mnk@rdac.hac.com
P.O. Box 92426	  MS: R2/9A37	EDEN:		rdac::mnk
Los Angeles,  CA  90009		Telephone:	(213) 615-9775
----------------------------------------------------------------------------

			8< Cut on the dotted line
...............................................................................
$!===========================================================================
$! VAX/VMS V5.0, V5.1, V5.2 patch for MONITOR to enable the disabled classes:
$!
$!	ETHERNET, JDEVICE, VMS1, VMS2, and VMS3
$!
$! Uncomment the appropriate DEFINE commands (three begging with "!!!!!")
$! in the patch for the version of VAX/VMS you are using.
$!
$! Copy the image SYS$SYSTEM:MONITOR.EXE into your working directory,
$! execute this file as a command file (@ it), define the logical name
$! MONITOR to specify the name of your copy of MONITOR and then you're
$! ready to go.
$!
$! Note: MONITOR ETHERNET uses promiscuous mode and therefore requires
$!	 PHY_IO privilege and only ONE user can MONITOR ETHERNET at a time.
$!
$! To connect to the ethernet device, the code uses the first successful
$! channel it gets from the following:
$!	1) translation of NI$DEVICE
$!	2) XEA0:
$!	3) XQA0:
$!
$! 29-Mar-88 Simon Hackett (simon%sirius.ua.oz@seismo.css.gov)
$!		modified for version V4.6 of VMS (and works fine for V4.7)
$! 11-Oct-89 Michael Kimura (mnk@rdac.hac.com)
$!		modified for version V5.1-1 of VMS
$!  3-Nov-89 Michael Kimura (mnk@rdac.hac.com)
$!		modified for version V5.2 of VMS
$!===========================================================================
$!
$ patch monitor.exe
!
!---------------------------------------------------------------------------
! Uncomment the defines below appropriate to your version of VAX/VMS
!---------------------------------------------------------------------------
!
!!!!!	define dspdata=6070	! VAX/VMS V5.0 through V5.1-1
!!!!!	define $plit$=251fc	! VAX/VMS V5.0 through V5.1-1
!!!!!	define $code$=24760	! VAX/VMS V5.0 through V5.1-1
!
!!!!!	define dspdata=6200	! VAX/VMS V5.2
!!!!!	define $plit$=25540	! VAX/VMS V5.2
!!!!!	define $code$=24aa4	! VAX/VMS V5.2
!
!---------------------------------------------------------------------------
! File: MONDAT, Module MONDAT: Re-enable disabled classes
!---------------------------------------------------------------------------
!
! Enable class VMS2
!
replace dspdata+348
00000211
exit
00000011	! Clear the disable bit (bit 9)
exit
!
! Enable class VMS3
!
replace dspdata+39c
00000211
exit
00000011	! Clear the disable bit (bit 9)
exit
!
! Enable class JDEVICE
!
replace dspdata+498
00000235
exit
00000035	! Clear the disable bit (bit 9)
exit
!
! Enable class VMS1
!
replace dspdata+594
00000211
exit
00000011	! Clear the disable bit (bit 9)
exit
!
! Enable class ETHERNET
!
replace dspdata+63c
00000211
exit
00000011	! Clear the disable bit (bit 9)
exit
!
!---------------------------------------------------------------------------
! File: COUNTERS, Module NI_PROMISCUOUS: Fix protocol and NI_FIND_COUNTER
!---------------------------------------------------------------------------
!
! Make protocol valid (60-06) reserved for customer use
! Note: protocol needs to be specified in reverse byte order 06-60
!
replace $plit$+9e
00000000
exit
00000660	! Protocol 60-06
exit
!
!---------------------------------------------------------------------------
! Make NI_FIND_COUNTER return success even if counter is not found.
!
! NI_FIND_COUNTER erroneously scans CTRBUF too far since it uses
! CTRDSC.DSC$W_LENGTH (which is fixed at 512) as CTRLEN instead of
! the length returned in the IOSB in the call to $QIOW in
! NI_CONVERT_DEVICE_COUNTERS.  Counter NMA$C_CTLIN_LBE is not returned
! in the buffer so NI_FIND_COUNTER scans too far and runs into a
! counter ID of 0 which it sees as having a 0 width counter and exits
! with failure.
!---------------------------------------------------------------------------
!
! Branch if illegal width to code to set value to 0
!
replace/ins $code$+2d9+38
'beql $code$+2d9+78'	! beql 8$
exit
'beql $code$+2d9+64'	! beql 6$+6	6$+6: CLRL @VALUE
exit
!
! Branch to code that sets R0 to 1 instead of 0
!
replace/ins $code$+2d9+6a
'brb $code$+2d9+78'	! brb 8$
exit
'brb $code$+2d9+74'	! brb 7$+8	7$+8: MOVL #1, STATUS
exit
!
update
exit
$ exit

