Re: _IOR/W with if_tun

From: bsder (snort_sam_at_yahoo.com)
Date: 10/30/05


Date: Sun, 30 Oct 2005 23:31:17 +1100

Jordan Abel wrote:
> On 2005-10-29, bsder <snort_sam@yahoo.com> wrote:
>
>>Hi,
>>
>>Can anyone tell me what does the following codes do:
>>
>>/* ioctl's for get/set debug */
>>#define TUNSDEBUG _IOW('t', 90, int)
>>#define TUNGDEBUG _IOR('t', 89, int)
>>#define TUNSIFINFO _IOW('t', 91, struct tuninfo)
>>#define TUNGIFINFO _IOR('t', 92, struct tuninfo)
>>#define TUNSLMODE _IOW('t', 93, int)
>>
>>I tried to find out the implementation of the _IOR/W functions, but I
>>found nothing in the src directory.
>>
>>Can anyone please tell me where can I allocate the implemetation of
>>these _IOR/W functions?
>>
>>Thanks
>>Sam
>
>
> It probably does some bit-shifting and stuff. It is most definitely
> a macro, rather than a function.
>
> Here it is - /usr/include/sys/ioccom.h
thanks, how to interpret the this macro:

#define _IOC(inout,group,num,len) \
         ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) |
((group) << 8) | (num)))

Thanks
Sam



Relevant Pages

  • Re: _IOR/W with if_tun
    ... > Can anyone tell me what does the following codes do: ... > found nothing in the src directory. ... It probably does some bit-shifting and stuff. ... a macro, rather than a function. ...
    (comp.unix.bsd.freebsd.misc)
  • allocate on flush
    ... can Allocate on Flush be implemented in NTFS?? ... or is it providing such type of implemetation ?? ...
    (microsoft.public.windowsxp.general)