[AGENT++] OID value as IP address

Jochen Katz katz at agentpp.com
Fri Oct 21 22:08:03 CEST 2016


Hi,

> I'm using SNMP++ library to parse the packet I received (by `unload()` to
> convert snmpmsg into pdu). However, I find when the OID value is IP
> address, even if my packet is valid, I will only get a pdu without any
> variable bindings.

so you are receiving the SNMP message through your own socket and
calling SnmpMessage::unload() to parse it?

> I debugged it and found SNMP++ checks whether the IP address is valid by
> `gethostbyname()`. But of course such behavior makes the address given by
> the remote device invalid and not being put into my pdu. (For example, the
> address I got is "10.0.0.1" and it is not valid on my host machine.)

I don't see why this should happen. Can you send a stack trace so I can
see from where the hostname lookup is triggered?

Regards,
  Jochen




More information about the AGENTPP mailing list