AW: AW: [SNMP4J] GenericAddress.parse(String) doesn't comply with IP standards?

Eggers, Henning Henning.Eggers at plath.de
Wed Apr 25 08:35:00 CEST 2007


> Hi Henning

Hi Rory !

> 
> I believe that it is IPv4 RFC 791.

Yep, that is the IPv4 standard. But it is solely concerned with header
formats and the like on a binary level. Scanning through it, I could not
find any specification of possible textual representations of IP
addresses.

> 
> Yes I am aware why IP addresses are written in DDN, but they 
> can also be in 
> Dotted Octal or Dotted Hex.
> 
> They can also be written with each byte in a different base e.g. 
> 0x42.0146.9.0x63 (try and ping something using a part hex 
> address or octal 
> address or type http://0x42.0146.9.0x63 into your browser and 
> see what 
> happens).

Nothing. No, not really, Firefox actually takes hex addresses which may
be for the same reason as you observered with SNMP4J. But for the rest,
like octals and using IE: Errors, just errors ...


> 
> I think you are right that the InetAddress parse uses IPv6 
> standard which 
> can be prefixed with a 0 due to it's Hex nature, which has 
> caused my issue. 
> I can't think of a reason why anyone would choose to use 
> Octal for IPv4 over 
> just straight decimal, but they do.

I am sorry for you. You will either have to ask them to stop making up
there own "standards" or do as you already said and parse their
addresses to the real one.

Actually, I was wondering if you or "they" are using some kind of
special DNS server of HTTP proxy that does the translating and that this
why it worked in the past. If the browser(more precisely the resolver
library) does not recognize an IP address it assumes it is a host name
and will try and resolve it through DNS. Or if it is using a proxy it
will send the request to the proxy as a whole.

Maybe you should look into that.

Keep having a nice day ;-)

Henning




More information about the SNMP4J mailing list