Fix junit dependencies in poms. Reuse existing from parent,
[bgpcep.git] / topology / api / src / main / yang / ospf-topology.yang
1 module ospf-topology {
2     yang-version 1;
3     namespace "urn:ietf:params:xml:ns:yang:ospf-topology";
4
5     // replace with IANA namespace when assigned
6     prefix "ospf";
7
8     import network-topology {
9         prefix "nt";
10     }
11
12     import l3-unicast-igp-topology {
13         prefix "igp";
14     }
15     import ietf-inet-types {
16         prefix "inet";
17     }
18     import ted {
19         prefix "ted";
20     }
21
22     organization "TBD";
23     contact "TBD";
24     description "OSPF Topology model";
25
26     revision "2013-07-12" {
27         description "Initial revision";
28         reference "TBD";
29     }
30
31     typedef area-id {
32         description "OSPF Area ID";
33         type uint32;
34     }
35
36     grouping ospf-topology-type {
37         container ospf {
38             presence "indiates OSPF Topology";
39         }
40     }
41
42     augment "/nt:network-topology/nt:topology/nt:topology-types/igp:l3-unicast-igp-topology" {
43         uses ospf-topology-type;
44     }
45
46     augment "/nt:network-topology/nt:topology/igp:igp-topology-attributes" {
47         when "../topology-types/ospf";
48         container ospf-topology-attributes {
49             leaf area-id {
50                 type area-id;
51             }
52         }
53
54     }
55
56     augment "/nt:network-topology/nt:topology/nt:node/igp:igp-node-attributes" {
57         when "../../../topology-types/ospf";
58         uses ospf-node-attributes;
59     }
60
61     augment "/nt:network-topology/nt:topology/nt:link/igp:igp-link-attributes" {
62         when "../../../topology-types/ospf";
63         uses ospf-link-attributes;
64     }
65
66     augment "/nt:network-topology/nt:topology/nt:node/igp:igp-node-attributes/igp:prefix" {
67         when "../../../../topology-types/ospf";
68         uses ospf-prefix-attributes;
69     }
70
71     grouping ospf-node-attributes {
72         container ospf-node-attributes {
73             choice router-type {
74                 case abr {
75                     leaf abr {
76                         type empty;
77                     }
78                 }
79                 case asbr {
80                     leaf asbr {
81                         type empty;
82                     }
83                 }
84                 case internal {
85                     leaf internal {
86                         type empty;
87                     }
88                 }
89                 case pseudonode {
90                     leaf pseudonode {
91                         type empty;
92                     }
93                 }
94             }
95             leaf dr-interface-id {
96                 when "../router-type/pseudonode";
97                 description "For pseudonodes, DR interface-id";
98                 default "0";
99                 type uint32;
100             }
101             leaf-list multi-topology-id {
102
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
152     grouping ospf-prefix-attributes {
153         container ospf-prefix-attributes {
154             leaf forwarding-address {
155                 when "../../igp:l3-unicast-igp-topology/igp:ospf/igp:router-type/igp:asbr";
156                 type inet:ipv4-address;
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 }