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: [email protected]
[mailto:[email protected]]im 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
becauseI 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 isexternal to lwip. Should I write a Timer callback function in
tcpip.c wich call a home madefunction that read a mailbox and send the trap?
Ive just read the commentsand 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 andthere is no thread to do.  Im using snmp
to do telemetry of some device. Thanks again!Alexandre
[email protected]
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to