I want to write a linux 2.6 netfilter module, which can check the incoming IP packet information ,such as dest-ip ,source-ip. and then pass these information to user space app. that app (socket app,I think ) will handle these information as soon as the packet reach the HOOKs.
I want to try two ways :
1, inside the netfilter module, make a fifo struct line, every time the packet reach the hook, put the packet information to the fifo. and with the help of /proc/example filesystem . every time the user space app read the /proc/example file , will get a packet information from the fifo head .
I'm a newbie of kernel program, this program crash my kernel several times. -_-! I wonder is this way possible?
2, inside the netfilter module , make a char device. the user space app read packet information from this char device. but I still do not know how to make sure get the packet as soon as possible, is there any way when the packet reach the netfilter hook, kernel will send some signal to info user space app , then the user space app come to pick the packet information?
Thank you very much.