Add new TAPGIFNAME tap(4) character device ioctl. This is a

convenient shortcut to obtain network interface name using
file descriptor for character device.

Obtained from:	NetBSD
MFC after:	1 week
This commit is contained in:
Maksim Yevmenkin 2008-09-08 22:43:55 +00:00
parent 8c68f75a7c
commit 03bbca8f63
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=182880
2 changed files with 7 additions and 0 deletions

View File

@ -745,6 +745,12 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
*(int *)data = tapdebug;
break;
case TAPGIFNAME: {
struct ifreq *ifr = (struct ifreq *) data;
strlcpy(ifr->ifr_name, ifp->if_xname, IFNAMSIZ);
} break;
case FIONBIO:
break;

View File

@ -55,6 +55,7 @@ struct tapinfo {
#define TAPGDEBUG _IOR('t', 89, int)
#define TAPSIFINFO _IOW('t', 91, struct tapinfo)
#define TAPGIFINFO _IOR('t', 92, struct tapinfo)
#define TAPGIFNAME _IOR('t', 93, struct ifreq)
/* VMware ioctl's */
#define VMIO_SIOCSIFFLAGS _IOWINT('V', 0)