Bug 8473: Reboot fixes for ECMP with extra-routes
[netvirt.git] / vpnservice / fibmanager / fibmanager-api / src / main / yang / odl-fib.yang
1 module odl-fib {
2     namespace "urn:opendaylight:netvirt:fibmanager";
3     prefix odl-fib;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6
7     revision "2015-03-30" {
8         description "FIB Manager module";
9     }
10
11     grouping ipv4Entries {
12         list ipv4Entry{
13             key  "destPrefix";
14             leaf destPrefix {type string;}
15             leaf nextHopAddress {type string;}
16         }
17     }
18
19     grouping vrfEntryBase {
20             leaf destPrefix {
21                 type string;
22                 mandatory true;
23             }
24             leaf mac {
25                type string;
26             }
27             leaf origin {
28                 type string;
29                 mandatory true;
30             }
31             leaf encap-type {
32                description
33                   "This flag indicates how to interpret the existing label field.
34                    A value of mplsgre indicates that the label within route paths will continue to be considered as an MPLS Label.
35                    A value of vxlan indicates that l3vni should be used to advertise to bgp and label will be ignored.";
36
37                type enumeration {
38                   enum mplsgre {
39                      value "0";
40                      description "MPLSOverGRE";
41                   }
42                   enum vxlan {
43                      value "1";
44                      description “VNI";
45                   }
46                }
47                default "mplsgre";
48             }
49
50             leaf l3vni {
51                type uint32;
52             }
53             leaf gateway_mac_address {
54                type string;
55             }
56             leaf parent-vpn-rd {
57                description
58                  "If set will get the vpn-to-dpn information from the parent-vpn-rd";
59                type string;
60             }
61             list route-paths {
62                 key "nexthop-address";
63                 leaf nexthop-address {
64                     type string;
65                 }
66                 leaf label {
67                     type uint32;
68                 }
69             }
70     }
71
72     grouping vrfEntries {
73         list vrfEntry{
74             key  "destPrefix";
75             uses vrfEntryBase;
76         }
77     }
78
79     grouping macVrfEntries {
80         list macVrfEntry {
81             key  "mac";
82             uses vrfEntryBase;
83             leaf l2vni {
84                type uint32;
85             }
86         }
87     }
88
89     augment "/odl-fib:fibEntries/odl-fib:vrfTables/odl-fib:vrfEntry" {
90             ext:augment-identifier "subnetRoute";
91             leaf elantag {type uint32;}
92     }
93
94     augment "/odl-fib:fibEntries/odl-fib:vrfTables/odl-fib:vrfEntry" {
95         ext:augment-identifier "routerInterface";
96         leaf uuid {type string;}
97         leaf mac-address {type string;}
98         leaf ip-address {type string;}
99     }
100
101     container fibEntries {
102         config true;
103         list vrfTables{
104             key "routeDistinguisher";
105             leaf routeDistinguisher {type string;}
106             uses vrfEntries;
107             uses macVrfEntries;
108         }
109
110         container ipv4Table{
111             uses ipv4Entries;
112         }
113     }
114
115     container label-route-map {
116          config false;
117          list label-route-info {
118             key label;
119             leaf label { type uint32; }
120             leaf dpn-id { type uint64; }
121             leaf prefix { type string; }
122             leaf-list next-hop-ip-list { type string; }
123             leaf-list vpn-instance-list { type string; }
124             leaf parent-vpnid { type uint32; }
125             leaf vpn-interface-name { type string; }
126             leaf elan-tag { type uint32; }
127             leaf is-subnet-route { type boolean; }
128             leaf parent-vpn-rd { type string; }
129          }
130     }
131
132     container extraroute-rds-map {
133         config true;
134         list extraroute-rds {
135             description
136                 "List of route distinguishers used to create a unique NLRI for the destination prefix";
137             key "vpnid";
138             leaf vpnid {
139                 type uint32;
140             }
141             list dest-prefixes {
142                 key "dest-prefix";
143                 leaf dest-prefix {
144                     type string;
145                 }
146                 list allocated-rds {
147                     key nexthop;
148                     leaf nexthop {
149                         type string;
150                         description "Ip address of the VM which is the nexthop for the extra route";
151                     }
152                     leaf rd {type string;}
153                 }
154             }
155         }
156    }
157
158    container ip-prefix-map {
159         description "Stores information about a parent vpn and prefix in that parent vpn,
160                     along with what other vpn-instances import the parent vpn";
161         config false;
162         list ip-prefix-info {
163             key "prefix parent-primary-rd";
164             leaf prefix {
165                 type string;
166             }
167             leaf parent-primary-rd {
168                 type string;
169             }
170             leaf dpn-id {
171                 type uint64;
172             }
173             leaf-list vpn-instance-list {
174                 type string;
175             }
176             leaf parent-vpnid {
177                 type uint32;
178             }
179             leaf vpn-interface-name {
180                 type string;
181             }
182             leaf elan-tag {
183                 type uint32;
184             }
185             leaf is-subnet-route {
186                 type boolean;
187             }
188             leaf encap-type {
189                 type enumeration {
190                     enum mplsgre {
191                         value "0";
192                     }
193                     enum vxlan {
194                         value "1";
195                     }
196                 }
197                 default "mplsgre";
198             }
199             leaf l3vni {
200                 type uint32;
201             }
202             leaf l2vni {
203                  type uint32;
204             }
205             list route-paths {
206                  key "nexthop-address";
207                  leaf nexthop-address {
208                       type string;
209                  }
210                  leaf label {
211                       type uint32;
212                  }
213                  leaf gateway_mac_address {
214                       type string;
215                  }
216             }
217         }
218    }
219
220 }