spf-discuss
[Top] [All Lists]

Re: Re: nailing down the CIDR length

2005-07-09 02:02:44
At 12:20 AM 7/9/2005, Frank Ellermann wrote:
wayne wrote:

> uh, something like this:

>    ip4-cidr-length  = "/" ( %x31-%x39 / "1" DIGIT / "2" DIGIT
>                        / "3" %x30-%x32 )
>    ip6-cidr-length  = "/" ( %x31-%x39 / DIGIT DIGIT
>                        / "10" DIGIT / "11" DIGIT /
>                        / "12" %x30-%x38 )

> (I just typed created these ABNF rules, beware of bugs.)

Next attempt, the ABNF RfC recommends to use brackets:

 ip4-cidr-length  = "/" ( nonzero                  ;   1 ..   9
                        / (( "1" / "2" ) DIGIT )   ;  10 ..  29
                        / "30 / "31" / "32" )      ;  30 ..  32
 ip6-cidr-length  = "/" ( nonzero [ DIGIT ]        ;   1 ..  99
                        / (( "10" / "11" ) DIGIT ) ; 100 .. 119
                        / ( "12" %x30-%x38 ) )     ; 120 .. 128
 nonzero          = %x31-39                        ;   1 ..   9

With some comments the gibberish is IMHO more tolerable.

Comments really help.

Perhaps even adding some wording like "The syntax facilitates non-zero valid CIDR range constructs for IP4 and IP6 respectively (e.g., 192.168.111.0/24 )." placed somewhere appropriate near the definition might help clarify further, especially as regards reenforcing the non-zero and valid range aspects for CIDRs that you wanted to express by adding these additional qualifiers. Perhaps that is overkill.

> Is this something I should put into the spec?

Makes sense.

Agreed. It may look a bit less attractive to some, but it certainly leaves no wriggle room for publishers to introduce zero or invalid CIDRs into their published records and then blame the specification for not being explicit.


 [macro]
> This value  needs to be at least one to make any sense and,
> due to limitations in a DNS query, a maximum of 128.

Maybe use the same syntax in both 1..128 constructs.  Don't
modify the ABNF without Bill's validator and discussion here,
our last minute fixes of the IPv4 literals made me nervous ;-)

                         Bye, Frank

Best,

Alan Maitland
WebMaster(_at_)Commerco(_dot_)Net
The Commerce Company - Making Commerce Simple(sm)
http://WWW.Commerco.Com/