title: userspace to kernel space and sysfs and how to use sysfs to change one reserved value in igmpv3 pkt
body: <p>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 packet which is sent by a host.</p>
  
  <p>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. </p>
  
  <p>To that one ctuffli has replied:</p>
  
  <blockquote>
    <p>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:</p>
    
    <ul>
    <li>Command line options. You can pass parameters to a kernel module which are available to it during initialization.</li>
    <li>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.</li>
    <li>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.    </li>
    <li>sysfs is a pseudo-file system used to export information about drivers and devices</li>
    </ul>
    
    <p>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.</p>
  </blockquote>
  
  <p>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?</p>