I defer to people with more YANG chops than I have, to decide whether the module should embed the error checking or if the constraints should just be written out in prose and left for the implementor. On the face of it, it’s attractive to have the YANG do it, because it minimizes the scope for implementations to get it wrong, but I understand that it comes with tradeoffs.
The main point in my review was that the semantics of what a prefix filter does need to be clearly expressed in the document. I’m OK with this being in code, or in prose, as long as it’s clear and unambiguous. Thanks, —John On Jul 7, 2020, at 2:45 PM, Yingzhen Qu <[email protected]> wrote: Hi all, Thank you all for the discussions and comments. If we’re to do error-checking in the YANG module, here’re the two issues: Ip-prefix is a union of “ipv4-prefix” and “ipv6-prefix”. The mask-length-upper is 32 for IPv4 and 128 for IPv6, so we either have to separate ipv4 and ipv6 in order to add a constraint or it will be up to the server to reject the config. “ipv4-prefix” and “ipv6-prefix” are defined as a string, so the mask-length is part of the string. I don’t know an easy way to add a constraint if mask-length-lower needs to be verified against mask-length. Any comments and suggestions are welcome. Thanks, Yingzhen From: John Scudder <[email protected]> Date: Tuesday, July 7, 2020 at 9:06 AM To: "John G. Scudder" <[email protected]> Cc: "Acee Lindem (acee)" <[email protected]>, Yingzhen Qu <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, RTGWG <[email protected]> Subject: Re: [RTG-DIR] RtgDir review: draft-ietf-rtgwg-policy-model-16 On Jul 7, 2020, at 11:35 AM, John G. Scudder <[email protected]> wrote: Hi Acee, On Jul 7, 2020, at 11:16 AM, Acee Lindem (acee) <[email protected]> wrote: Yes. I’d say we should just use the ip-prefix type from RFC 6021. This type has the right semantics. However, I’m wondering how we do the mask-length-lower checking with the union. I imagine it should be possible. How would you test the constraint on mask-length-upper if you use ip-prefix? Duh, that’s what you said, s/upper/lower/. I don’t see a way to do it, but if you can work it out I agree it otherwise seems like the right approach. —John
_______________________________________________ rtgwg mailing list [email protected] https://www.ietf.org/mailman/listinfo/rtgwg
