Subject: tty classes
To: None <tech-userlevel@NetBSD.ORG>
From: Ty Sarna <tsarna@endicor.com>
List: tech-userlevel
Date: 12/02/1997 14:08:33
I'm writing a program to monitor logged-in ttys, boot idle users, etc.
It works pretty well, but I want to associate different parameters for
some of these things with different classes of ttys. For example,
console ttys should have a long or no idle timeout. Network logins
should have a medium-long timeout. Modems dialups should have a short
idle timeout.

I could come up with my own file format for that, but instead I'd like
to propose that we have (a hook for) tty classes, much like we have (a
hook for) user classes. This would be a field in /etc/ttys that is a key
that is specified to index into a termcap-style database describing
various unspecified attributes of ttys in that class.

To implement this, I propose that we extend /etc/ttys with a parameter
"class=<string>", with similar syntax to the window= parameter. Then,
extend struct ttyent with "char *ty_class" at the end, and enhance the
getttyXXX() functions to parse this extra paramater.

Note that this should be 100% backwards compatible, because the
paramater is optional, and binary compatible as well since struct
ttyent's should only be allocated or declared inside libc. 
Also note that while the indended use of the class parameter is
documented, like user classes the implementation is up to the local
site. The class paramater is just an extra hook that can be used for
anything you want, or ignored.

Oh, and one more change, I propose we update etc/etc.*/ttys to add the
following defaults:

class=pty	pseudo-terminals
class=term	real or software-emulated "hardwired local terminals"
		(eg, /dev/console or /dev/ttyvN on i386, or a real
		hardwired terminal on a real serial port)
class=dialup	on dialup lines

These are of course merely defaults, and can be edited to whatever.

Any objections before I start coding and send-pr this?