Communication between kernel modules (what's the proper way?)
Somewhat out of topic for the mailing list, but I guess the developers here could advise me on the matter:
I have developed two modules that use hooks to manipulate packets, and I wish for them to communicate with each other. The proper way to communicate with userspace is by using ioctls. But what is a proper way to use to pass data between the two modules, bearing in mind these are my modules and I cant apply for a system call...?
regards,
Ioannis
Quoted 8 lines · JC
Somewhat out of topic for the mailing list, but I guess the developers here could advise me on the matter:
I have developed two modules that use hooks to manipulate packets, and I wish for them to communicate with each other. The proper way to communicate with userspace is by using ioctls. But what is a proper way to use to pass data between the two modules, bearing in mind these are my modules and I cant apply for a system call...?
This isn't netfilter related at all, but it's related with kernel programming.
You could do it by means of kernel notifiers (linux/notifier.h). You can export a notifier_block that can be used to [un]register callbacks (notifier_chain_[un]register) by both modules.
--
Pablo