[AGENT++] IP address validity
Ramin Dousti
ramin at cannon.eng.us.uu.net
Tue Sep 21 22:24:32 CEST 2004
I'm sorry. The below test works just fine. Apologies...
On Tue, Sep 21, 2004 at 04:01:22PM -0400, Ramin Dousti wrote:
> 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
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://agentpp.org/mailman/listinfo/agentpp
More information about the AGENTPP
mailing list