Add RFC6643 parser support
[yangtools.git] / yang / rfc6643-parser-support / src / test / resources / foo.yang
1 module foo {
2     namespace "urn:opendaylight:yang:extension:third-party";
3     prefix foo;
4     yang-version 1;
5
6     import ietf-yang-smiv2 { prefix "smiv2"; }
7
8     revision 2016-06-09;
9
10     typedef InterfaceIndexOrZero {
11         type int32 {
12             range "0..2147483647";
13         }
14         description
15             "This textual convention is an extension of the
16              InterfaceIndex convention.  The latter defines a greater
17              than zero value used to identify an interface or interface
18              sub-layer in the managed system.  This extension permits the
19              additional value of zero.  the value zero is object-specific
20              and must therefore be defined as part of the description of
21              any object which uses this syntax.  Examples of the usage of
22              zero might include situations where interface was unknown,
23              or when none or all interfaces need to be referenced.";
24         smiv2:display-hint "d";
25     }
26
27     container root {
28         smiv2:oid "1";
29
30         list ifStackEntry {
31             smiv2:oid "1.1";
32             smiv2:implied "ifStackHigherLayer";
33             key "ifStackHigherLayer";
34
35             leaf ifStackHigherLayer {
36                 type foo:InterfaceIndexOrZero;
37                 smiv2:max-access "not-accessible";
38                 description "The value of ifIndex corresponding to the higher sub-layer
39                             of the relationship, i.e., the sub-layer which runs on 'top'
40                             of the sub-layer identified by the corresponding instance of
41                             ifStackLowerLayer.  If there is no higher sub-layer (below
42                             the internetwork layer), then this object has the value 0.";
43                 smiv2:oid "1.1.1";
44             }
45
46             leaf test-number {
47                 type int32;
48                 description "Test leaf;";
49                 smiv2:max-access "not-accessible";
50                 smiv2:subid "2";
51                 smiv2:defval "0";
52             }
53         }
54     }
55
56     smiv2:alias "ifXTable" {
57         description "A list of interface entries.  The number of entries is
58                     given by the value of ifNumber.  This table contains
59                     additional objects for the interface table.";
60         smiv2:oid "1.3.6.1.2.1.31.1.1";
61     }
62
63
64 }