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:
parent
8c68f75a7c
commit
03bbca8f63
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user