Re: [netmod] Can a derived type of instance-identifier change the require-instance property?

2021-12-15 Thread Martin Björklund
Hi,


"Fengchong \(frank\)"  wrote:
> Hi all and martin,
> 
> If I have defined a typedef a
> typedef a {
>   type instance-identifier {
>   require-instance false;
>   }
> }
> 
> And then I define another typedef b
> 
> typedef b {
>   type a {
> require-instance true;
>   }
> 
> }
> 
> Is it correct?

Yes.  However, it is not clear if this is allowed:

   typedef c {
 type b {
   require-instance false;
 }
   }

Note how section 7.4 in RFC 7950 says:

   The "type" statement takes as an argument a string that is the name
   of a YANG built-in type (see Section 9) or a derived type (see
   Section 7.3), followed by an optional block of substatements that is
   used to put further restrictions on the type.
   

This implies that a subtype cannot expand the value space, which would
make "c" above illegal.

This was the intention, but it could be made more clear.  In many
other cases it is explicitly mentioned, e.g. in 9.4.5:

   If a pattern restriction is applied to a type that is already
   pattern-restricted, values must match all patterns in the base type,
   in addition to the new patterns.

> The same scenario is leafref.

Same answer as above.


/martin



> 本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
> This e-mail and its attachments contain confidential information from HUAWEI, 
> which is intended only for the person or entity whose address is listed 
> above. Any use of the information contained herein in any way (including, but 
> not limited to, total or partial disclosure, reproduction, or dissemination) 
> by persons other than the intended recipient(s) is prohibited. If you receive 
> this e-mail in error, please notify the sender by phone or email immediately 
> and delete it!
> 
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


[netmod] Can a derived type of instance-identifier change the require-instance property?

2021-12-14 Thread Fengchong (frank)
Hi all and martin,

If I have defined a typedef a
typedef a {
  type instance-identifier {
  require-instance false;
  }
}

And then I define another typedef b

typedef b {
  type a {
require-instance true;
  }

}

Is it correct?

The same scenario is leafref.
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod