On Friday, June 14, 2002, at 06:04 , Mat Harrison wrote: [..] > actually, it should only be 1-254 inclusive as 255 is reserved for > broadcast or other special addresses (sometimes not used atall). > oficially the 255 node it ignored.
that is actually a "dangerous" assertion to make. Since it basically is only true in the case of well managed class "C" address blocks... {the assertion is non-sensical in class "A" address space, and in CIDR blocks... } http://www.wetware.com/drieux/pbl/Net/simpleDotQuad.txt the problem here is the question "valid IP address" which if all we mean is 'does it comply with the RFC791 specification of the range of four octets that are dot separated then we need merely prove that assertion. In the code I present above - I hope folks see that this really is sorta a three pass problem - a) does it comply with the basic /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ pattern of being a 'dotQuad' b) is each octet in range of 0..255 c) the funky part if you want to get into things like worry about it being a loop back, an RFC 1918, a broadcast, a multi-cast.... folks may wish to remember that while addresses like 0.0.0.0 and 127.0.0.1 may not be their pet fave ID_ADDR's - there are others that they should be aware of as well. remember from things like RFC1918 that 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) designate the IP_ADDR space that is not accessible on the internet itself.... cf: http://www.faqs.org/rfcs/rfc1918.html We could of course go back and consult say RFC 791.... ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]