edf75ca6ea4ad7425070291af548beea6417481c
[yangtools.git] / yang / yang-parser-impl / src / test / resources / semantic-statement-parser / two-revisions / isis-topology@2013-10-21.yang
1 module isis-topology {
2     yang-version 1;
3     namespace "urn:TBD:params:xml:ns:yang:network:isis-topology";
4     // replace with IANA namespace when assigned
5     prefix "isis";
6     import network-topology {
7         prefix nt;
8         revision-date 2013-10-21;
9     }
10     import l3-unicast-igp-topology {
11         prefix igp;
12         revision-date 2013-10-21;
13     }
14     import ted {
15         prefix ted;
16         revision-date 2013-10-21;
17     }
18
19     organization "TBD";
20     contact "TBD";
21     description "ISIS Topology model";
22
23     revision "2013-10-21" {
24         description "Initial version";
25     }
26     typedef iso-system-id {
27         description "ISO System ID. RFC 1237";
28         type string {
29             pattern '[0-9a-fA-F]{4}(\.[0-9a-fA-F]{4}){2}';
30         }
31     }
32
33     typedef iso-pseudonode-id {
34         description "ISO pseudonode id for broadcast network";
35         type string {
36             pattern '[0-9a-fA-F]{2}';
37         }
38     }
39     typedef iso-net-id {
40         description "ISO NET ID. RFC 1237";
41         type string {
42             pattern '[0-9a-fA-F]{2}((\.[0-9a-fA-F]{4}){6})';
43         }
44     }
45
46     grouping isis-topology-type {
47         container isis {
48             presence "Indicates ISIS Topology";
49         }
50     }
51
52     augment "/nt:network-topology/nt:topology/nt:topology-types/igp:l3-unicast-igp-topology" {
53         uses isis-topology-type;
54     }
55
56     augment "/nt:network-topology/nt:topology/igp:igp-topology-attributes" {
57         when "../nt:topology-types/igp:l3-unicast-igp-topology/isis";
58         container isis-topology-attributes {
59             leaf net {
60                 type iso-net-id;
61             }
62         }
63     }
64
65     augment "/nt:network-topology/nt:topology/nt:node/igp:igp-node-attributes" {
66         when "../../nt:topology-types/igp:l3-unicast-igp-topology/isis";
67         uses isis-node-attributes;
68     }
69
70     augment "/nt:network-topology/nt:topology/nt:link/igp:igp-link-attributes" {
71
72         when "../../nt:topology-types/igp:l3-unicast-igp-topology/isis";
73         uses isis-link-attributes;
74     }
75
76     grouping isis-node-attributes {
77         container isis-node-attributes {
78             container iso {
79                 leaf iso-system-id {
80                     type iso-system-id;
81                 }
82                 leaf iso-pseudonode-id {
83                     default "0";
84                     type iso-pseudonode-id;
85                 }
86             }
87             leaf-list net {
88                 max-elements 3;
89                 type iso-net-id;
90             }
91             leaf-list multi-topology-id {
92                 description "List of Multi Topology Identifier upto 128 (0-127). RFC 4915";
93                 max-elements "128";
94                 type uint8 {
95                     range "0..127";
96                 }
97             }
98             choice router-type {
99                 case level-2 {
100                     leaf level-2 {
101                         type empty;
102                     }
103                 }
104                 case level-1 {
105                     leaf level-1 {
106                         type empty;
107                     }
108                 }
109                 case level-1-2 {
110                     leaf level-1-2 {
111                         type empty;
112                     }
113                 }
114             }
115             container ted {
116                 uses ted:ted-node-attributes;
117             }
118         }
119     }
120
121     grouping isis-link-attributes {
122         container isis-link-attributes {
123             leaf multi-topology-id {
124                 type uint8 {
125                     range "0..127";
126                 }
127             }
128             container ted {
129                 uses ted:ted-link-attributes;
130             }
131         }
132     }
133
134     augment "/igp:igp-node-event" {
135         uses isis-topology-type;
136         uses isis-node-attributes;
137     }
138
139     augment "/igp:igp-link-event" {
140         uses isis-topology-type;
141         uses isis-link-attributes;
142     }
143 } // Module isis-topology