This is a discussion on snmp message length within the SNMP Coders forums, part of the Networking and Network Related category; Hi, I'm new here. First of all - I'm snmp beginner (than sorry for my -maybe- simple question). I'...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I'm new here. First of all - I'm snmp beginner (than sorry for my -maybe- simple question). I'm coding a snmp tool, but I have a problem with describe a length of snmp message. SNMP message begins as follows: // this is snmpv1 trap pdu 30 82 01 17 02 01 00 04 06 70 75 62 6c 69 63 a4 82 01 08 06 0d 2b ... etc. whole frame is 280bytes long: first four bytes: 30 - sequence 82 -> (0x82 & 0x7f)*0x80 => 2 * 0x80 = 0x100 (8th bit is set) 01 -> 0x100 + 0x01 = 0x101 (257d) // 8th bit is not set - so - we should finish calculating length here .. but 17 -> 0x101 + 0x17 = 0x118 (280d) - this is our proper length WHY length 280d is coded in three bytes? And why in that way? Normally - I think - this should be coded as follows: 0x82 0x18 This situation (length coded in 3 bytes) is only on the beginning of snmp frame. In PDU (eg. trap pdu) - length is coded in 2 bytes (if 8th bit is set - value > 127d). Maybe this is normal, but I can't find information about it. ehh, sorry for my english :) Thanks in advance, -- ..:Mike:. |