title: Network stats gatherer (loadable kernel module) isn't working?
body: <p>I'm kinda new to linux kernel modules and I'm trying to write my own module that gives me some statistics about a device ( the NIC here). 
  although I'm using kernel 2.6.35 and I've included <code>linux/netdevices</code>, compiling keeps saying that the function <code>ndo_get_stats</code> is implicitly declared. can anyone tell me what's going on ?</p>
  
  <p>here's the module, simple I know, </p>
  
  <pre><code>#include &lt;linux/module.h&gt;       /* Needed by all modules */
  #include &lt;linux/kernel.h&gt;       /* Needed for KERN_INFO */
  #include &lt;linux/netdevice.h&gt;    /* Needed for netdevice*/
  
  
  
  
  static int __init hello_start(void)
  {
       struct net_device *dev;
       struct net_device_stats *devstats;
  
      printk(KERN_INFO "Loading Stats module...\n");
      printk(KERN_ALERT "Hello world\n");
      dev = first_net_device(&amp;init_net);
      while (dev)
      {
           printk(KERN_INFO "found [%s] and it's [%d]\n", dev-&gt;name, dev-&gt;flags &amp; IFF_UP);
  
           printk(KERN_INFO "End of dev struct ... now starts the get_stats struct\n");
  
       devstats = ndo_get_stats(dev);
  
       printk(KERN_INFO "recive errors: [%li]\n transmission errors: [%li]\n number of collisions: [%li]", devstats-&gt;rx_errors , devstats-&gt;tx_errors, devstats-&gt;collisions);
  
        dev = next_net_device(dev);
       }
  
      return 0;
  }
  
  static void __exit hello_end(void)
  {
      printk(KERN_ALERT "Goodbye.\n");
  }
  
  module_init(hello_start);
  module_exit(hello_end);
  </code></pre>