[AGENT++] IpAddress: how to create a Hex-String instead a String?
Claus Klein
claus.klein at arcormail.de
Sat Nov 6 10:39:41 CET 2010
Hallo List,
I have a simple table with an agent++::IpAddress, but when I read this
OID, the result is NOT encoded as I expected
This is how I fill this value:
IpAddress _ipAddr("::1");
row->get_nth(nNetSnmpHostAddress)-
>replace_value(OctetStr(_ipAddr).clone());
And that is what I get:
--- snip ---
dumph_recv: VarBindList
dumph_recv: VarBind
dumph_recv: Name
dumpx_recv: 06 15 2B 06 01 04 01 BF 08 02 02 02 01 03 08 6C
6F 6F 70 62 61 63 6B
dumpv_recv: ObjID: NET-SNMP-EXAMPLES-
MIB::netSnmpHostAddress."loopback"
dumph_recv: Value
dumpx_recv: 04 27 30 30 30 30 3A 30 30 30 30 3A 30 30 30 30
3A 30 30 30 30 3A 30 30 30 30 3A 30 30 30 30 3A
30 30 30 30 3A 30 30 30 31
dumpv_recv: String:
0000:0000:0000:0000:0000:0000:0000:0001
dumph_recv: VarBind
dumph_recv: Name
dumpx_recv: 06 13 2B 06 01 06 03 0C 01 02 01 03 69 6E 74 65
72 6E 61 6C 30
dumpv_recv: ObjID: SNMP-TARGET-
MIB::snmpTargetAddrTAddress.'internal0'
dumph_recv: Value
dumpx_recv: 04 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 01 A2 00
NET-SNMP-EXAMPLES-MIB::netSnmpHostAddress."loopback" = STRING:
"0000:0000:0000:0000:0000:0000:0000:0001"
SNMP-TARGET-MIB::snmpTargetAddrTAddress.'internal0' = Hex-STRING: 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 A2 00
As you can see, the TargetAddressTable is more compact for this simple
ipv6 localhost address!
Too, IpAddress::get_printable() should get the string as "::1" in this
case.
Is it possible to control this?
Any good idea would help.
With regards,
Claus
More information about the AGENTPP
mailing list