> -----Original Message-----
> From: Juergen Schoenwaelder <[email protected]>
> Sent: 29 April 2019 17:12
> To: Rob Wilton (rwilton) <[email protected]>
> Cc: Ladislav Lhotka <[email protected]>; NETMOD WG <[email protected]>
> Subject: Re: [netmod] 6021 ipv4-prefix
>
> On Mon, Apr 29, 2019 at 03:58:03PM +0000, Rob Wilton (rwilton) wrote:
> >
> >
> > But according to RFC-7950, from a language POV, I think that it is
> > reasonable
> to interpret the canonical format of ipv4-prefix to match that of its base
> YANG
> type, i.e. string.
> >
> > 9.4.2. Canonical Form
> >
> > The canonical form is the same as the lexical representation. No
> > Unicode normalization of string values is performed.
> >
> > Section "9.1. Canonical Representation" does not state that the canonical
> format of a type may be overridden by a description statement.
> >
>
> Section 9.1 talks about 'types' - the text does not indicate that this is
> restricted
> to built-in types.
The whole of section 9 is for "Built-In-Types" and doesn't cover the typedef
statement. In fact, it states "When a server sends XML-encoded data, it MUST
use the canonical form defined in this section."
If YANG allows a typedef to refine the canonical definition of a base type,
then I think that the YANG RFC should be explicit on this (e.g. in YANG Next).
Particularly, because this requires a server implementation to read/understand
the description associated with a leaf/typedef in case they have to add
specific canonicalization code to implement the leaf/typedef.
>
> We are defining canonical formats of typedefs since RFC 6021, which was
> published together with the first version of YANG (RFC 6020). Are you telling
> us
> that we got this all wrong?
I'm not sure that we have really got a simple solution for either clients or
servers:
1) Clients may use non canonical format on configuration input
2) But clients must still use canonical format for xpath expressions
3) Clients must also handle canonical format being returned on any get
requests.
4) Servers must perform normalization of any type to a canonical format, as
defined in the type/typedef/leaf description.
Possibly having a keyword in YANG to mark leaves/typedefs where the canonical
definition refines the canonical type associated with the base type might have
been helpful.
Thanks,
Rob
>
> /js
>
> --
> Juergen Schoenwaelder Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> Fax: +49 421 200 3103 <https://www.jacobs-university.de/>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod