Subject: [YANG] Choice and uses statement

From: Li Yan <[email-masked]>
Date: Fri, 18 Jan 2008 18:30:18 +0800

Hi,

Why the "uses" statement is not able to reference the "choice" definition?
If it can, the "choice" definition would be allowed to be reused.

I noticed that the "choice" statement can be contained immediately in the
"module" and "submodule" statement. I wonder how to make use of this
"choice" definition?

Yan

_______________________________________________
YANG mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/yang

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 18 Jan 2008 12:39:47 +0100 (CET)

> If it can, the "choice" definition would be allowed to be reused.

uses always references a named grouping.  The grouping can contain a
choice, so you can do:

   grouping protocol-type {
     choice proto {
       case tcp { ... }
       case udp { ... }
     }
   }

And then:

   uses protocol-type;

> "module" and "submodule" statement. I wonder how to make use of this

'choice' is one of the "data-definition statements" in YANG.  All
data-definitions are allowed at the top-level.  We didn't really see a
reason to restrict these usages.

/martin