[AGENT++] [SNMP++] Longer than expected response with unprintable characters
Jochen Katz
katz at agentpp.com
Mon Jul 2 11:22:53 CEST 2007
Hi,
you obviously use the get_printable() function, that behaves as desired.
If the string contains nonprintable characters, the output of
get_printable_hex() is returned.
See http://sa-ha.de/tmp_doc/classOctetStr.html#a17
If you want the raw value, you have to use data() and len() functions.
Regards,
Jochen
Altaf Aali schrieb:
> Using the SNMP++ library, I am observing that I am getting longer responses
> than expected which contain unprintable characters and spaces beyond the
> valid characters. This always happens for the hex octet strings. So if a
> MAC
> address is to be returned as follows:
>
> AC 03 EF 00 00 00
>
> I get ........ AC 03 EF 00 00 00 ......................... ............
>
> The same applies to IP address values etc. I have worked around this in my
> application by checking the size of the printable_value and that of the
> octetstr which differ in this case and if they are different, I strip off
> characters myself.
>
> A bigger problem occurs when the type is a composite string in which case I
> get more garbage.
>
> Is this a known problem and is there a fix for this?
>
> thanks
> Altaf
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp
More information about the AGENTPP
mailing list