[Click] How do Click elements use Push and Pull?

betamaz betamaz at gmail.com
Thu Apr 21 16:33:47 EDT 2005


Hi,

In the FAQs it's mentioned that a new element should implement push
and pull.  I'm trying to figure out how some of the existing elements
use push and pull functions.  For example, in the udpgen.click
configuration:
 
1) fastudpsource.cc has pull defined. Since FastUDPSource goal is to
create packets. Shouldn't it use push to send the new packets the next
output?

2) On the other hand, polldevice.cc makes sense that it is using push
to send packets to the element ToHost.  It does this through
skb_push(skb,...) and output(0).push.  What are these two functions? I
couldn't pinpoint the file that called output.

I guess I dont' am confused how click defines pull and push, since
comparing the processing type of FromDevice/ToDevice and
FromHost/ToHost doesn't make sense. I thought push was implemented by
the sender and pull by the receiver. I would appreciate any help.

Bita.

----------------------------------

here is udpgen.click for reference:

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(eth0, 82000, 820000, 1500,
	    00:0C:41:1F:9C:8F, 128.111.40.189, 1234,
	    00:0C:41:1F:9C:70, 129.111.40.200, 1234);



More information about the click mailing list