ofp_packet_queue structure - implemented missing fields 98/2598/1
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 8 Nov 2013 15:42:17 +0000 (16:42 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 8 Nov 2013 15:43:02 +0000 (16:43 +0100)
VlanVidMatchEntry contains cfiBit field
Minor generated classes unification & rename
Changed logging in handler constructors to debug

Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
22 files changed:
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-protocol.yang
openflow-protocol-api/src/main/yang/openflow-types.yang
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OF13Decoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OF13Encoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TlsDetector.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/OFSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializer.java [moved from openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntriesDeserializer.java with 93% similarity]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchSerializer.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryMultiTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryTest.java
openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/impl/integration/MockPlugin.java

index 77dca25ee3aa1eb3c9ba8d468e7c4188a6b54e16..4b9cf81120d7375181cd360c0a8fa84697d34efc 100644 (file)
@@ -78,20 +78,16 @@ module openflow-action {
     }
     
     container actions-container {
-        uses action-header;
+        uses actions;
     }
     
     grouping actions {
         list actions-list {
-            uses action-header;
-        }
-    }
-
-    grouping action-header {
-        container action {
-            leaf type {
-                type identityref {
-                    base oft:action;
+            container action {
+                leaf type {
+                    type identityref {
+                        base oft:action;
+                    }
                 }
             }
         }
index f443120f293584e2c373167d3e54d71fd43f2142..c3129a32e76274a8b119181e4e9aa992d85a36bb 100644 (file)
@@ -203,53 +203,53 @@ module openflow-augments {
      }\r
 \r
 // OFP_ACTION AUGMENTS\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "port-action";\r
          leaf port {\r
              type oft:port-number;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "max-length-action";\r
          leaf max-length {\r
              type uint16;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "mpls-ttl-action";\r
          leaf mpls-ttl {\r
              type uint8;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "ethertype-action";\r
          leaf ethertype {\r
              type oft:ether-type;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "queue-id-action";\r
          leaf queue-id {\r
              type uint32;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "group-id-action";\r
          leaf group-id {\r
              type uint32;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "nw-ttl-action";\r
          leaf nw-ttl {\r
              type uint8;\r
          }\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "oxm-fields-action";\r
          uses oxm:oxm-fields;\r
      }\r
-     augment "/ofaction:actions-container/ofaction:action" {\r
+     augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
          ext:augment-identifier "experimenter-action";\r
          leaf experimenter {\r
              type uint32;\r
@@ -259,9 +259,7 @@ module openflow-augments {
 // OFP_TABLE_FEATURES_PROPERTIES AUGMENTS\r
      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
          ext:augment-identifier "instruction-related-table-feature-property";\r
-         list instruction-ids {\r
-             uses ofinstruction:instructions;\r
-         }\r
+         uses ofinstruction:instructions;\r
      }\r
      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
          ext:augment-identifier "next-table-related-table-feature-property";\r
@@ -273,15 +271,11 @@ module openflow-augments {
      }\r
      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
          ext:augment-identifier "action-related-table-feature-property";\r
-         list action-ids {\r
-             uses ofaction:actions;\r
-         }\r
+         uses ofaction:actions;\r
      }\r
      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
          ext:augment-identifier "oxm-related-table-feature-property";\r
-         list oxm-ids {\r
-             uses oxm:oxm-fields;\r
-         }\r
+         uses oxm:oxm-fields;\r
      }\r
      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
          ext:augment-identifier "experimenter-related-table-feature-property";\r
@@ -331,4 +325,21 @@ module openflow-augments {
              type binary;\r
          }\r
      }\r
+     \r
+// OFP_QUEUE_PROP AUGMENTS\r
+     augment "/ofproto:queue-prop-container/ofproto:queue-property" {\r
+         ext:augment-identifier "rate-queue-property";\r
+         leaf rate {\r
+             type uint16;\r
+         }\r
+     }\r
+     augment "/ofproto:queue-prop-container/ofproto:queue-property" {\r
+         ext:augment-identifier "experimenter-queue-property";\r
+         leaf experimenter {\r
+             type uint32;\r
+         }\r
+         leaf data {\r
+             type binary;\r
+         }\r
+     }\r
 }
\ No newline at end of file
index 7f65a22b444aca36113425f860750d289359dd7d..88279c2c17f22a34d59081920b12834ff773962d 100644 (file)
@@ -70,14 +70,16 @@ module openflow-protocol {
                 units "kbps"; \r
             }\r
         }\r
-\r
-        grouping match {\r
-            leaf type {\r
-                type identityref {\r
-                    base oft:match-type-base;\r
+        \r
+        grouping match-grouping {\r
+            container match {\r
+                leaf type {\r
+                    type identityref {\r
+                        base oft:match-type-base;\r
+                    }\r
                 }\r
+                uses oxm:oxm-fields;\r
             }\r
-            uses oxm:oxm-fields;\r
         }\r
 \r
         grouping buckets {\r
@@ -112,8 +114,6 @@ module openflow-protocol {
             }\r
         }\r
 \r
-    // TODO: ofp_packet_queue\r
-\r
     // # MESSAGE Structures\r
         /* Immutable messages. */\r
             grouping ofHeader {\r
@@ -145,10 +145,6 @@ module openflow-protocol {
                     leaf-list version-bitmap {\r
                         type boolean;\r
                     }\r
-                    \r
-                    leaf data {\r
-                        type binary;\r
-                    }\r
                 }\r
             }\r
             grouping error {\r
@@ -286,9 +282,7 @@ module openflow-protocol {
                     // Cookie of the flow entry that was looked up.\r
                     type uint64;\r
                 }\r
-                container match {\r
-                    uses match;\r
-                }\r
+                uses match-grouping;\r
 \r
 // struct ofp_match match; /* Packet metadata. Variable size. */\r
 // /* The variable size and padded match is always followed by:\r
@@ -337,9 +331,7 @@ module openflow-protocol {
                 leaf byte-count {\r
                     type uint64;\r
                 }\r
-                container match {\r
-                    uses match;\r
-                }\r
+                uses match-grouping;\r
             } \r
             grouping port-status {\r
                 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"\r
@@ -410,9 +402,7 @@ module openflow-protocol {
                 leaf flags {\r
                     type oft:flow-mod-flags;\r
                 }\r
-                container match {\r
-                    uses match;\r
-                }\r
+                uses match-grouping;\r
                 \r
                 uses ofinstruction:instructions;\r
             } \r
@@ -501,9 +491,7 @@ module openflow-protocol {
                         leaf cookie-mask {\r
                             type uint64;\r
                         }\r
-                        container match {\r
-                            uses match;\r
-                        }\r
+                        uses match-grouping;\r
                     }\r
                     case multipart-request-aggregate {\r
                         leaf table-id {\r
@@ -521,9 +509,7 @@ module openflow-protocol {
                         leaf cookie-mask {\r
                             type uint64;\r
                         }\r
-                        container match {\r
-                            uses match;\r
-                        }\r
+                        uses match-grouping;\r
                     }\r
                     case multipart-request-port-stats {\r
                         leaf port-no {\r
@@ -648,9 +634,7 @@ module openflow-protocol {
                             leaf byte-count {\r
                                 type uint64;\r
                             }\r
-                            container match {\r
-                                uses match;\r
-                            }\r
+                            uses match-grouping;\r
                             \r
                             uses ofinstruction:instructions;\r
                         }\r
@@ -789,7 +773,6 @@ module openflow-protocol {
                     case multipart-reply-group-desc {\r
                         list group-desc {\r
                             leaf type {\r
-                                //type uint8;\r
                                 type oft:group-type;\r
                             }\r
                             leaf group-id {\r
@@ -808,8 +791,9 @@ module openflow-protocol {
                         leaf-list max_groups {\r
                             type uint32;\r
                         }\r
-                        \r
-                        uses ofaction:actions;\r
+                        leaf-list actions-bitmap {\r
+                            type oft:action-type;\r
+                        }\r
                     }\r
                     case multipart-reply-meter {\r
                         list meter-stats {\r
@@ -954,13 +938,16 @@ module openflow-protocol {
                 leaf port {\r
                     type oft:port-number;\r
                 }\r
-                list properties {\r
-                    uses queue-property-header;\r
-                }\r
+                uses queue-property-header;\r
+            }\r
+            container queue-prop-container {\r
+                uses queue-property-header;\r
             }\r
             grouping queue-property-header {\r
-                leaf property {\r
-                    type oft:queue-property;\r
+                list queue-property {\r
+                    leaf property {\r
+                        type oft:queue-properties;\r
+                    }\r
                 }\r
             }\r
             /* Controller role change request messages. */\r
index a2b11ddb6c05312198c11826782b870bf911ff72..ebfa88d22b41ee33b037b17d79cc67b1958a63c8 100644 (file)
@@ -8,51 +8,7 @@ module openflow-types {
 
     typedef port-number {
         type uint32 {
-                range "0..4294967040"; // 0xffffff00 See for actual value
-        }
-    }
-
-    typedef special-port-number {
-        type enumeration {
-            enum in-port { 
-                //value "4294967288";
-                //description "Send the packet out the input port. This virtual port must be explicitly used in order to send back out of the input port."
-            }
-            enum table { 
-                //value "4294967289"; // 0xfffffff9;
-                //description "Perform actions in flow table. NB: This can only be the destination port for packet-out messages."
-            }
-            enum normal { 
-                //value "4294967290"; // 0xfffffffa;
-                //description "Process with normal L2/L3 switching."
-            }
-            enum flood { 
-                //value "4294967291"; // 0xfffffffb;
-                //description "All physical ports except input port and those disabled by STP."
-            }
-            enum all { 
-                //value "4294967292"; // 0xfffffffc;
-                //description "All physical ports except input port."
-            }
-            enum controller { 
-                //value "4294967293";  // 0xfffffffd;
-                //description "Send to controller."
-            }
-            enum local { 
-                //value "4294967294"; // 0xfffffffe;
-                //description "Local openflow port."
-            }
-            enum none { 
-                //value "4294967295"; // 0xffffffff;
-                //description "not associated with a physical port."
-            }
-        }
-    }
-
-    typedef any-port-number {
-        type union {
-            type port-number;
-            type special-port-number;
+            range "0..4294967040"; // 0xffffff00 See for actual value
         }
     }
 
@@ -189,9 +145,6 @@ module openflow-types {
         type identityref {
             base oft:match-type-base;
         }
-        
-        //TODO: use identityref, when generating available
-        //type string;
     }
 
     identity instruction {
@@ -200,7 +153,6 @@ module openflow-types {
     identity action {
     }
 
-
     typedef metadata {
         type binary;
     }
@@ -561,7 +513,7 @@ module openflow-types {
         }
     }
 
-    typedef queue-property {
+    typedef queue-properties {
         /* ofp_queue_properties */
         type enumeration {
             enum OFPGT_ALL {
@@ -622,6 +574,79 @@ module openflow-types {
             }
         }
     }
+    
+    typedef action-type {
+        /* ofp_action_type */
+        type bits {
+            bit OFPAT_OUTPUT {
+                position 0;
+                /* Output to switch port. */
+            }
+            bit OFPAT_COPY_TTL_OUT {
+                position 1;
+                /* Copy TTL "outwards" -- from next-to-outermost to outermost */
+            }
+            bit OFPAT_COPY_TTL_IN {
+                position 2;
+                /* Copy TTL "inwards" -- from outermost to next-to-outermost */
+            }
+            bit OFPAT_SET_MPLS_TTL {
+                position 3;
+                /* MPLS TTL */
+            }
+            bit OFPAT_DEC_MPLS_TTL {
+                position 4;
+                /* Decrement MPLS TTL */
+            }
+            bit OFPAT_PUSH_VLAN {
+                position 5;
+                /* Push a new VLAN tag */
+            }
+            bit OFPAT_POP_VLAN {
+                position 6;
+                /* Pop the outer VLAN tag */
+            }
+            bit OFPAT_PUSH_MPLS {
+                position 7;
+                /* Push a new MPLS tag */
+            }
+            bit OFPAT_POP_MPLS {
+                position 8;
+                /* Pop the outer MPLS tag */
+            }
+            bit OFPAT_SET_QUEUE {
+                position 9;
+                /* Set queue id when outputting to a port */
+            }
+            bit OFPAT_GROUP {
+                position 10;
+                /* Apply group. */
+            }
+            bit OFPAT_SET_NW_TTL {
+                position 11;
+                /* IP TTL. */
+            }
+            bit OFPAT_DEC_NW_TTL {
+                position 12;
+                /* Decrement IP TTL. */
+            }
+            bit OFPAT_SET_FIELD {
+                position 13;
+                /* Set a header field using OXM TLV format. */
+            }
+            bit OFPAT_PUSH_PBB {
+                position 14;
+                /* Push a new PBB service tag (I-TAG) */
+            }
+            bit OFPAT_POP_PBB {
+                position 15;
+                /* Pop the outer PBB service tag (I-TAG) */
+            }
+            bit OFPAT_EXPERIMENTER {
+                position 16;
+            }
+        }
+    }
 
     typedef meter-mod-command {
         /* ofp_meter_mod_command */
index 9ef3b73e8be8b16d668c278b8f06a621e86c486b..4b5bff3d58e54fca51dfac2262b1405b6d204272 100644 (file)
@@ -26,7 +26,7 @@ public class DelegatingInboundHandler extends ChannelInboundHandlerAdapter {
      * @param connectionAdapter reference for adapter communicating with upper layers outside library\r
      */\r
     public DelegatingInboundHandler(MessageConsumer connectionAdapter) {\r
-        LOGGER.info("Creating DelegatingInboundHandler");\r
+        LOGGER.debug("Creating DelegatingInboundHandler");\r
         consumer = connectionAdapter;\r
     }\r
     \r
index 01206d4e4b91bcbd6416c8d80f3cdc94fb8cb4df..11f8f55957b727575eff1f370180303077f90986 100644 (file)
@@ -24,7 +24,7 @@ public class OF13Decoder extends MessageToMessageDecoder<VersionMessageWrapper>
      * Constructor of class\r
      */\r
     public OF13Decoder() {\r
-        LOGGER.info("Creating OF 1.3 Decoder");\r
+        LOGGER.debug("Creating OF 1.3 Decoder");\r
     }\r
 \r
     @Override\r
index 3a7ad0cc695f9a3d3edd81c024b431a65df29104..3f3c05ab65730ecdacd7cf4cdf1ad218f2444856 100644 (file)
@@ -21,7 +21,7 @@ public class OF13Encoder extends MessageToByteEncoder<OfHeader> {
     \r
     /** Constructor of class */\r
     public OF13Encoder() {\r
-        LOGGER.info("Creating OF13Encoder");\r
+        LOGGER.debug("Creating OF13Encoder");\r
     }\r
     @Override\r
     protected void encode(ChannelHandlerContext ctx, OfHeader msg, ByteBuf out)\r
index 677bab0c327da24285e0403b89b88a6e89aff902..71cbb5cf3bc4dfe663b5963b0ea2ce5cf660dc41 100644 (file)
@@ -27,7 +27,7 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
      * Constructor of class.
      */
     public OFFrameDecoder() {
-        LOGGER.info("Creating OFFrameDecoder");
+        LOGGER.debug("Creating OFFrameDecoder");
     }
 
     @Override
index fa419b92c11a2789687fee6b567ef59f99f138de..ba94bf3b2973636c405d9dfee4589b8620308f9c 100644 (file)
@@ -26,15 +26,15 @@ public class OFVersionDetector extends ByteToMessageDecoder {
      * Constructor of class.
      */
     public OFVersionDetector() {
-        LOGGER.info("Creating OFVersionDetector");
+        LOGGER.debug("Creating OFVersionDetector");
     }
 
     @Override
     protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
-        LOGGER.info("Decoding frame");
+        LOGGER.debug("Decoding frame");
 
         if (bb.readableBytes() == 0) {
-            LOGGER.info("not enough data");
+            LOGGER.debug("not enough data");
             bb.release();
             return;
         }
index 0ae503a8a91fe661ddd0d633583a9560b3c7c47b..92ef7dac4f3fe891f5f4d68e529455fc7262d073 100644 (file)
@@ -105,7 +105,6 @@ public class TcpHandler implements ServerFacade {
      */
     @Override
     public void run() {
-        LOGGER.info("Switch ");
         bossGroup = new NioEventLoopGroup();
         workerGroup = new NioEventLoopGroup();
         try {
@@ -204,6 +203,9 @@ public class TcpHandler implements ServerFacade {
         channelInitializer.setSwitchConnectionHandler(switchConnectionHandler);
     }
     
+    /**
+     * @param switchIdleTimeout in milliseconds
+     */
     public void setSwitchIdleTimeout(long switchIdleTimeout) {
         channelInitializer.setSwitchIdleTimeout(switchIdleTimeout);
     }
index fa8793de79e2f0ddb2c8fc20a74bdacc937087e6..2ce089bada950bc2bf440aa8fc48dfa11c35aa04 100644 (file)
@@ -36,7 +36,7 @@ public class TlsDetector extends ByteToMessageDecoder {
      * Constructor of class
      */
     public TlsDetector() {
-        LOGGER.info("Creating TLS Detector");
+        LOGGER.debug("Creating TLS Detector");
         detectSsl = true;
     }
 
index 9541caccf0b0331850c2fccb52721769226b6ee9..cdb03b045385462f69f8e064ec19a89122fb5aff 100644 (file)
@@ -10,15 +10,22 @@ import java.util.List;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
 import org.opendaylight.openflowjava.protocol.impl.util.ActionsDeserializer;\r
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionsDeserializer;\r
-import org.opendaylight.openflowjava.protocol.impl.util.MatchEntriesDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;\r
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeaturePropertyBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterRelatedTableFeatureProperty;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterRelatedTableFeaturePropertyBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeaturePropertyBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeaturePropertyBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeaturePropertyBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupCapabilities;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupType;\r
@@ -200,12 +207,11 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
     private static MultipartReplyFlow setFlow(ByteBuf input) {\r
         final byte PADDING_IN_FLOW_STATS_HEADER_01 = 1;\r
         final byte PADDING_IN_FLOW_STATS_HEADER_02 = 4;\r
-        final byte flowLength = 2;\r
         MultipartReplyFlowBuilder flowBuilder = new MultipartReplyFlowBuilder();\r
         List<FlowStats> flowStatsList = new ArrayList<>();\r
         FlowStatsBuilder flowStatsBuilder = new FlowStatsBuilder();\r
         while (input.readableBytes() > 0) {\r
-            input.skipBytes(flowLength);\r
+            input.skipBytes(Short.SIZE / Byte.SIZE);\r
             flowStatsBuilder.setTableId(input.readUnsignedByte());\r
             input.skipBytes(PADDING_IN_FLOW_STATS_HEADER_01);\r
             flowStatsBuilder.setDurationSec(input.readUnsignedInt());\r
@@ -224,8 +230,8 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];\r
             input.readBytes(byteCount);\r
             flowStatsBuilder.setByteCount(new BigInteger(byteCount));\r
-            // TODO match\r
-            // TODO instructions\r
+            flowStatsBuilder.setMatch(MatchDeserializer.createMatch(input));\r
+            flowStatsBuilder.setInstructions(InstructionsDeserializer.createInstructions(input, input.readableBytes()));\r
             flowStatsList.add(flowStatsBuilder.build());\r
         }\r
         flowBuilder.setFlowStats(new ArrayList<>(flowStatsList));\r
@@ -318,7 +324,9 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             tableFeaturesLength -= propertyLength;\r
             if (type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS)) {\r
-                InstructionsDeserializer.createInstructions(input, propertyLength - COMMON_PROPERTY_LENGTH);\r
+                InstructionRelatedTableFeaturePropertyBuilder insBuilder = new InstructionRelatedTableFeaturePropertyBuilder();\r
+                insBuilder.setInstructions(InstructionsDeserializer.createInstructions(input, propertyLength - COMMON_PROPERTY_LENGTH));\r
+                builder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insBuilder.build());\r
             } else if (type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLES)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS)) {\r
                 propertyLength -= COMMON_PROPERTY_LENGTH;\r
@@ -331,19 +339,22 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
                 }\r
                 tableBuilder.setNextTableIds(ids);\r
                 builder.addAugmentation(NextTableRelatedTableFeatureProperty.class, tableBuilder.build());\r
-                properties.add(builder.build());\r
             } else if (type.equals(TableFeaturesPropType.OFPTFPTWRITEACTIONS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS)) {\r
-                ActionsDeserializer.createActionsList(input, propertyLength - COMMON_PROPERTY_LENGTH);\r
+                ActionRelatedTableFeaturePropertyBuilder actionBuilder = new ActionRelatedTableFeaturePropertyBuilder();\r
+                actionBuilder.setActionsList(ActionsDeserializer.createActionsList(input, propertyLength - COMMON_PROPERTY_LENGTH));\r
+                builder.addAugmentation(ActionRelatedTableFeatureProperty.class, actionBuilder.build());\r
             } else if (type.equals(TableFeaturesPropType.OFPTFPTMATCH)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTWILDCARDS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTWRITESETFIELD)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS)) {\r
-                MatchEntriesDeserializer.createMatchEntries(input, propertyLength - COMMON_PROPERTY_LENGTH);\r
+                OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();\r
+                oxmBuilder.setMatchEntries(MatchDeserializer.createMatchEntries(input, propertyLength - COMMON_PROPERTY_LENGTH));\r
+                builder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());\r
             } else if (type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTER)\r
                     || type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS)) {\r
                 final byte EXPERIMENTER_PROPERTY_LENGTH = 12;\r
@@ -354,8 +365,8 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
                 input.readBytes(data);\r
                 expBuilder.setData(data);\r
                 builder.addAugmentation(ExperimenterRelatedTableFeatureProperty.class, expBuilder.build());\r
-                properties.add(builder.build());\r
             }\r
+            properties.add(builder.build());\r
         }\r
         return properties;\r
     }\r
@@ -725,19 +736,46 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
     }\r
     \r
     private static MultipartReplyBody setGroupFeatures(ByteBuf rawMessage) {\r
-        final int SIZE_OF_MAX_GROUPS = 4;\r
+        final int GROUP_TYPES = 4;\r
         MultipartReplyGroupFeaturesBuilder featuresBuilder = new MultipartReplyGroupFeaturesBuilder();\r
         featuresBuilder.setTypes(createGroupType(rawMessage.readUnsignedInt()));\r
         featuresBuilder.setCapabilities(createCapabilities(rawMessage.readUnsignedInt()));\r
         List<Long> maxGroupsList = new ArrayList<>();\r
-        for (int i = 0; i < SIZE_OF_MAX_GROUPS ; i++) {\r
+        for (int i = 0; i < GROUP_TYPES ; i++) {\r
             maxGroupsList.add(rawMessage.readUnsignedInt());\r
         }\r
         featuresBuilder.setMaxGroups(maxGroupsList);\r
-        // TODO - groupfeatures - actions bitmap\r
-        rawMessage.skipBytes(4);\r
+        List<ActionType> actionBitmaps = new ArrayList<>();\r
+        for (int i = 0; i < GROUP_TYPES ; i++) {\r
+            actionBitmaps.add(createActionBitmap(rawMessage.readUnsignedInt()));\r
+        }\r
+        featuresBuilder.setActionsBitmap(actionBitmaps);\r
         return featuresBuilder.build();\r
     }\r
+    \r
+    private static ActionType createActionBitmap(long input) {\r
+        final Boolean OFPAT_OUTPUT = ((input) & (1<<0)) != 0;\r
+        final Boolean OFPAT_COPY_TTL_OUT = ((input) & (1<<1)) != 0;\r
+        final Boolean OFPAT_COPY_TTL_IN = ((input) & (1<<2)) != 0;\r
+        final Boolean OFPAT_SET_MPLS_TTL = ((input) & (1<<3)) != 0;\r
+        final Boolean OFPAT_DEC_MPLS_TTL = ((input) & (1<<4)) != 0;\r
+        final Boolean OFPAT_PUSH_VLAN = ((input) & (1<<5)) != 0;\r
+        final Boolean OFPAT_POP_VLAN = ((input) & (1<<6)) != 0;\r
+        final Boolean OFPAT_PUSH_MPLS = ((input) & (1<<7)) != 0;\r
+        final Boolean OFPAT_POP_MPLS = ((input) & (1<<8)) != 0;\r
+        final Boolean OFPAT_SET_QUEUE = ((input) & (1<<9)) != 0;\r
+        final Boolean OFPAT_GROUP = ((input) & (1<<10)) != 0;\r
+        final Boolean OFPAT_SET_NW_TTL = ((input) & (1<<11)) != 0;\r
+        final Boolean OFPAT_DEC_NW_TTL = ((input) & (1<<12)) != 0;\r
+        final Boolean OFPAT_SET_FIELD = ((input) & (1<<13)) != 0;\r
+        final Boolean OFPAT_PUSH_PBB = ((input) & (1<<14)) != 0;\r
+        final Boolean OFPAT_POP_PBB = ((input) & (1<<15)) != 0;\r
+        final Boolean OFPAT_EXPERIMENTER = ((input) & (1<<16)) != 0;\r
+        return new ActionType(OFPAT_COPY_TTL_IN, OFPAT_COPY_TTL_OUT, OFPAT_DEC_MPLS_TTL,\r
+                OFPAT_DEC_NW_TTL, OFPAT_EXPERIMENTER, OFPAT_GROUP, OFPAT_OUTPUT, OFPAT_POP_MPLS,\r
+                OFPAT_POP_PBB, OFPAT_POP_VLAN, OFPAT_PUSH_MPLS, OFPAT_PUSH_PBB, OFPAT_PUSH_VLAN,\r
+                OFPAT_SET_FIELD, OFPAT_SET_MPLS_TTL, OFPAT_SET_NW_TTL, OFPAT_SET_QUEUE);\r
+    }\r
 \r
     private static GroupCapabilities createCapabilities(long input) {\r
         final Boolean OFOFPGFC_SELECT_WEIGHT = ((input) & (1<<0)) != 0;\r
@@ -769,18 +807,13 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();\r
         List<BucketsList> bucketsList = new ArrayList<>();\r
         List<ActionsList> actionsList = new ArrayList<>();\r
-        \r
         while (input.readableBytes() > 0) {\r
             bodyLength = input.readUnsignedShort();\r
-            actualLength = 0;\r
-            \r
-            groupDescBuilder.setType(GroupType.forValue(input.readUnsignedByte())); // TODO enum or class?\r
+            groupDescBuilder.setType(GroupType.forValue(input.readUnsignedByte()));\r
             input.skipBytes(PADDING_IN_GROUP_DESC_HEADER);\r
             groupDescBuilder.setGroupId(input.readUnsignedInt());\r
             actualLength = GROUP_DESC_HEADER_LENGTH;\r
-            \r
             while (actualLength < bodyLength) {\r
-                \r
                 bucketsLength = input.readUnsignedShort();\r
                 bucketsBuilder.setWeight(input.readUnsignedShort());\r
                 bucketsBuilder.setWatchPort(new PortNumber(input.readUnsignedInt()));\r
index edcf8883907203b467f1cc2a62a30112469f658b..bec0c57f813d713fe24c7601a18dc037cca8eb1a 100644 (file)
@@ -1,21 +1,21 @@
 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
 \r
+import io.netty.buffer.ByteBuf;\r
+\r
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
-import io.netty.buffer.ByteBuf;\r
-\r
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutputBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.Properties;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.PropertiesBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;\r
 \r
 /**\r
  * @author timotej.kubas\r
@@ -63,16 +63,16 @@ public class QueueGetConfigReplyMessageFactory implements OFDeserializer<GetQueu
             queueBuilder.setPort(new PortNumber(input.readUnsignedInt()));\r
             input.skipBytes(2);\r
             input.skipBytes(PADDING_IN_PACKET_QUEUE_HEADER);\r
-            queueBuilder.setProperties(createPropertiesList(input));\r
+            queueBuilder.setQueueProperty(createPropertiesList(input));\r
             queuesList.add(queueBuilder.build());\r
         } \r
         return queuesList;\r
     }\r
     \r
-    private static List<Properties> createPropertiesList(ByteBuf propertiesInput){\r
-        List<Properties> propertiesList = new ArrayList<>();\r
-        PropertiesBuilder propertiesBuilder = new PropertiesBuilder();\r
-        propertiesBuilder.setProperty(QueueProperty.forValue(propertiesInput.readUnsignedShort()));\r
+    private static List<QueueProperty> createPropertiesList(ByteBuf propertiesInput){\r
+        List<QueueProperty> propertiesList = new ArrayList<>();\r
+        QueuePropertyBuilder propertiesBuilder = new QueuePropertyBuilder();\r
+        propertiesBuilder.setProperty(QueueProperties.forValue(propertiesInput.readUnsignedShort()));\r
         propertiesInput.skipBytes(2);\r
         propertiesInput.skipBytes(PADDING_IN_QUEUE_PROPERTY_HEADER);\r
         propertiesList.add(propertiesBuilder.build());\r
index 1413063f87f3dc3235d84ba72cc49ab64d4cd385..811ce8668cd28118b53637be320bda32341b6862 100644 (file)
@@ -22,7 +22,7 @@ public interface OFSerializer <E extends DataObject> {
     \r
     /**\r
      * Compute length of received message\r
-     * @param message TODO\r
+     * @param message \r
      * @return computed length\r
      */\r
     public abstract int computeLength(E message);\r
index 7b9f7b1110398a05cab6cd98895a4328fc20b5c2..4574bf54db875147d796f0b3e8db60027b52b0b1 100644 (file)
@@ -4,12 +4,26 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 import io.netty.buffer.ByteBuf;\r
 \r
 import java.util.HashMap;\r
+import java.util.List;\r
 import java.util.Map;\r
 \r
 import org.opendaylight.openflowjava.protocol.impl.serialization.OFSerializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionsSerializer;\r
 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;\r
+import org.opendaylight.openflowjava.protocol.impl.util.InstructionsSerializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.MatchSerializer;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeatureProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestMessage;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregate;\r
@@ -22,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueue;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableFeatures;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features.TableFeatures;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeatureProperties;\r
 \r
 /**\r
  * @author timotej.kubas\r
@@ -30,8 +45,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 public class MultipartRequestMessageFactory implements OFSerializer<MultipartRequestMessage> {\r
     private static final byte MESSAGE_TYPE = 18;\r
     private static final int MESSAGE_LENGTH = 16;\r
-    private static MultipartRequestMessageFactory instance; \r
     private static final byte PADDING_IN_MULTIPART_REQUEST_MESSAGE = 4;\r
+    private static final byte TABLE_FEAT_HEADER_LENGTH = 4;\r
+    private static MultipartRequestMessageFactory instance; \r
+    \r
     private MultipartRequestMessageFactory() {\r
         // singleton\r
     }\r
@@ -68,10 +85,10 @@ public class MultipartRequestMessageFactory implements OFSerializer<MultipartReq
             encodeMeterBody(message.getMultipartRequestBody(), out);\r
         } else if (message.getMultipartRequestBody() instanceof MultipartRequestMeterConfig) {\r
             encodeMeterConfigBody(message.getMultipartRequestBody(), out);\r
-        } else if (message.getMultipartRequestBody() instanceof MultipartRequestExperimenter) {\r
-            encodeExperimenterBody(message.getMultipartRequestBody(), out);\r
         } else if (message.getMultipartRequestBody() instanceof MultipartRequestTableFeatures) {\r
             encodeTableFeaturesBody(message.getMultipartRequestBody(), out);\r
+        } else if (message.getMultipartRequestBody() instanceof MultipartRequestExperimenter) {\r
+            encodeExperimenterBody(message.getMultipartRequestBody(), out);\r
         }\r
     }\r
     \r
@@ -105,7 +122,7 @@ public class MultipartRequestMessageFactory implements OFSerializer<MultipartReq
         ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02, output);\r
         output.writeLong(flow.getCookie().longValue()); \r
         output.writeLong(flow.getCookieMask().longValue());\r
-        //TODO match field\r
+        MatchSerializer.encodeMatch(flow.getMatch(), output);\r
     }\r
     \r
     private static void encodeAggregateBody(MultipartRequestBody multipartRequestBody, ByteBuf output) {\r
@@ -119,7 +136,7 @@ public class MultipartRequestMessageFactory implements OFSerializer<MultipartReq
         ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_02, output);\r
         output.writeLong(aggregate.getCookie().longValue()); \r
         output.writeLong(aggregate.getCookieMask().longValue());\r
-        //TODO match field\r
+        MatchSerializer.encodeMatch(aggregate.getMatch(), output);\r
     }\r
     \r
     private static void encodePortStatsBody(MultipartRequestBody multipartRequestBody, ByteBuf output) {\r
@@ -163,19 +180,157 @@ public class MultipartRequestMessageFactory implements OFSerializer<MultipartReq
     }\r
     \r
     private static void encodeTableFeaturesBody(MultipartRequestBody multipartRequestBody, ByteBuf output) {\r
-        MultipartRequestTableFeatures tableFeatures = (MultipartRequestTableFeatures) multipartRequestBody;\r
-        \r
-        for (TableFeatures currTableFeature : tableFeatures.getTableFeatures()) {\r
-            final byte PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY = 5;\r
-            output.writeByte(currTableFeature.getTableId());\r
-            ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY, output);\r
-            output.writeBytes(currTableFeature.getName().getBytes());\r
-            ByteBufUtils.padBuffer((32 - currTableFeature.getName().getBytes().length), output);\r
-            output.writeLong(currTableFeature.getMetadataMatch().longValue());\r
-            output.writeLong(currTableFeature.getMetadataWrite().longValue());\r
-            output.writeInt(createTableConfigBitmask(currTableFeature.getConfig()));\r
-            output.writeInt(currTableFeature.getMaxEntries().intValue());\r
-            //TODO properties\r
+        if (multipartRequestBody != null) {\r
+            MultipartRequestTableFeatures tableFeatures = (MultipartRequestTableFeatures) multipartRequestBody;\r
+            for (TableFeatures currTableFeature : tableFeatures.getTableFeatures()) {\r
+                final byte PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY = 5;\r
+                output.writeByte(currTableFeature.getTableId());\r
+                ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY, output);\r
+                output.writeBytes(currTableFeature.getName().getBytes());\r
+                ByteBufUtils.padBuffer((32 - currTableFeature.getName().getBytes().length), output);\r
+                output.writeLong(currTableFeature.getMetadataMatch().longValue());\r
+                output.writeLong(currTableFeature.getMetadataWrite().longValue());\r
+                output.writeInt(createTableConfigBitmask(currTableFeature.getConfig()));\r
+                output.writeInt(currTableFeature.getMaxEntries().intValue());\r
+                writeTableFeatureProperties(output, currTableFeature.getTableFeatureProperties());\r
+            }\r
+        }\r
+    }\r
+    \r
+    private static void writeTableFeatureProperties(ByteBuf output, List<TableFeatureProperties> props) {\r
+        if (props != null) {\r
+            for (TableFeatureProperties property : props) {\r
+                TableFeaturesPropType type = property.getType();\r
+                if (type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONS)) {\r
+                    final byte INSTRUCTIONS_CODE = 0;\r
+                    writeInstructionRelatedTableProperty(output, property, INSTRUCTIONS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS)) {\r
+                    final byte INSTRUCTIONS_MISS_CODE = 1;\r
+                    writeInstructionRelatedTableProperty(output, property, INSTRUCTIONS_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLES)) {\r
+                    final byte NEXT_TABLE_CODE = 2;\r
+                    writeNextTableRelatedTableProperty(output, property, NEXT_TABLE_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS)) {\r
+                    final byte NEXT_TABLE_MISS_CODE = 3;\r
+                    writeNextTableRelatedTableProperty(output, property, NEXT_TABLE_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTWRITEACTIONS)) {\r
+                    final byte WRITE_ACTIONS_CODE = 4;\r
+                    writeActionsRelatedTableProperty(output, property, WRITE_ACTIONS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS)) {\r
+                    final byte WRITE_ACTIONS_MISS_CODE = 5;\r
+                    writeActionsRelatedTableProperty(output, property, WRITE_ACTIONS_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONS)) {\r
+                    final byte APPLY_ACTIONS_CODE = 6;\r
+                    writeActionsRelatedTableProperty(output, property, APPLY_ACTIONS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS)) {\r
+                    final byte APPLY_ACTIONS_MISS_CODE = 7;\r
+                    writeActionsRelatedTableProperty(output, property, APPLY_ACTIONS_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTMATCH)) {\r
+                    final byte MATCH_CODE = 8;\r
+                    writeOxmRelatedTableProperty(output, property, MATCH_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTWILDCARDS)) {\r
+                    final byte WILDCARDS_CODE = 10;\r
+                    writeOxmRelatedTableProperty(output, property, WILDCARDS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTWRITESETFIELD)) {\r
+                    final byte WRITE_SETFIELD_CODE = 12;\r
+                    writeOxmRelatedTableProperty(output, property, WRITE_SETFIELD_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS)) {\r
+                    final byte WRITE_SETFIELD_MISS_CODE = 13;\r
+                    writeOxmRelatedTableProperty(output, property, WRITE_SETFIELD_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD)) {\r
+                    final byte APPLY_SETFIELD_CODE = 14;\r
+                    writeOxmRelatedTableProperty(output, property, APPLY_SETFIELD_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS)) {\r
+                    final byte APPLY_SETFIELD_MISS_CODE = 15;\r
+                    writeOxmRelatedTableProperty(output, property, APPLY_SETFIELD_MISS_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTER)) {\r
+                    final int EXPERIMENTER_CODE = 65534; // 0xFFFE\r
+                    writeExperimenterRelatedTableProperty(output, property, EXPERIMENTER_CODE);\r
+                } else if (type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS)) {\r
+                    final int EXPERIMENTER_MISS_CODE = 65535; // 0xFFFF\r
+                    writeExperimenterRelatedTableProperty(output, property, EXPERIMENTER_MISS_CODE);\r
+                } \r
+            }\r
+        }\r
+    }\r
+\r
+    private static void writeInstructionRelatedTableProperty(ByteBuf output,\r
+            TableFeatureProperties property, byte code) {\r
+        output.writeShort(code);\r
+        List<Instructions> instructions = property.\r
+                getAugmentation(InstructionRelatedTableFeatureProperty.class).getInstructions();\r
+        int length = TABLE_FEAT_HEADER_LENGTH;\r
+        if (instructions != null) {\r
+        output.writeShort(InstructionsSerializer.computeInstructionsLength(instructions)\r
+                + TABLE_FEAT_HEADER_LENGTH);\r
+        InstructionsSerializer.encodeInstructions(instructions, output);\r
+        } else {\r
+            output.writeShort(length);\r
+        }\r
+    }\r
+    \r
+    private static void writeNextTableRelatedTableProperty(ByteBuf output,\r
+            TableFeatureProperties property, byte code) {\r
+        output.writeShort(code);\r
+        List<NextTableIds> nextTableIds = property.\r
+                getAugmentation(NextTableRelatedTableFeatureProperty.class).getNextTableIds();\r
+        int length = TABLE_FEAT_HEADER_LENGTH;\r
+        if (nextTableIds != null) {\r
+            output.writeShort(length + nextTableIds.size());\r
+            for (NextTableIds next : nextTableIds) {\r
+                output.writeByte(next.getTableId());\r
+            }\r
+        } else {\r
+            output.writeShort(length);\r
+        }\r
+    }\r
+    \r
+    private static void writeActionsRelatedTableProperty(ByteBuf output,\r
+            TableFeatureProperties property, byte code) {\r
+        output.writeShort(code);\r
+        List<ActionsList> actions = property.\r
+                getAugmentation(ActionRelatedTableFeatureProperty.class).getActionsList();\r
+        int length = TABLE_FEAT_HEADER_LENGTH;\r
+        if (actions != null) {\r
+        output.writeShort(ActionsSerializer.computeLengthOfActions(actions)\r
+                + TABLE_FEAT_HEADER_LENGTH);\r
+        ActionsSerializer.encodeActions(actions, output);\r
+        } else {\r
+            output.writeShort(length);\r
+        }\r
+    }\r
+    \r
+    private static void writeOxmRelatedTableProperty(ByteBuf output,\r
+            TableFeatureProperties property, byte code) {\r
+        output.writeShort(code);\r
+        List<MatchEntries> entries = property.\r
+                getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntries();\r
+        int length = TABLE_FEAT_HEADER_LENGTH;\r
+        if (entries != null) {\r
+        output.writeShort(MatchSerializer.computeMatchEntriesLength(entries)\r
+                + TABLE_FEAT_HEADER_LENGTH);\r
+        MatchSerializer.encodeMatchEntries(entries, output);\r
+        } else {\r
+            output.writeShort(length);\r
+        }\r
+    }\r
+    \r
+    private static void writeExperimenterRelatedTableProperty(ByteBuf output,\r
+            TableFeatureProperties property, int code) {\r
+        output.writeShort(code);\r
+        ExperimenterRelatedTableFeatureProperty exp = property.\r
+                getAugmentation(ExperimenterRelatedTableFeatureProperty.class);\r
+        byte[] data = exp.getData();\r
+        int length = TABLE_FEAT_HEADER_LENGTH + 2 * (Integer.SIZE / Byte.SIZE);\r
+        if (data != null) {\r
+            output.writeShort(length + data.length);\r
+            output.writeInt(exp.getExperimenter().intValue());\r
+            output.writeInt(exp.getExpType().intValue());\r
+            output.writeBytes(data);\r
+        } else {\r
+            output.writeShort(length);\r
+            output.writeInt(exp.getExperimenter().intValue());\r
+            output.writeInt(exp.getExpType().intValue());\r
         }\r
     }\r
     \r
index 589d86bf48f5d9a521c6e67a0f392547f45a2a5e..afed9255b092657c7dd3e1f3864b651db3e851d1 100644 (file)
@@ -41,9 +41,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.action.header.ActionBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
 \r
@@ -136,7 +136,6 @@ public abstract class ActionsDeserializer {
                         \r
                 case 25:\r
                         actionsLength = input.readUnsignedShort();//8\r
-                        //TODO field\r
                         actionsList.add(ActionsDeserializer.createSetFieldAction(input, actionsLength));\r
                         break; \r
                 case 26: \r
@@ -378,7 +377,7 @@ public abstract class ActionsDeserializer {
     public static ActionsList createSetFieldAction(ByteBuf in, int actionLength) {\r
         actionBuilder.setType(SetField.class);\r
         OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();\r
-        matchEntries.setMatchEntries(MatchEntriesDeserializer.createMatchEntries(in, actionLength - 4));\r
+        matchEntries.setMatchEntries(MatchDeserializer.createMatchEntries(in, actionLength - 4));\r
         actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());\r
         actionsListBuilder.setAction(actionBuilder.build());\r
         \r
index 15e8b2b61afa39615080f47c320b1c5cd04f9064..3f92f9900f8e9dcfe73fa75f8fb3f6a5d0c8dba3 100644 (file)
@@ -32,8 +32,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.action.header.Action;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
similarity index 93%
rename from openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntriesDeserializer.java
rename to openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializer.java
index 97e9735259b6c7fecd41097391992ce34d8dddf2..c2d571ea794e3f25aa20953945dec60ec0201e63 100644 (file)
@@ -62,6 +62,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntryBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;\r
@@ -96,6 +97,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Mpls
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm0Class;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;\r
@@ -108,6 +110,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Vlan
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.MatchBuilder;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
@@ -118,8 +122,8 @@ import com.google.common.base.Joiner;
  * @author timotej.kubas\r
  * @author michal.polkorab\r
  */\r
-public abstract class MatchEntriesDeserializer {\r
-    private static final Logger LOGGER = LoggerFactory.getLogger(MatchEntriesDeserializer.class);\r
+public abstract class MatchDeserializer {\r
+    private static final Logger LOGGER = LoggerFactory.getLogger(MatchDeserializer.class);\r
     private static final byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;\r
     private static final byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;\r
     private static final byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;\r
@@ -128,6 +132,35 @@ public abstract class MatchEntriesDeserializer {
     private static List<MatchEntries> matchEntriesList = new ArrayList<>();\r
     private static MatchEntriesBuilder matchEntriesBuilder = new MatchEntriesBuilder(); \r
     \r
+    /**\r
+     * Creates match\r
+     * @param in inputu ByteBuf\r
+     * @return ofp_match\r
+     */\r
+    public static Match createMatch(ByteBuf in) {\r
+        if (in.readableBytes() > 0) {\r
+            final byte PADDING_IN_MATCH = 4;\r
+            MatchBuilder builder = new MatchBuilder();\r
+            int type = in.readUnsignedShort();\r
+            int length = in.readUnsignedShort();\r
+            switch (type) {\r
+            case 0:\r
+                builder.setType(StandardMatchType.class);\r
+                builder.setMatchEntries(createMatchEntries(in, length - 2 * Short.SIZE));\r
+                break;\r
+            case 1:\r
+                builder.setType(OxmMatchType.class);\r
+                builder.setMatchEntries(createMatchEntries(in, length - 2 * Short.SIZE));\r
+                break;\r
+            default:\r
+                break;\r
+            }\r
+            in.skipBytes(PADDING_IN_MATCH);\r
+            return builder.build();\r
+        }\r
+        return null;\r
+    }\r
+    \r
     /**\r
      * @param in input ByteBuf\r
      * @param matchArrayLength to infer size of array\r
@@ -494,7 +527,7 @@ public abstract class MatchEntriesDeserializer {
         Ipv4AddressMatchEntryBuilder ipv4AddressBuilder = new Ipv4AddressMatchEntryBuilder();\r
         List<String> groups = new ArrayList<>();\r
         for (int i = 0; i < GROUPS_IN_IPV4_ADDRESS; i++) {\r
-            groups.add(String.format("X", in.readUnsignedByte()));\r
+            groups.add(Short.toString(in.readUnsignedByte()));\r
         }\r
         Joiner joiner = Joiner.on(".");\r
         ipv4AddressBuilder.setIpv4Address(new Ipv4Address(joiner.join(groups)));\r
index ce40c52f5949e0b04320e90c5940ba49f6ae52ad..6bf6a063f9d8533019d87ca5654febd9044d9de1 100644 (file)
@@ -83,7 +83,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpS
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.flow.mod.Match;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
index b9e0f6ed0076b1466d2f3989a92a41a247d906bf..6825f92ed50d204402e2c07ad0fb96e8807ee717 100644 (file)
@@ -11,12 +11,12 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.Properties;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.PropertiesBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;\r
 \r
 /**\r
  * @author timotej.kubas\r
@@ -64,16 +64,16 @@ public class QueueGetConfigReplyMessageFactoryMultiTest {
         for (int i = 1; i <= 3; i++) {\r
             qb.setQueueId(new QueueId((long) i));\r
             qb.setPort(new PortNumber((long) i));\r
-            qb.setProperties(createPropertiesList());\r
+            qb.setQueueProperty(createPropertiesList());\r
             queuesList.add(qb.build());\r
         }\r
         return queuesList;\r
     }\r
 \r
-    private static List<Properties> createPropertiesList() {\r
-        List<Properties> propertiesList = new ArrayList<>();\r
-        PropertiesBuilder pb = new PropertiesBuilder();\r
-        pb.setProperty(QueueProperty.values()[1]);\r
+    private static List<QueueProperty> createPropertiesList() {\r
+        List<QueueProperty> propertiesList = new ArrayList<>();\r
+        QueuePropertyBuilder pb = new QueuePropertyBuilder();\r
+        pb.setProperty(QueueProperties.forValue(1));\r
         propertiesList.add(pb.build());\r
         return propertiesList;\r
     }\r
index 4c447fc3441430860b3effe02ffb696d08b5255f..ba2eba3984f61b5ee36b975575e38feb990fed12 100644 (file)
@@ -11,12 +11,12 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.Properties;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.packet.queue.PropertiesBuilder;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;\r
 \r
 /**\r
  * @author timotej.kubas\r
@@ -41,16 +41,16 @@ public class QueueGetConfigReplyMessageFactoryTest {
         QueuesBuilder qb = new QueuesBuilder();\r
         qb.setQueueId(new QueueId(1L));\r
         qb.setPort(new PortNumber(1L));\r
-        qb.setProperties(createPropertiesList());\r
+        qb.setQueueProperty(createPropertiesList());\r
         queuesList.add(qb.build());\r
         \r
         return queuesList;\r
     }\r
     \r
-    private static List<Properties> createPropertiesList(){\r
-        List<Properties> propertiesList = new ArrayList<>();\r
-        PropertiesBuilder pb = new PropertiesBuilder();\r
-        pb.setProperty(QueueProperty.values()[2]);\r
+    private static List<QueueProperty> createPropertiesList(){\r
+        List<QueueProperty> propertiesList = new ArrayList<>();\r
+        QueuePropertyBuilder pb = new QueuePropertyBuilder();\r
+        pb.setProperty(QueueProperties.forValue(2));\r
         propertiesList.add(pb.build());\r
         \r
         return propertiesList;\r
index 340cba23f2aa05730f59730d3b31d9c11a73c4e6..e98b48eddc787970e8acf6927b9a256c734565eb 100644 (file)
@@ -68,7 +68,6 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan
 \r
     @Override\r
     public boolean accept(InetAddress switchAddress) {\r
-        // TODO Auto-generated method stub\r
         return true;\r
     }\r
 \r