TLV encoding and Decoding

5.7k views Asked by At

I'm new to TLV encoding format. Could someone please provide some pointers for how to encode and decode SNMP PDU's in TLV. I have a requirement to decode the TLV encoded smspdu and I'm really lost where to start.

1

There are 1 answers

0
Lex Li On BEST ANSWER

SNMP uses ASN.1 BER to encode/decode PDUs,

http://en.wikipedia.org/wiki/Type-length-value

http://en.wikipedia.org/wiki/Basic_Encoding_Rules#BER_encoding

Thus, to learn the algorithm you can refer to Wikipedia. That can get you started.

SNMP has its own tags too for basic types, which you can find from related books and articles. But nothing is more reliable than source code of famous open source projects in this area, such as Net-SNMP