[Click] Writing your own element
Ian Rose
ianrose at eecs.harvard.edu
Sat Jan 23 13:15:27 EST 2010
Could you say a bit more about how you want this element to work - I'm
afraid I'm not really getting the full picture. Perhaps an example of
how a packet should be handled would help. And when you say that the
receive "is not working out", what do you mean? Are packets never
received by your element? It might help to put a Print element right
before your element (in your click configuration) - this element will
Print some stuff to the console every time a packet flows through it, so
if nothing is ever printed then you know that packets simply aren't
moving and it might be a problem with your click config itself (in which
case, send it in an email so we can take a look).
Also, what does your elements 'processing' method return? Just look in
<yourelement>.hh and you should see something like:
const char *processing() const { return PUSH; }
or
const char *processing() const { return AGNOSTIC; }
If you don't see a processing method then you are using the default
(AGNOSTIC).
- Ian
Amita Ekbote wrote:
> Hello,
>
> I need to write an element which can send packets and receive packets. The
> send needs to be like the timed source and based on packets received the
> send packet will be modified. The send and receive is to the same ip but
> different port numbers. I have the run_timer function which sends the packet
> but integrating the receive part in the same element is not working out. I
> could write another element for receive and pass it as configuration to the
> send but was hoping to integrate them into one element. Any suggestions
> would be appreciated.
>
> Thanks
>
More information about the click
mailing list