SNMP table index using octet string -


i working on snmp agent using net-snmp , developing mib data held in tables.

i considering using table key based on string of around 15 decimal digits.

is reasonable implement octet string index?

even if encode 2 digits per octet, around 8 octets long.

with octet string index, each octet added node oid.

i know can convert integer(s), decimal digits have leading zeros.

are there views or suggestions this?

thanks in advance.

you can put zeros octet strings, yes can way. octet strings can contain binary data, , encoded number oid. net-snmp api accepts not pointer char *, length of data returned. , because it's legal have octet strings null values encoded within it.

on oid side, if had string consisting of characters a, b 0, d encoded as:

blah.blah.4.65.66.0.67

where 4 length of string. if octet string marked implicit, 4 left out.

you're encoding decimal digits string, values closer things 0x15, 0x04, 0x42, etc. fine (you're building binary string).

whether should or whether should plop integers down in string subject debate depends on you're doing, , bandwidth constraints of environment, etc.


Comments