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