From:	ADVAX::"""l_leahy""@star.enet.dec.com" "Lee Leahy DTN 381-0570 17-May-1991 1014" 17-MAY-1991 22:00:32.40
To:	arisia::everhart
CC:	
Subj:	MONLAT.MAR - First section of 4

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Fri, 17 May 91 21:58:57 EDT
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA27135 for ; Fri, 17 May 91 21:05:14 -0400
Received: from enet-gw.pa.dec.com by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA13515; Fri, 17 May 91 10:15:04 -0400
	for ARISIA.dnet.ge.com!EVERHART
Received: by enet-gw.pa.dec.com; id AA27290; Fri, 17 May 91 07:13:58 -0700
Message-Id: <9105171413.AA27290@enet-gw.pa.dec.com>
Received: from star.enet; by decwrl.enet; Fri, 17 May 91 07:14:06 PDT
Date: Fri, 17 May 91 07:14:06 PDT
From: Lee Leahy DTN 381-0570  17-May-1991 1014 <"l_leahy"@star.enet.dec.com>
To: arisia::everhart
Subject: MONLAT.MAR - First section of 4
 
  	.TITLE	MONLAT
	.IDENT	/V2.0/
 
; This program will listen for LAT multicast messages and display information
; from the messages it finds.
 
; Author = David Gagne
 
	.LIBRARY	"SYS$LIBRARY:LIB.MLB"
 
	$IODEF				;Define I/O functions and modifiers
	$NMADEF				;Define Network Management parameters
	$LNMDEF				;Define logical name parameters
 
	.EXTERNAL	SYS$FAO
 
; Modification history
;
;	2.0	David Gagne				06-May-1991
;		08 Include the node name and service name in option 1 and 2.
;		07 Print a device summary for option 1.
;		06 Add more SYSID device names.
;		05 Add more driver names.
;		04 Display the group codes as numbers, not as a bit mask.
;		03 Print a better message when the protocol is being used.
;		02 Display the hardware address from the SYSID response.
;		01 Make the output tablized for option 1 and 2.
;	1.2	David Gagne
;		01 Fix a bug where we were printing duplicate entries
;	1.1	David Gagne
;		01 Modify the specific node display

; QIO data structures for the LAT channel.
 
; Setmode parameter buffer
 
SETPARM:
	.WORD	NMA$C_PCLI_PTY		; Protocol type
		.LONG	^X0460
	.WORD	NMA$C_PCLI_BFN		; Number of buffers to save
		.LONG	4
	.WORD	NMA$C_PCLI_BUS		; Max. receivable buffer size
		.LONG	1500
	.WORD	NMA$C_PCLI_PAD		; Padding
		.LONG	NMA$C_STATE_OFF
	.WORD	NMA$C_PCLI_MCA		; Multicast address
		.WORD	8
		.WORD	NMA$C_LINMC_SET
		.BYTE	09,00,^X2B,00,00,^X0F
 
SETPARMLEN = .-SETPARM
 
SETPARMDSC:
	.LONG		SETPARMLEN
	.ADDRESS	SETPARM
 
; Read buffer for LAT multicast messages
 
RCVBUF:
	.BLKB	1504
 
RCVBUFLEN = .-RCVBUF
 
; Place to store incoming P5 buffer
 
RCVP5:
RCVDA:	.BLKB	6
RCVSA:	.BLKB	6
RCVPTY:	.BLKB	2

; QIO data structures for the MOP (SYSTEM ID) channel.
 
; P2 parameter buffer for finding devices of other nodes.
 
SIDPARM:
	.WORD	NMA$C_PCLI_PTY		; Protocol Type
		.LONG	^X0260
 
SIDPARMLEN = .-SIDPARM
 
SIDPARMDSC:
	.LONG		SIDPARMLEN
	.ADDRESS	SIDPARM
 
; P2 transmit data buffer for sending request SYSID messages.
 
XMTP2BUF:
	.BYTE	05			; SYSTEM ID request code
	.BYTE	00			; Reserved
XMTP2RCT:
	.WORD	4242			; Receipt number (to be returned)
 
XMTP2LEN = .-XMTP2BUF
 
; Address of the node whose Device ID we would like to find.
 
SIDADDR:
	.BLKB	6
 
; Read buffer for receiving System IDs
 
RCVBUF2:
	.BLKB	1504
 
RCVBUFLEN2 = .-RCVBUF2
 
; Place to store incoming P5 buffer
 
RCVP52:
RCVDA2:	.BLKB	6
RCVSA2:	.BLKB	6
RCVPT2:	.BLKB	2

; Message structures
 
; General message buffer
 
FAODESC:
FAOLEN:	.LONG		80
	.ADDRESS	FAOBUF
FAOBUF:
	.BLKB		80
 
HDRMSG1:
	.ASCID	"MONLAT - Ethernet LAT monitoring program. Version 2.0"
INPMSG1:
	.ASCID	"Monitor requests available:"
INPMSG2:
	.ASCID	"    1) Monitor service announcements from all nodes"
INPMSG3:
	.ASCID	"    2) Monitor service announcements for a specific group code"
INPMSG4:
	.ASCID	"    3) Monitor service announcement  from a specific node"
INPMSG5:
	.ASCID	"    any other input will stop the program"
IOMSG:
	.ASCID	"!/The contents of the 2nd longword in the IOSB is !XL"
NDMSG:
	.ASCID	"No device found.  Please define ETH appropriately."
PT1MSG:
	.ASCID	"Another user is using the LAT protocol (60-04)"
PT2MSG:
	.ASCID	"Another user is using the remote console protocol (60-02)"
DNEMSG:
	.ASCID	"MONLAT complete.  Thank you for your continued support."
BLNKMSG:
	.ASCID	""
 
; Output strings for monitoring service announcements from all nodes
 
M1HDR1:	.ASCID	" Current Address    Controller   Hardware Address    DECnet     Node/Service"
M1HDR2:	.ASCID	"-----------------   ----------   -----------------   -------  --------------"
M1DAT1:	.ASCID	"!XB-!XB-!XB-!XB-!XB-!XB   !3UB=!AS                                   "
M1DAT2:	.ASCID	"!XB-!XB-!XB-!XB-!XB-!XB   !2UB.!UW    "
M1DAT3:	.ASCID	"!AD/!AD"
M1CODE:	.ASCID	"                     Group codes: !3UB !3UB !3UB !3UB !3UB !3UB !3UB"
M1SEP1:	.ASCID	"----------------------------------------------------------------------------"
M1NONE:	.ASCID	"No service announcement messages were found"
M1SUM1:	.ASCID	"  Device usage summary"
M1SUM2:	.ASCID	"    Device    Amount"
M1SUM3:	.ASCID	"    ------    ------"
M1SUMM:	.ASCID	"    !5AS     !5UW"
M1TOTL:	.ASCID	"    TOTAL =   !5UW"
 
; Output strings for monitoring service announcements for a specific group
 
M2HDR0:	.ASCID	"Nodes using group code #!3UB"
M2NONE:	.ASCID	"No service announcement messages were found using Group Code #!3UB"
 
; Output strings for monitoring service announcements from a specific node
 
M3ADDR:	.ASCID	"Address: !XB-!XB-!XB-!XB-!XB-!XB"
M3NODE:	.ASCID	"   DECnet node:  !2UB.!UW"
M3CONT:	.ASCID	"   Controller:   !UB = !AS"
M3IDN1:	.ASCID	"   Node name:    !AD"
M3IDN2:	.ASCID	"   Node desc:    !AD"
M3IDN3:	.ASCID	"   Service name: !AD"
M3IDN4:	.ASCID	"   Service desc: !AD"
M3HDR1:	.ASCID	"   Group Codes Set:"
M3GCOD:	.ASCID	"       !3UW"
M3NONE:	.ASCID	"No service announcement message found from !XB-!XB-!XB-!XB-!XB-!XB"
 
; Strings for various device names
 
DEV001:	.ASCID	"DEUNA"
DEV003:	.ASCID	"DECNA"
DEV005:	.ASCID	"DEQNA"
DEV011:	.ASCID	"DELUA"
DEV013:	.ASCID	"MSLAN"
DEV017:	.ASCID	"DS100"
DEV021:	.ASCID	"DEBET"
DEV023:	.ASCID	"DEBNA"
DEV025:	.ASCID	"PCLAN"
DEV027:	.ASCID	"3C501"
DEV033:	.ASCID	"DS200"
DEV035:	.ASCID	"DS500"
DEV037:	.ASCID	"DELQA"
DEV039:	.ASCID	"DESVA"
DEV041:	.ASCID	"MX100"
DEV043:	.ASCID	"DEPCA"
DEV045:	.ASCID	"LTM  "
DEV047:	.ASCID	"DESNC"
DEV049:	.ASCID	"MX300"
DEV053:	.ASCID	"LB200"
DEV060:	.ASCID	"DS300"
DEV063:	.ASCID	"VLIII"
DEV064:	.ASCID	"VL350"
DEV065:	.ASCID	"DEBNI"
DEV066:	.ASCID	"DEMNA"
DEV067:	.ASCID	"PMX  "
DEV072:	.ASCID	"DP250"
DEV073:	.ASCID	"SGEC "
DEV075:	.ASCID	"DEQTA"
DEV076:	.ASCID	"LB150"
DEV086:	.ASCID	"DR250"
DEV090:	.ASCID	"DB500"
DEV091:	.ASCID	"DB500"
DEV092:	.ASCID	"WC500"
DEV093:	.ASCID	"DEMFA"
DEV094:	.ASCID	"PMAD "
DEV104:	.ASCID	"KFE52"
DEV105:	.ASCID	"RT300"
DEV112:	.ASCID	"LPS20"
DEV114:	.ASCID	"DWT-1"
DEV119:	.ASCID	"DEFZA"
DEVUNK:	.ASCID	"Unkwn"
DEVMIS:	.ASCID	"Misng"
DEVNAN:	.ASCID	"Noans"
 
CTRMIS:	.WORD	0
CTRNAN:	.WORD	0
 
DEVTBL:	.BYTE	1
	.WORD	0
	.ADDRESS	DEV001
	.BYTE	3
	.WORD	0
	.ADDRESS	DEV003
	.BYTE	5
	.WORD	0
	.ADDRESS	DEV005
	.BYTE	11
	.WORD	0
	.ADDRESS	DEV011
	.BYTE	13
	.WORD	0
	.ADDRESS	DEV013
	.BYTE	17
	.WORD	0
	.ADDRESS	DEV017
	.BYTE	21
	.WORD	0
	.ADDRESS	DEV021
	.BYTE	23
	.WORD	0
	.ADDRESS	DEV023
	.BYTE	25
	.WORD	0
	.ADDRESS	DEV025
	.BYTE	27
	.WORD	0
	.ADDRESS	DEV027
	.BYTE	33
	.WORD	0
	.ADDRESS	DEV033
	.BYTE	35
	.WORD	0
	.ADDRESS	DEV035
	.BYTE	37
	.WORD	0
	.ADDRESS	DEV037
	.BYTE	39
	.WORD	0
	.ADDRESS	DEV039
	.BYTE	41
	.WORD	0
	.ADDRESS	DEV041
	.BYTE	43
	.WORD	0
	.ADDRESS	DEV043
	.BYTE	45
	.WORD	0
	.ADDRESS	DEV045
	.BYTE	47
	.WORD	0
	.ADDRESS	DEV047
	.BYTE	49
	.WORD	0
	.ADDRESS	DEV049
	.BYTE	53
	.WORD	0
	.ADDRESS	DEV053
	.BYTE	60
	.WORD	0
	.ADDRESS	DEV060
	.BYTE	63
	.WORD	0
	.ADDRESS	DEV063
	.BYTE	64
	.WORD	0
	.ADDRESS	DEV064
	.BYTE	65
	.WORD	0
	.ADDRESS	DEV065
	.BYTE	66
	.WORD	0
	.ADDRESS	DEV066
	.BYTE	67
	.WORD	0
	.ADDRESS	DEV067
	.BYTE	72
	.WORD	0
	.ADDRESS	DEV072
	.BYTE	73
	.WORD	0
	.ADDRESS	DEV073
	.BYTE	75
	.WORD	0
	.ADDRESS	DEV075
	.BYTE	76
	.WORD	0
	.ADDRESS	DEV076
	.BYTE	86
	.WORD	0
	.ADDRESS	DEV086
	.BYTE	90
	.WORD	0
	.ADDRESS	DEV090
	.BYTE	91
	.WORD	0
	.ADDRESS	DEV091
	.BYTE	92
	.WORD	0
	.ADDRESS	DEV092
	.BYTE	93
	.WORD	0
	.ADDRESS	DEV093
	.BYTE	94
	.WORD	0
	.ADDRESS	DEV094
	.BYTE	104
	.WORD	0
	.ADDRESS	DEV104
	.BYTE	105
	.WORD	0
	.ADDRESS	DEV105
	.BYTE	112
	.WORD	0
	.ADDRESS	DEV112
	.BYTE	114
	.WORD	0
	.ADDRESS	DEV114
	.BYTE	119
	.WORD	0
	.ADDRESS	DEV119
	.BYTE	0
	.WORD	0
 
; Variables to find numerical values for the group codes enabled.
 
GCMAX = 7
GCODES:	.BLKB	GCMAX			; Where to store the numerical codes
GCMASK:	.LONG	0			; Mask to look at
NUMGC:	.LONG	0			; Number of Group codes found
NODNAM:	.BLKB	6			; Temp storage for node name
SERNAM:	.BLKB	6			; Temp storage for service name
 
; Information from the SYSID response.
 
DEVDSC:	.BLKQ				; General device name descriptor
DEVID:	.BLKB				; Device ID from SYSID response
DEVHWA:	.BLKB	6			; Device HWA from SYSID response
 
; Buffers, variables, and strings for the time control of the program
 
HOURS:	.BLKB	1			; Storage of requested input
MINUTES:.BLKB	1
SECONDS:.BLKB	1
 
; The following variables are for reading input from the user after prompting.
 
INPSTRDSC:				; Input buffer descriptor
	.LONG		0
	.ADDRESS	INPSTR
 
INPSTR:	.BLKB		18		; Input buffer
 
INPSIZ:	.BLKL	1			
 
; The prompts are defined next.
 
RPRMT:	.ASCID	"Which monitor request would you like to make: "
HPRMT:	.ASCID	"How many hours   would you like to monitor: "
MPRMT:	.ASCID	"How many minutes would you like to monitor: "
SPRMT:	.ASCID	"How many seconds would you like to monitor: "
GPRMT:	.ASCID	"Which group code would you like to monitor: "
APRMT:	.ASCID	"Enter the address of the node (ex: AA-00-04-00-75-4C): "
 
; Input variables from prompts
 
REQ:	.LONG	0			; Request number
DSTADR:	.BLKB	6			; Address to look for
GCODE:	.BYTE	1			; Group code to look for
 
ENDTIM:	.BLKQ	1			; Time to end test
TIME:	.BLKQ	1			; Temporary time buffer
DTIME:	.ASCID	/0 !2ZB:!2ZB:!2ZB.00/	; String for calculating delta time
 
; Miscellaneous variables
 
GCBITS: .BLKB	32			; Used for examining group codes
RCVTRY:	.BLKL	1			; Counter for receive attempts
IOSB:	.BLKQ	1			; I/O status block
 
; Device names
 
DEVDSC1:.ASCID	'ETH'			; Units to use for test
DEVDSC2:.ASCID	'ESA0'
DEVDSC3:.ASCID	'XQA0'
DEVDSC4:.ASCID	'ETA0'
DEVDSC5:.ASCID	'XEA0'
DEVDSC6:.ASCID	'EXA0'
DEVDSC7:.ASCID	'EZA0'
DEVDSC8:.ASCID	'FXA0'
DEVDSC9:.ASCID	'FGA0'
 
; Table of pointers to device names
 
DEVADR:	.ADDRESS	DEVDSC1
	.ADDRESS	DEVDSC2
	.ADDRESS	DEVDSC3
	.ADDRESS	DEVDSC4
	.ADDRESS	DEVDSC5
	.ADDRESS	DEVDSC6
	.ADDRESS	DEVDSC7
	.ADDRESS	DEVDSC8
	.ADDRESS	DEVDSC9
	.LONG	0
 
; Channels - one for LAT and one for Remote Console
 
CHNLAT:	.BLKL	1
CHNRMC:	.BLKL	1

	.ENTRY	START,^M<>
 
; Assign both channels to the first device found which is available
 
	CLRL	R5			; Check each channel name to see if one
10$:	TSTL	DEVADR(R5)		; is available until one is found: the
	BEQL	30$			; first name checked is "ETH", a dummy
	MOVL	DEVADR(R5),R4		; name which can be defined to the
	$ASSIGN_S-			; device desired if either:
		DEVNAM=(R4),-		;      1) An unregistered device is used
		CHAN=CHNLAT		;  or  2) One device is prefered
	BLBS	R0,20$			; If success, assign the 2nd channel
	ADDL	#4,R5			; Skip to next device name
	CMPW	R0,#SS$_NOSUCHDEV	; Was the error "no such device"?
	BEQL	10$			; If yes, try next device name
	BRW	ERROR			; Else, exit with error
20$:	$ASSIGN_S-			; Assign the 2nd channel to the same
		DEVNAM=(R4),-		; device name
		CHAN=CHNRMC
	BLBS	R0,ASSIGN_OK		; If success, continue
	BRW	ERROR			; Else, exit with an error
 
; No device was found.
 
30$:	BSBW	BLANK			; No device was found, so say so and
	PUSHAB	NDMSG			; then exit.
	CALLS	#1,G^LIB$PUT_OUTPUT
	BRW	EXIT
 
ASSIGN_OK:
 
; Start up the first channel for examining LAV packets.
 
	$QIOW_S	FUNC=#<IO$_SETMODE!IO$M_CTRL!IO$M_STARTUP>,-
		CHAN=CHNLAT,-
		IOSB=IOSB,-
		P2=#SETPARMDSC
 
	BLBS	R0,START_REQ_OK1
	BRW	ERROR
 
START_REQ_OK1:
	MOVZWL	IOSB,R0
	BLBS	R0,START_IO_OK1
	CMPW	#SS$_BADPARAM,R0	; Was this a bad parameter?
	BNEQ	10$			; If not, use general error path
	CMPW	#NMA$C_PCLI_PTY,IOSB+4	; Was protocol type the bad parameter?
	BNEQ	10$			; If not, use general error path
	BSBW	BLANK
	PUSHAB	PT1MSG			; Print the protocol type error
	CALLS	#1,G^LIB$PUT_OUTPUT
	BRW	EXIT
10$:	BRW	ERROR
 
START_IO_OK1:
 
