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