On 13 January 2011 16:58, Wes Hardaker <[email protected]> wrote:
JP> Could you explain should "4" (between "1" and IP) be in the OID or
JP> not?
WH> Yes. It gives the length of address following it so that it can be
WH> properly decoded. Although you could determine the length from the IP
WH> address type
Note that these two MIB objects are defined as of type InetAddress,
which means that they can be used for various different types of
address (including IPv4, IPv6, and DNS names) - hence the length
of this value cannot be predicted.
That's why the encoding needs to include the length subidentifier.
I'm also not totally convinced that escaping the quotes around the IP
address will work correctly. My suspicion is that this might well be
interpreted as a printable string (that happened to contain a sequence
of digits and period characters).
So you could easily end up with an OID of the form
.1.3.6.1.2.1.6.19.1.7.1.13.'1'.'9'.'2'.'.'.'1'.'6'.'8'.'.'.'.'8'.'5'.'.'.'9'.'2'....
or
.1.3.6.1.2.1.6.19.1.7.1.13.48.57.49.46.48.54.56.46.56.53.46.57.49...
where 13 is the length of the string "192.168.85.92"
(and similarly for the second IP type/address pair)
I *might* be wrong, and the OID parsing code is clever enough to
spot InetAddress (and similar) values, and interpret the strings
accordingly. But I'd be very surprised....
Dave
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders