views:

322

answers:

0

I have posted query previously and i am repeating same I want to modify igmpv3 (Linux) which is inbuilt in kernel2.6.-- such that it reads a value from a file and appropriately decides reserved(res 1) value inside the igmpv3 paket which is sent by a host.

I want to add more to above question by saying that this is more a generic question of changing variable of kernel space from user space.

To that one ctuffli has replied:

From the perspective of a user land program, you should think of the driver as a "black box" with well defined interfaces instead of code with variables you want to change. Using this mental model, there are four ways (i.e. interfaces) to communicate control information to the driver that you should consider:

* Command line options. You can pass parameters to a kernel module which are available to it during initialization.
* IOCTLs. This is the traditional way of passing control information to a driver, but this mechanism is a little more cumbersome to use than sysfs.
* proc the process information pseudo-file system. proc creates files in the /proc directory which user land programs can read and sometimes write. In the past, this interface was appropriated to also communicate with drivers. Although proc looks similarly to sysfs, newer drivers (Linux 2.6) should use sysfs instead as the intent of the proc is to report on the status of processes.    

* sysfs is a pseudo-file system used to export information about drivers and devices

Depending on when you need to communicate with the driver (i.e. initialization, run time), you should add either a new command line option or a new sysfs entry to change how the driver treats the value of reserved fields in the packet.

Thanks Ctuffli for your answer. I do not have any knowledge of sysfs. Can you provide more details abt it? I want to change one of the reserve value of igmpv3 pkt to be either 0 or 1 or 2. This the only thing which i need to change. Could you please give me more details for this specific problem?

Regards, Bhavin.