On 10/11/06, Jinesh K J <jineshkj.newsletters@xxxxxxxxx> wrote:
On 10/11/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote: > You asked for ways that userspace and kernelspace can communicate and > syscalls is one such way. > This is my requirement. I need to capture the data from an NIC. Instead of pushing it into the network stack, I'll make it to store them in a kernel ring buffer. From that buffer, a user space application will read the raw packet, do the necessary processing and send it back. As you can see I'm looking towards to transfer chunks of data to and from userspace. So, which method does suit well here?
Have you considered packet sockets with PACKET_MMAP option? It is excellent with very low overhead for receiving. If you want to prevent your packet from entering the network stack, you will have to use something like iptables/ipchains to drop the packets.
Jinesh. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
-- There is only one success - to be able to spend your life in your own way. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/