RE: Getting Too Long Error
"Rucha" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I have created PDU using following API pdu = snmp_pdu_create(SNMP_MSG_GET); Doesn't it populate version by default ? Regards, Rucha From: Pranesh Kulkarni [mailto:[email protected]] Sent: Friday, June 20, 2008 12:11 PM To: Rucha Cc: Dave Shield; [email protected] Subject: Re: Getting Too Long Error I think PDU is malformed as Dave said , ... Check version , its stating that it -1 and errstat and errindex as also -1 . On Fri, Jun 20, 2008 at 11:41 AM, Rucha <[email protected]> wrote: Hi Dave, Here is the dump of pdu. (gdb) p pdu $1 = (netsnmp_pdu *) 0x951b398 (gdb) p *$1 $2 = {version = -1, command = 160, reqid = 713309340, msgid = 1415423209, transid = 0, sessid = 0, errstat = -1, errindex = -1, time = 0, flags = 0, securityModel = -1, securityLevel = 0, msgParseModel = 0, transport_data = 0x0, transport_data_length = 0, tDomain = 0x0, tDomainLen = 0, variables = 0x0, community = 0x0, community_len = 0, enterprise = 0x0, enterprise_length = 0, trap_type = 0, specific_type = 0, agent_addr = "\000\000\000", contextEngineID = 0x0, contextEngineIDLen = 0, contextName = 0x0, contextNameLen = 0, securityEngineID = 0x0, securityEngineIDLen = 0, securityName = 0x0, securityNameLen = 0, priority = 0, range_subid = 0, securityStateRef = 0x0} 135 int length = sizeof(pdu); (gdb) n 137 printf("PDU Length = %d\n", length); (gdb) n PDU Length = 4 139 status = snmp_synch_response(ss, pdu, &response); (gdb) p length $4 = 4 Regards, Rucha -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield Sent: Thursday, June 19, 2008 8:18 PM To: Rucha Cc: Pranesh Kulkarni; [email protected] Subject: Re: Getting Too Long Error 2008/6/19 Rucha <[email protected]>: > I checked the size of pdu which I am sending, its size of just 4bytes. An SNMP PDU of just 4 bytes!!? Can you please post a packet dump of this request. > Any other reason for getting this error ? Given that a GET PDU will typically be at *least* 30 bytes in size, and the absolute minimum size of a completely empty GET request is (I think) 18 bytes - if your GET request is just 4 bytes, then it's almost certainly invalid. If it's malformed, then the parsing code might well be reading the length as over-size, and returning a tooLong error. 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://sourceforge.net/services/buy/index.php _______________________________________________ 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