[comp.os.vms] Translating LTAnnnn: to terminal server and port names

SYSTEM@INDYVAX.BITNET (05/27/88)

[non-blank blank line]

Hi all.   A while back, while half of the INFO-VAX stuff was disappearing
down a black hole for us BITNET folks, there was a question about
translating LAT terminal line numbers to server and port names.

Of course one can do it by logging into SYSTEM and typing something like:

$ MCR LATCP SHOW PORTS [terminal-name]

I found something on DSIN that shows how to get the server and port name
from a program (obviously what LATCP is doing).  You have to be able to
open a channel on the LAT terminal (have SHARE privilege I think it is).

Here is a PHOTO log of running the demo program under SYSTEM:

[PHOTO: Recording initiated 26-MAY-1988 20:39]

$ show proc

26-MAY-1988 20:39:08.64                      User: SYSTEM
Pid: 00002CBA   Proc. name: SYSTEM_1         UIC: [SYSTEM]
Priority:   7   Default file spec: DISK$USER3:[IJAH400.MISC]
$ ! Gee, I wonder if bozo is logged in...
$ show user bozo
          VAX/VMS Interactive Users
           26-MAY-1988 20:39:27.28
    Total number of interactive users = 20

 Username     Process Name      PID     Terminal
 BOZO         BOZO1939,DAT    00002EA6  LTA3532        LTA3532:
$ ! Gee, wonder what port bozo's on...
$ run latran
LAT terminal name: lta3532
Server:    TRMSRV_15
Port name: PORT_1
$ pop
  Process SYSTEM_1 logged out at 26-MAY-1988 20:39:50.69

[PHOTO: Recording terminated 26-MAY-1988 20:39 PHOTO.LOG;1]

I suppose this stuff is all documented under VMS 5.0, I don't know.
Now if we could only get DEC to put the server and port name in security
alarms and LOGFAIL accounting entries when LAT terminals are involved...

      - Jim Harvey
        IJAH400@INDYVAX.BITNET

PS: Here is the demo program (original was called LATREAD.FOR, do a TXT
search on DSIN for the product "TERMINAL/SERVER" and key "QIO INTERFACE
TO LAT"), as modified from the DSIN version (to take an arbitrary LAT
terminal name and to compile without errors):

<-----LATRAN.FOR----cut here----->
      PROGRAM LATRAN

      INCLUDE '($IODEF)'
      INCLUDE '($SSDEF)'

      PARAMETER READ_BUF_LEN = 34
      CHARACTER*16    LAT_DEV_NAME
      INTEGER         END1,END2,START2
      INTEGER         SYS$ASSIGN,SYS$QIOW,SYS$DASSGN
      INTEGER*2       LT_CHAN
      INTEGER*2       IOSB(4)
      BYTE            READ_BUF(READ_BUF_LEN)

C  Prompt for and read the LAT terminal name to be translated

      WRITE (6,11)
   11 FORMAT (' LAT terminal name: ',$)
      READ (5,12) (LAT_DEV_NAME(I:I),I=1,16)
   12 FORMAT (16A1)
      IF (LAT_DEV_NAME .EQ. ' ') LAT_DEV_NAME = 'SYS$INPUT:'

C  Stick a colon on the name if they left it off...

      DO 13 I = 1, 16
          IF (LAT_DEV_NAME(I:I) .EQ. ' ') LAT_DEV_NAME(I:I) = ':'
          IF (LAT_DEV_NAME(I:I) .EQ. ':') GOTO 14
   13     CONTINUE
   14 CONTINUE

C  Assign a channel to terminal

      ISTAT = SYS$ASSIGN(LAT_DEV_NAME,LT_CHAN,,)
      IF (.NOT. ISTAT) CALL LIB$STOP(%VAL(ISTAT))

C  Read port characteristics into P1 buffer.

      ISTAT = SYS$QIOW(,%VAL(LT_CHAN),
     +       %VAL(IO$_TTY_PORT.OR.IO$M_LT_READPORT),
     +       IOSB,,,%REF(READ_BUF),%VAL(READ_BUF_LEN),,,,)
      IF (.NOT. ISTAT) CALL LIB$STOP(%VAL(ISTAT))

C  Write out the port name and server name

      END1 = READ_BUF(1) + 1
      START2 = END1 + 2
      END2 = READ_BUF(END1 + 1) + START2 - 1

      WRITE (6,100) (READ_BUF(I),I=START2,END2)
  100 FORMAT (' Server:    ',16A1)

      WRITE (6,200) (READ_BUF(I),I=2,END1)
  200 FORMAT (' Port name: ',16A1)

C  Deassign channel to terminal

      ISTAT = SYS$DASSGN(%VAL(LT_CHAN))
      IF (.NOT. ISTAT) CALL LIB$STOP(%VAL(STAT))

C  Exit program

      CALL EXIT
      END
<-----LATRAN.FOR----cut here----->

kvc@nrcvax.UUCP (Kevin Carosso) (06/05/88)

In article <8805291308.AA25063@ucbvax.Berkeley.EDU> SYSTEM@INDYVAX.BITNET writes:

>Now if we could only get DEC to put the server and port name in security
>alarms and LOGFAIL accounting entries when LAT terminals are involved...

They have -- in V5.  At least they've got it in SHOW TERMINAL as well
as intrusion records and more than likely security alarms as well.
I don't know about LOGFAIL accounting records, I'd check but am in
the middle of the V5 install right now.  I know they do not include the
information (called "Access Port Information") in regular process accounting
records since with virtual terminals you cannot know for sure where
a process was during the course of a session.

In addition, the access port name can be gotten with GETDVI. This works
from DCL as well, you can say "port = F$GETDVI ("LTAxx:", "TT_ACCPORNAM").
(In V5, of course)

        /Kevin Carosso                     kvc@nrc.com
         Network Research Co.              kvc@ymir.bitnet
                                           kvc@nrcvax.uucp