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