Added copyright in yang files
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-types.yang
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8  
9  module openflow-types {
10     namespace "urn:opendaylight:openflow:common:types";
11     prefix "oft";
12
13     revision "2013-07-31" {
14         //description "OpenFlow 1.3 - common types model";
15     }
16
17     typedef port-number {
18         type uint32;
19     }
20     
21     typedef port-number-values {
22         type enumeration {
23             enum MAX {
24                 value -256; // 0xffffff00 
25             }
26             enum IN_PORT {
27                 value -8; // 0xfffffff8
28             }
29             enum TABLE {
30                 value -7; // 0xfffffff9 
31             }
32             enum NORMAL {
33                 value -6; // 0xfffffffa 
34             }
35             enum FLOOD {
36                 value -5; // 0xfffffffb 
37             }
38             enum ALL {
39                 value -4; // 0xfffffffc 
40             }
41             enum CONTROLLER {
42                 value -3; // 0xfffffffd
43             }
44             enum LOCAL {
45                 value -2; // 0xfffffffe
46             }
47             enum ANY {
48                 value -1; // 0xffffffff
49             }
50         }
51     }
52
53     typedef port-features {
54         ////description "Features of ports available in datapath.";
55         //reference "ofp_port_features";
56         type bits {
57             bit _10mb_hd { 
58                 position 0;
59                 //description "10 Mb half-duplex rate support.";
60             }
61             bit _10mb-fd { 
62                 position 1;
63                 //description "10 Mb full-duplex rate support.";
64             }
65             bit _100mb-hd { 
66                 position 2;
67                 //description "100 Mb half-duplex rate support.";
68             }
69             bit _100mb-fd { 
70                 position 3;
71                 //description "100 Mb full-duplex rate support.";
72             }
73             bit _1gb-hd { 
74                 position 4;
75                 //description "1 Gb half-duplex rate support.";
76             }
77             bit _1gb-fd { 
78                 position 5;
79                 //description "1 Gb full-duplex rate support.";
80             }
81             bit _10gb-fd { 
82                 position 6;
83                 //description "10 Gb full-duplex rate support.";
84             }
85             bit _40gb-fd { 
86                 position 7;
87                 //description "40 Gb full-duplex rate support.";
88             }
89             bit _100gb-fd { 
90                 position 8;
91                 //description "100 Gb full-duplex rate support.";
92             }
93             bit _1tb-fd { 
94                 position 9;
95                 //description "1 Tb full-duplex rate support.";
96             }
97             bit other { 
98                 position 10;
99                 //description "Other rate, not in the list.";
100             }
101             bit copper { 
102                 position 11;
103                 //description "Copper medium.";
104             }
105             bit fiber { 
106                 position 12;
107                 //description "Fiber medium.";
108             }
109             bit autoneg { 
110                 position 13;
111                 //description "Auto-negotiation.";
112             }
113             bit pause { 
114                 position 14;
115                 //description "Pause.";
116             }
117             bit pause-asym { 
118                 position 15;
119                 //description "Asymmetric pause.";
120             }
121         }
122     }
123
124     typedef port-config {
125         description 
126            "Flags to indicate behavior of the physical port. These flags are
127             describe the current configuration and used port_mod message 
128             to configure the port's behavior.";
129         type bits {
130             bit port-down { 
131                 //description " Port is administratively down.";
132                 position 0;
133             }
134             bit no-recv { 
135                 //description " Drop all packets received by port.";
136                 position 2;
137             }
138             bit no-fwd { 
139                 //description " Drop packets forwarded to port.";
140                 position 5;
141             }
142             bit no-packet-in { 
143                 //description "Do not send packet-in msgs for port.";
144                 position 6;
145             }
146         }
147     }
148
149     typedef port-state {
150         description 
151             "Current state of the physical port. These are not configurable from
152             the controller.";
153         type bits {
154             bit link_down {
155                 //description "No physical link present.";
156                 position 0;
157             }
158             bit blocked {
159                 //description "Port is blocked";
160                 position 1;
161             }
162             bit live {
163                 //description "Live for Fast Failover Group.";
164                 position 2;
165             }
166         }
167     }
168
169     identity match-type-base {
170         description 
171            "The match type indicates the match structure (set of fields that compose the
172             match) in use. The match type is placed in the type field at the beginning
173             of all match structures.Extensions that define match types may be 
174             published on the ONF wiki. Support for extensions is optional.";
175     }
176
177     identity standard-match-type {
178         base oft:match-type-base;
179     }
180
181     identity instruction {
182     }
183
184     identity action {
185     }
186
187     typedef metadata {
188         type binary;
189     }
190
191     typedef table-id {
192         type uint32;
193     }
194     typedef meter-id {
195         type uint32;
196     }
197     typedef queue-id {
198         type uint32;
199     }
200     typedef group-id {
201         type uint32;
202     }
203
204     typedef ether-type {
205         type uint16;
206     }
207
208     typedef error-type {
209         type enumeration {
210             enum HELLO_FAILED {
211                 value 0; 
212                 description "Hello Protocol failed.";
213             }
214             enum BAD_REQUEST {
215                 value 1; 
216                 description "Request was not understood.";
217             }
218             enum BAD_ACTION {
219                 value 2; 
220                 description "Error in action description.";
221             }
222             enum BAD_INSTRUCTION {
223                 value 3; 
224                 description "Error in instruction list.";
225             }
226             enum BAD_MATCH {
227                 value 4; 
228                 description "Error in match.";
229             }
230             enum FLOW_MOD_FAILED {
231                 value 5; 
232                 description "Problem modifying flow entry.";
233             }
234             enum GROUP_MOD_FAILED {
235                 value 6; 
236                 description "Problem modifying group entry.";
237             }
238             enum PORT_MOD_FAILED {
239                 value 7; 
240                 description "Port mod request failed.";
241             }
242             enum TABLE_MOD_FAILED {
243                 value 8; 
244                 description "Table mod request failed.";
245             }
246             enum QUEUE_OP_FAILED {
247                 value 9; 
248                 description "Queue operation failed.";
249             }
250             enum SWITCH_CONFIG_FAILED {
251                 value 10; 
252                 description "Switch config request failed.";
253             }
254             enum ROLE_REQUEST_FAILED {
255                 value 11; 
256                 description "Controller Role request failed.";
257             }
258             enum METER_MOD_FAILED {
259                 value 12; 
260                 description "Error in meter.";
261             }
262             enum TABLE_FEATURES_FAILED {
263                 value 13; 
264                 description "Setting table features failed.";
265             }
266             enum EXPERIMENTER {
267                 value 65535; //0xffff 
268                 description "Experimenter error messages.";
269             }
270         }
271     }
272     
273     typedef hello-failed-code {
274         type enumeration {
275             enum INCOMPATIBLE {
276                 value 0; 
277                 description "Hello Protocol failed.";
278             }
279             enum EPERM {
280                 value 1; 
281                 description "Request was not understood.";
282             }
283         }
284     }
285     
286     typedef bad-request-code {
287         type enumeration {
288             enum BAD_VERSION {
289                 value 0; 
290             }
291             enum BAD_TYPE {
292                 value 1; 
293             }
294             enum BAD_MULTIPART {
295                 value 2; 
296             }
297             enum BAD_EXPERIMENTER {
298                 value 3; 
299             }
300             enum BAD_EXP_TYPE {
301                 value 4; 
302             }
303             enum EPERM {
304                 value 5; 
305             }
306             enum BAD_LEN {
307                 value 6; 
308             }
309             enum BUFFER_EMPTY {
310                 value 7; 
311             }
312             enum BUFFER_UNKNOWN {
313                 value 8; 
314             }
315             enum BAD_TABLE_ID {
316                 value 9; 
317             }
318             enum IS_SLAVE {
319                 value 10; 
320             }
321             enum BAD_PORT {
322                 value 11; 
323             }
324             enum BAD_PACKET {
325                 value 12; 
326             }
327             enum MULTIPART_BUFFER_OVERFLOW {
328                 value 13; 
329             }
330         }
331     }
332     
333     typedef bad-action-code {
334         type enumeration {
335             enum BAD_TYPE {
336                 value 0; 
337             }
338             enum BAD_LEN {
339                 value 1; 
340             }
341             enum BAD_EXPERIMENTER {
342                 value 2; 
343             }
344             enum BAD_EXP_TYPE {
345                 value 3; 
346             }
347             enum BAD_OUT_PORT {
348                 value 4; 
349             }
350             enum BAD_ARGUMENT {
351                 value 5; 
352             }
353             enum EPERM {
354                 value 6; 
355             }
356             enum TOO_MANY {
357                 value 7; 
358             }
359             enum BAD_QUEUE {
360                 value 8; 
361             }
362             enum BAD_OUT_GROUP {
363                 value 9; 
364             }
365             enum MATCH_INCONSISTENT {
366                 value 10; 
367             }
368             enum UNSUPPORTED_ORDER {
369                 value 11; 
370             }
371             enum BAD_TAG {
372                 value 12; 
373             }
374             enum BAD_SET_TYPE {
375                 value 13; 
376             }
377             enum BAD_SET_LEN {
378                 value 14; 
379             }
380             enum BAD_SET_ARGUMENT {
381                 value 15; 
382             }
383         }
384     }
385     
386     typedef bad-instruction-code {
387         type enumeration {
388             enum UNKNOWN_INST {
389                 value 0; 
390             }
391             enum UNSUP_INST {
392                 value 1; 
393             }
394             enum BAD_TABLE_ID {
395                 value 2; 
396             }
397             enum UNSUP_METADATA {
398                 value 3; 
399             }
400             enum UNSUP_METADATA_MASK {
401                 value 4; 
402             }
403             enum BAD_EXPERIMENTER {
404                 value 5; 
405             }
406             enum BAD_EXP_TYPE {
407                 value 6; 
408             }
409             enum BAD_LEN {
410                 value 7; 
411             }
412             enum EPERM {
413                 value 8; 
414             }
415         }
416     }
417     
418     typedef bad-match-code {
419         type enumeration {
420             enum BAD_TYPE {
421                 value 0; 
422             }
423             enum BAD_LEN {
424                 value 1; 
425             }
426             enum BAD_TAG {
427                 value 2; 
428             }
429             enum BAD_DL_ADDR_MASK {
430                 value 3; 
431             }
432             enum BAD_NW_ADDR_MASK {
433                 value 4; 
434             }
435             enum BAD_WILDCARDS {
436                 value 5; 
437             }
438             enum BAD_FIELD {
439                 value 6; 
440             }
441             enum BAD_VALUE {
442                 value 7; 
443             }
444             enum BAD_MASK {
445                 value 8; 
446             }
447             enum BAD_PREREQ {
448                 value 9; 
449             }
450             enum DUP_FIELD {
451                 value 10; 
452             }
453             enum EPERM {
454                 value 11; 
455             }
456         }
457     }
458     
459     typedef flow-mod-failed-code {
460         type enumeration {
461             enum UNKNOWN {
462                 value 0; 
463             }
464             enum TABLE_FULL {
465                 value 1; 
466             }
467             enum BAD_TABLE_ID {
468                 value 2; 
469             }
470             enum OVERLAP {
471                 value 3; 
472             }
473             enum EPERM {
474                 value 4; 
475             }
476             enum BAD_TIMEOUT {
477                 value 5; 
478             }
479             enum BAD_COMMAND {
480                 value 6; 
481             }
482             enum BAD_FLAGS {
483                 value 7; 
484             }
485         }
486     }
487     
488     typedef group-mod-failed-code {
489         type enumeration {
490             enum GROUP_EXISTS {
491                 value 0; 
492             }
493             enum INVALID_GROUP {
494                 value 1; 
495             }
496             enum WEIGHT_UNSUPPORTED {
497                 value 2; 
498             }
499             enum OUT_OF_GROUPS {
500                 value 3; 
501             }
502             enum OUT_OF_BUCKETS {
503                 value 4; 
504             }
505             enum CHAINING_UNSUPPORTED {
506                 value 5; 
507             }
508             enum WATCH_UNSUPPORTED {
509                 value 6; 
510             }
511             enum LOOP {
512                 value 7; 
513             }
514             enum UNKNOWN_GROUP {
515                 value 8; 
516             }
517             enum CHAINED_GROUP {
518                 value 9; 
519             }
520             enum BAD_TYPE {
521                 value 10; 
522             }
523             enum BAD_COMMAND {
524                 value 11; 
525             }
526             enum BAD_BUCKET {
527                 value 12; 
528             }
529             enum BAD_WATCH {
530                 value 13; 
531             }
532             enum EPERM {
533                 value 14; 
534             }
535         }
536     }
537     
538     typedef port-mod-failed-code {
539         type enumeration {
540             enum BAD_PORT {
541                 value 0; 
542             }
543             enum BAD_HW_ADDR {
544                 value 1; 
545             }
546             enum BAD_CONFIG {
547                 value 2; 
548             }
549             enum BAD_ADVERTISE {
550                 value 3; 
551             }
552             enum EPERM {
553                 value 4; 
554             }
555         }
556     }
557     
558     typedef table-mod-failed-code {
559         type enumeration {
560             enum BAD_TABLE {
561                 value 0; 
562             }
563             enum BAD_CONFIG {
564                 value 1; 
565             }
566             enum EPERM {
567                 value 2; 
568             }
569         }
570     }
571
572     typedef queue-op-failed-code {
573         type enumeration {
574             enum BAD_PORT {
575                 value 0; 
576             }
577             enum BAD_QUEUE {
578                 value 1; 
579             }
580             enum EPERM {
581                 value 2; 
582             }
583         }
584     }
585     
586     typedef switch-config-failed-code {
587         type enumeration {
588             enum BAD_FLAGS {
589                 value 0; 
590             }
591             enum BAD_LEN {
592                 value 1; 
593             }
594             enum EPERM {
595                 value 2; 
596             }
597         }
598     }
599     
600     typedef role-request-failed-code {
601         type enumeration {
602             enum STALE {
603                 value 0; 
604             }
605             enum UNSUP {
606                 value 1; 
607             }
608             enum BAD_ROLE {
609                 value 2; 
610             }
611         }
612     }
613     
614     typedef meter-mod-failed-code {
615         type enumeration {
616             enum UNKNOWN {
617                 value 0; 
618             }
619             enum METER_EXISTS {
620                 value 1; 
621             }
622             enum INVALID_METER {
623                 value 2; 
624             }
625             enum UNKNOWN_METER {
626                 value 3; 
627             }
628             enum BAD_COMMAND {
629                 value 4; 
630             }
631             enum BAD_FLAGS {
632                 value 5; 
633             }
634             enum BAD_RATE {
635                 value 6; 
636             }
637             enum BAD_BURST {
638                 value 7; 
639             }
640             enum BAD_BAND {
641                 value 8; 
642             }
643             enum BAD_BAND_VALUE {
644                 value 9; 
645             }
646             enum OUT_OF_METERS {
647                 value 10; 
648             }
649             enum OUT_OF_BANDS {
650                 value 11; 
651             }
652         }
653     }
654     
655     typedef table-features-failed-code {
656         type enumeration {
657             enum BAD_TABLE {
658                 value 0; 
659             }
660             enum BAD_METADATA {
661                 value 1; 
662             }
663             enum BAD_TYPE {
664                 value 2; 
665             }
666             enum BAD_LEN {
667                 value 3; 
668             }
669             enum BAD_ARGUMENT {
670                 value 4; 
671             }
672             enum EPERM {
673                 value 5; 
674             }
675         }
676     }
677     
678     typedef hello-element-type {
679         type enumeration {
680             enum VERSIONBITMAP {
681                 value 1; 
682                 description "Bitmap of version supported.";
683             }
684         }
685     }
686     
687     typedef capabilities {
688         type bits {
689             bit OFPC_FLOW_STATS {
690                 position 0;
691                 /* Flow statistics. */
692             } 
693             bit OFPC_TABLE_STATS {
694                 position 1;
695                 /* Table statistics. */
696             }
697             bit OFPC_PORT_STATS {
698                 position 2;
699                 /* Port statistics. */
700             }
701             bit OFPC_GROUP_STATS {
702                 position 3;
703                 /* Group statistics. */
704             }
705             bit OFPC_IP_REASM {
706                 position 5;
707                 /* Can reassemble IP fragments. */
708             }
709             bit OFPC_QUEUE_STATS {
710                 position 6;
711                 /* Queue statistics. */
712             }
713             bit OFPC_PORT_BLOCKED {
714                 position 8;
715                 /* Switch will block looping ports. */
716             }
717         }
718     }
719
720     typedef switch-config-flag {
721         /* Handling of IP fragments. */
722         type enumeration {
723             enum FRAG_NORMAL {
724                 value 0; 
725                 description "No special handling for fragments.";
726             }
727             enum OFPC_FRAG_DROP {
728                 value 1; 
729                 description "Drop fragments.";
730             }
731             enum OFPC_FRAG_REASM {
732                 value 2; 
733                 description "Reassemble (only if OFPC_IP_REASM set).";
734             }
735             enum OFPC_FRAG_MASK {
736                 value 3; 
737             }
738         }
739     }
740
741     typedef flow-removed-reason {
742         /* flow removed */
743         type enumeration {
744             enum OFPRR_IDLE_TIMEOUT {
745                 value 0;
746                 description "Flow idle time exceeded idle_timeout.";
747             }
748             enum OFPRR_HARD_TIMEOUT {
749                 value 1;
750                 description "Time exceeded hard_timeout.";
751             }
752             enum OFPRR_DELETE {
753                 value 2;
754                 description "Evicted by a DELETE flow mod.";
755             }
756             enum OFPRR_GROUP_DELETE {
757                 value 3;
758                 description "Group was removed.";
759             }
760         }
761     }
762
763     typedef port-reason {
764         /* port status */
765         type enumeration {
766             enum OFPPR_ADD {
767                 value 0;
768                 description "The port was added.";
769             }
770             enum OFPPR_DELETE {
771                 value 1;
772                 description "he port was removed.";
773             }
774             enum OFPPR_MODIFY {
775                 value 2;
776                 description "Some attribute of the port has changed.";
777             }
778         }
779     }
780
781     typedef flow-mod-command {
782         /* ofp_flow_mod_command */
783         type enumeration {
784             enum OFPFC_ADD {      
785                 value 0;      
786                 description "New flow.";    
787             }
788             enum OFPFC_MODIFY {
789                 value 1;
790                 description "Modify all matching flows.";
791             }
792             enum OFPFC_MODIFY_STRICT {
793                 value 2;
794                 description "Modify entry strictly matching wildcards and priority.";
795             }
796             enum OFPFC_DELETE {
797                 value 3;
798                 description "Delete all matching flows.";
799             }
800             enum OFPFC_DELETE_STRICT {
801                 value 4;
802                 description "Delete entry strictly matching wildcards and priority.";
803             }
804         }
805     }
806
807     typedef flow-mod-flags {
808         /* ofp_flow_mod_flags */
809         type bits {
810             bit OFPFF_SEND_FLOW_REM {
811                 position 0;
812                 /* Send flow removed message when flow expires or is deleted. */
813             }
814             bit OFPFF_CHECK_OVERLAP {
815                 position 1;
816                 /* Check for overlapping entries first. */
817             }
818             bit OFPFF_RESET_COUNTS {
819                 position 2;
820                 /* Reset flow packet and byte counts. */
821             }
822             bit OFPFF_NO_PKT_COUNTS {
823                 position 3;
824                 /* Don't keep track of packet count. */
825             }
826             bit OFPFF_NO_BYT_COUNTS {
827                 position 4;
828                 /* Don't keep track of byte count. */
829             }
830         }
831     }
832
833     typedef group-mod-command {
834         /* ofp_group_mod_command */
835         type enumeration {
836             enum OFPGC_ADD {            
837               value 0;            
838               description "New group.";            
839             }
840             enum OFPGC_MODIFY {
841               value 1;
842               description "Modify all matching groups.";
843             }
844             enum OFPGC_DELETE {
845               value 2;
846               description "Delete all matching groups.";
847             }
848             
849         }
850     }
851
852     typedef group-type {
853         /* ofp_group_type */
854         type enumeration {
855             enum OFPGT_ALL {            
856               value 0;            
857               description "All (multicast/broadcast) group.";            
858             }
859             enum OFPGT_SELECT {
860               value 1;
861               description "Select group.";
862             }
863             enum OFPGT_INDIRECT {
864               value 2;
865               description "Indirect group.";
866             }
867             enum OFPGT_FF {
868               value 3;
869               description "Fast failover group.";
870             }
871         }
872     }
873     
874     typedef table-values {
875         /* ofp_table */
876         type enumeration {
877             enum OFPTT_MAX {            
878               value 254; // 0xfe             
879               description "Last usable table number.";            
880             }
881             enum OFPTT_ALL {
882               value 255; // 0xff
883               description "Wildcard table used for table config, 
884                            flow stats and flow deletes.";
885             }
886         }
887     }
888
889         typedef group {
890                 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
891                 type enumeration {
892                         enum OFPG_MAX {
893                                 value -256; //0xffffff00
894                                 description "Last usable group number";
895                         }
896                         
897                         /* Fake groups. */
898                         enum OFPG_ALL {
899                                 value -4; //0xfffffffc
900                                 description "Represents all groups for group delete commands";
901                         }
902                         enum OFPG_ANY {
903                                 value -1; //0xffffffff
904                                 description "Wildcard group used only for flow stats requests. 
905                                                                 Selects all flows regardless of group (including flows with no group)";
906                                 
907                         }
908                 }
909                 
910         }
911         
912     typedef multipart-request-flags {
913         description
914             "enum ofp_multipart_request_flags ";
915         type bits {
916             bit OFPMPF_REQ_MORE {
917                 //description "More requests to follow.";
918                 position 0;
919             }
920         }
921     }
922
923     typedef multipart-type {
924         /* ofp_multipart_type */
925         type enumeration {
926             enum OFPMP_DESC {
927               value 0;
928               description "Description of this OpenFlow switch.
929                  The request body is empty.
930                  The reply body is struct ofp_desc.";
931             }
932             enum OFPMP_FLOW {
933               value 1;
934               description "Individual flow statistics.
935                  The request body is struct ofp_flow_stats_request.
936                  The reply body is an array of struct ofp_flow_stats.";
937             }
938             enum OFPMP_AGGREGATE {
939               value 2;
940               description "Aggregate flow statistics.
941                  The request body is struct ofp_aggregate_stats_request.
942                  The reply body is struct ofp_aggregate_stats_reply.";
943             }
944             enum OFPMP_TABLE {
945               value 3;
946               description "Flow table statistics.
947                  The request body is empty.
948                  The reply body is an array of struct ofp_table_stats.";
949             }
950             enum OFPMP_PORT_STATS {
951               value 4;
952               description "Port statistics.
953                  The request body is struct ofp_port_stats_request.
954                  The reply body is an array of struct ofp_port_stats.";
955             }
956             enum OFPMP_QUEUE {
957               value 5;
958               description "Queue statistics for a port
959                  The request body is struct ofp_queue_stats_request.
960                  The reply body is an array of struct ofp_queue_stats";
961             }
962             enum OFPMP_GROUP {
963               value 6;
964               description "Group counter statistics.
965                  The request body is struct ofp_group_stats_request.
966                  The reply is an array of struct ofp_group_stats.";
967             }
968             enum OFPMP_GROUP_DESC {
969               value 7;
970               description "Group description.
971                  The request body is empty.
972                  The reply body is an array of struct ofp_group_desc.";
973             }
974             enum OFPMP_GROUP_FEATURES {
975               value 8;
976               description "Group features.
977                  The request body is empty.
978                  The reply body is struct ofp_group_features.";
979             }
980             enum OFPMP_METER {
981               value 9;
982               description "Meter statistics.
983                  The request body is struct ofp_meter_multipart_requests.
984                  The reply body is an array of struct ofp_meter_stats.";
985             }
986             enum OFPMP_METER_CONFIG {
987               value 10;
988               description "Meter configuration.
989                  The request body is struct ofp_meter_multipart_requests.
990                  The reply body is an array of struct ofp_meter_config.";
991             }
992             enum OFPMP_METER_FEATURES {
993               value 11;
994               description "Meter features.
995                  The request body is empty.
996                  The reply body is struct ofp_meter_features.";
997             }
998             enum OFPMP_TABLE_FEATURES {
999               value 12;
1000               description "Table features.
1001                  The request body is either empty or contains an array of
1002                  struct ofp_table_features containing the controller’s
1003                  desired view of the switch. If the switch is unable to
1004                  set the specified view an error is returned.
1005                  The reply body is an array of struct ofp_table_features.";
1006             }
1007             enum OFPMP_PORT_DESC {
1008               value 13;
1009               description "Port description.
1010                  The request body is empty.
1011                  The reply body is an array of struct ofp_port.";
1012             }
1013             enum OFPMP_EXPERIMENTER {
1014               value 65535; //0xffff
1015               description "Experimenter extension.
1016                  The request and reply bodies begin with
1017                  struct ofp_experimenter_multipart_header.
1018                  The request and reply bodies are otherwise experimenter-defined.";
1019             }
1020         }
1021     }
1022
1023     typedef queue-properties {
1024         /* ofp_queue_properties */
1025         type enumeration {
1026             enum OFPQT_NONE {
1027               value 0;
1028               description "No property defined for queue (default).";
1029             }
1030             enum OFPQT_MIN_RATE {
1031                 value 1;
1032                 description "Minimum datarate guaranteed.";
1033             }
1034             enum OFPQT_MAX_RATE {
1035                 value 2;
1036                 description "Maximum datarate.";
1037             }
1038             enum OFPQT_EXPERIMENTER {
1039                 value 65535; // 0xffff 
1040                 description "Experimenter defined property.";
1041             }
1042         }
1043     }
1044
1045     typedef controller-role {
1046         /* ofp_controller_role */
1047         type enumeration {
1048             enum OFPCR_ROLE_NOCHANGE {
1049               value 0;
1050               description "Don’t change current role.";
1051             }
1052             enum OFPCR_ROLE_EQUAL {
1053               value 1;
1054               description "Default role, full access.";
1055             }
1056             enum OFPCR_ROLE_MASTER {
1057               value 2;
1058               description "Full access, at most one master.";
1059             }
1060             enum OFPCR_ROLE_SLAVE {
1061               value 3;
1062               description "Read-only access.";
1063             }
1064         }
1065     }
1066
1067     typedef packet-in-reason {
1068         /* ofp_packet_in_reason */
1069         type enumeration {
1070             enum OFPR_NO_MATCH {
1071               value 0;
1072               description "No matching flow (table-miss flow entry). ";
1073             }
1074             enum OFPR_ACTION {
1075               value 1;
1076               description "Action explicitly output to controller. ";
1077             }
1078             enum OFPR_INVALID_TTL {
1079               value 2;
1080               description "Packet has invalid TTL ";
1081             }
1082         }
1083     }
1084     
1085     typedef action-type {
1086         /* ofp_action_type */
1087         type bits {
1088             bit OFPAT_OUTPUT {
1089                 position 0;
1090                 /* Output to switch port. */
1091             }
1092             bit OFPAT_COPY_TTL_OUT {
1093                 position 1;
1094                 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1095             }
1096             bit OFPAT_COPY_TTL_IN {
1097                 position 2;
1098                 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1099             }
1100             bit OFPAT_SET_MPLS_TTL {
1101                 position 3;
1102                 /* MPLS TTL */
1103             }
1104             bit OFPAT_DEC_MPLS_TTL {
1105                 position 4;
1106                 /* Decrement MPLS TTL */
1107             }
1108             bit OFPAT_PUSH_VLAN {
1109                 position 5;
1110                 /* Push a new VLAN tag */
1111             }
1112             bit OFPAT_POP_VLAN {
1113                 position 6;
1114                 /* Pop the outer VLAN tag */
1115             }
1116             bit OFPAT_PUSH_MPLS {
1117                 position 7;
1118                 /* Push a new MPLS tag */
1119             }
1120             bit OFPAT_POP_MPLS {
1121                 position 8;
1122                 /* Pop the outer MPLS tag */
1123             }
1124             bit OFPAT_SET_QUEUE {
1125                 position 9;
1126                 /* Set queue id when outputting to a port */
1127             }
1128             bit OFPAT_GROUP {
1129                 position 10;
1130                 /* Apply group. */
1131             }
1132             bit OFPAT_SET_NW_TTL {
1133                 position 11;
1134                 /* IP TTL. */
1135             }
1136             bit OFPAT_DEC_NW_TTL {
1137                 position 12;
1138                 /* Decrement IP TTL. */
1139             }
1140             bit OFPAT_SET_FIELD {
1141                 position 13;
1142                 /* Set a header field using OXM TLV format. */
1143             }
1144             bit OFPAT_PUSH_PBB {
1145                 position 14;
1146                 /* Push a new PBB service tag (I-TAG) */
1147             }
1148             bit OFPAT_POP_PBB {
1149                 position 15;
1150                 /* Pop the outer PBB service tag (I-TAG) */
1151             }
1152             bit OFPAT_EXPERIMENTER {
1153                 position 16;
1154             }
1155         }
1156     }
1157
1158     typedef meter-mod-command {
1159         /* ofp_meter_mod_command */
1160         type enumeration {
1161             enum OFPMC_ADD {
1162               description "New meter. ";
1163             }
1164             enum OFPMC_MODIFY {
1165               description "Modify specified meter. ";
1166             }
1167             enum OFPMC_DELETE {
1168               description "Delete specified meter. ";
1169             }
1170         }
1171     }
1172
1173     typedef meter-flags {
1174         /* ofp_meter_flags */
1175         type bits {
1176             bit OFPMF_KBPS {
1177                 position 0;
1178                 /* Rate value in kb/s (kilo-bit per second). */
1179             }
1180             bit OFPMF_PKTPS {
1181                 position 1;
1182                 /* Rate value in packet/sec. */
1183             }
1184             bit OFPMF_BURST {
1185                 position 2;
1186                 /* Do burst size. */
1187             }
1188             bit OFPMF_STATS {
1189                 position 3;
1190                 /* Collect statistics. */
1191             }
1192         }
1193     }
1194
1195     typedef meter-band-type {
1196         /* ofp_meter_band_type */
1197         type enumeration {
1198             enum OFPMBT_DROP {
1199               value 1;
1200               description "Drop packet. ";
1201             }
1202             enum OFPMBT_DSCP_REMARK {
1203               value 2;
1204               description "Remark DSCP in the IP header. ";
1205             }
1206             enum OFPMBT_EXPERIMENTER {
1207               value 65535; //0xFFFF
1208               description "Experimenter meter band. ";
1209             }
1210         }
1211     }
1212     
1213     typedef meter-band-type-bitmap {
1214         /* ofp_meter_band_type */
1215         type bits {
1216             bit OFPMBT_DROP {
1217               position 1;
1218               description "Drop packet. ";
1219             }
1220             bit OFPMBT_DSCP_REMARK {
1221               position 2;
1222               description "Remark DSCP in the IP header. ";
1223             }
1224         }
1225     }
1226
1227         typedef meter {
1228                 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
1229                 type enumeration {
1230                         enum OFPM_MAX {
1231                                 value -65536; //0xffff0000
1232                                 description "Last usable meter number";
1233                         }
1234                         
1235                         /* Virtual meters. */
1236                         enum OFPM_SLOWPATH {
1237                                 value -3; //0xfffffffd
1238                                 description "Meter for slow datapath";
1239                         }
1240                         enum OFPM_CONTROLLER {
1241                                 value -2; //0xfffffffe
1242                                 description "Meter for controller connection";
1243                         }
1244                         enum OFPM_ALL {
1245                                 value -1; //0xffffffff
1246                                 description "Represents all meters for stat requests commands";
1247                         }
1248                 }
1249                 
1250         }
1251
1252     typedef table-config {
1253         /* ofp_table_config */
1254         type bits {
1255             bit OFPTC_DEPRECATED_MASK {
1256                 /* Deprecated bits */
1257                 position 3;
1258             }
1259         }
1260     }
1261
1262     typedef table-features-prop-type {
1263         type enumeration {
1264             enum OFPTFPT_INSTRUCTIONS {
1265                 value 0; 
1266                 description "Instructions property.";
1267             }
1268             enum OFPTFPT_INSTRUCTIONS_MISS {
1269                 value 1; 
1270                 description "Instructions for table-miss.";
1271             }
1272             enum OFPTFPT_NEXT_TABLES {
1273                 value 2; 
1274                 description "Next Table property.";
1275             }
1276             enum OFPTFPT_NEXT_TABLES_MISS {
1277                 value 3; 
1278                 description "Next Table for table-miss.";
1279             }
1280             enum OFPTFPT_WRITE_ACTIONS {
1281                 value 4; 
1282                 description "Write Actions property.";
1283             }
1284             enum OFPTFPT_WRITE_ACTIONS_MISS {
1285                 value 5; 
1286                 description "Write Actions for table-miss.";
1287             }
1288             enum OFPTFPT_APPLY_ACTIONS {
1289                 value 6; 
1290                 description "Apply Actions property.";
1291             }
1292             enum OFPTFPT_APPLY_ACTIONS_MISS {
1293                 value 7; 
1294                 description "Apply Actions for table-miss.";
1295             }
1296             enum OFPTFPT_MATCH {
1297                 value 8; 
1298                 description "Match property.";
1299             }
1300             enum OFPTFPT_WILDCARDS {
1301                 value 10; 
1302                 description "Wildcards property.";
1303             }
1304             enum OFPTFPT_WRITE_SETFIELD {
1305                 value 12; 
1306                 description "Write Set-Field property.";
1307             }
1308             enum OFPTFPT_WRITE_SETFIELD_MISS {
1309                 value 13; 
1310                 description "Write Set-Field for table-miss.";
1311             }
1312             enum OFPTFPT_APPLY_SETFIELD {
1313                 value 14; 
1314                 description "Apply Set-Field property.";
1315             }
1316             enum OFPTFPT_APPLY_SETFIELD_MISS {
1317                 value 15; 
1318                 description "Apply Set-Field for table-miss.";
1319             }
1320             enum OFPTFPT_EXPERIMENTER {
1321                 value 65534; 
1322                 description "Experimenter property.";
1323             }
1324             enum OFPTFPT_EXPERIMENTER_MISS {
1325                 value 65535; //0xffff 
1326                 description "Experimenter for table-miss.";
1327             }
1328         }
1329     }
1330
1331     typedef group-types {
1332         /* ofp_group_type */
1333         type bits {
1334             bit OFPGT_ALL {
1335                 /* All (multicast/broadcast) group. */
1336                 position 0;
1337             }
1338             bit OFPGT_SELECT {
1339                 /* Select group. */
1340                 position 1;
1341             }
1342             bit OFPGT_INDIRECT {
1343                 /* Indirect group. */
1344                 position 2;
1345             }
1346             bit OFPGT_FF {
1347                 /* Fast failover group. */
1348                 position 3;
1349             }
1350         }
1351     }
1352
1353     typedef group-capabilities {
1354         /* ofp_group_capabilities */
1355         type bits {
1356             bit OFPGFC_SELECT_WEIGHT {
1357                 /* Support weight for select groups */
1358                 position 0;
1359             }
1360             bit OFPGFC_SELECT_LIVENESS {
1361                 /* Support liveness for select groups */
1362                 position 1;
1363             }
1364             bit OFPGFC_CHAINING {
1365                 /* Support chaining groups */
1366                 position 2;
1367             }
1368             bit OFPGFC_CHAINING_CHECKS {
1369                 /* Check chaining for loops and delete */
1370                 position 3;
1371             }
1372         }
1373     }
1374     
1375     typedef ipv6-exthdr-flags {
1376         type bits {
1377             bit nonext {
1378                 description "<No next header> encountered.";
1379                 position 0;
1380             }
1381             bit esp {
1382                 description "Encrypted Sec Payload header present.";
1383                 position 1;
1384             }
1385             bit auth {
1386                 description "Authentication header present.";
1387                 position 2;
1388             }
1389             bit dest {
1390                 description "1 or 2 dest headers present.";
1391                 position 3;
1392             }
1393             bit frag {
1394                 description "Fragment header present.";
1395                 position 4;
1396             }
1397             bit router {
1398                 description "Router header present.";
1399                 position 5;
1400             }
1401             bit hop {
1402                 description "Hop-by-hop header present.";
1403                 position 6;
1404             }
1405             bit unrep {
1406                 description "Unexpected repeats encountered.";
1407                 position 7;
1408             }
1409             bit unseq {
1410                 description "Unexpected sequencing encountered.";
1411                 position 8;
1412             }
1413         }
1414     }
1415     
1416 // OPENFLOW v1.0 STRUCTURES
1417     // Structures under this line are needed to support OpenFlow version 1.0 
1418     // wire protocol 0x01;
1419     
1420     typedef error-type-v10 {
1421         type enumeration {
1422             enum HELLO_FAILED {
1423                 value 0; 
1424                 description "Hello Protocol failed.";
1425             }
1426             enum BAD_REQUEST {
1427                 value 1; 
1428                 description "Request was not understood.";
1429             }
1430             enum BAD_ACTION {
1431                 value 2; 
1432                 description "Error in action description.";
1433             }
1434             enum FLOW_MOD_FAILED {
1435                 value 3; 
1436                 description "Problem modifying flow entry.";
1437             }
1438             enum PORT_MOD_FAILED {
1439                 value 4; 
1440                 description "Port mod request failed.";
1441             }
1442             enum QUEUE_OP_FAILED {
1443                 value 5; 
1444                 description "Queue operation failed.";
1445             }
1446         }
1447     }
1448     
1449     typedef hello-failed-code-v10 {
1450         type enumeration {
1451             enum INCOMPATIBLE {
1452                 value 0; 
1453                 description "Hello Protocol failed.";
1454             }
1455             enum EPERM {
1456                 value 1; 
1457                 description "Request was not understood.";
1458             }
1459         }
1460     }
1461     
1462     typedef bad-request-code-v10 {
1463         type enumeration {
1464             enum BAD_VERSION {
1465                 value 0; 
1466             }
1467             enum BAD_TYPE {
1468                 value 1; 
1469             }
1470             enum BAD_STAT {
1471                 value 2; 
1472             }
1473             enum BAD_VENDOR {
1474                 value 3; 
1475             }
1476             enum BAD_SUBTYPE {
1477                 value 4; 
1478             }
1479             enum EPERM {
1480                 value 5; 
1481             }
1482             enum BAD_LEN {
1483                 value 6; 
1484             }
1485             enum BUFFER_EMPTY {
1486                 value 7; 
1487             }
1488             enum BUFFER_UNKNOWN {
1489                 value 8; 
1490             }
1491         }
1492     }
1493     
1494     typedef bad-action-code-v10 {
1495         type enumeration {
1496             enum BAD_TYPE {
1497                 value 0; 
1498             }
1499             enum BAD_LEN {
1500                 value 1; 
1501             }
1502             enum VENDOR {
1503                 value 2; 
1504             }
1505             enum BAD_VENDOR_TYPE {
1506                 value 3; 
1507             }
1508             enum BAD_OUT_PORT {
1509                 value 4; 
1510             }
1511             enum BAD_ARGUMENT {
1512                 value 5; 
1513             }
1514             enum EPERM {
1515                 value 6; 
1516             }
1517             enum TOO_MANY {
1518                 value 7; 
1519             }
1520             enum BAD_QUEUE {
1521                 value 8; 
1522             }
1523         }
1524     }
1525     
1526     typedef flow-mod-failed-code-v10 {
1527         type enumeration {
1528             enum ALL_TABLES_FULL {
1529                 value 0; 
1530             }
1531             enum OVERLAP {
1532                 value 1; 
1533             }
1534             enum EPERM {
1535                 value 2; 
1536             }
1537             enum BAD_EMERG_TIMEOUT {
1538                 value 3; 
1539             }
1540             enum BAD_COMMAND {
1541                 value 4; 
1542             }
1543             enum UNSUPPORTED {
1544                 value 5; 
1545             }
1546         }
1547     }
1548     
1549     typedef port-mod-failed-code-v10 {
1550         type enumeration {
1551             enum BAD_PORT {
1552                 value 0; 
1553             }
1554             enum BAD_HW_ADDR {
1555                 value 1; 
1556             }
1557         }
1558     }
1559     
1560     typedef queue-op-failed-code-v10 {
1561         type enumeration {
1562             enum BAD_PORT {
1563                 value 0; 
1564             }
1565             enum BAD_QUEUE {
1566                 value 1; 
1567             }
1568             enum EPERM {
1569                 value 2; 
1570             }
1571         }
1572     }
1573     
1574     typedef port-number-values-v10 {
1575         type enumeration {
1576             enum MAX {
1577                 value 65280; // 0xff00 
1578             }
1579             enum IN_PORT {
1580                 value 65528; // 0xfff8
1581             }
1582             enum TABLE {
1583                 value 65529; // 0xfff9 
1584             }
1585             enum NORMAL {
1586                 value 65530; // 0xfffa 
1587             }
1588             enum FLOOD {
1589                 value 65531; // 0xfffb 
1590             }
1591             enum ALL {
1592                 value 65532; // 0xfffc 
1593             }
1594             enum CONTROLLER {
1595                 value 65533; // 0xfffd
1596             }
1597             enum LOCAL {
1598                 value 65534; // 0xfffe
1599             }
1600             enum NONE {
1601                 value 65535; // 0xffff
1602             }
1603         }
1604     }
1605     
1606     typedef port-config-v10 {
1607         description 
1608            "Flags to indicate behavior of the physical port. These flags are
1609             describe the current configuration and used port_mod message 
1610             to configure the port's behavior.";
1611         type bits {
1612             bit port-down { 
1613                 //description " Port is administratively down.";
1614                 position 0;
1615             }
1616             bit no-stp {
1617                 //description" Disable 802.1D spanning tree on port.";
1618                 position 1;
1619             }
1620             bit no-recv { 
1621                 //description " Drop all packets received by port.";
1622                 position 2;
1623             }
1624             bit no-recv-stp { 
1625                 //description " Drop received 802.1D STP packets.";
1626                 position 3;
1627             }
1628             bit no-flood { 
1629                 //description " Do not include this port when flooding.";
1630                 position 4;
1631             }
1632             bit no-fwd { 
1633                 //description " Drop packets forwarded to port.";
1634                 position 5;
1635             }
1636             bit no-packet-in { 
1637                 //description "Do not send packet-in msgs for port.";
1638                 position 6;
1639             }
1640         }
1641     }
1642     
1643     typedef port-state-v10 {
1644         description 
1645             "Current state of the physical port. These are not configurable from
1646             the controller.";
1647         type bits {
1648             bit link_down {
1649                 //description "No physical link present.";
1650                 position 0;
1651             }
1652             bit blocked {
1653                 //description "Port is blocked";
1654                 position 1;
1655             }
1656             bit live {
1657                 //description "Live for Fast Failover Group.";
1658                 position 2;
1659             }
1660             bit stp_listen {
1661                 //description "Not learning or relaying frames.";
1662             }
1663             bit stp_learn {
1664                 //description "Learning but not relaying frames.";
1665             }
1666             bit stp_forward {
1667                 //description "Learning and relaying frames.";
1668             }
1669             bit stp_block {
1670                 //description "Not part of spanning tree.";
1671             }
1672             bit stp_mask {
1673                 //description "Bit mask for OFPPS_STP_* values.";
1674             }
1675         }
1676     }
1677     
1678     typedef port-features-v10 {
1679         ////description "Features of ports available in datapath.";
1680         //reference "ofp_port_features";
1681         type bits {
1682             bit _10mb-hd { 
1683                 position 0;
1684                 //description "10 Mb half-duplex rate support.";
1685             }
1686             bit _10mb-fd { 
1687                 position 1;
1688                 //description "10 Mb full-duplex rate support.";
1689             }
1690             bit _100mb-hd { 
1691                 position 2;
1692                 //description "100 Mb half-duplex rate support.";
1693             }
1694             bit _100mb-fd { 
1695                 position 3;
1696                 //description "100 Mb full-duplex rate support.";
1697             }
1698             bit _1gb-hd { 
1699                 position 4;
1700                 //description "1 Gb half-duplex rate support.";
1701             }
1702             bit _1gb-fd { 
1703                 position 5;
1704                 //description "1 Gb full-duplex rate support.";
1705             }
1706             bit _10gb-fd { 
1707                 position 6;
1708                 //description "10 Gb full-duplex rate support.";
1709             }
1710             bit copper { 
1711                 position 7;
1712                 //description "Copper medium.";
1713             }
1714             bit fiber { 
1715                 position 8;
1716                 //description "Fiber medium.";
1717             }
1718             bit autoneg { 
1719                 position 9;
1720                 //description "Auto-negotiation.";
1721             }
1722             bit pause { 
1723                 position 10;
1724                 //description "Pause.";
1725             }
1726             bit pause-asym { 
1727                 position 11;
1728                 //description "Asymmetric pause.";
1729             }
1730         }
1731     }
1732     
1733     typedef capabilities-v10 {
1734         type bits {
1735             bit OFPC_FLOW_STATS {
1736                 position 0;
1737                 /* Flow statistics. */
1738             } 
1739             bit OFPC_TABLE_STATS {
1740                 position 1;
1741                 /* Table statistics. */
1742             }
1743             bit OFPC_PORT_STATS {
1744                 position 2;
1745                 /* Port statistics. */
1746             }
1747             bit OFPC_STP {
1748                 position 3;
1749                 /* 802.1d spanning tree. */
1750             }
1751             bit OFPC_RESERVED {
1752                 position 4;
1753                 /* Reserved, must be zero. */
1754             }
1755             bit OFPC_IP_REASM {
1756                 position 5;
1757                 /* Can reassemble IP fragments. */
1758             }
1759             bit OFPC_QUEUE_STATS {
1760                 position 6;
1761                 /* Queue statistics. */
1762             }
1763             bit OFPC_ARP_MATCH_IP {
1764                 position 8;
1765                 /* Match IP addresses in ARP pkts. */
1766             }
1767         }
1768     }
1769     
1770     typedef flow-mod-flags-v10 {
1771         /* ofp_flow_mod_flags */
1772         type bits {
1773             bit OFPFF_SEND_FLOW_REM {
1774                 position 0;
1775                 /* Send flow removed message when flow expires or is deleted. */
1776             }
1777             bit OFPFF_CHECK_OVERLAP {
1778                 position 1;
1779                 /* Check for overlapping entries first. */
1780             }
1781             bit OFPFF_EMERG {
1782                 position 2;
1783                 /* Reset flow packet and byte counts. */
1784             }
1785         }
1786     }
1787     
1788     typedef action-type-v10 {
1789         /* ofp_action_type */
1790         type bits {
1791             bit OFPAT_OUTPUT {
1792                 position 0;
1793                 /* Output to switch port. */
1794             }
1795             bit OFPAT_SET_VLAN_VID {
1796                 position 1;
1797                 /* Set the 802.1q VLAN id. */
1798             }
1799             bit OFPAT_SET_VLAN_PCP {
1800                 position 2;
1801                 /* Set the 802.1q priority. */
1802             }
1803             bit OFPAT_STRIP_VLAN {
1804                 position 3;
1805                 /* Strip the 802.1q header. */
1806             }
1807             bit OFPAT_SET_DL_SRC {
1808                 position 4;
1809                 /* Ethernet source address. */
1810             }
1811             bit OFPAT_SET_DL_DST {
1812                 position 5;
1813                 /* Ethernet destination address. */
1814             }
1815             bit OFPAT_SET_NW_SRC {
1816                 position 6;
1817                 /* IP source address. */
1818             }
1819             bit OFPAT_SET_NW_DST {
1820                 position 7;
1821                 /* IP destination address. */
1822             }
1823             bit OFPAT_SET_NW_TOS {
1824                 position 8;
1825                 /* IP ToS (DSCP field, 6 bits). */
1826             }
1827             bit OFPAT_SET_TP_SRC {
1828                 position 9;
1829                 /* TCP/UDP source port. */
1830             }
1831             bit OFPAT_SET_TP_DST {
1832                 position 10;
1833                 /* TCP/UDP destination port. */
1834             }
1835             bit OFPAT_ENQUEUE {
1836                 position 11;
1837                 /* Output to queue. */
1838             }
1839             bit OFPAT_VENDOR {
1840                 position 12;
1841                 /* Experimenter in later versions */
1842             }
1843         }
1844     }
1845     
1846     typedef flow-wildcards-v10 {
1847         /* ofp_flow_wildcards */
1848         type bits {
1849             bit IN_PORT {
1850                 position 0;
1851             }
1852             bit DL_VLAN {
1853                 position 1;
1854             }
1855             bit DL_SRC {
1856                 position 2;
1857             }
1858             bit DL_DST {
1859                 position 3;
1860             }
1861             bit DL_TYPE {
1862                 position 4;
1863             }
1864             bit NW_PROTO {
1865                 position 5;
1866             }
1867             bit TP_SRC {
1868                 position 6;
1869             }
1870             bit TP_DST {
1871                 position 7;
1872             }
1873             bit DL_VLAN_PCP {
1874                 position 20;
1875             }
1876             bit NW_TOS {
1877                 position 21;
1878             }
1879         }
1880     }
1881     
1882 }