This is a discussion on Re: Strange error in test program... within the SNMP Coders forums, part of the Networking and Network Related category; Hi Dave, Thanks again for your response. On Tue, Apr 8, 2008 at 2:51 PM, Dave Shield <D....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi Dave,
Thanks again for your response. On Tue, Apr 8, 2008 at 2:51 PM, Dave Shield <D.T.Shield@liverpool.ac.uk> wrote: > You need to update the 'if_oid' buffer with the OID from this response. > > At the moment, you're asking for the same OID every time. Yes, I thought so, but all attempts were without result. Here's what I thought I should do: --- // Update OID memmove(if_oid, resp->variables->name, resp->variables->name_length); if_oid_len = resp->variables->name_length; --- However, still no result. I take it that the response PDU contains the oid with which I should update the 'old' one? The total 'walk' looks like: ---------------------- // Get starting object: 'IF-MIB::ifPhysAddress.*' read_objid("IF-MIB::ifPhysAddress", if_oid, &if_oid_len); // Walk the list of IF-MIB::ifPhysAddress.x for (i = 0; i < 10; i++) { // Create a PDU (SNMP packet) req = snmp_pdu_create(SNMP_MSG_GETNEXT); snmp_add_null_var(req, if_oid, if_oid_len); // Send request PDU ret = snmp_synch_response(sess_h, req, &resp); if (ret != STAT_SUCCESS || resp->errstat != SNMP_ERR_NOERROR) goto out_snmp_synch_response; // Update OID memmove(if_oid, resp->variables->name, resp->variables->name_length); if_oid_len = resp->variables->name_length; // DEBUG print_variable(resp->variables->name, resp->variables->name_length, resp->variables); // Free response PDU if (resp) snmp_free_pdu(resp); } ----------------------- -Kris ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757...un.com/javaone _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|