[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NGO] SMI and InetAddress modules for review



Hi Andy,

Andy Bierman píše v So 03. 03. 2007 v 07:16 -0800:

> I updated my SMI and InetAddress schemas based on your comments
> on the mailing list (e.g., union not choice, type attr optional).
> I think the IPv6 patterns are still wrong though.

The pattern for IPv4 address is also wrong - it doesn't match addresses
where one of the parts is for example 249. The correct regexp should be
something like this (all on a single line):

((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|
2[0-4][0-9]|[01]?[0-9]?[0-9])

I would also prefer a different structuring of IPv6 addresses. There is
no reason for separating the full and shortened form of the IPv6
address. Both forms together can be matched by the conjunction of the
following two regexps:

([0-9a-fA-F]{0,4}:){0,7}[0-9a-fA-F]{0,4}

AND

(([0-9a-fA-F]+:){7}[0-9a-fA-F]+)|(([0-9a-fA-F]+:)*[0-9a-fA-F]+)?::
(([0-9a-fA-F]+:)*[0-9a-fA-F]+)?

On the other hand, the IPv4-mapped and IPv4-compatible IPv6 addresses
should be separate types as in some contexts they need not be allowed.

Lada
 


>  <xs:simpleType name="InetAddressIPv4">
>   <xs:annotation>
>    <xs:documentation>InetAddressIPv4 TC from RFC 4001, pages 7 - 8.</xs:documentation>
>   </xs:annotation>
>   <xs:restriction base="xs:string">
>    <xs:pattern value="(([0-1]?[0-9]?[0-9]|2?[0-5]?[0-5])\.){3}
>                      ([0-1]?[0-9]?[0-9]|2?[0-5]?[0-5])"/>
>    <xs:minLength value="7"/>
>    <xs:maxLength value="15"/>
>   </xs:restriction>
>  </xs:simpleType>

>  <xs:simpleType name="InetAddressIPv6">
>   <xs:annotation>
>    <xs:documentation>InetAddressIPv6 TC from RFC 4001, page 8.,
>          draft-romascanu-netconf-datatypes-01.txt, page 6</xs:documentation>
>   </xs:annotation>
>   <xs:restriction base="xs:string">
>    <xs:pattern value="(([0-9a-fA-F]{1,4}:){6})
>             (([0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4})|
>             ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))"/>
>   </xs:restriction>
>  </xs:simpleType>
> 
>  <xs:simpleType name="InetAddressIPv6m">
>   <xs:annotation>
>    <xs:documentation>draft-romascanu-netconf-datatypes-01.txt, page 6</xs:documentation>
>   </xs:annotation>
>   <xs:restriction base="xs:string">
>    <xs:pattern value="(([0-9a-fA-F]{1,4}:){6})
>               (([0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4})|
>               ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))"/>
>   </xs:restriction>
>  </xs:simpleType>
> 
>  <xs:simpleType name="InetAddressIPv6s">
>   <xs:annotation>
>    <xs:documentation>draft-romascanu-netconf-datatypes-01.txt, page 6</xs:documentation>
>   </xs:annotation>
>   <xs:restriction base="xs:string">
>    <xs:pattern value="(([0-9a-fA-F]{1,4}:)*|([0-9a-fA-F]{1,4}))*(::)
>              (([0-9a-fA-F]{1,4}:)*|([0-9a-fA-F]{1,4}))*"/>
>   </xs:restriction>
>  </xs:simpleType>
> 

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C


_______________________________________________
NGO mailing list
NGO at ietf.org
https://www1.ietf.org/mailman/listinfo/ngo