.title notail ;watch lcdtim and stop tailgating .enabl lc ;billy y 21-oct-88 .ident \007E\ ;detached job version .nlist bex,me ;from hh's timck/usrcop .mcall .exit,.twait ; NOTAIL - Documentation ; ; Tailgating is the name commonly given to what happens when a modem data ; path is broken before the job using it has logged off, and the next call ; is connected to that still active session of the prior user. Further info ; about tailgating may be found in Data Communications, March, 1988, page 55. ; ; On a busy TSX-Plus system, this can be a problem as the same time value ; (TIMOUT) which governs how long a job will be held active after the data ; carrier has been lost also determines the time allowed for a caller to ; first connect, type two returns and initialize the line. Thus, setting ; TIMOUT small enough to prevent tailgating means its not likely anyone ; will be able to log on a phone line either. ; ; This little program, running as a detached job, checks desginated lines ; every 0.5 second and kills any that may still be logged on without dcd ; held true. Phone lines on which dcd is true keep LCDTIM refreshed with ; TIMOUT, otherwise LCDTIM is decremented every 0.5 second. Status of ; monitored jobs is kept here in an internal table, maintained by their ; broadcast status reports. When LCDTIM no longer equals TIMOUT for a ; watched line that's still active, that job will be killed by this program. ; ; Most modems provide some immunity to brief hits in the carrier by including ; a small delay before dropping dcd, and the test done here is not sync'd ; with the LCDTIM refresh, so it may take as long as two seconds from actual ; loss of carrier until a logoff command file has run, however this is less ; time than it takes for a following call to be connected. Modems which can ; retrain should be configured to keep dcd asserted true during that process. ; TSX-Plus has no provision for use of dcd to ignore the retrain string, but ; loss of dcd will result in the line being killed. ; ; TSX-Plus V6.3 or above is required as recent prior versions only allow ; the kill emt to bomb detached jobs - if tailgating is a serious concern ; upgrading to the current release of TSX-Plus is recommended. ; ; INSTALLATION INSTRUCTIONS: ; ; To use this program the appropiate values for the four user settable ; parameters, below, must be patched as indicated. Lines to be watched ; must be numerically consecutive, or the init routine suitably modified. ; Monitoring a non-phone will definitely render it useless. This program ; must be rebuilt any time any of these four parameters change, such as ; when a new system generation changes the LCDTIM table address. ; ; After assembling and linking to create NOTAIL.SAV, copy this text into a ; detached job command file and edit TSGEN.MAC to run same when the system ; is started: ; ; SET PROCESS/NAME="dcd_time_out"/PRIORITY=55 ; INSTALL ADD *:CLEAR.COM/PRIV=(TERMINAL) ! needed for SET TT stuff ; MEMORY 1 ! don't waste core ; R/MEMLOCK NOTAIL ! MUST be locked in core to do timing stuff.. ; ; If not started by the system itself, this program will need MEMMAP, SEND ; and WORLD privileges to run. Also the parameter MAXMON must accomodate ; the number of lines monitored as well as any other use of it, and PHONE ; should be set true (PHONE=1), both of which may be done via TSXMOD, after ; which TSX+ must be restarted to read the new values, if there's an existing ; detached job running at start-up to which the above may be appended. ; ; As the modem itself is reset by dropping dtr, actually dumping a modem ; connection is most efficiently done by the use of a logoff command file, ; which is assigned in each phone line's start-up command file. Example: ; ; SET ERROR FATAL ; SET LOGOFF FILE=SY:CLEAR.COM ; SET TT PAGE !see note for CLEAR.COM, below ; R LOGON ; ; Then SY:CLEAR.COM would contain: ; ; SET ERROR NONE ; SET TT NOPAGE,NODTR,PHONE,AUTO,XON ; !Insert whatever else's needed here.. ; ; The reasons for the various SET TT options used above are: ; ; NOPAGE ensures possible noise induced xoff on dtr drop is harmless ; NODTR resets the modem ; PHONE ensures port is not in local mode, just in case.. ; AUTO ensures port not stuck at any particular speed ; XON resets any xoff which may have snuck thru.. ; ; This may be over doing it, but it does in practice work very well, where ; lesser schemes have not been as completely reliable.. ; ; Billy Youdelman, POB 1207, Culver City, CA 90232 USA .sbttl - user settable parameters fline = 6. ;first primary line number to check nlines = 4. ;# contiguous lines to check from fline up.. lcdtim = 20062 ;tsx time out table addr, get from TSX.MAP timout = 30. ;tsx normal time out, must match TSX.SAV .sbttl - init designated lines notail: mov #fline,linno ;start at this line mov #nlines,r4 ;how many to do 1$: mov linno,monlin ;give line number to monitor emt mov #monjob,r0 ;point to monitor emt arg block emt 375 ;begin monitoring for this line bcc 2$ ;branch if ok jmp errext 2$: inc linno ;prep for another sob r4,1$ ;another to check? .sbttl - main loop ;search + destroy every 0.5 sec loop: mov #fline,linno ;start at this line mov #nlines,r4 ;how many to do 1$: mov linno,r0 ;get a line number asl r0 ;make it an even word boundry tst flags(r0) ;test table to see if this line is active beq 2$ ;nope, on to the next one mov r0,lindex ;save shifted index number add #lcdtim,r0 ;convert to physical address for line mov r0,addr ;save for peek mov #pkemt,r0 ;set up peek emt 375 ;get lcdtim reg value cmp r0,#timout ;if lcdtim<>timout dcd has gone away.. beq 2$ ;if lcdtim=timout skip to next.. mov linno,knum ;give job number to kill emt mov #kill,r0 ;point to args emt 375 ;kill the line mov lindex,r0 ;recover pointer clr flags(r0) ;clear flag for this line 2$: inc linno ;prep for next line sob r4,1$ ;another to check? .twait #area,#time ;wait until lcdtim regs have been bumped again br loop .sbttl - monitoring completion routine moncpl: bit #100000,r0 ;iz it a system message bne 9$ ;nope, can't use it bic #100000,r0 ;strip system message bit asl r0 ;convert to even word boundry cmp r1,#1 ;iz this job init message? bne 2$ ;no bis #1,flags(r0) ;set the line's table entry as logged on br 9$ ;and return 2$: cmp r1,#5 ;has job logged off? bne 9$ ;no so return clr flags(r0) ;clear flag for this line 9$: return ;that's it.. .sbttl - job monitoring scheduling error errbyt = 52 ;emt error byte location errext: movb @#errbyt,r1 ;get emt error code add #'0,r1 ;convert to ascii numeral movb r1,errcod ;stuff into error message mov linno,r1 ;recover line number at which error occured mov #,r2 ;get pointer to end of buffer mov #2,r3 ;setup for two loops 1$: clr r0 ;prepare for divide div #10.,r0 ;get value of digit add #'0,r1 ;convert it to ascii movb r1,-(r2) ;put ascii number in buffer mov r0,r1 ;get tens digit for second pass sob r3,1$ ;two digits only mov #yell,r0 ;load emt arg block emt 375 ;display err msg on operator's console .exit ;stop pgm if can't establish monitoring .sbttl - data.. linno: .word 0 ;current loop line number lindex: .word 0 ;asl'd linno monjob: .byte 0,157 ;emt arg block to monitor a line monlin: .word 0 ;monitor this line .word moncpl ;completion routine address pkemt: .byte 1,34 ;.peek emt arg block addr: .word 0 ;where to peek kill: .byte 2,132 ;kill emt knum: .word 0 ;job number area: .blkw 2 ;2 word arg area for .twait time: .word 0 ;time high word .word 30. ;time low word - sleep for 0.5 sec flags: .blkw fline+nlines ;lines data table yell: .byte 1,127 ;display text on .word 1 ;operator's console .word cplerr ;what to send starts here cplerr: .ascii <15><12><7>\?NOTAIL-F-Monitor EMT error #\ errcod: .ascii \0 for Line #\ ;error # goes here which: .asciz \00\<15><12> ;line # goes here .even .end notail