ELAN: skip remote unicast MACs
[netvirt.git] / natservice / natservice-api / src / main / yang / odl-nat.yang
1 module odl-nat {
2     namespace "urn:opendaylight:netvirt:natservice";
3     prefix odl-nat;
4
5     import ietf-yang-types { prefix "yang"; /*revision-date 2013-07-15; */}
6     import ietf-inet-types { prefix "inet"; }
7
8     revision "2016-01-11" {
9         description "NAT Manager module";
10     }
11
12     container external-networks {
13         list networks  {
14             key id;
15             leaf id {
16                 type yang:uuid;
17             }
18             leaf vpnid { type yang:uuid; }
19             leaf-list router-ids { type yang:uuid; }
20             leaf provider-network-type { type provider-types; }
21         }
22     }
23
24     container ext-routers {
25         list routers {
26             key router-name;
27             leaf router-name { type string; }
28             leaf network-id { type yang:uuid; }
29             leaf enable-snat { type boolean; }
30             list external-ips {
31                 key "subnet-id ip-address";
32                 leaf subnet-id {
33                     description "This is external subnet id";
34                     type yang:uuid;
35                 }
36                 leaf ip-address {
37                     type string; //format - ipaddress\prefixlength
38                 }
39             }
40             leaf-list subnet-ids { type yang:uuid; }
41             leaf ext_gw_mac_address { type string; }
42         }
43     }
44
45     container floating-ip-info {
46         config true;
47         list router-ports {
48             key router-id;
49             leaf router-id { type string; }
50             leaf external-network-id { type yang:uuid; }
51             list ports {
52                 key port-name;
53                 leaf port-name { type string; }
54                 list internal-to-external-port-map {
55                     key "internal-ip";
56                     leaf internal-ip { type string; }
57                     leaf external-ip { type string; }
58                     leaf external-id { type yang:uuid; }
59                     leaf label { type uint32; config false; }
60                 }
61             }
62         }
63     }
64
65     container floating-ip-port-info {
66         config true;
67         description "Stores the floating IP UUID (L3) and [UUID, subnet UUID, MAC address] for the corresponding
68         floating IP port (L2)";
69         list floating-ip-id-to-port-mapping {
70             key "floating-ip-id";
71             leaf floating-ip-id { type yang:uuid; }
72             leaf floating-ip-port-id { type yang:uuid; }
73             leaf floating-ip-port-subnet-id { type yang:uuid; }
74             leaf floating-ip-port-mac-address { type string; }
75             leaf floating-ip-deleted {
76                 type boolean;
77                 default false;
78                 description
79                     "True if corresponding floating IP is deleted, indicating depopulation of this map to be
80                     processed once consumed in the deletion path";
81             }
82         }
83     }
84
85     container napt-switches {
86         list router-to-napt-switch {
87             key router-name;
88             leaf router-name { type string; }
89             leaf primary-switch-id { type uint64; }
90         }
91     }
92
93     grouping ip-port-entity {
94         leaf ip-address { type string; }
95         leaf port-num { type uint16; }
96     }
97
98     typedef protocol-types {
99         type enumeration {
100               enum TCP;
101               enum UDP;
102         }
103     }
104
105     typedef provider-types {
106         type enumeration {
107               enum FLAT;
108               enum VLAN;
109               enum VXLAN;
110               enum GRE;
111         }
112     }
113
114     container intext-ip-port-map {
115         config true;
116         list ip-port-mapping {
117             key router-id;
118             leaf router-id { type uint32; }
119             list intext-ip-protocol-type {
120                 key protocol;
121                 leaf protocol { type protocol-types; }
122                 list ip-port-map {
123                     key ip-port-internal;
124                     description "internal to external ip-port mapping";
125                     leaf ip-port-internal { type string; }
126                     container ip-port-external {
127                        uses ip-port-entity;
128                     }
129                 }
130             }
131          }
132     }
133
134     container snatint-ip-port-map {
135         list intip-port-map {
136             key router-id;
137             leaf router-id { type uint32; }
138             list ip-port {
139                 key internal-ip;
140                 leaf internal-ip { type string; }
141                 list int-ip-proto-type {
142                     key protocol;
143                     leaf protocol { type protocol-types; }
144                     leaf-list ports { type uint16; }
145                 }
146             }
147         }
148     }
149
150      container intext-ip-map {
151          config false;
152          list ip-mapping {
153              key segment-id;
154              leaf segment-id { type uint32; }
155              list ip-map {
156                  key internal-ip;
157                  leaf internal-ip { type string; }
158                  leaf external-ip { type string; }
159                  leaf label {type uint32;}
160              }
161          }
162      }
163
164      container router-to-vpn-mapping {
165          list routermapping {
166              key router-name;
167              leaf router-name { type string; }
168              leaf vpn-id { type uint32; }
169              leaf vpn-name { type string; }
170          }
171      }
172
173      container router-id-name {
174        list routerIds {
175            key router-id;
176            leaf router-id {type uint32;}
177            leaf router-name { type string; }
178        }
179     }
180
181     container external-ips-counter {
182         config false;
183         list external-counters{
184             key segment-id;
185             leaf segment-id { type uint32; }
186             list external-ip-counter {
187                 key external-ip;
188                 leaf external-ip { type string; }
189                 leaf counter { type uint8; }
190             }
191         }
192     }
193
194     container external-subnets {
195         list subnets  {
196             key id;
197             leaf id {
198                 type yang:uuid;
199             }
200             leaf vpn-id {
201                 type yang:uuid;
202             }
203             leaf external-network-id {
204                 type yang:uuid;
205             }
206             leaf-list router-ids {
207                 type yang:uuid;
208             }
209         }
210     }
211 }