blob: a7b8489ea74ec6e3859dbe49c0e20188467fd39c [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001module openconfig-openflow {
2
3 yang-version "1";
4
5 namespace "http://openconfig.net/yang/openflow";
6
7 prefix "openflow";
8
9 import openconfig-extensions { prefix oc-ext; }
10 import openconfig-inet-types { prefix oc-inet; }
11 import openconfig-interfaces { prefix oc-if; }
12 import openconfig-openflow-types { prefix of-types; }
13 import openconfig-system { prefix oc-sys; }
14
15 organization "OpenConfig working group";
16
17 contact
18 "OpenConfig working group
19 www.openconfig.net";
20
21 description
22 "This module defines configuration and operational state data for
23 Openflow.";
24
25 oc-ext:openconfig-version "0.1.0";
26
27 revision "2017-06-01" {
28 description
29 "Initial revision";
30 reference "0.1.0";
31 }
32
33 grouping openflow-controller-config {
34 description
35 "Openflow controller config";
36
37 leaf name {
38 type string;
39 description "Name of this Openflow controller. All connections
40 for the same controller need to have the same name.";
41 }
42 }
43
44 grouping openflow-controller-state {
45 description
46 "Openflow controller state";
47 }
48
49 grouping openflow-controllers-top {
50 description
51 "Top-level for the Openflow controllers model";
52
53 container controllers {
54 description
55 "Container for the Openflow controllers model";
56
57 list controller {
58 key "name";
59
60 description
61 "The Openflow Switch connects to all Openflow controllers
62 configured";
63
64 leaf name {
65 type leafref {
66 path "../config/name";
67 }
68 description
69 "The name identifies the controller.";
70 }
71
72 container config {
73 description
74 "Container for the Openflow controller config.";
75
76 uses openflow-controller-config;
77 }
78
79 container state {
80 config false;
81
82 description
83 "Container for the Openflow controller state.";
84
85 uses openflow-controller-config;
86 uses openflow-controller-state;
87 }
88
89 uses openflow-connections-top;
90 }
91 }
92 }
93
94
95 grouping openflow-connections-config {
96 description
97 "Configuration data for OpenFlow controller connections";
98
99 leaf aux-id {
100 type of-types:auxiliary-id;
101 description
102 "Controller auxiliary ID. Must be 0 for the main controller.
103 One controller may have multiple auxiliary connections as
104 specified by the Openflow protocol. Besides configuring the
105 main controller, it is also possible to configure auxiliary
106 connections. The main controller must have the aux-id
107 set to zero. All others must have an aux-id different
108 from 0.";
109 }
110
111 leaf priority {
112 type uint8;
113 description
114 "Optional value for servicing auxiliary connections with
115 different priorities.";
116 }
117
118 leaf address {
119 type oc-inet:ip-address;
120 description
121 "The IP address of the controller.";
122 }
123
124 leaf port {
125 type oc-inet:port-number;
126 default 6653;
127 description
128 "Controller port to use.";
129 }
130
131 leaf transport {
132 type of-types:transport;
133 default TCP;
134 description
135 "Controller transport protocol used.";
136 }
137
138 leaf source-interface {
139 type oc-if:base-interface-ref;
140 description
141 "Optionally specify the source interface for the
142 controller connection.";
143 }
144 }
145
146 grouping openflow-connections-state {
147 description
148 "Operational state data for OpenFlow controller connections";
149
150 leaf connected {
151 type boolean;
152 description
153 "When set to true, indicates the connection between the
154 switch and controller is established.";
155 }
156 }
157
158 grouping openflow-connections-top {
159 description
160 "Top-level grouping for OpenFlow controller connections";
161
162 container connections {
163 description
164 "Enclosing container for list of controller connections";
165
166 list connection {
167 key "aux-id";
168 description
169 "List of connections to the OpenFlow controller.
170 The Openflow switch always connects to configured Openflow
171 controllers. Each controller can have more than one
172 connection, called auxiliary Openflow connections.";
173
174 leaf aux-id {
175 type leafref {
176 path "../config/aux-id";
177 }
178 description
179 "Reference to auxiliary id list key";
180 }
181
182 container config {
183 description
184 "Configuration data for OpenFlow controller connections";
185
186 uses openflow-connections-config;
187 }
188
189 container state {
190
191 config false;
192
193 description
194 "Operational state data for OpenFlow controller
195 connections";
196
197 uses openflow-connections-config;
198 uses openflow-connections-state;
199 }
200 }
201 }
202 }
203
204
205 grouping openflow-agent-config {
206 description
207 "Openflow agent config";
208
209 leaf datapath-id {
210 type of-types:datapath-id;
211 description
212 "Datapath unique ID. The lower 48-bits are for
213 a MAC address, while the upper 16-bits are
214 implementer-defined.";
215 }
216
217 leaf failure-mode {
218 type of-types:failure-mode;
219 description
220 "Failure mode for Openflow.";
221 }
222
223 leaf backoff-interval {
224 type uint32;
225 units seconds;
226 description
227 "Openflow agent connection backoff interval.";
228 }
229
230 leaf max-backoff {
231 type uint32;
232 units seconds;
233 description
234 "Openflow agent max backoff time.";
235 }
236
237 leaf inactivity-probe {
238 type uint32;
239 units seconds;
240 description
241 "Openflow agent inactivity probe period.";
242 }
243 }
244
245 grouping openflow-agent-state {
246 description
247 "Openflow agent state";
248 }
249
250 grouping openflow-agent-top {
251 description
252 "Top-level for the Openflow agent model";
253
254 container agent {
255 description
256 "Container for the Openflow agent model.";
257
258 container config {
259 description
260 "Container for the Openflow agent config.";
261
262 uses openflow-agent-config;
263 }
264
265 container state {
266 config false;
267
268 description
269 "Container for the Openflow agent state.";
270
271 uses openflow-agent-config;
272 uses openflow-agent-state;
273 }
274 }
275 }
276
277
278 grouping openflow-top {
279 description
280 "Top-level for the Openflow model";
281
282 container openflow {
283 description
284 "Container for Openflow model";
285
286
287 uses openflow-controllers-top;
288 uses openflow-agent-top;
289 }
290 }
291
292
293 augment "/oc-sys:system" {
294 description
295 "Adding OpenConfig data to the system model";
296
297 uses openflow-top;
298 }
299
300}