Reputation: 301
Hi I have a packet capture from wireshark .
I have opened the file and saw the below output in variable bindings.
Object Name: .1.3.6.1.4.1.193.183.4.1.4.5.1.8(iso.3.6.1.4.1.193.183.4.1.4.5.1.8) Value(Octect String ) : 353038
Can I find the integer value of the octect string ?
Octect string and Octal value mean the same ? If so , can a octal value contain 8 in 353038 .. ?
Please guide how do I know the integer value of the octect string : 353038
Upvotes: 1
Views: 9167
Reputation: 63243
Octet strings are defined as OCTET STRING in ASN.1 and SNMP. There is nothing called "Octect String". Meanwhile, octet strings have little relationship with the octal numeric system.
When you see 353038
is as an octet string, it simply means on the wire an SNMP packet have arrived, and it contains a string of ASCII characters "3", "5", "3", "0", "3", and "8". It is a string by nature, and does not necessarily need to be an integer (unless the definition of .1.3.6.1.4.1.193.183.4.1.4.5.1.8
in the corresponding MIB document mandates that fact).
Most of your questions above are invalid, as you misunderstood the concept of octet strings. But if the object definition does indicate the string to represent an integer, you can always convert the string received to an integer. Most programming languages support that kind of conversion.
Upvotes: 2
Reputation: 2536
Octet string is a sequence of bytes. In your example, it consists of 3 bytes with hexadecimal values 35, 30, and 38. In a general case, you cannot talk in a meaningful way about an "integer value of the octet string". In this particular case, if you interpret the individual bytes as ASCII, then 35 hex represents character "5", 30 hex represents character "0", and 38 hex represents character "8", so the whole string is "508".
I suspect that the "integer value" you are looking for is 508 in this case, but keep in mind that the interpretation of the meaning of the string depends very much on the application.
Upvotes: 3