Finished yang generation for match, action, instruction and tableFeatureProperties 02/1902/1
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 15 Oct 2013 12:09:29 +0000 (14:09 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 15 Oct 2013 12:09:45 +0000 (14:09 +0200)
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
openflow-protocol-api/src/main/yang/openflow-action.yang
openflow-protocol-api/src/main/yang/openflow-augments.yang
openflow-protocol-api/src/main/yang/openflow-extensible-match.yang
openflow-protocol-api/src/main/yang/openflow-instruction.yang
openflow-protocol-api/src/main/yang/openflow-protocol.yang
openflow-protocol-api/src/main/yang/openflow-types.yang

index bb43ed402485cf40d59a8ff7ba16441004186d68..f28b083b26c5129b188c4db36300c3cdc4e5ac13 100644 (file)
@@ -95,6 +95,12 @@ module openflow-action {
                     range "0..65294"; // 0..0xff0e
                 }
                 type enumeration {
+                    enum max {
+                        desription
+                            "maximum max_len value which can be used
+                            to request a specific byte length";
+                        value 65509; //0xffe5
+                    }
                     enum no-buffer {
                         description 
                             "indicates that no buffering should be
@@ -161,6 +167,9 @@ module openflow-action {
         }
     }
     
+    container actions {
+        uses action-header;
+    }
     
     grouping action-header {
         leaf type {
@@ -168,11 +177,6 @@ module openflow-action {
                 base oft:action;
             }
         }
-        choice action-type {
-            case output {
-                uses output;
-            }
-        }
     }
     
 }
\ No newline at end of file
index badda304f6413a59924d5821e0ae41ff0064058e..17de70ccc48654f908fc6a45a46e6b2f01ca3392 100644 (file)
@@ -2,28 +2,350 @@ module openflow-augments {
     namespace "urn:opendaylight:openflow:augments";\r
     prefix "aug";\r
 \r
+    import ietf-inet-types {prefix inet;}\r
+    import ietf-yang-types {prefix yang;}\r
+    \r
+    import openflow-types {prefix oft;}\r
     import openflow-protocol {prefix ofproto;}\r
+    import openflow-action {prefix ofaction;}\r
+    import openflow-instruction {prefix ofinstruction;}\r
     import openflow-extensible-match {prefix oxm;}\r
 \r
 \r
     revision "2013-10-02" {\r
         description "Initial model";\r
     }\r
-\r
+// OFP_MATCH AUGMENTS\r
      augment "/oxm:oxm-container/oxm:match-entries" {\r
-         uses oxm:in-port;\r
-         /* common augment for fields:\r
-            OXM_OF_IN_PORT\r
-            OXM_OF_IN_PHY_PORT\r
-         */\r
+         leaf port-number {\r
+             type uint32;\r
+         }\r
      }\r
 \r
      augment "/oxm:oxm-container/oxm:match-entries" {\r
-         uses oxm:metadata;\r
-         /* common augment for fields:\r
-            OXM_OF_METADATA\r
-            OXM_OF_TUNNEL_ID\r
-         */\r
+         leaf metadata {\r
+             type binary;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf mask {\r
+             type binary;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf mac-address {\r
+             type yang:mac-address;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf eth-type {\r
+             type oft:ether-type;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf vlan-vid {\r
+             type uint16;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf vlan-pcp {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf dscp {\r
+             type inet:dscp;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf ecn {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf protocol-number {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf ipv4-prefix {\r
+             type inet:ipv4-prefix;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf port {\r
+             type inet:port-number;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf icmpv4-type {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf icmpv4-code {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf op-code {\r
+             type uint16;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf ipv6-prefix {\r
+             type inet:ipv6-prefix;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf ipv6-flabel {\r
+             type inet:ipv6-flow-label;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf icmpv6-type {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf icmpv6-code {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf ipv6-address {\r
+             type inet:ipv6-address;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf mpls-label {\r
+             type uint32;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf tc {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf bos {\r
+             type boolean;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf isid {\r
+             type uint32;\r
+         }\r
+     }\r
+     \r
+     augment "/oxm:oxm-container/oxm:match-entries" {\r
+         leaf pseudo-field {\r
+             type bits {\r
+                 bit nonext {\r
+                     description "<No next header> encountered.";\r
+                     position 0;\r
+                 }\r
+                 bit esp {\r
+                     description "Encrypted Sec Payload header present.";\r
+                     position 1;\r
+                 }\r
+                 bit auth {\r
+                     description "Authentication header present.";\r
+                     position 2;\r
+                 }\r
+                 bit dest {\r
+                     description "1 or 2 dest headers present.";\r
+                     position 3;\r
+                 }\r
+                 bit frag {\r
+                     description "Fragment header present.";\r
+                     position 4;\r
+                 }\r
+                 bit router {\r
+                     description "Router header present.";\r
+                     position 5;\r
+                 }\r
+                 bit hop {\r
+                     description "Hop-by-hop header present.";\r
+                     position 6;\r
+                 }\r
+                 bit unrep {\r
+                     description "Unexpected repeats encountered.";\r
+                     position 7;\r
+                 }\r
+                 bit unseq {\r
+                     description "Unexpected sequencing encountered.";\r
+                     position 8;\r
+                     }                    \r
+             }\r
+         }\r
      }\r
 \r
+// OFP_ACTION AUGMENTS\r
+     augment "/ofaction:actions" {\r
+         leaf port {\r
+             type oft:any-port-number;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf max-length {\r
+             description "Maximum packet length to be send to controller.";\r
+             type union {\r
+                 type uint16 {\r
+                     range "0..65294"; // 0..0xff0e\r
+                 }\r
+                 type enumeration {\r
+                     enum max {\r
+                         desription\r
+                             "maximum max_len value which can be used\r
+                             to request a specific byte length";\r
+                         value 65509; //0xffe5\r
+                     }\r
+                     enum no-buffer {\r
+                         description \r
+                             "indicates that no buffering should be\r
+                              applied and the whole packet is to be\r
+                              sent to the controller";\r
+                         value 65535; //0xffff\r
+                     }\r
+                 }\r
+             }\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf mpls-ttl {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf ethertype {\r
+             type oft:ether-type;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf queue-id {\r
+             type uint32;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf group-id {\r
+             type uint32;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf nw-ttl {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         uses oxm:oxm-fields;\r
+     }\r
+     \r
+     augment "/ofaction:actions" {\r
+         leaf experimenter {\r
+             type uint32;\r
+         }\r
+     }\r
+\r
+// OFP_TABLE_FEATURES_PROPERTIES AUGMENTS\r
+     augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
+         list instruction-ids {\r
+             uses ofinstruction:instructions;\r
+         }\r
+     }\r
+\r
+     augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
+         list next-table-ids {\r
+             leaf table-id {\r
+                 type uint8;\r
+             }\r
+         }\r
+     }\r
+\r
+     augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
+         list action-ids {\r
+             uses ofaction:action-header;\r
+         }\r
+     }\r
+\r
+     augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
+         list oxm-ids {\r
+             uses oxm:oxm-fields;\r
+         }\r
+     }\r
+\r
+     augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
+         leaf experimenter {\r
+             type uint32;\r
+         }\r
+         leaf exp-type {\r
+             type uint32;\r
+         }\r
+         leaf data {\r
+             type binary;\r
+         }\r
+     }\r
+     \r
+// OFP_INSTRUCTION AUGMENTS\r
+     augment "/ofinstruction:instruction" {\r
+         leaf table-id {\r
+             type uint8;\r
+         }\r
+     }\r
+     \r
+     augment "/ofinstruction:instruction" {\r
+         leaf metadata {\r
+             type binary;\r
+         }\r
+         leaf metadata-mask {\r
+             type binary;\r
+         }\r
+     }\r
+     \r
+     augment "/ofinstruction:instruction" {\r
+         list actions {\r
+             uses ofaction:action-header;\r
+         }\r
+     }\r
+     \r
+     augment "/ofinstruction:instruction" {\r
+         leaf meter-id {\r
+             type uint32;\r
+         }\r
+     }\r
+     \r
+     augment "/ofinstruction:instruction" {\r
+         leaf experimenter {\r
+             type uint32;\r
+         }\r
+     }\r
 }
\ No newline at end of file
index 54decb1a9fe6928fc5e6bfb975331c73c5da81d3..53aefc6a5324a6f1044cf07b84a86634b63f4294 100644 (file)
@@ -540,7 +540,7 @@ module openflow-extensible-match {
             container in-port {
                 presence "";
                 uses in-port; 
-        
+
             }
             container in-phy-port {
                 presence "";
index da945f8feee5d4ed9d8c8fc91960c904a4eda4ca..3ebb549b4aee081a3cf96cf8195486a9deca2ac8 100644 (file)
@@ -7,7 +7,7 @@ module openflow-instruction {
     revision "2013-07-31" {
        // description "Initial model";
     }
-    /*
+
     identity goto_table {
         //description " Setup the next table in the lookup pipeline";
         base oft:instruction;
@@ -36,7 +36,7 @@ module openflow-instruction {
         description "Experimenter instruction";
         base oft:instruction;
     }
-    */
+
     // Structures
 
     grouping goto-table {
@@ -80,4 +80,16 @@ module openflow-instruction {
         }
     }
 
+    container instruction {
+        uses instructions;
+    }
+
+    grouping instructions {
+        leaf type {
+            type identityref {
+                base oft:instruction;
+            }
+        }
+    }
+
 }
\ No newline at end of file
index 104917c807be8db79307e459594c8107e7d44c58..ee8d88fd9d9ebbe2245f95a000410c1a2bec0423 100644 (file)
@@ -84,9 +84,19 @@ module openflow-protocol {
             uses oxm:oxm-fields;\r
         }\r
         \r
+        container table-features-properties-container {\r
+            uses table-features-properties;\r
+        }\r
         \r
+        grouping table-features-properties {\r
+            list table-feature-properties {\r
+                leaf type {\r
+                    type oft:table-features-prop-type;\r
+                }\r
+            }\r
+        }\r
 \r
-    // TODO: ofp_packat_queue\r
+    // TODO: ofp_packet_queue\r
 \r
     // # MESSAGE Structures\r
         /* Immutable messages. */\r
@@ -545,7 +555,7 @@ module openflow-protocol {
                         }\r
                     }\r
                     case multipart-request-table-features {\r
-                        list table_features {\r
+                        list table-features {\r
                             leaf table-id {\r
                                 type uint8;\r
                             }\r
@@ -564,6 +574,7 @@ module openflow-protocol {
                             leaf max-entries {\r
                                 type uint32;\r
                             }\r
+                            uses table-features-properties;\r
                         }\r
                     }\r
                     case multipart-request-experimenter {\r
index b771f69230c2cfa4a9b6920161481364ba85f9c3..6552b2ee8527cf985d7e3e2e9ffd1a4eef848ee9 100644 (file)
@@ -699,6 +699,75 @@ module openflow-types {
         }
     }
     
+    typedef table-features-prop-type {
+        type enumeration {
+            enum OFPTFPT_INSTRUCTIONS {
+                value 0; 
+                description "Instructions property.";
+            }
+            enum OFPTFPT_INSTRUCTIONS_MISS {
+                value 1; 
+                description "Instructions for table-miss.";
+            }
+            enum OFPTFPT_NEXT_TABLES {
+                value 2; 
+                description "Next Table property.";
+            }
+            enum OFPTFPT_NEXT_TABLES_MISS {
+                value 3; 
+                description "Next Table for table-miss.";
+            }
+            enum OFPTFPT_WRITE_ACTIONS {
+                value 4; 
+                description "Write Actions property.";
+            }
+            enum OFPTFPT_WRITE_ACTIONS_MISS {
+                value 5; 
+                description "Write Actions for table-miss.";
+            }
+            enum OFPTFPT_APPLY_ACTIONS {
+                value 6; 
+                description "Apply Actions property.";
+            }
+            enum OFPTFPT_APPLY_ACTIONS_MISS {
+                value 7; 
+                description "Apply Actions for table-miss.";
+            }
+            enum OFPTFPT_MATCH {
+                value 8; 
+                description "Match property.";
+            }
+            enum OFPTFPT_WILDCARDS {
+                value 10; 
+                description "Wildcards property.";
+            }
+            enum OFPTFPT_WRITE_SETFIELD {
+                value 12; 
+                description "Write Set-Field property.";
+            }
+            enum OFPTFPT_WRITE_SETFIELD_MISS {
+                value 13; 
+                description "Write Set-Field for table-miss.";
+            }
+            enum OFPTFPT_APPLY_SETFIELD {
+                value 14; 
+                description "Apply Set-Field property.";
+            }
+            enum OFPTFPT_APPLY_SETFIELD_MISS {
+                value 15; 
+                description "Apply Set-Field for table-miss.";
+            }
+            enum OFPTFPT_EXPERIMENTER {
+                value 65534; 
+                description "Experimenter property.";
+            }
+            enum OFPTFPT_EXPERIMENTER_MISS {
+                value 65535; //0xffff 
+                description "Experimenter for table-miss.";
+            }
+        }
+    }
+    
     typedef group-types {
         /* ofp_group_type */
         type bits {