Re: questions about netlink socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, July 13 2007 3:22:59 pm Jing Huang wrote:
> I am thinking of use netlink socket as a replacement of IOCTLs in a
> SCSI HBA driver I am working on. After reading some document from the
> Internet, I have the following questions:
>
> 1) Is netlink Socket designed as a general mechanism to replace IOCTL
> or it is still mostly used for networking? I seems that currently
> there are only 32 protocol types available in netlink.h, most of them
> are used for networking purpose.
>
> 2) I seems to me that the there is no mechanism to share the same protocol
> type among different drivers or kernel modules. For example, I can not just
> use one of the existing protocol type say NETLINK_ROUTE to implement the
> IOCTL functionality of a driver. Am I missing anything?
>
> 3) What is the kernel community's policy of accepting a new protocol
> type into netlink.h? Since the maximum is 32, with only about 16 left,
> it seems to be impossible to get a protocol type specifically used for
> a particular driver.

I can't answer your question about netlink vs ioctls, but I can offer some 
answers to questions two and three.  The answer to question #2 is most 
certainly "no", in general you shouldn't use an existing netlink type for 
something which is unrelated; routing and driver ioctls are pretty unrelated 
I think.  Question #3 is a bit harder to answer, but I can tell you that all 
new uses of netlink are _strongly_ encouraged to use generic netlink instead.  
Generic netlink is an abstraction layer that sits on top of netlink and helps 
reduce the limited protocol type space of generic netlink.  Some more 
information on generic netlink can be found here:

 * http://linux-net.osdl.org/index.php/Generic_Netlink_HOWTO

-- 
paul moore
linux security @ hp
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux