I am having trouble using the Single API to perform asynchronous walks
with Net-SNMP version 5.4.3.  Any help would be great.  I have two
main issues:

1.  Does the Single API really use the same callback function
signature as the Traditional API (snmp_callback at snmp_api.h:180)?
I would expect the second parameter, the session pointer, to be a
(void *) or a (struct session_list *) instead of a (netsnmp_session *)
because the Single API uses opaque session pointers.  If the second
parameter of the callback must be a (netsnmp_session *), how can I
make this work?

2. What is the proper way to perform an asynchronous bulk walk to get
all subtree OIDs?
When sending subsequent asynchronous SNMP_MSG_GETBULK APDUs in my
callback function, my program segmentation faults when
_sess_async_send() dereferences its session pointer at
snmp_api.c:4696.  The session pointer points to an invalid non-null
address; I think the issue may be related to possible misuse described
in item 1.  If I should not make additional asynchronous calls from
the callback function, what is the proper procedure?  Here is a
backtrace, and I can provide my code if needed.

#0  0x00007ff1c6ea31c1 in _sess_async_send (sessp=0x13dbc60, pdu=0x1478570,
    callback=0x401a9e <response_h>, cb_data=0x7fffbb24ffe0) at snmp_api.c:4696
#1  0x00007ff1c6ea3dc1 in snmp_sess_async_send (sessp=0x13dbc60,
    pdu=0x1478570, callback=0x401a9e <response_h>, cb_data=0x7fffbb24ffe0)
    at snmp_api.c:4973
#2  0x000000000040210b in response_h (operation=1, sp=0x13dbc60,
    reqid=163334208, cb_pdu=0x1477140, cb_data=0x7fffbb24ffe0)
    at walktest_async_multireq.c:261
#3  0x00007ff1c6ea49fc in _sess_process_packet (sessp=0x1418c50, sp=0x13dbc60,
    isp=0x14631f0, transport=0x1463430, opaque=0x1459a10, olength=20,
    packetptr=0x1467130
"0\201\322\002\001\003\060\021\002\004\066\336\207\066\002\003",
length=213) at snmp_api.c:5263
#4  0x00007ff1c6ea6359 in _sess_read (sessp=0x1418c50, fdset=0x7fffbb251050)
    at snmp_api.c:5764
#5  0x00007ff1c6ea63a7 in snmp_sess_read (sessp=0x1418c50,
    fdset=0x7fffbb251050) at snmp_api.c:5783
#6  0x0000000000401a57 in main (argc=1, argv=0x7fffbb251398)
    at walktest_async_multireq.c:148

Thank you for your time.

Brendan

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to