[Click] need your help

Eddie Kohler kohler at cs.ucla.edu
Tue Sep 14 12:12:38 EDT 2004


liuzhan_hn wrote:
> I am a beginner of click router. I want to ask a question ,could anyone help me?
> How to add a output to an element? thank you 
> When I implemented an click example udpgen.click , it works well. But when I add a Print() to demonstrate the generated package information,I get error:UDPGen has 0 output. How to deal with it?  Thank you very much.

Zhan,

The easiest thing to do here is put the Print inside the
definition of UDPGen -- after "source", for example.

Here is the syntax for an elementclass with an output.

elementclass Whatever {
   source :: FastUDPSource(...) -> output;
}
Whatever -> Print -> Discard;

Eddie


> 
> the example is:
> elementclass UDPGen {
>   $device, $rate, $limit, $size,
>   $seth, $sip, $sport, $deth, $dip, $dport |
> 
>   source :: FastUDPSource($rate, $limit, $size, $seth, $sip, $sport,
>                                                 $deth, $dip, $dport);
>   pd :: PollDevice($device) -> ToHost;
>   source -> td :: ToDevice($device);
> }
> 
> // create a UDPGen
> 
> u :: UDPGen(eth1, 82000, 820000, 1500,
> 	    00:e0:29:05:e2:d4, 2.0.0.2, 1234,
> 	    00:c0:95:e2:09:14, 1.0.0.2, 1234);
> 
> 
> -------------------------------------------------------------------------------------AOC(¹Ú½Ý)17´çÒº¾§16ms£¤2888 http://desigggn.163.com/aocmonitor/index.html
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click




More information about the click mailing list