Fixed NAT in OFOverlay based on EIG
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / yang / ofoverlay.yang
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 module ofoverlay {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:ofoverlay";
13     prefix "ofoverlay";
14
15     import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
16
17     import yang-ext {prefix ext; revision-date "2013-07-09";}
18     import opendaylight-inventory {prefix inv; revision-date "2013-08-19";}
19     import overlay {prefix ovsdb-overlay; revision-date 2015-01-05;}
20
21     import gbp-common {prefix gbp-common;}
22     import endpoint {prefix endpoint;}
23
24     description
25         "This module defines the group-based policy ofoverlay renderer model.";
26
27     revision "2014-05-28" {
28         description
29             "Initial revision.";
30     }
31
32     // ******************
33     // Configuration Data
34     // ******************
35     container of-overlay-config {
36         description
37             "Configuration for the OpenFlow overlay renderer";
38
39         config true;
40
41         leaf encapsulation-format {
42             description "The encapsulation format to use for tunnels";
43             type enumeration {
44                 enum vxlan {
45                     description "Use VXLAN encapsulation";
46                 }
47             }
48         }
49
50         leaf learning-mode {
51             description
52                 "Selects how and whether we learn endpoints";
53             type enumeration {
54                 enum orchestrated {
55                     description
56                         "An external orchestration system will provide
57                          information about all endpoints, and no
58                          direct learning will occur.";
59                 }
60             }
61         }
62
63         uses initial-values;
64     }
65
66     grouping initial-values {
67         description
68             "Initial value of table offset is set in config subsystem";
69         leaf gbp-ofoverlay-table-offset {
70             description
71                 "Used to offset pipeline to start at offset+1. Table0 is required.
72                 This is to allow the enduser to configure where the GBP pipeline starts.";
73             type uint8;
74         }
75     }
76
77     grouping endpoint-location {
78         description
79             "The location for this endpoint in the overlay network";
80         leaf node-id {
81             description
82                 "The OpenFlow switch for the endpoint. Must be included
83                  for all internal endpoints.  The format is
84                  openflow:[dpid] where the dpid is the value of the
85                  switch DPID cast to a long.";
86             type inv:node-id;
87         }
88         leaf node-connector-id {
89             description
90                 "The node connector for the endpoint's OpenFlow port. The
91                  format is openflow:[dpid]:[port] where the dpid is
92                  the value of the switch DPID cast to a long, and port
93                  is the openflow port number of the interface where
94                  the endpoint is connected.";
95             type inv:node-connector-id;
96         }
97         leaf port-name {
98             type gbp-common:name;
99             description
100                 "Port name";
101         }
102         leaf interface-id {
103             type gbp-common:unique-id;
104             description
105                 "Unique identifier for interface";
106         }
107     }
108
109     augment "/endpoint:endpoints/endpoint:endpoint" {
110         ext:augment-identifier "of-overlay-context";
111         uses endpoint-location;
112     }
113
114     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
115         ext:augment-identifier "of-overlay-l3-context";
116         uses endpoint-location;
117     }
118
119     augment "/endpoint:register-endpoint/endpoint:input" {
120         ext:augment-identifier "of-overlay-context-input";
121         uses endpoint-location;
122     }
123
124     augment "/inv:nodes/inv:node" {
125         ext:augment-identifier "of-overlay-node-config";
126         list tunnel {
127             key "tunnel-type";
128             uses ovsdb-overlay:tunnel-type-attributes;
129             uses ovsdb-overlay:ip-port-locator;
130             leaf node-connector-id {
131                 description
132                     "The node connector where is the tunnel located. The
133                      format is openflow:[dpid]:[port] where the dpid is
134                      the value of the switch DPID cast to a long, and port
135                      is the openflow port number of the interface where
136                      the endpoint is connected.";
137                 type inv:node-connector-id;
138             }
139         }
140         container ovsdb-config {
141             leaf ip {
142                 description
143                     "The IP address used to connect to OVSDB on this switch";
144                 type inet:ip-address;
145             }
146             leaf port {
147                 description
148                     "The port number used to connect to OVSDB on this switch";
149                 type inet:port-number;
150                 default 6640;
151             }
152         }
153         list external-interfaces {
154             description
155                 "The node connectors for the external interfaces to the underlay.
156                 If interface name is required, can be looked up from inventory using
157                 this field as a key to FCNC (FlowCapableNodeConnector)";
158             key "node-connector-id";
159             leaf node-connector-id {
160                 type inv:node-connector-id;
161             }
162         }
163     }
164 }