Hello,

i have a little problem :-)


I am developing an application which acts like a proxy.
I can get e.g. GET-messages from the manager and forward them to the
agent. And i can also get the RESPONSE-message concerning the GET and forward
it to the manager.

To know the correct port, where the manager sends the GET and waits for the 
RESPONSE,
i save the transport_data of the GET-pdu in the callback_magic field of a new 
session, which
i get through new_session = snmp_open(sp).

sp is the session-pointer i get with my callback function (second parameter):

int my_callback(int operation, struct snmp_session *sp, int reqid, struct 
snmp_pdu *pdu, void *magic)


Then i use this new_session to forward the GET to the agent via snmp_send.

When the RESPONSE-message arrives, the callback function is called with the 
session-pointer
i used to forward the GET-message.

Now i can read the transport_data saved in callback_magic and copy it into the 
response-pdu.
The RESPONSE will then be forwarded to the correct ip and port of the manager. 



The problem: When i now try to call snmp_close(new_session) i get an 
segmentation fault.
When i do not close the session i get also a segmentation fault after receiving 
many snmp packets.


Can anyone tell me what i am doing wrong?


Susanne


______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to