Merge "LLDP monitor interval update fixes"
[vpnservice.git] / natservice / natservice-api / src / main / yang / odl-nat.yang
1 module odl-nat {
2     namespace "urn:opendaylight:vpnservice: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         }
21    }
22
23    container ext-routers {
24        list routers {
25            key router-name;
26            leaf router-name { type string; }
27            leaf network-id { type yang:uuid; }
28            leaf enable-snat { type boolean; }
29            leaf-list external-ips {
30                 type string; //format - ipaddress\prefixlength
31            }
32            leaf-list subnet-ids { type yang:uuid; }
33            leaf ext_gw_mac_address { type string; }
34        }
35    }
36
37
38     grouping external-interface-info {
39         leaf internal-ip { type string; }
40         leaf external-ip { type string; }
41         leaf label { type uint16; config false; }
42     }
43
44     container floating-ip-info {
45         config true;
46         list router-ports {
47             key router-id;
48             leaf router-id { type string; }
49             leaf external-network-id { type yang:uuid; }
50             list ports {
51                 key port-name;
52                 leaf port-name { type string; }
53                 list ip-mapping {
54                     key "internal-ip";
55                     uses external-interface-info;
56                 }
57             }
58         }
59     }
60
61     container napt-switches {
62         list router-to-napt-switch {
63             key router-name;
64             leaf router-name { type string; }
65             leaf primary-switch-id { type uint64; }
66         }
67     }
68
69     grouping ip-port-entity {
70         leaf ip-address { type string; }
71         leaf port-num { type uint16; }
72     }
73
74     typedef protocol-types {
75         type enumeration {
76               enum TCP;
77               enum UDP;
78         }
79     }
80
81     container intext-ip-port-map {
82         config true;
83         list ip-port-mapping {
84             key router-id;
85             leaf router-id { type uint32; }
86             list intext-ip-protocol-type {
87                 key protocol;
88                 leaf protocol { type protocol-types; }
89                 list ip-port-map {
90                     key ip-port-internal;
91                     description "internal to external ip-port mapping";
92                     leaf ip-port-internal { type string; }
93                     container ip-port-external {
94                        uses ip-port-entity;
95                     }
96                 }
97             }
98          }
99     }
100
101     container snatint-ip-port-map {
102         list intip-port-map {
103             key router-id;
104             leaf router-id { type uint32; }
105             list ip-port {
106                 key internal-ip;
107                 leaf internal-ip { type string; }
108                 list int-ip-proto-type {
109                     key protocol;
110                     leaf protocol { type protocol-types; }
111                     leaf-list ports { type uint16; }
112                 }
113             }
114         }
115     }
116
117      container intext-ip-map {
118          config false;
119          list ip-mapping {
120              key segment-id;
121              leaf segment-id { type uint32; }
122              list ip-map {
123                  key internal-ip;
124                  leaf internal-ip { type string; }
125                  leaf external-ip { type string; }
126                  leaf label {type uint32;}
127              }
128          }
129      }
130
131      container router-id-name {
132        list routerIds {
133            key router-id;
134            leaf router-id {type uint32;}
135            leaf router-name { type string; }
136        }
137     }
138 }