This is a discussion on Re: problems with read_objid within the SNMP Coders forums, part of the Networking and Network Related category; On 09/01/2008, Carlos Rubio <kadabrachile@gmail.com> wrote: > pdu = snmp_pdu_create(SNMP_MSG_GET); > read_objid(".1....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 09/01/2008, Carlos Rubio <kadabrachile@gmail.com> wrote:
> pdu = snmp_pdu_create(SNMP_MSG_GET); > read_objid(".1.3.6.1.2.1.33.1.1.1.0", anOID, &anOID_len); > snmp_add_null_var(pdu, anOID, anOID_len); > read_objid(".1.3.6.1.2.1.33.1.1.2.0", anOID, &anOID_len); > snmp_add_null_var(pdu, anOID, anOID_len); At this point, the variable 'anOID_len' contains the length of the previous two OIDs (which happen to be the same length). You need to reset the value of 'anOID_len' to be the full size of the 'anOID' buffer before each call to 'read_objid' > read_objid("1.3.6.1.2.1.33.1.3.3.1.2.1", anOID, &anOID_len); > snmp_add_null_var(pdu, anOID, anOID_len); This OID doesn't fit into the apparent size of the buffer that you're providing. So the 'read_objid' call fails. If you were checking your return codes, you'd have spotted this :-) Dave ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216...et/marketplace _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|