[Click] Constructing a ping test configuration

Eddie Kohler kohler at CS.UCLA.EDU
Wed Jun 9 20:44:58 EDT 2004


Hi Chao-Kuo,

>   I want to make a click configuration such that it will checks 
> devices for any
> ping packets and dumps out the ping information.  I have tried to 
> write one
> with no success.  I was wondering if anyone already has something 
> similar or
> can give me some pointers.  I am running click as a user program using 
> libpcap.
> Thank you.

I've just added a sample 'print-pings.click' file to the repository.  
Hopefully this example will help!  Change 'eth1' to the name of your 
device.

Eddie


// print-pings.click

// This configuration reads packets from a device, and prints out any 
ICMP
// echo requests it receives.

// You can run it at user level (as root) as
// 'userlevel/click < conf/print-pings.click'
// or in the kernel with
// 'click-install conf/print-pings.click'

FromDevice(eth1)				// read packets from device
						// (assume Ethernet device)
    -> Classifier(12/0800)			// select IP-in-Ethernet
    -> Strip(14)					// strip Ethernet header
    -> CheckIPHeader				// check IP header, mark as IP
    -> IPFilter(allow icmp && icmp type echo)	// select ICMP echo 
requests
    -> IPPrint					// print them out
    -> Discard;



More information about the click mailing list