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