Handling packets from kernel click to user process

Eddie Kohler kohler at aciri.org
Fri May 11 19:06:44 EDT 2001


Hi Brecht,

Sorry for the delay.

> - tolinuxsniffers : this is approx. the same as tolinux, but if I
> understand correctly the magical line : 
> ptype_dispatch(skb, 0xFFFF);  // an unlikely protocol number 
> sets an unknown protocol and so the linux kernel doesn't handle it. Am I
> correct by saying that this doesn't change the content of the IP packet
> itself and that by using the pcap library we can sniff those packets ?

You have it exactly right.

> - in the manpage of tolinuxsniffers : 'Hands packets to any packet
> sniffers registered with Linux, such as packet sockets.'
> What are exactly 'packet sockets' ?

man 7 packet. For code, check out userlevel FromDevice.

> - do you have other possibilities in mind for communication between the
> click module and a userprocess (eventually with a new Click element) ?
> (/proc needs polling, so this is not the ideal way, I think) or is the
> linuxsniffers/pcap method the best one ?

You could implement an ioctl (in Click, they're called "llrpc"s). Would
still require polling, but would be much faster than packet sockets or
/proc. But packet sockets is probably easiest.

Also FYI, we are working on a 2.4 kernel patch....!

love,
ed



More information about the click mailing list