I am trying to write a network stub driver. I am new to the Linux environment and so I am not sure if my approach works. Please some one help me if my approach is wrong or if there is a better or easy way to do this. Thanks.

I want to register a network stub driver say xyz0. So it will look like regular ethernet driver to the Linux kernel. But when an IP packet comes from the internet on the regular ethernet interface for interface xyz0, my stub driver function will post a message to my user application which will actually process the IP packet.

Please point me to the right documentation or sample code that will help me to write this driver.