Hi Tom, et al, In the latest version, -17, we have used the standard IETF ip-prefix type and specified the constrain in the text. Thanks, Acee
On 7/8/20, 7:53 AM, "tom petch" <[email protected]> wrote: From: rtgwg <[email protected]> on behalf of Yingzhen Qu <[email protected]> Sent: 07 July 2020 19:45 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. <tp> As I said before, it is possible to make more checks with YANG but as you point out, they are complex. For me, it is not worth the added complexity and I would just make sure that the description is clear to such as RTG-DIR. 'must' be present, and max>= min I think fine, but that is as far as I would go. Where ipv4 goes one way and ipv6 goes another then YANG choice case case comes to mind but probably not worth it here. Tom Petch 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
