[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: snmp payload compression
>>>>> Robert Story writes:
>> 5.2.1 ODC Algorithm
>>
>> 3. Truncation of OIDs (which may shorten or enlarge OIDs). A
>> truncation, which may only appear at the end, is encoded as
>> follows:
Robert> May appear only at the end of what? I assume you mean the
Robert> compressed OID?
Correct. I will make the clear in the next update.
Robert> Does this imply that the first two can appear in any order?
Yes.
Robert> Can you have multiple occurances of either of the first two?
Yes.
Robert> Even if each can only occur once, there is still no indication
Robert> of how many of the 3 types will occur. So when decoding, how
Robert> do you know if the byte after the first compression type is
Robert> another compression type or the start of the value?
while (/* there are more bytes in the compressed PDU */) {
if (first_byte & 0x80) {
/* do range substitution */
} else if (! last byte) {
/* do single substitution */
} else {
/* do truncation */
}
}
Perhaps we should just put an implementation into the appendix...
/js