Subject: Re: How to add if-IOCTL?
To: Heiko W.Rupp <hwr@pilhuhn.de>
From: Zdenek Salvet <salvet@ics.muni.cz>
List: tech-net
Date: 08/06/1998 21:53:11
> On Wed, Aug 06, 1997 at 10:47:35AM -0700, Bill Studenmund wrote:
> > I think what you need to do is bind a socket to that interface (I'm not
> > exactly sure how to do this) and then do the ioctl.
> 
> Hm? I have defined an ioctl like this:
> 
> #define LODEBUG        _IOW('t', 100 , int)

I think should have 
#define LODEBUG        _IOW('i',100 ,struct ifreq)
a stuff interface name in ifreq->ifr_name, otherwise the ioctl
cannot know the target interface etc.

> I did
> 
> #define LODEBUG        _IOW('t', 100 , int)
> 
> where the 't', I have seen (i think) with th if_tun driver.
> But the the other ones from sys/sockio.h that deal with an 
> interface either have a 'i' or a 'u'. Will try it with 'i' and/or 'u'.
> Is there any documentation about that?

Yes, /sys/kern/sys_socket.c :-)
You must use 'i' group for interface ioctls.

-- 
Zdenek Salvet                                              salvet@ics.muni.cz 
----------------------------------------------------------------------------
           If God had meant for us to be in the Army,
         we would have been born with green, baggy skin.