Manjunatha R
Manjunatha R

Reputation: 9

SNMP Mac ID formatting issue

I need clarity related MAC SNMP oid .1.3.6.1.2.1.2.2.1.6.

The oid is retrieving data in two formats - octet string and hex string. Ex:

1) octet string .1.3.6.1.2.1.2.2.1.6.2 STRING: 00:01:80:5c:df:1c

2) hex string. .1.3.6.1.2.1.2.2.1.6.1 STRING: 30:30:3a:30:30:3a:30:30:3a:30:30:3a:30:30:3a:30:30

Hence while writing code logic, we need to handle both variety. But How to identify the retrieving data is octet string or hex string? Is this related to little endian or big endian concept? Any OID will provide us inform type of data. Kindly help.

Upvotes: 1

Views: 299

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385295

This is specified in the relevant MIB. You should work with MIBs, not just numerical OIDs out of context. An OID just tells you which object is being referred to, but there is so much more information in the MIB about those objects, including their type and how they ought to be interpreted.

In fact there is no such thing as a HEX STRING; these are usually OCTET STRINGs with a display-hint that they should be shown to the user in hex-pair notation.

OCTET STRINGs don't have endianness; they're strings. Sequences.

Upvotes: 1

Related Questions