ErrorMessage - int values for type and code provided
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-protocol.yang
1 module openflow-protocol {\r
2     namespace "urn:opendaylight:openflow:protocol";\r
3     prefix "ofproto";\r
4 \r
5     import ietf-inet-types {prefix inet;}\r
6     import ietf-yang-types {prefix yang;}\r
7     \r
8     import openflow-types {prefix oft;}\r
9     import openflow-extensible-match { prefix oxm;}\r
10     import openflow-instruction { prefix ofinstruction;}\r
11     import openflow-action {prefix ofaction;}\r
12 \r
13     revision "2013-07-31" {\r
14         description "OpenFlow 1.3 - protocol objects model";\r
15     }\r
16 \r
17     // Generic Structures\r
18         grouping port {\r
19             // reference "ofp_port";\r
20             leaf port-no { \r
21                 // reference "ofp_port.port_no"; \r
22                 type uint32;\r
23             }\r
24             leaf hw-addr { \r
25                 // reference "ofp_port.hw_addr"; \r
26                 type yang:mac-address;\r
27             }\r
28             leaf name { \r
29                 // reference "ofp_port.name"; \r
30                 type string;\r
31             }\r
32             leaf config { \r
33                 // reference "ofp_port.config"; \r
34                 type oft:port-config;\r
35             }\r
36             leaf state { \r
37                 // reference "ofp_port.state"; \r
38                 type oft:port-state;\r
39             }\r
40             leaf current-features { \r
41                 description "Current features.";\r
42                 // reference "ofp_port.curr"; \r
43                 type oft:port-features; \r
44             }\r
45             leaf advertised-features { \r
46                 description "Features being advertised by the port.";\r
47                 // reference "ofp_port.advertised"; \r
48                 type oft:port-features; \r
49             }\r
50             leaf supported-features { \r
51                 description "Features supported by the port.";\r
52                 // reference "ofp_port.supported"; \r
53                 type oft:port-features; \r
54             }\r
55             leaf peer-features { \r
56                 description "Features advertised by peer.";\r
57                 // reference "ofp_port.peer"; \r
58                 type oft:port-features; \r
59             }\r
60             leaf curr_speed { \r
61                 description "Current port bitrate in kbps.";\r
62                 // reference "ofp_port.curr_speed"; \r
63                 type uint32; \r
64                 units "kbps";\r
65             }\r
66             leaf max_speed { \r
67                 description "Max port bitrate in kbps";\r
68                 // reference "ofp_port.max_speed"; \r
69                 type uint32;\r
70                 units "kbps"; \r
71             }\r
72             \r
73             // OF1.0 structures\r
74             leaf config-v10 { \r
75                 // reference "ofp_port.config"; \r
76                 type oft:port-config-v10;\r
77             }\r
78             leaf state-v10 { \r
79                 // reference "ofp_port.state"; \r
80                 type oft:port-state-v10;\r
81             }\r
82             leaf current-features-v10 { \r
83                 description "Current features.";\r
84                 // reference "ofp_port.curr"; \r
85                 type oft:port-features-v10; \r
86             }\r
87             leaf advertised-features-v10 { \r
88                 description "Features being advertised by the port.";\r
89                 // reference "ofp_port.advertised"; \r
90                 type oft:port-features-v10; \r
91             }\r
92             leaf supported-features-v10 { \r
93                 description "Features supported by the port.";\r
94                 // reference "ofp_port.supported"; \r
95                 type oft:port-features-v10; \r
96             }\r
97             leaf peer-features-v10 { \r
98                 description "Features advertised by peer.";\r
99                 // reference "ofp_port.peer"; \r
100                 type oft:port-features-v10; \r
101             }\r
102         }\r
103         \r
104         grouping match-grouping {\r
105             container match {\r
106                 leaf type {\r
107                     type identityref {\r
108                         base oft:match-type-base;\r
109                     }\r
110                 }\r
111                 uses oxm:oxm-fields;\r
112             }\r
113         }\r
114 \r
115         grouping buckets {\r
116                 list buckets-list {\r
117                     uses bucket;\r
118                 }\r
119             }\r
120             \r
121             grouping bucket {\r
122                 leaf weight {\r
123                     type uint16;\r
124                 }\r
125                 leaf watch-port {\r
126                     type oft:port-number;\r
127                 }\r
128                 leaf watch-group {\r
129                     type uint32;\r
130                 }\r
131                 \r
132                 uses ofaction:actions;\r
133             }\r
134             \r
135         container table-features-properties-container {\r
136             uses table-features-properties;\r
137         }\r
138 \r
139         grouping table-features-properties {\r
140             list table-feature-properties {\r
141                 leaf type {\r
142                     type oft:table-features-prop-type;\r
143                 }\r
144             }\r
145         }\r
146 \r
147     // # MESSAGE Structures\r
148         /* Immutable messages. */\r
149             grouping ofHeader {\r
150                 //reference "ofpt_header struct in Openflow Switch 1.3 Spec"\r
151                 leaf version {\r
152                     type uint8;\r
153                     //reference "OpenFlow Header - OFP_VERSION";\r
154                 }\r
155                 leaf xid {\r
156                     type uint32;\r
157                     //reference "OpenFlow Header - transaction id";\r
158                 }\r
159             }\r
160             grouping ofHelloElementHeader {\r
161                 //reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec"\r
162                 leaf type {\r
163                     type oft:hello-element-type;\r
164                     //reference "OpenFlow Header element type - OFPHET_*";\r
165                 }\r
166             }\r
167             grouping hello {\r
168                 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
169                 /* Symmetric message */\r
170                 uses ofHeader;\r
171                 \r
172                 list elements {\r
173                     uses ofHelloElementHeader;\r
174                     \r
175                     leaf-list version-bitmap {\r
176                         type boolean;\r
177                     }\r
178                 }\r
179             }\r
180             grouping error {\r
181                 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"\r
182                 /* Symmetric message */\r
183                 uses ofHeader;\r
184                 \r
185                 leaf type {\r
186                     type uint16;\r
187                 }\r
188                 leaf code {\r
189                     type uint16;\r
190                 }\r
191                 leaf type-string {\r
192                     type string;\r
193                 }\r
194                 leaf code-string {\r
195                     type string;\r
196                 }\r
197                 leaf data {\r
198                     type binary; \r
199                 }\r
200             }\r
201             grouping echo-request {\r
202                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
203                 /* Symmetric message */\r
204                 uses ofHeader;\r
205                 \r
206                 leaf data {\r
207                     type binary;\r
208                 }\r
209             }\r
210             grouping echo-reply {\r
211                 // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"\r
212                 /* Symmetric message */\r
213                 uses ofHeader;\r
214                 \r
215                 leaf data {\r
216                     type binary;\r
217                 }\r
218             }\r
219             grouping experimenter {\r
220                 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
221                 /* Symmetric message */\r
222                 uses ofHeader;\r
223                 \r
224                 leaf experimenter {\r
225                     type uint32;\r
226                 }\r
227                 leaf exp_type {\r
228                     type uint32;\r
229                 }\r
230                 leaf data {\r
231                     type binary;\r
232                 }\r
233             }\r
234         /* Switch configuration messages. */\r
235             grouping features-request {\r
236                 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"\r
237                 /* Controller/switch message */\r
238                 uses ofHeader;\r
239             }\r
240             grouping features-reply {\r
241                 // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"\r
242                 /* Controller/switch message */\r
243                 uses ofHeader;\r
244                 \r
245                 leaf datapathId {\r
246                     type uint64;\r
247                 }\r
248                 leaf buffers {\r
249                     type uint32;\r
250                 }\r
251                 leaf tables {\r
252                     type uint8;\r
253                 }\r
254                 leaf auxiliaryId {\r
255                     type uint8;\r
256                 }\r
257                 leaf capabilities {\r
258                     type oft:capabilities;\r
259                 }\r
260                 leaf reserved {\r
261                     type uint32;\r
262                 }\r
263                 // OF1.0 structures\r
264                 leaf capabilities-v10 {\r
265                     type oft:capabilities-v10;\r
266                 }\r
267                 leaf actions-v10 {\r
268                     type oft:action-type-v10;\r
269                 }\r
270                 uses port;\r
271             }\r
272             grouping get-config-request {\r
273                 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
274                 /* Controller/switch message */\r
275                 uses ofHeader;\r
276             }\r
277             grouping get-config-reply {\r
278                 // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
279                 /* Controller/switch message */\r
280                 uses ofHeader;\r
281                 \r
282                 leaf flags {\r
283                     type oft:switch-config-flag;\r
284                 }\r
285                 leaf miss-send-len {\r
286                     type uint16;\r
287                 }\r
288             }\r
289             grouping set-config {\r
290                 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"\r
291                 /* Controller/switch message */\r
292                 \r
293                 uses ofHeader;\r
294                 \r
295                 leaf flags {\r
296                     type oft:switch-config-flag;\r
297                 }\r
298                 leaf miss-send-len {\r
299                     type uint16;\r
300                 }\r
301             }\r
302         /* Asynchronous messages. */\r
303             grouping packet-in {\r
304                 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"\r
305                 /* Async message */\r
306                 \r
307                 uses ofHeader;\r
308                 \r
309                 leaf buffer-id {\r
310                     // ID assigned by datapath.\r
311                     type uint32;\r
312                 }\r
313                 leaf total-len {\r
314                     // Full length of frame.\r
315                     type uint16;\r
316                 }\r
317                 leaf reason {\r
318                     // Reason packet is being sent (one of OFPR_*) \r
319                     type oft:packet-in-reason;\r
320                 }\r
321                 leaf table-id {\r
322                     // ID of the table that was looked up\r
323                     type oft:table-id;\r
324                 }\r
325                 leaf cookie {\r
326                     // Cookie of the flow entry that was looked up.\r
327                     type uint64;\r
328                 }\r
329                 uses match-grouping;\r
330                 \r
331 // struct ofp_match match; /* Packet metadata. Variable size. */\r
332 // /* The variable size and padded match is always followed by:\r
333 //  *   - Exactly 2 all-zero padding bytes, then\r
334 //  *   - An Ethernet frame whose length is inferred from header.length.\r
335 //  * The padding bytes preceding the Ethernet frame ensure that the IP\r
336 //  * header (if any) following the Ethernet header is 32-bit aligned.\r
337 //  */\r
338                 leaf data {\r
339                     type binary;\r
340                 }\r
341                 \r
342                 // OF1.0 structures\r
343                 leaf in-port {\r
344                     type uint16;\r
345                 }\r
346             }\r
347             grouping flow-removed {\r
348                 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"\r
349                 /* Async message */\r
350                 uses ofHeader;\r
351                 \r
352                 leaf cookie {\r
353                     type uint64;\r
354                 }\r
355                 leaf priority {\r
356                     type uint16;\r
357                 }\r
358                 leaf reason {\r
359                     type oft:flow-removed-reason;\r
360                 }\r
361                 leaf table-id {\r
362                     type oft:table-id;\r
363                 }\r
364                 leaf duration-sec {\r
365                     type uint32;\r
366                 }\r
367                 leaf duration-nsec {\r
368                     type uint32;\r
369                 }\r
370                 leaf idle-timeout {\r
371                     type uint16;\r
372                 }\r
373                 leaf hard-timeout {\r
374                     type uint16;\r
375                 }\r
376                 leaf packet-count {\r
377                     type uint64;\r
378                 }\r
379                 leaf byte-count {\r
380                     type uint64;\r
381                 }\r
382                 uses match-grouping;\r
383                 \r
384                 // OF1.0 structures\r
385                 uses oxm:match-v10-grouping;\r
386             } \r
387             grouping port-status {\r
388                 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"\r
389                 \r
390                 uses ofHeader;\r
391                 \r
392                 uses port;\r
393                 \r
394                 leaf reason {\r
395                     type oft:port-reason;\r
396                 }\r
397             } /* Async message */\r
398         /* Controller command messages. */\r
399             grouping packet-out {\r
400                 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"\r
401                 /* Controller/switch message */\r
402                 \r
403                 uses ofHeader;\r
404                 \r
405                 uses ofaction:actions;\r
406                 \r
407                 leaf data {\r
408                     type binary;\r
409                 }\r
410                 leaf buffer-id {\r
411                     type uint32;\r
412                 }\r
413                 leaf in-port {\r
414                     type oft:port-number;\r
415                 }\r
416             } \r
417             grouping flow-mod {\r
418                 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"\r
419                 /* Controller/switch message */\r
420                 \r
421                 uses ofHeader;\r
422                 \r
423                 leaf cookie {\r
424                     type uint64;\r
425                 }\r
426                 leaf cookie-mask {\r
427                     type uint64;\r
428                 }\r
429                 leaf table-id {\r
430                     type oft:table-id;\r
431                 }\r
432                 leaf command {\r
433                     type oft:flow-mod-command;\r
434                 }\r
435                 leaf idle-timeout {\r
436                     type uint16;\r
437                 }\r
438                 leaf hard-timeout {\r
439                     type uint16;\r
440                 }\r
441                 leaf priority {\r
442                     type uint16;\r
443                 }\r
444                 leaf buffer-id {\r
445                     type uint32;\r
446                 }\r
447                 leaf out-port {\r
448                     type oft:port-number;\r
449                 }\r
450                 leaf out-group {\r
451                     type uint32;\r
452                 }\r
453                 leaf flags {\r
454                     type oft:flow-mod-flags;\r
455                 }\r
456                 uses match-grouping;\r
457                 \r
458                 uses ofinstruction:instructions;\r
459                 \r
460                 // OF1.0 structures\r
461                 leaf flags-v10 {\r
462                     type oft:flow-mod-flags-v10;\r
463                 }\r
464                 uses oxm:match-v10-grouping;\r
465                 uses ofaction:actions;\r
466             } \r
467             grouping group-mod {\r
468                 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"\r
469                 /* Controller/switch message */\r
470                 \r
471                 uses ofHeader;\r
472                 \r
473                 leaf command {\r
474                     type oft:group-mod-command;\r
475                 }\r
476                 leaf type {\r
477                     type oft:group-type;\r
478                 }\r
479                 leaf group-id {\r
480                     type uint32;\r
481                 }\r
482                 \r
483                 uses buckets;\r
484             }\r
485             \r
486             grouping port-mod {\r
487                 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"\r
488                 /* Controller/switch message */\r
489 \r
490                 uses ofHeader;\r
491                 \r
492                 leaf port-no {\r
493                     type oft:port-number;\r
494                 }\r
495                 leaf hw-address {\r
496                     type yang:mac-address;\r
497                 }       \r
498                 leaf config {\r
499                     type oft:port-config;\r
500                 }   \r
501                 leaf mask {\r
502                     type oft:port-config;\r
503                 }\r
504                 leaf advertise {\r
505                     type oft:port-features;\r
506                 }\r
507                 // OF1.0 structures\r
508                 leaf config-v10 {\r
509                     type oft:port-config-v10;\r
510                 }\r
511                 leaf mask-v10 {\r
512                     type oft:port-config-v10;\r
513                 }\r
514                 leaf advertise-v10 {\r
515                     type oft:port-features-v10;\r
516                 }\r
517             } \r
518             grouping table-mod {\r
519                 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"\r
520                 /* Controller/switch message */\r
521 \r
522                 uses ofHeader;\r
523                 \r
524                 leaf table-id {\r
525                     type oft:table-id;\r
526                 }\r
527                 leaf config {\r
528                     type oft:table-config;\r
529                 }\r
530             } \r
531             \r
532         /* Multipart messages. */\r
533             grouping multipart-request {\r
534                 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"\r
535                 /* Controller/switch message */\r
536 \r
537                 uses ofHeader;\r
538                 \r
539                 leaf type {\r
540                     type oft:multipart-type;\r
541                 }          \r
542                 leaf flags {\r
543                     type oft:multipart-request-flags;\r
544                 }      \r
545                 choice multipart-request-body {\r
546                     case multipart-request-desc {\r
547                         leaf empty {\r
548                             type empty;\r
549                         }\r
550                     }\r
551                     case multipart-request-flow {\r
552                         leaf table-id {\r
553                             type uint8;\r
554                         }\r
555                         leaf out-port {\r
556                             type uint32;\r
557                         }\r
558                         leaf out-group {\r
559                             type uint32;\r
560                         }\r
561                         leaf cookie {\r
562                             type uint64;\r
563                         }\r
564                         leaf cookie-mask {\r
565                             type uint64;\r
566                         }\r
567                         uses match-grouping;\r
568                         \r
569                         // OF1.0 structures\r
570                         uses oxm:match-v10-grouping;\r
571                     }\r
572                     case multipart-request-aggregate {\r
573                         leaf table-id {\r
574                             type uint8;\r
575                         }\r
576                         leaf out-port {\r
577                             type uint32;\r
578                         }\r
579                         leaf out-group {\r
580                             type uint32;\r
581                         }\r
582                         leaf cookie {\r
583                             type uint64;\r
584                         }\r
585                         leaf cookie-mask {\r
586                             type uint64;\r
587                         }\r
588                         uses match-grouping;\r
589                         \r
590                         // OF1.0 structures\r
591                         uses oxm:match-v10-grouping;\r
592                     }\r
593                     case multipart-request-table {\r
594                         leaf empty {\r
595                             type empty;\r
596                         }\r
597                     }\r
598                     case multipart-request-port-stats {\r
599                         leaf port-no {\r
600                             type uint32;\r
601                         }\r
602                     }\r
603                     case multipart-request-queue {\r
604                         leaf port-no {\r
605                             type uint32;\r
606                         }\r
607                         leaf queue-id {\r
608                             type uint32;\r
609                         }\r
610                     }\r
611                     case multipart-request-group {\r
612                         leaf group-id {\r
613                             type uint32;\r
614                         }\r
615                     }\r
616                     case multipart-request-group-desc {\r
617                         leaf empty {\r
618                             type empty;\r
619                         }\r
620                     }\r
621                     case multipart-request-group-features {\r
622                         leaf empty {\r
623                             type empty;\r
624                         }\r
625                     }\r
626                     case multipart-request-meter {\r
627                         leaf meter-id {\r
628                             type uint32;\r
629                         }\r
630                     }\r
631                     case multipart-request-meter-config {\r
632                         leaf meter-id {\r
633                             type uint32;\r
634                         }\r
635                     }\r
636                     case multipart-request-meter-features {\r
637                         leaf empty {\r
638                             type empty;\r
639                         }\r
640                     }\r
641                     case multipart-request-table-features {\r
642                         list table-features {\r
643                             leaf table-id {\r
644                                 type uint8;\r
645                             }\r
646                             leaf name {\r
647                                 type string;\r
648                             }\r
649                             leaf metadata-match {\r
650                                 type uint64;\r
651                             }\r
652                             leaf metadata-write {\r
653                                 type uint64;\r
654                             }\r
655                             leaf config {\r
656                                 type oft:table-config;\r
657                             }\r
658                             leaf max-entries {\r
659                                 type uint32;\r
660                             }\r
661                             uses table-features-properties;\r
662                         }\r
663                     }\r
664                     case multipart-request-port-desc {\r
665                         leaf empty {\r
666                             type empty;\r
667                         }\r
668                     }\r
669                     case multipart-request-experimenter {\r
670                         leaf experimenter {\r
671                             type uint32;\r
672                         }\r
673                         leaf exp-type {\r
674                             type uint32;\r
675                         }\r
676                         leaf data {\r
677                             type binary;\r
678                         }\r
679                     }\r
680                 }\r
681             } \r
682             grouping multipart-reply {\r
683                 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"\r
684                 /* Controller/switch message */\r
685 \r
686                 uses ofHeader;\r
687                 \r
688                 leaf type {\r
689                     type oft:multipart-type;\r
690                 }\r
691                 leaf flags {\r
692                     type oft:multipart-request-flags;\r
693                 }\r
694                 choice multipart-reply-body {\r
695                     case multipart-reply-desc {\r
696                         leaf mfr_desc {\r
697                             type string;\r
698                         }\r
699                         leaf hw_desc {\r
700                             type string;\r
701                         }\r
702                         leaf sw_desc {\r
703                             type string;\r
704                         }\r
705                         leaf serial_num {\r
706                             type string;\r
707                         }\r
708                         leaf dp_desc {\r
709                             type string;\r
710                         }\r
711                     }\r
712                     case multipart-reply-flow {\r
713                         list flow-stats {\r
714                             leaf table-id {\r
715                                 type uint8;\r
716                             }\r
717                             leaf duration-sec {\r
718                                 type uint32;\r
719                             }\r
720                             leaf duration-nsec {\r
721                                 type uint32;\r
722                             }\r
723                             leaf priority {\r
724                                 type uint16;\r
725                             }\r
726                             leaf idle-timeout {\r
727                                 type uint16;\r
728                             }\r
729                             leaf hard-timeout {\r
730                                 type uint16;\r
731                             }\r
732                             leaf flags {\r
733                                 type oft:flow-mod-flags;\r
734                             }\r
735                             leaf cookie {\r
736                                 type uint64;\r
737                             }\r
738                             leaf packet-count {\r
739                                 type uint64;\r
740                             }\r
741                             leaf byte-count {\r
742                                 type uint64;\r
743                             }\r
744                             uses match-grouping;\r
745                             \r
746                             uses ofinstruction:instructions;\r
747                             \r
748                             // OF1.0 structures\r
749                             uses oxm:match-v10-grouping;\r
750                             uses ofaction:actions;\r
751                         }\r
752                     }\r
753                     case multipart-reply-aggregate {\r
754                         leaf packet-count {\r
755                             type uint64;\r
756                         }\r
757                         leaf byte-count {\r
758                             type uint64;\r
759                         }\r
760                         leaf flow-count {\r
761                             type uint32;\r
762                         }\r
763                     }\r
764                     case multipart-reply-table {\r
765                         list table-stats {\r
766                             leaf table-id {\r
767                                 type uint8;\r
768                             }\r
769                             leaf active-count {\r
770                                 type uint32;\r
771                             }\r
772                             leaf lookup-count {\r
773                                 type uint64;\r
774                             }\r
775                             leaf matched-count {\r
776                                 type uint64;\r
777                             }\r
778                             \r
779                             // OF1.0 structures\r
780                             leaf name {\r
781                                 type string;\r
782                             }\r
783                         }\r
784                     }\r
785                     case multipart-reply-port-stats {\r
786                         list port-stats {\r
787                             leaf port-no {\r
788                                 type uint32;\r
789                             }\r
790                             leaf rx-packets {\r
791                                 type uint64;\r
792                             }\r
793                             leaf tx-packets {\r
794                                 type uint64;\r
795                             }\r
796                             leaf rx-bytes {\r
797                                 type uint64;\r
798                             }\r
799                             leaf tx-bytes {\r
800                                 type uint64;\r
801                             }\r
802                             leaf rx-dropped {\r
803                                 type uint64;\r
804                             }\r
805                             leaf tx-dropped {\r
806                                 type uint64;\r
807                             }\r
808                             leaf rx-errors {\r
809                                 type uint64;\r
810                             }\r
811                             leaf tx-errors {\r
812                                 type uint64;\r
813                             }\r
814                             leaf rx-frame-err {\r
815                                 type uint64;\r
816                             }\r
817                             leaf rx-over-err {\r
818                                 type uint64;\r
819                             }\r
820                             leaf rx-crc-err {\r
821                                 type uint64;\r
822                             }\r
823                             leaf collisions {\r
824                                 type uint64;\r
825                             }\r
826                             leaf duration-sec {\r
827                                 type uint32;\r
828                             }\r
829                             leaf duration-nsec {\r
830                                 type uint32;\r
831                             }\r
832                         }\r
833                     }\r
834                     case multipart-reply-queue {\r
835                         list queue-stats {\r
836                             leaf port-no {\r
837                                 type uint32;\r
838                             }\r
839                             leaf queue-id {\r
840                                 type uint32;\r
841                             }\r
842                             leaf tx-bytes {\r
843                                 type uint64;\r
844                             }\r
845                             leaf tx-packets {\r
846                                 type uint64;\r
847                             }\r
848                             leaf tx-errors {\r
849                                 type uint64;\r
850                             }\r
851                             leaf duration-sec {\r
852                                 type uint32;\r
853                             }\r
854                             leaf duration-nsec {\r
855                                 type uint32;\r
856                             }\r
857                         }\r
858                     }\r
859                     case multipart-reply-group {\r
860                         list group-stats {\r
861                             leaf group-id {\r
862                                 type uint32;\r
863                             }\r
864                             leaf ref-count {\r
865                                 type uint32;\r
866                             }\r
867                             leaf packet-count {\r
868                                 type uint64;\r
869                             }\r
870                             leaf byte-count {\r
871                                 type uint64;\r
872                             }\r
873                             leaf duration-sec {\r
874                                 type uint32;\r
875                             }\r
876                             leaf duration-nsec {\r
877                                 type uint32;\r
878                             }\r
879                             list bucket-stats {\r
880                                 leaf packet-count {\r
881                                     type uint64;\r
882                                 }\r
883                                 leaf byte-count {\r
884                                     type uint64;\r
885                                 }\r
886                             }\r
887                         }\r
888                     }\r
889                     case multipart-reply-group-desc {\r
890                         list group-desc {\r
891                             leaf type {\r
892                                 type oft:group-type;\r
893                             }\r
894                             leaf group-id {\r
895                                 type uint32;\r
896                             }\r
897                             uses buckets;\r
898                         }\r
899                     }\r
900                     case multipart-reply-group-features {\r
901                         leaf types {\r
902                             type oft:group-types;\r
903                         }\r
904                         leaf capabilities {\r
905                             type oft:group-capabilities;\r
906                         }\r
907                         leaf-list max_groups {\r
908                             type uint32;\r
909                         }\r
910                         leaf-list actions-bitmap {\r
911                             type oft:action-type;\r
912                         }\r
913                     }\r
914                     case multipart-reply-meter {\r
915                         list meter-stats {\r
916                             leaf meter-id {\r
917                                 type uint32;\r
918                             }\r
919                             leaf flow-count {\r
920                                 type uint32;\r
921                             }\r
922                             leaf packet-in-count {\r
923                                 type uint64;\r
924                             }\r
925                             leaf byte-in-count {\r
926                                 type uint64;\r
927                             }\r
928                             leaf duration-sec {\r
929                                 type uint32;\r
930                             }\r
931                             leaf duration-nsec {\r
932                                 type uint32;\r
933                             }\r
934                             list meter-band-stats {\r
935                                 leaf packet-band-count {\r
936                                     type uint64;\r
937                                 }\r
938                                 leaf byte-band-count {\r
939                                     type uint64;\r
940                                 }\r
941                             }\r
942                         }\r
943                     }\r
944                     case multipart-reply-meter-config {\r
945                         list meter-config {\r
946                             leaf flags {\r
947                                 type oft:meter-flags;\r
948                             }\r
949                             leaf meter-id {\r
950                                 type uint32;\r
951                             }\r
952                             list bands {\r
953                                 uses meter-band-header;\r
954                             }\r
955                         }\r
956                     }\r
957                     case multipart-reply-meter-features {\r
958                         leaf max-meter {\r
959                             type uint32;\r
960                         }\r
961                         leaf band-types {\r
962                             type oft:meter-band-type-bitmap;\r
963                         }\r
964                         leaf capabilities {\r
965                             type oft:meter-flags;\r
966                         }\r
967                         leaf max-bands {\r
968                             type uint8;\r
969                         }\r
970                         leaf max-color {\r
971                             type uint8;\r
972                         }\r
973                     }\r
974                     case multipart-reply-table-features {\r
975                         list table-features {\r
976                             leaf table-id {\r
977                                 type uint8;\r
978                             }\r
979                             leaf name {\r
980                                 type string;\r
981                             }\r
982                             leaf metadata-match {\r
983                                 type binary;\r
984                             }\r
985                             leaf metadata-write {\r
986                                 type binary;\r
987                             }\r
988                             leaf config {\r
989                                 type oft:port-config;\r
990                             } \r
991                             leaf max-entries {\r
992                                 type uint32;\r
993                             }\r
994                             uses table-features-properties;\r
995                         }\r
996                     }\r
997                     case multipart-reply-port-desc {\r
998                         list ports {\r
999                             uses port;\r
1000                         }\r
1001                     }\r
1002                     case multipart-reply-experimenter {\r
1003                         leaf experimenter {\r
1004                             type uint32;\r
1005                         }\r
1006                         leaf exp-type {\r
1007                             type uint32;\r
1008                         }\r
1009                         leaf data {\r
1010                             type binary;\r
1011                         }\r
1012                     }\r
1013                 }\r
1014             } \r
1015             /* Barrier messages. */\r
1016             grouping barrier-request {\r
1017                 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"\r
1018                 /* Controller/switch message */\r
1019                 uses ofHeader;\r
1020             } \r
1021             grouping barrier-reply {\r
1022                 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"\r
1023                 /* Controller/switch message */\r
1024                 uses ofHeader;\r
1025             } \r
1026         /* Queue Configuration messages. */\r
1027             grouping queue-get-config-request {\r
1028                 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
1029                 /* Controller/switch message */\r
1030                 \r
1031                 uses ofHeader;\r
1032                 \r
1033                 leaf port {\r
1034                     type oft:port-number;\r
1035                 }\r
1036             } \r
1037             grouping queue-get-config-reply {\r
1038                 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
1039                 /* Controller/switch message */\r
1040 \r
1041                 uses ofHeader;\r
1042                 \r
1043                 leaf port {\r
1044                     type oft:port-number;\r
1045                 }\r
1046                 list queues {\r
1047                     uses packet-queue;\r
1048                 }\r
1049             }\r
1050             grouping packet-queue {\r
1051                 leaf queue-id {\r
1052                     type oft:queue-id;\r
1053                 }\r
1054                 leaf port {\r
1055                     type oft:port-number;\r
1056                 }\r
1057                 uses queue-property-header;\r
1058             }\r
1059             container queue-prop-container {\r
1060                 uses queue-property-header;\r
1061             }\r
1062             grouping queue-property-header {\r
1063                 list queue-property {\r
1064                     leaf property {\r
1065                         type oft:queue-properties;\r
1066                     }\r
1067                 }\r
1068             }\r
1069             /* Controller role change request messages. */\r
1070             grouping role-request {\r
1071                 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"\r
1072                 /* Controller/switch message */\r
1073                 \r
1074                 uses ofHeader;\r
1075                 \r
1076                 leaf role {\r
1077                     type oft:controller-role;\r
1078                 }\r
1079                 leaf generation-id {\r
1080                     type uint64;\r
1081                 }\r
1082             } \r
1083             grouping role-reply {\r
1084                 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"\r
1085                 /* Controller/switch message */\r
1086 \r
1087                 uses ofHeader;\r
1088                 \r
1089                 leaf role {\r
1090                     type oft:controller-role;\r
1091                 }\r
1092                 leaf generation-id {\r
1093                     type uint64;\r
1094                 }\r
1095             } \r
1096             /* Asynchronous message configuration. */\r
1097             grouping get-async-request {\r
1098                 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"\r
1099                 /* Controller/switch message */\r
1100 \r
1101                 uses ofHeader;                \r
1102             } \r
1103             grouping get-async-reply {\r
1104                 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"\r
1105                 /* Controller/switch message */\r
1106 \r
1107                 uses ofHeader;\r
1108                 uses async-body-grouping;\r
1109             } \r
1110             grouping set-async {\r
1111                 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"\r
1112                 /* Controller/switch message */\r
1113                 \r
1114                 uses ofHeader;\r
1115                 uses async-body-grouping;\r
1116             }\r
1117             \r
1118             grouping async-body-grouping {\r
1119                 list packet-in-mask {\r
1120                     leaf-list mask {\r
1121                         type oft:packet-in-reason;\r
1122                     }\r
1123                 }\r
1124                 list port-status-mask {\r
1125                     leaf-list mask {\r
1126                         type oft:port-reason;\r
1127                     }\r
1128                 }\r
1129                 list flow-removed-mask {\r
1130                     leaf-list mask {\r
1131                         type oft:flow-removed-reason;\r
1132                     }\r
1133                 }\r
1134             }\r
1135             /* Meters and rate limiters configuration messages. */\r
1136             grouping meter-mod {\r
1137                 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"\r
1138                 /* Controller/switch message */\r
1139 \r
1140                 uses ofHeader;\r
1141                 \r
1142                 leaf command {\r
1143                     type oft:meter-mod-command;\r
1144                 } \r
1145                 leaf flags {\r
1146                     type oft:meter-flags;\r
1147                 }            \r
1148                 leaf meter-id {\r
1149                     type oft:meter-id;\r
1150                 }   \r
1151                 list bands {\r
1152                     uses meter-band-header;\r
1153                 }\r
1154             } \r
1155             \r
1156             grouping meter-band-header {\r
1157                 choice meter-band {\r
1158                     case meter-band-drop {\r
1159                         uses meter-band-commons;\r
1160                     }\r
1161                     case meter-band-dscp-remark {\r
1162                         uses meter-band-commons;\r
1163                         leaf prec-level {\r
1164                             type uint8;\r
1165                         }\r
1166                     }\r
1167                     case meter-band-experimenter {\r
1168                         uses meter-band-commons;\r
1169                         leaf experimenter {\r
1170                             type uint32;\r
1171                         }\r
1172                     }\r
1173                 }\r
1174             }\r
1175             \r
1176             grouping meter-band-commons {\r
1177                 leaf type {\r
1178                     type oft:meter-band-type;\r
1179                 }\r
1180                 leaf rate {\r
1181                     type uint32;\r
1182                 }\r
1183                 leaf burst-size {\r
1184                     type uint32;\r
1185                 }\r
1186             }\r
1187 \r
1188             /* Immutable messages. */\r
1189             notification hello-message {\r
1190                 uses hello;\r
1191                 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
1192                 \r
1193                 /* Symmetric message */\r
1194             }\r
1195             notification error-message {\r
1196                 uses error;\r
1197                 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"\r
1198                 \r
1199                 /* Symmetric message */\r
1200             }\r
1201             notification echo-request-message {\r
1202                 uses echo-request;\r
1203                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
1204                 \r
1205                 /* Symmetric message */\r
1206             }\r
1207             notification experimenter-message {\r
1208                 uses experimenter;\r
1209                 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
1210                 // TODO:: does switch send this when understood experimenter msg from lib?\r
1211                 /* Symmetric message */\r
1212             }\r
1213     // # Notification and RPCs\r
1214         /* Symmetric RPC. */\r
1215             rpc echo {\r
1216                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
1217                 input {\r
1218                     uses echo-request;\r
1219                 }\r
1220                 /* Controller/switch message */\r
1221                 output {\r
1222                     uses echo-reply;\r
1223                 }\r
1224             }\r
1225             \r
1226             rpc echo-reply {\r
1227                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
1228                 input {\r
1229                     uses echo-reply;\r
1230                 }\r
1231             }\r
1232             \r
1233             rpc hello {\r
1234                 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
1235                 input {\r
1236                     uses hello;\r
1237                 }\r
1238             }\r
1239             \r
1240             rpc experimenter {\r
1241                 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
1242                 input {\r
1243                     uses experimenter;\r
1244                 }\r
1245             }\r
1246 \r
1247         /* Switch configuration messages. */\r
1248             rpc get-features {\r
1249                 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"\r
1250                 input {\r
1251                     uses features-request;\r
1252                 }\r
1253                 /* Controller/switch message */\r
1254                 output {\r
1255                     uses features-reply;\r
1256                 }\r
1257             }\r
1258             \r
1259             rpc get-config {\r
1260                 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
1261                 input {\r
1262                     uses get-config-request;\r
1263                 }\r
1264                 output {\r
1265                     uses get-config-reply;\r
1266                 }\r
1267                 /* Controller/switch message */\r
1268             }\r
1269             \r
1270             rpc set-config {\r
1271                 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"\r
1272                 input {\r
1273                     uses set-config;\r
1274                 }   \r
1275                 /* Controller/switch message */\r
1276             }\r
1277         /* Asynchronous messages. */\r
1278             notification packet-in-message {\r
1279                 uses packet-in;\r
1280                 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"\r
1281                 \r
1282              /* Async message */\r
1283             }\r
1284             notification flow-removed-message {\r
1285                 uses flow-removed;\r
1286                 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"\r
1287                 \r
1288                 /* Async message */\r
1289             } \r
1290             notification port-status-message {\r
1291                 uses port-status;\r
1292                 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"\r
1293                 \r
1294             } /* Async message */\r
1295 \r
1296         /* Controller command messages. */\r
1297             rpc packet-out {\r
1298                 input {\r
1299                     uses packet-out;\r
1300                     // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"\r
1301                 }\r
1302                 /* Controller/switch message */\r
1303             } \r
1304             rpc flow-mod {\r
1305                 input {\r
1306                     uses flow-mod;\r
1307                     // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"\r
1308                 }\r
1309                 /* Controller/switch message */\r
1310             } \r
1311             rpc group-mod {\r
1312                 input {\r
1313                     uses group-mod;\r
1314                     // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"\r
1315                 }\r
1316                 /* Controller/switch message */\r
1317             } \r
1318             rpc port-mod {\r
1319                 input {\r
1320                     uses port-mod;\r
1321                     // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"\r
1322                 }\r
1323             } /* Controller/switch message */\r
1324             \r
1325             rpc table-mod {\r
1326                 input {\r
1327                     uses table-mod;\r
1328                     // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"\r
1329                 }\r
1330             } /* Controller/switch message */\r
1331 \r
1332         /* Multipart messages. */\r
1333 \r
1334             rpc multipart-request {\r
1335                 input {\r
1336                     uses multipart-request;\r
1337                 }\r
1338             }\r
1339 \r
1340              /* Controller/switch message */\r
1341             notification multipart-reply-message {\r
1342                 uses multipart-reply;\r
1343                 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"\r
1344                 // notification because of multiple following responses\r
1345             } /* Controller/switch message */\r
1346             \r
1347 \r
1348             /* Barrier messages. */\r
1349             rpc barrier {\r
1350                 input {\r
1351                     uses barrier-request;\r
1352                     // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"\r
1353                 }\r
1354                 output {\r
1355                     uses barrier-reply;\r
1356                     // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"\r
1357                 }\r
1358             }\r
1359         /* Queue Configuration messages. */\r
1360             rpc get-queue-config {\r
1361                 input {\r
1362                     uses queue-get-config-request;\r
1363                     // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
1364                 }\r
1365                 output {\r
1366                     uses queue-get-config-reply;\r
1367                     // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
1368                 }\r
1369             } \r
1370 \r
1371         /* Controller role change request messages. */\r
1372             rpc role-request {\r
1373                 input {\r
1374                     uses role-request;\r
1375                     // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"\r
1376                 }\r
1377                 output {\r
1378                     uses role-reply;\r
1379                     // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"\r
1380                 }\r
1381             } /* Controller/switch message */\r
1382             \r
1383         /* Asynchronous message configuration. */\r
1384             rpc get-async {\r
1385                 input {\r
1386                     uses get-async-request;\r
1387                     // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"\r
1388                 }\r
1389                 output {\r
1390                     uses get-async-reply;\r
1391                     // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"\r
1392                 }\r
1393             } \r
1394              /* Controller/switch message */\r
1395             rpc set-async {\r
1396                 input { \r
1397                     uses set-async;\r
1398                 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"\r
1399                 }\r
1400                 \r
1401             } \r
1402         /* Meters and rate limiters configuration messages. */\r
1403             rpc meter-mod {\r
1404                 input {\r
1405                     uses meter-mod;\r
1406                     // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"\r
1407                 }\r
1408             } /* Controller/switch message */\r
1409 }