diff options
author | brian <brian@FreeBSD.org> | 2002-05-14 12:55:39 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2002-05-14 12:55:39 +0000 |
commit | c2da7c8697491402af4f8ab3082d2c047114ccad (patch) | |
tree | 213dbf675b601fdd2934367847c24da5854fd2d9 /usr.sbin/ppp/tty.c | |
parent | 4e0ba1d0e6f3418e983e80b52552d0cd201048bb (diff) | |
download | FreeBSD-src-c2da7c8697491402af4f8ab3082d2c047114ccad.zip FreeBSD-src-c2da7c8697491402af4f8ab3082d2c047114ccad.tar.gz |
o Clean up some #includes
o Bump version number to 3.0.4
o When talking to a RADIUS server, provide a NAS-Port-Type.
When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal
to the SESSIONID from the environment in direct mode or the
NGM_PPPOE_SESSIONID message in other modes. If no SESSIONID is found,
default to the interface index in client mode or zero in server mode.
When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number
of the physical device (ie, the N in /dev/i4brbchN).
This makes it easier for the RADIUS server to identify the client
WRT accounting data etc.
Prompted by: lsz8425 <lsz8425@mail.cd.hn.cn>
Diffstat (limited to 'usr.sbin/ppp/tty.c')
-rw-r--r-- | usr.sbin/ppp/tty.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.sbin/ppp/tty.c b/usr.sbin/ppp/tty.c index a246aab..b26bfdb 100644 --- a/usr.sbin/ppp/tty.c +++ b/usr.sbin/ppp/tty.c @@ -40,6 +40,7 @@ #include <sysexits.h> #include <sys/uio.h> #include <termios.h> +#include <ttyent.h> #include <unistd.h> #ifndef NONETGRAPH #include <netgraph.h> @@ -553,6 +554,23 @@ tty_OpenInfo(struct physical *p) return buf; } +static int +tty_Slot(struct physical *p) +{ + struct ttyent *ttyp; + int slot; + + setttyent(); + for (slot = 1; (ttyp = getttyent()); ++slot) + if (!strcmp(ttyp->ty_name, p->name.base)) { + endttyent(); + return slot; + } + + endttyent(); + return -1; +} + static void tty_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov, int *auxfd, int *nauxfd) @@ -598,7 +616,8 @@ static struct device basettydevice = { tty_Write, tty_device2iov, tty_Speed, - tty_OpenInfo + tty_OpenInfo, + tty_Slot }; struct device * |