Handling packets from kernel click to user process

Brecht Vermeulen brecht.vermeulen at rug.ac.be
Wed May 9 15:39:13 EDT 2001


Hi guys,

We want to give some packets from the kernel to a user process (the
packets are not destined for the router, but will normally be forwarded,
however we want to intercept them).

One thing we've just tried (with success), is changing the destination
IP address to that of the router (SetIPaddress,
StoreIPaddress,SetIPchecksum, tolinux) and a userprocess listening for
that protocol (RSVP messages, protocol 46) via raw sockets. (if we don't
change the destination IP address, the packet gets forwarded by the
linux kernel).

My question is now if there are other possibilities for this :
- 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 ?

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

- 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 ?

thanks for any idea,
Brecht
PS. click 1.2.0 SMP seems *very* interesting and amazing ! but had no
time to test it yet (and our gbit NICs are under way :-) ).



More information about the click mailing list