[AGENT++] IP address validity

Ramin Dousti ramin at cannon.eng.us.uu.net
Tue Sep 21 22:01:22 CEST 2004


Hi,

I'm receiving traps with some private enterprise OID with an octed-string
value which should represent an IP address. How can I make sure that the
value I receive is a valid IP address and not a random string? What I did
was:

IpAddress tmpIP(vb.get_printable_value());
if (tmpIP.valid()) {
	// the octed-string is a valid IP address
	...
} else {
	// the octed-string is _not_ a valid IP address
	...
}

but unfortunately it shows valid all the time even if the octed-string is,
eg, "test".

Ramin




More information about the AGENTPP mailing list