Added model generation from ietf-topology models
[yangtools.git] / model / ietf / ietf-topology-ospf / src / main / yang / ospf-topology@2013-07-12.yang
1 ňmodule ospf-topology {
2     yang-version 1;
3     namespace "urn:ietf:params:xml:ns:yang:ospf-topology";
4         // replace with IANA namespace when assigned
5     prefix "ospf";
6
7     import network-topology {
8                 prefix "nt";
9     }
10
11     import l3-unicast-igp-topology {
12                 prefix "igp";
13     }
14     import ietf-inet-types {
15                 prefix "inet";
16     }
17     import ted {
18                 prefix "ted";
19     }
20
21     organization "TBD";
22     contact "TBD";
23     description "OSPF Topology model";
24
25     revision "2013-07-12" {
26                 description "Initial revision";
27                 reference "TBD";
28     }
29
30     typedef area-id {
31                 description "OSPF Area ID";
32                 type uint32;
33     }
34
35     grouping ospf-topology-type {
36                 container ospf {
37                         presence "indiates OSPF Topology";
38                 }
39     }
40
41     augment "/nt:network-topology/nt:topology/nt:topology-types/igp:l3-unicast-igp-topology" {
42                 uses ospf-topology-type;
43     }
44
45     augment "/nt:network-topology/nt:topology/igp:igp-topology-attributes" {
46                 when "../topology-types/ospf";
47                 container ospf-topology-attributes {
48                         leaf area-id {
49                                 type area-id;
50                         }
51                 }
52     }
53
54     augment "/nt:network-topology/nt:topology/nt:node/igp:igp-node-attributes" {
55                 when "../../../topology-types/ospf";
56                 uses ospf-node-attributes;
57     }
58
59     augment "/nt:network-topology/nt:topology/nt:link/igp:igp-link-attributes" {
60                 when "../../../topology-types/ospf";
61                 uses ospf-link-attributes;
62     }
63
64     augment "/nt:network-topology/nt:topology/nt:node/igp:igp-node-attributes/igp:prefix" {
65                 when "../../../../topology-types/ospf";
66                 uses ospf-prefix-attributes;
67     }
68
69     grouping ospf-node-attributes {
70                 container ospf-node-attributes {
71                         choice router-type {
72                                 case abr {
73                                         leaf abr {
74                                                 type empty;
75                                         }
76                                 }
77                                 case asbr {
78                                         leaf asbr {
79                                                 type empty;
80                                         }
81                                 }
82                                 case internal {
83                                         leaf internal {
84                                                 type empty;
85                                         }
86                                 }
87                                 case pseudonode {
88                                         leaf pseudonode {
89                                                 type empty;
90                                         }
91                                 }
92                         }
93                         leaf dr-interface-id {
94                                 when "../router-type/pseudonode";
95                                 description "For pseudonodes, DR interface-id";
96                                 default "0";
97                                 type uint32;
98                         }
99                         leaf-list multi-topology-id {
100                                 description "List of Multi-Topology Identifier up-to 128 (0-127). RFC 4915";
101                                 max-elements "128";
102                                 type uint8 {
103                                         range "0..127";
104                                 }
105                         }
106                         leaf capabilities {
107                                 description "OSPF capabilities as bit vector. RFC 4970";
108                                 type bits {
109                                         bit graceful-restart-capable {
110                                                 position 0;
111                                         }
112                                         bit graceful-restart-helper {
113                                                 position 1;
114                                         }
115                                         bit stub-router-support {
116                                                 position 2;
117                                         }
118                                         bit traffic-engineering-support {
119                                                 position 3;
120                                         }
121                                         bit point-to-point-over-lan {
122                                                 position 4;
123                                         }
124                                         bit experimental-te {
125                                                 position 5;
126                                         }
127                                 }
128                         }
129                         container ted {
130                                 uses ted:ted-node-attributes;
131                         }
132                 } // ospf
133     } // ospf-node-attributes
134
135     grouping ospf-link-attributes {
136                 container ospf-link-attributes {
137                         leaf multi-topology-id {
138                                 type uint8 {
139                                         range "0..127";
140                                 }
141                         }
142                         container ted {
143                                 uses ted:ted-link-attributes;
144                         }
145                 }
146     } // ospf-link-attributes
147
148     grouping ospf-prefix-attributes {
149                 container ospf-prefix-attributes {
150                         leaf forwarding-address {
151                                 when "../../igp:l3-unicast-igp-topology/igp:ospf/igp:router-type/igp:asbr";
152                                 type inet:ipv4-address;
153                         }
154                 }
155     }
156
157         /*
158     augment "/igp:igp-node-event" {
159             uses ospf-topology-type;
160             uses ospf:ospf-node-attributes;
161     }
162
163     augment "/igp:igp-link-event" {
164             uses ospf-topology-type;
165             uses ospf:ospf-link-attributes;
166     }
167
168     augment "/igp:igp-prefix-event" {
169             uses ospf-topology-type;
170             uses ospf:ospf-prefix-attributes;
171     }
172     */
173 }