[Click] Help with Click HashMap

Swati Sinha Deb Swati.Deb at bristol.ac.uk
Wed Apr 5 06:45:49 EDT 2006


Hi Eddie,

I did solve my problem by implementing it inside push method. In this way I 
do not have to work on the copy of packet. And before removing the entry 
from the hashmap I am calling uniqueify and then sending this uniqueify 
packet to the downstream element. Thank you very much for your help.

regards,
Swati

--On 05 April 2006 09:44 +0100 Swati Sinha Deb <Swati.Deb at bristol.ac.uk> 
wrote:

> Hi Eddie,
>
> Sending the copy of packet does work. I was getting error
> "LinearIPLookup:  no gw for 90000e0" because I was calling
> _pkt_map.remove(pktid_) in my  callback. I thought that "remove" simply
> removes the entry from HashMap but  looking at the code seems it destroys
> the Key and the Value. If I don't  remove the entry can HashMap handle
> very very large number of entries?  Another question, clone won't help me
> to change the packet. I would like to  change the packet in my callback
> and send the packet from there to  downstream element. Please advice.
> Thanks.
>
> regards,
> Swati
>
> --On 04 April 2006 10:08 -0700 Eddie Kohler <kohler at CS.UCLA.EDU> wrote:
>
>> You need to be much more specific about your problem.
>>
>>
>> On Apr 4, 2006, at 9:12 AM, Swati Sinha Deb wrote:
>>
>>> Hi Eddie,
>>>
>>> Thanks for the reply.
>>>
>>>>
>>>>    _pkt_map.insert(_pktid, p->clone());
>>>>     ....
>>>>    return p;
>>>>
>>> I tried the changes you mentioned but I get loads of following
>>> error as soon as I start reading the packets from my callback
>>> function.
>>>
>>> LinearIPLookup: no gw for 90000e0
>>>
>>> It's probably as you explained the packets might be getting
>>> modified or destroyed by the downstream element. Is there any other
>>> way to get around this problem? Thanks.
>>>
>>> regards,
>>> Swati
>>>
>>>
>>>> Either that or return 0.
>>>> Eddie
>>>>
>>>>
>>>>
>>>>>
>>>>> void PktHandler::callback(uint32_t pktid_, int token_)
>>>>> {
>>>>>     WritablePacket *p =  _pkt_map.find(pktid_);
>>>>>     //here I am not able to read the packet p.
>>>>>     .....................
>>>>> }
>>>>>
>>>>> regards,
>>>>> Swati
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> click mailing list
>>>>> click at amsterdam.lcs.mit.edu
>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>
>>>
>>>
>>>
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click






More information about the click mailing list