blob: 943d840f08dc5f46a051dedcf62d4e1b037ceab4 [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
27
28#version 1
29
30struct ofp_header {
31 uint8_t version;
32 uint8_t type;
33 uint16_t length;
34 uint32_t xid;
35};
36
37struct ofp_hello {
38 uint8_t version;
39 uint8_t type;
40 uint16_t length;
41 uint32_t xid;
42};
43
44struct ofp_echo_request {
45 uint8_t version;
46 uint8_t type;
47 uint16_t length;
48 uint32_t xid;
49 of_octets_t data;
50};
51
52struct ofp_echo_reply {
53 uint8_t version;
54 uint8_t type;
55 uint16_t length;
56 uint32_t xid;
57 of_octets_t data;
58};
59
60struct ofp_experimenter {
61 uint8_t version;
62 uint8_t type;
63 uint16_t length;
64 uint32_t xid;
65 uint32_t experimenter;
66 uint32_t subtype;
67 of_octets_t data;
68};
69
70struct ofp_barrier_request {
71 uint8_t version;
72 uint8_t type;
73 uint16_t length;
74 uint32_t xid;
75};
76
77struct ofp_barrier_reply {
78 uint8_t version;
79 uint8_t type;
80 uint16_t length;
81 uint32_t xid;
82};
83
84struct ofp_get_config_request {
85 uint8_t version;
86 uint8_t type;
87 uint16_t length;
88 uint32_t xid;
89};
90
91struct ofp_get_config_reply {
92 uint8_t version;
93 uint8_t type;
94 uint16_t length;
95 uint32_t xid;
96 uint16_t flags;
97 uint16_t miss_send_len;
98};
99
100struct ofp_set_config {
101 uint8_t version;
102 uint8_t type;
103 uint16_t length;
104 uint32_t xid;
105 uint16_t flags;
106 uint16_t miss_send_len;
107};
108
109struct ofp_port_desc {
110 of_port_no_t port_no;
111 of_mac_addr_t hw_addr;
112 of_port_name_t name;
113 uint32_t config;
114 uint32_t state;
115 uint32_t curr;
116 uint32_t advertised;
117 uint32_t supported;
118 uint32_t peer;
119};
120
121struct ofp_features_request {
122 uint8_t version;
123 uint8_t type;
124 uint16_t length;
125 uint32_t xid;
126};
127
128struct ofp_features_reply {
129 uint8_t version;
130 uint8_t type;
131 uint16_t length;
132 uint32_t xid;
133 uint64_t datapath_id;
134 uint32_t n_buffers;
135 uint8_t n_tables;
136 uint8_t[3] pad;
137 uint32_t capabilities;
138 uint32_t actions;
139 list(of_port_desc_t) ports;
140};
141
142struct ofp_port_status {
143 uint8_t version;
144 uint8_t type;
145 uint16_t length;
146 uint32_t xid;
147 uint8_t reason;
148 uint8_t[7] pad;
149 of_port_desc_t desc;
150};
151
152struct ofp_port_mod {
153 uint8_t version;
154 uint8_t type;
155 uint16_t length;
156 uint32_t xid;
157 of_port_no_t port_no;
158 of_mac_addr_t hw_addr;
159 uint32_t config;
160 uint32_t mask;
161 uint32_t advertise;
162 uint8_t[4] pad;
163};
164
165struct ofp_packet_in {
166 uint8_t version;
167 uint8_t type;
168 uint16_t length;
169 uint32_t xid;
170 uint32_t buffer_id;
171 uint16_t total_len;
172 of_port_no_t in_port;
173 uint8_t reason;
174 uint8_t pad;
175 of_octets_t data;
176};
177
178struct ofp_action_output {
179 uint16_t type;
180 uint16_t len;
181 of_port_no_t port;
182 uint16_t max_len;
183};
184
185struct ofp_action_set_vlan_vid {
186 uint16_t type;
187 uint16_t len;
188 uint16_t vlan_vid;
189 uint8_t[2] pad;
190};
191
192struct ofp_action_strip_vlan {
193 uint16_t type;
194 uint16_t len;
195 uint8_t[4] pad;
196};
197
198struct ofp_action_set_vlan_pcp {
199 uint16_t type;
200 uint16_t len;
201 uint8_t vlan_pcp;
202 uint8_t[3] pad;
203};
204
205struct ofp_action_set_dl_src {
206 uint16_t type;
207 uint16_t len;
208 of_mac_addr_t dl_addr;
209 uint8_t[6] pad;
210};
211
212struct ofp_action_set_dl_dst {
213 uint16_t type;
214 uint16_t len;
215 of_mac_addr_t dl_addr;
216 uint8_t[6] pad;
217};
218
219struct ofp_action_set_nw_src {
220 uint16_t type;
221 uint16_t len;
222 uint32_t nw_addr;
223};
224
225struct ofp_action_set_nw_dst {
226 uint16_t type;
227 uint16_t len;
228 uint32_t nw_addr;
229};
230
231struct ofp_action_set_tp_src {
232 uint16_t type;
233 uint16_t len;
234 uint16_t tp_port;
235 uint8_t[2] pad;
236};
237
238struct ofp_action_set_tp_dst {
239 uint16_t type;
240 uint16_t len;
241 uint16_t tp_port;
242 uint8_t[2] pad;
243};
244
245struct ofp_action_set_nw_tos {
246 uint16_t type;
247 uint16_t len;
248 uint8_t nw_tos;
249 uint8_t[3] pad;
250};
251
252struct ofp_action_experimenter {
253 uint16_t type;
254 uint16_t len;
255 uint32_t experimenter;
256 of_octets_t data;
257};
258
259struct ofp_action_enqueue {
260 uint16_t type;
261 uint16_t len;
262 of_port_no_t port;
263 uint8_t[6] pad;
264 uint32_t queue_id;
265};
266
267struct ofp_action {
268 uint16_t type;
269 uint16_t len;
270 uint8_t[4] pad;
271};
272
273struct ofp_packet_out {
274 uint8_t version;
275 uint8_t type;
276 uint16_t length;
277 uint32_t xid;
278 uint32_t buffer_id;
279 of_port_no_t in_port;
280 uint16_t actions_len;
281 list(of_action_t) actions;
282 of_octets_t data;
283};
284
285struct ofp_match_v1 {
286 of_wc_bmap_t wildcards;
287 of_port_no_t in_port;
288 of_mac_addr_t eth_src;
289 of_mac_addr_t eth_dst;
290 uint16_t vlan_vid;
291 uint8_t vlan_pcp;
292 uint8_t[1] pad1;
293 uint16_t eth_type;
294 uint8_t ip_dscp;
295 uint8_t ip_proto;
296 uint8_t[2] pad2;
297 uint32_t ipv4_src;
298 uint32_t ipv4_dst;
299 uint16_t tcp_src;
300 uint16_t tcp_dst;
301};
302
303struct ofp_flow_add {
304 uint8_t version;
305 uint8_t type;
306 uint16_t length;
307 uint32_t xid;
308 of_match_t match;
309 uint64_t cookie;
310 of_fm_cmd_t _command;
311 uint16_t idle_timeout;
312 uint16_t hard_timeout;
313 uint16_t priority;
314 uint32_t buffer_id;
315 of_port_no_t out_port;
316 uint16_t flags;
317 list(of_action_t) actions;
318};
319
320struct ofp_flow_modify {
321 uint8_t version;
322 uint8_t type;
323 uint16_t length;
324 uint32_t xid;
325 of_match_t match;
326 uint64_t cookie;
327 of_fm_cmd_t _command;
328 uint16_t idle_timeout;
329 uint16_t hard_timeout;
330 uint16_t priority;
331 uint32_t buffer_id;
332 of_port_no_t out_port;
333 uint16_t flags;
334 list(of_action_t) actions;
335};
336
337struct ofp_flow_modify_strict {
338 uint8_t version;
339 uint8_t type;
340 uint16_t length;
341 uint32_t xid;
342 of_match_t match;
343 uint64_t cookie;
344 of_fm_cmd_t _command;
345 uint16_t idle_timeout;
346 uint16_t hard_timeout;
347 uint16_t priority;
348 uint32_t buffer_id;
349 of_port_no_t out_port;
350 uint16_t flags;
351 list(of_action_t) actions;
352};
353
354struct ofp_flow_delete {
355 uint8_t version;
356 uint8_t type;
357 uint16_t length;
358 uint32_t xid;
359 of_match_t match;
360 uint64_t cookie;
361 of_fm_cmd_t _command;
362 uint16_t idle_timeout;
363 uint16_t hard_timeout;
364 uint16_t priority;
365 uint32_t buffer_id;
366 of_port_no_t out_port;
367 uint16_t flags;
368 list(of_action_t) actions;
369};
370
371struct ofp_flow_delete_strict {
372 uint8_t version;
373 uint8_t type;
374 uint16_t length;
375 uint32_t xid;
376 of_match_t match;
377 uint64_t cookie;
378 of_fm_cmd_t _command;
379 uint16_t idle_timeout;
380 uint16_t hard_timeout;
381 uint16_t priority;
382 uint32_t buffer_id;
383 of_port_no_t out_port;
384 uint16_t flags;
385 list(of_action_t) actions;
386};
387
388struct ofp_flow_removed {
389 uint8_t version;
390 uint8_t type;
391 uint16_t length;
392 uint32_t xid;
393 of_match_t match;
394 uint64_t cookie;
395 uint16_t priority;
396 uint8_t reason;
397 uint8_t[1] pad;
398 uint32_t duration_sec;
399 uint32_t duration_nsec;
400 uint16_t idle_timeout;
401 uint8_t[2] pad2;
402 uint64_t packet_count;
403 uint64_t byte_count;
404};
405
406struct ofp_error_msg {
407 uint8_t version;
408 uint8_t type;
409 uint16_t length;
410 uint32_t xid;
411 uint16_t err_type;
412 uint16_t code;
413 of_octets_t data;
414};
415
416// STATS ENTRIES: flow, table, port, queue,
417struct ofp_flow_stats_entry {
418 uint16_t length;
419 uint8_t table_id;
420 uint8_t pad;
421 of_match_t match;
422 uint32_t duration_sec;
423 uint32_t duration_nsec;
424 uint16_t priority;
425 uint16_t idle_timeout;
426 uint16_t hard_timeout;
427 uint8_t[6] pad2;
428 uint64_t cookie;
429 uint64_t packet_count;
430 uint64_t byte_count;
431 list(of_action_t) actions;
432};
433
434struct ofp_table_stats_entry {
435 uint8_t table_id;
436 uint8_t[3] pad;
437 of_table_name_t name;
438 of_wc_bmap_t wildcards;
439 uint32_t max_entries;
440 uint32_t active_count;
441 uint64_t lookup_count;
442 uint64_t matched_count;
443};
444
445struct ofp_port_stats_entry {
446 of_port_no_t port_no;
447 uint8_t[6] pad;
448 uint64_t rx_packets;
449 uint64_t tx_packets;
450 uint64_t rx_bytes;
451 uint64_t tx_bytes;
452 uint64_t rx_dropped;
453 uint64_t tx_dropped;
454 uint64_t rx_errors;
455 uint64_t tx_errors;
456 uint64_t rx_frame_err;
457 uint64_t rx_over_err;
458 uint64_t rx_crc_err;
459 uint64_t collisions;
460};
461
462struct ofp_queue_stats_entry {
463 of_port_no_t port_no;
464 uint8_t[2] pad;
465 uint32_t queue_id;
466 uint64_t tx_bytes;
467 uint64_t tx_packets;
468 uint64_t tx_errors;
469};
470
471// STATS request/reply: Desc, flow, agg, table, port, queue
472
473struct ofp_desc_stats_request {
474 uint8_t version;
475 uint8_t type;
476 uint16_t length;
477 uint32_t xid;
478 uint16_t stats_type;
479 uint16_t flags;
480};
481
482struct ofp_desc_stats_reply {
483 uint8_t version;
484 uint8_t type;
485 uint16_t length;
486 uint32_t xid;
487 uint16_t stats_type;
488 uint16_t flags;
489 of_desc_str_t mfr_desc;
490 of_desc_str_t hw_desc;
491 of_desc_str_t sw_desc;
492 of_serial_num_t serial_num;
493 of_desc_str_t dp_desc;
494};
495
496struct ofp_flow_stats_request {
497 uint8_t version;
498 uint8_t type;
499 uint16_t length;
500 uint32_t xid;
501 uint16_t stats_type;
502 uint16_t flags;
503 of_match_t match;
504 uint8_t table_id;
505 uint8_t pad;
506 of_port_no_t out_port;
507};
508
509struct ofp_flow_stats_reply {
510 uint8_t version;
511 uint8_t type;
512 uint16_t length;
513 uint32_t xid;
514 uint16_t stats_type;
515 uint16_t flags;
516 list(of_flow_stats_entry_t) entries;
517};
518
519struct ofp_aggregate_stats_request {
520 uint8_t version;
521 uint8_t type;
522 uint16_t length;
523 uint32_t xid;
524 uint16_t stats_type;
525 uint16_t flags;
526 of_match_t match;
527 uint8_t table_id;
528 uint8_t pad;
529 of_port_no_t out_port;
530};
531
532struct ofp_aggregate_stats_reply {
533 uint8_t version;
534 uint8_t type;
535 uint16_t length;
536 uint32_t xid;
537 uint16_t stats_type;
538 uint16_t flags;
539 uint64_t packet_count;
540 uint64_t byte_count;
541 uint32_t flow_count;
542 uint8_t[4] pad;
543};
544
545struct ofp_table_stats_request {
546 uint8_t version;
547 uint8_t type;
548 uint16_t length;
549 uint32_t xid;
550 uint16_t stats_type;
551 uint16_t flags;
552};
553
554struct ofp_table_stats_reply {
555 uint8_t version;
556 uint8_t type;
557 uint16_t length;
558 uint32_t xid;
559 uint16_t stats_type;
560 uint16_t flags;
561 list(of_table_stats_entry_t) entries;
562};
563
564struct ofp_port_stats_request {
565 uint8_t version;
566 uint8_t type;
567 uint16_t length;
568 uint32_t xid;
569 uint16_t stats_type;
570 uint16_t flags;
571 of_port_no_t port_no;
572 uint8_t[6] pad;
573};
574
575struct ofp_port_stats_reply {
576 uint8_t version;
577 uint8_t type;
578 uint16_t length;
579 uint32_t xid;
580 uint16_t stats_type;
581 uint16_t flags;
582 list(of_port_stats_entry_t) entries;
583};
584
585struct ofp_queue_stats_request {
586 uint8_t version;
587 uint8_t type;
588 uint16_t length;
589 uint32_t xid;
590 uint16_t stats_type;
591 uint16_t flags;
592 of_port_no_t port_no;
593 uint8_t[2] pad;
594 uint32_t queue_id;
595};
596
597struct ofp_queue_stats_reply {
598 uint8_t version;
599 uint8_t type;
600 uint16_t length;
601 uint32_t xid;
602 uint16_t stats_type;
603 uint16_t flags;
604 list(of_queue_stats_entry_t) entries;
605};
606
607struct ofp_experimenter_stats_request {
608 uint8_t version;
609 uint8_t type;
610 uint16_t length;
611 uint32_t xid;
612 uint16_t stats_type;
613 uint16_t flags;
614 uint32_t experimenter;
615 of_octets_t data;
616};
617
618struct ofp_experimenter_stats_reply {
619 uint8_t version;
620 uint8_t type;
621 uint16_t length;
622 uint32_t xid;
623 uint16_t stats_type;
624 uint16_t flags;
625 uint32_t experimenter;
626 of_octets_t data;
627};
628
629// END OF STATS OBJECTS
630
631struct ofp_queue_prop {
632 uint16_t type;
633 uint16_t len;
634 uint8_t[4] pad;
635};
636
637struct ofp_queue_prop_min_rate {
638 uint16_t type;
639 uint16_t len;
640 uint8_t[4] pad;
641 uint16_t rate;
642 uint8_t[6] pad;
643};
644
645struct ofp_packet_queue {
646 uint32_t queue_id;
647 uint16_t len;
648 uint8_t[2] pad;
649 list(of_queue_prop_t) properties;
650};
651
652struct ofp_queue_get_config_request {
653 uint8_t version;
654 uint8_t type;
655 uint16_t length;
656 uint32_t xid;
657 of_port_no_t port;
658 uint8_t[2] pad;
659};
660
661struct ofp_queue_get_config_reply {
662 uint8_t version;
663 uint8_t type;
664 uint16_t length;
665 uint32_t xid;
666 of_port_no_t port;
667 uint8_t[6] pad;
668 list(of_packet_queue_t) queues;
669};