[Click] Internal Handlers

Cliff Frey cliff at meraki.com
Mon Feb 1 13:37:58 EST 2010


Take a look at click/elements/standard/counter.cc to see a simple example of
one element that uses a handler of another... you can pass the handlers as
config parameters of your elements.

In some cases, it can be easier to just pass the element itself... For
instance you can pass an ARPTable element to an ARPQuerier element as a
parameter, allowing the ARPQuerier element to make calls directly to the
ARPTable element.

Cliff

On Mon, Feb 1, 2010 at 1:40 PM, David Sesmero Sáez <Deivid_Sesme at hotmail.com
> wrote:

> Hi! I have a problem related to the internal handlers. Inside one file
> .click I use some elements for emulate the behavior of one switch, two of
> those elements there are VlanEncap and VlanSwitch, the .click file is like
> this:
>
>
> vlanswitch_0::VlanSwitch(TIMEOUT 300, LEARNING 1, VLAN_MODE 0)
> vlanencap_0::VlanEncap(VLAN_MODE 0, NUM_PORTS 8)
> L0::LinkUnqueueMod(LATENCY 0.0, BANDWIDTH 100.0kbps)
> L1::LinkUnqueueMod(LATENCY 0.0, BANDWIDTH 100.0kbps)
>
> FromHost(tap3)->vlanencap->Queue->L0->[0]vlanswitch[0]->ToHost(tap3)
>
> FromHost(tap4)->vlanencap->Queue->L1->[1]vlanswitch[1]->ToHost(tap4)
>
>
> I need use some handlers from vlanencap_0 to vlanswitch_0 but I don't know
> how I have to do inside the VlanSwitch.cc code. Anyone can help me?
>
> I read something about Router::Handler but I don't know how I have to write
> the code inside de VlanSwitch.cc for catch the handers of vlanencap_0
> defined on .click file... I have for example one read-handler inside the
> vlanencap_0 who they give me the source MAC, his name is vlanencap_0.src.
>
>
> David Sesmero Sáez.
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list