lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Re: [lwip-users] memory leak when sending snmp trap


From: Mathias Zenger
Subject: AW: Re: [lwip-users] memory leak when sending snmp trap
Date: Thu, 11 Jun 2009 16:10:17 +0200

If the SNMP code really uses the raw API (not sure about) then it won't work with your blocking FreeRTOS task. lwIP wiki (http://lwip.wikia.com/wiki/Raw/native_API) says:
 

"When running in a multithreaded environment, raw API functions may only be called from the core thread (aka. the tcpip-thread) since raw API functions are not protected from concurrent access (aside from pbuf- and memory management functions). "

"Raw API applications may never block since all packet processing (input and output) as well as timer processing (TCP mainly) is done in a single execution context."

You should either use the netconn or the socket API (further description at wiki). No idea if any SNMP library exists which uses one of these APIs. However, it's perhaps not too hard to write your own SNMP functions. Usually SNMP uses UDP for transport. To send/receive UDP datagrams with the socket API is easy.

 

-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hiddenIm Auftrag von Alexandre Malo
Gesendet: Donnerstag, 11. Juni 2009 15:06
An: lwip
Betreff: Re: Re: [lwip-users] memory leak when sending snmp trap

Hi,
 
  thanks for the info. I have doubt the timer is giving problem  because
I putted a low random number just so the bug happen as fast as possible.
 
As for the task, what should I do to have a thread that launch trap wich is
external to lwip.
 
Should I write a Timer callback function in tcpip.c wich call a home made
function that read a mailbox and send the trap? Ive just read the comments
and this is a single shot call. So its not Timer callback.
 
I cant really write inside the lwip main loop? That would be very unclean hehe!
 
Oh, I just found tcpip_callback_with_block.
Is that the way?
 
I'll try this and give you news :)!
 
I successfuly added my private MIB. This was more easy since it's static and
there is no thread to do. 
 
Im using snmp to do telemetry of some device.
 
Thanks again!
Alexandre Malo
address@hidden
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]