Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
IPC between the kernel and a user space program confuses me. Hopefully some of you can clear things up.
I want to be able to communicate with a kernel module from a user space prorgam in a fast and convinient (? :-)) way.
In my world I can imagine, in general, two basic ways how this can be performed:
1. Writing to some kind of file, where the parties can write/read to communicate.
2. Implement some kind of funtion call.
On the web I have found a few alternatives:
1. Implement a system call in the kernel module
2. Implement an ioctl in the kernel module
3. Use netlink/rtnetlink sockets
4. Register a device (e.g /dev)
5. Use the /proc file system thing
The problem is that I can't weigh pros and cons and then decide which one to use. I would appreciate it very much, if some one could say a few words on this and/or point me to some documentation (A link to a good document can be enough since I'm will to learn these things myself, but a few words from an experienced one will do no harm).
If there is a 2.4 vs 2.6 collision, I'm mostly interested in Linux 2.6.
I'll try to create a firewall that can be mastered by passing rules from user space down to a the kernel module that make sure the rules are applied using the netfilter framework. The main purpose is to learn how stuff works... (I dont want to queue packets for userspace using the premade lib since this will be too slow I guess, and too easy...)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.