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/i4b.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/i4b.c')
-rw-r--r-- | usr.sbin/ppp/i4b.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/ppp/i4b.c b/usr.sbin/ppp/i4b.c index cf2032d..5744e89 100644 --- a/usr.sbin/ppp/i4b.c +++ b/usr.sbin/ppp/i4b.c @@ -32,6 +32,7 @@ #if defined(__OpenBSD__) || defined(__NetBSD__) #include <sys/ioctl.h> #endif +#include <sys/stat.h> #include <errno.h> #include <fcntl.h> @@ -274,6 +275,17 @@ i4b_OpenInfo(struct physical *p) return buf; } +static int +i4b_Slot(struct physical *p) +{ + struct stat st; + + if (fstat(p->fd, &st) == 0) + return minor(st.st_rdev); + + return -1; +} + static void i4b_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov, int *auxfd, int *nauxfd) @@ -312,7 +324,8 @@ static struct device basei4bdevice = { NULL, i4b_device2iov, i4b_Speed, - i4b_OpenInfo + i4b_OpenInfo, + i4b_Slot }; struct device * |