Add multipart request message serializers 52/52952/13
authorTomas Slusny <tomas.slusny@pantheon.tech>
Wed, 1 Mar 2017 15:38:29 +0000 (16:38 +0100)
committerTomas Slusny <tomas.slusny@pantheon.tech>
Mon, 10 Apr 2017 06:16:36 +0000 (06:16 +0000)
- Add serializers for multipart request and it's subtypes
- Add YANG models for multipart request and it's subtypes

See also: bug 6915

Change-Id: I465c23a6fc3bea0cf944bbe8e6f75e17833d4449
Signed-off-by: Tomas Slusny <tomas.slusny@pantheon.tech>
105 files changed:
extension/openflowplugin-extension-api/src/main/yang/openflowplugin-experimenter-types.yang
model/model-flow-base/src/main/yang/opendaylight-flow-types.yang
model/model-flow-base/src/main/yang/opendaylight-multipart-types.yang
model/model-flow-base/src/main/yang/opendaylight-port-types.yang
model/model-flow-base/src/main/yang/opendaylight-table-types.yang
model/model-flow-service/src/main/yang/flow-node-inventory.yang
model/model-flow-service/src/main/yang/sal-table.yang
model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang
model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang
model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang
model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang
model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartReplyTranslatorUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/ActionDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/InstructionDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/MatchDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/MessageDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/MultipartDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MatchSerializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MessageSerializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartMatchFieldSerializerInjector.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartSerializerInjector.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartTableFeaturesSerializerInjector.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/SerializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/FlowMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestDescSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestExperimenterSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowAggregateStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowTableStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupDescSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupFeaturesSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterConfigSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterFeaturesSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortDescSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestQueueStatsSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestTableFeaturesSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/AbstractTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/MatchTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WildcardsTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldMissTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldTablePropertySerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/AbstractMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpOpMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpShaMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpSpaMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpThaMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpTpaMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthDstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthSrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthTypeMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4CodeMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4TypeMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6CodeMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6TypeMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPhyPortMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPortMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpDscpMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpEcnMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpProtoMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4DstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4SrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6DstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6ExtHdrMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6FlabelMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdSllMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTargetMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTllMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6SrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MetadataMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsBosMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsLabelMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsTcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/PbbIsidMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpDstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpSrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpDstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpFlagsMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpSrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TunnelIdMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpDstMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpSrcMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanPcpMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanVidMatchFieldSerializer.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/util/ActionUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/util/InstructionUtil.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializerTest.java [new file with mode: 0644]

index 6c9b77acc3fa5fa6f566567513db41e50a56f819..f8c0d80a9d6f869a5ca2d1768356668120a99800 100644 (file)
@@ -8,7 +8,6 @@ module openflowplugin-experimenter-types {
         description "Initial revision of experimenter basic types";
     }
 
-
     grouping experimenter-core-message {
         choice experimenter-message-of-choice {
             // to be augmented by vendors
@@ -21,4 +20,9 @@ module openflowplugin-experimenter-types {
         }
     }
 
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-experimenter {
+            uses experimenter-core-message;
+        }
+    }
 }
index c6f72046906a8b119257109c641782509ebfa147..ce4baf673802d2024116ea96c630f393a34704bf 100644 (file)
@@ -8,20 +8,21 @@ module opendaylight-flow-types {
     import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";}
     import openflow-protocol { prefix ofproto; revision-date "2013-07-31"; }
     import openflow-types { prefix oft; revision-date "2013-07-31"; }
+    import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
 
     revision "2013-10-26" {
         description "Initial revision of flow service";
     }
-    
+
     typedef flow-ref {
         type instance-identifier;
     }
-    
+
     typedef flow-cookie {
         description "openflow specific type - flow cookie / flow cookie mask";
         type uint64;
     }
-    
+
     typedef output-port-values {
         type enumeration {
             enum MAX {
@@ -74,47 +75,47 @@ module opendaylight-flow-types {
                  }
              }
             }
-             
+
             case write-metadata-case {
                 container write-metadata {
                  leaf metadata {
                      type uint64;
                  }
-                 
+
                  leaf metadata-mask {
                      type uint64;
                  }
              }
             }
-             
+
             case write-actions-case {
                 container write-actions {
                  uses action:action-list;
              }
             }
-             
+
             case apply-actions-case {
                 container apply-actions {
                  uses action:action-list;
              }
             }
-             
+
             case clear-actions-case {
                 container clear-actions {
                  uses action:action-list;
              }
             }
-             
+
             case meter-case {
                 container meter {
                      leaf meter-id {
                         type meter:meter-id;
-                     } 
+                     }
                  }
              }
          }
     }
-    
+
     typedef flow-mod-flags {
         type bits {
             bit CHECK_OVERLAP;
@@ -145,68 +146,68 @@ module opendaylight-flow-types {
 
             }
      }
-    
+
     grouping generic_flow_attributes {
         leaf priority {
             type uint16;
         }
-        
+
         leaf idle-timeout {
             type uint16;
         }
-        
+
         leaf hard-timeout {
             type uint16;
         }
-        
+
         leaf cookie {
             type flow-cookie;
         }
-        
+
         leaf table_id {
             type uint8;
         }
     }
-    
+
     grouping flow {
         container match {
             uses match:match;
         }
-        
+
         container instructions {
             uses instruction-list;
-        }          
-         
+        }
+
         uses generic_flow_attributes;
-        
+
         leaf container-name {
-            type string; 
+            type string;
         }
-        
+
         leaf cookie_mask {
             type flow-cookie;
         }
-        
+
         leaf buffer_id {
             type uint32;
         }
-        
+
         leaf out_port {
             type uint64;
         }
-        
+
         leaf out_group {
             type uint32;
         }
-        
+
         leaf flags {
             type flow-mod-flags;
         }
-        
+
         leaf flow-name {
             type string;
         }
-        
+
         leaf installHw {
             type boolean;
         }
@@ -244,20 +245,20 @@ module opendaylight-flow-types {
     grouping flow-table-statistics {
         leaf active {
             type yang:counter64;
-        } 
+        }
 
         leaf lookup {
             type yang:counter64;
         }
 
         leaf matched {
-            type yang:counter64;   
+            type yang:counter64;
         }
     }
-    
+
     grouping flow-mod-removed {
         uses generic_flow_attributes;
-        
+
         leaf removed_reason {
             type removed-flow-reason;
         }
@@ -265,7 +266,7 @@ module opendaylight-flow-types {
         leaf duration_nsec {
             type uint32;
         }
-        
+
         leaf duration_sec {
             type uint32;
         }
@@ -277,7 +278,7 @@ module opendaylight-flow-types {
         leaf byte_count {
             type uint64;
         }
-               
+
         container match {
             uses match:match;
         }
@@ -291,4 +292,13 @@ module opendaylight-flow-types {
             type oft:flow-mod-command;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-flow-stats {
+            uses flow;
+        }
+        case multipart-request-flow-aggregate-stats {
+            uses flow;
+        }
+    }
 }
index 0280fe502e59f08ba054d5d648c8c7bbc400df56..5696ae5b5e07a55c6438edc8a2255c4fd794bc77 100644 (file)
@@ -8,15 +8,26 @@ module opendaylight-multipart-types {
         description "Initial revision";
     }
 
-    container multipart-reply {
+    grouping multipart-header {
         uses ofproto:ofHeader;
 
         leaf request-more {
             type boolean;
             default false;
         }
+    }
+
+    container multipart-reply {
+        uses multipart-header;
 
         choice multipart-reply-body {
         }
     }
+
+    container multipart-request {
+        uses multipart-header;
+
+        choice multipart-request-body {
+        }
+    }
 }
index a2f6ed035627e8b507555b54523dc46779c0191d..9c6d3a34bdbca56192336e1bd84ab79fe082d4d7 100644 (file)
@@ -193,4 +193,11 @@ module opendaylight-port-types {
             }
         }
     }
+
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-port-desc {
+            // Empty case
+        }
+    }
 }
index e236287807e5403098f98b2d3ce966c96ef0a900..f67159bfb564c134ec9c9b674ccb5b5b993b1650 100644 (file)
@@ -4,6 +4,7 @@ module opendaylight-table-types {
 
     import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
     import opendaylight-action-types {prefix action;}
+    import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
 
     revision "2013-10-26" {
         description "Initial revision of table service";
@@ -16,7 +17,7 @@ module opendaylight-table-types {
     typedef table-ref {
         type instance-identifier;
     }
-    
+
     typedef table-config {
         type bits {
             bit DEPRECATED-MASK;
@@ -211,135 +212,135 @@ module opendaylight-table-types {
             }
             leaf has-mask {
                 type boolean;
-            } 
+            }
         }
     }
-      
+
     grouping table-feature-prop-type {
         choice table-feature-prop-type {
-            case instructions { 
+            case instructions {
                 container instructions {
                     uses flow:instruction-list;
-                } 
+                }
             }
-            
-            case instructions-miss {   
+
+            case instructions-miss {
                 container instructions-miss {
                     uses flow:instruction-list;
-                } 
+                }
             }
 
-            case next-table {   
+            case next-table {
                 container tables {
                     leaf-list table-ids {
                         type uint8;
                     }
-                } 
+                }
             }
-            
-            case next-table-miss {   
+
+            case next-table-miss {
                 container tables-miss {
                     leaf-list table-ids {
                         type uint8;
                     }
-                } 
+                }
             }
-            
-            case write-actions {   
+
+            case write-actions {
                 container write-actions {
                     uses action:action-list;
-                } 
+                }
             }
-            
-            case write-actions-miss {   
+
+            case write-actions-miss {
                 container write-actions-miss {
                     uses action:action-list;
-                } 
+                }
             }
-            
-            case apply-actions {   
+
+            case apply-actions {
                 container apply-actions {
                     uses action:action-list;
-                } 
+                }
             }
-            
-            case apply-actions-miss {   
+
+            case apply-actions-miss {
                 container apply-actions-miss {
                     uses action:action-list;
-                } 
+                }
             }
-            
+
             case match {
                        container match-setfield {
-                           uses set-field-match; 
+                   uses set-field-match;
                        }
             }
-            
-            case wildcards {   
+
+            case wildcards {
                        container wildcard-setfield {
                     uses set-field-match;
                 }
             }
-            
-            case write-setfield {   
+
+            case write-setfield {
                        container write-setfield {
                     uses set-field-match;
                 }
             }
-            
-            case write-setfield-miss {   
+
+            case write-setfield-miss {
                 container write-setfield-miss {
                     uses set-field-match;
                 }
             }
-            
-            case apply-setfield {   
+
+            case apply-setfield {
                 container apply-setfield {
-                    uses set-field-match; 
+                    uses set-field-match;
                 }
             }
-            
-            case apply-setfield-miss {   
+
+            case apply-setfield-miss {
                 container apply-setfield-miss {
-                    uses set-field-match; 
+                    uses set-field-match;
                 }
             }
         }
-    } 
-    
+    }
+
     grouping table-features {
         list table-features {
             key "table-id";
-            
+
             leaf table-id {
                 type uint8;
-            }      
-            
+            }
+
             leaf name {
                 description "Name of the table";
-                type string;               
+                type string;
             }
-            
+
             leaf metadata-match {
                 description "Bits of metadata table can match";
-                type uint64;                
+                type uint64;
             }
-            
+
             leaf metadata-write {
                 description "Bits of metadata table can write";
-                type uint64;                
+                type uint64;
             }
-            
+
             leaf max-entries {
                 description "Max number of entries supported";
-                type uint32;                
+                type uint32;
             }
-            
+
             leaf config {
                 description "Bitmap of OFPTC_ values";
                 type table-config;
             }
-            
+
             container table-properties {
                 list table-feature-properties {
                      key "order";
@@ -348,5 +349,17 @@ module opendaylight-table-types {
                 }
             }
         }
-    }    
+    }
+
+    augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
+        case multipart-reply-table-features {
+            uses table-features;
+        }
+    }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-table-features {
+            uses table-features;
+        }
+    }
 }
index 4901f08f24462b891d594a64845439841796456e..813a8b225a025eb68bab1d0354626744507b99f3 100644 (file)
@@ -324,4 +324,10 @@ module flow-node-inventory {
             uses desc;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-desc {
+            // Empty request case
+        }
+    }
 }
index ddaabebeb33f068a8632b34816a49b11cf16c7d4..cfbd6f03040ac5996c3c5966879e0faa17b2fc79 100644 (file)
@@ -5,14 +5,13 @@ module sal-table {
     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
     import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
     import flow-capable-transaction {prefix tr; revision-date "2015-03-04";}
-    import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
 
     description "Openflow table management.";
 
     revision "2013-10-26" {
         description "Initial revision of table service";
     }
-    
+
     grouping table-update {
         description "Openflow table configuration structure suitable for rpc (contains node-context-ref)";
 
@@ -24,10 +23,10 @@ module sal-table {
             uses table-type:table-features;
         }
     }
-    
+
     rpc update-table {
         description "Configuring openflow table.";
-        
+
         input {
             uses tr:transaction-metadata;
             leaf table-ref {
@@ -40,7 +39,7 @@ module sal-table {
             uses tr:transaction-aware;
         }
     }
-    
+
     notification table-updated {
         status deprecated;
 
@@ -48,11 +47,4 @@ module sal-table {
         uses tr:multipart-transaction-aware;
         uses table-type:table-features;
     }
-
-
-    augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
-        case multipart-reply-table-features {
-            uses table-type:table-features;
-        }
-    }
 }
index 96e4e8d55a7ed3cf454665e44f73902cbfc73953..4c069c891f164145390a58a3434ccebc0a9d0995 100644 (file)
@@ -74,4 +74,10 @@ module opendaylight-flow-table-statistics {
             uses flow-table-and-statistics-map;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-flow-table-stats {
+            // Empty request case
+        }
+    }
 }
index 318cf17430b8ef212ca7a6c16bad718e58cafeb0..ee3bc86fd66061c0562ef68137d28939fbc0e750 100644 (file)
@@ -146,4 +146,18 @@ module opendaylight-group-statistics {
             uses group-types:group-features-reply;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-group-desc {
+            // Empty request case
+        }
+        case multipart-request-group-features {
+            // Empty request case
+        }
+        case multipart-request-group-stats {
+            leaf group-id {
+                type group-types:group-id;
+            }
+        }
+    }
 }
index 0d91e4c49eae83882c9c5ecbfce16290cc791327..a41176e7d5353b228efafe799759c75766695677 100644 (file)
@@ -137,4 +137,20 @@ module opendaylight-meter-statistics {
             uses meter-types:meter-features-reply;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-meter-config {
+            leaf meter-id {
+                type meter-types:meter-id;
+            }
+        }
+        case multipart-request-meter-features {
+            // Empty request case
+        }
+        case multipart-request-meter-stats {
+            leaf meter-id {
+                type meter-types:meter-id;
+            }
+        }
+    }
 }
index e63f1bd7af3e94d9e9eb4a03cb9fe97841a8e127..16cf660c2d264d9dd2b21de68104c6989b31e87f 100644 (file)
@@ -87,4 +87,12 @@ module opendaylight-port-statistics {
             uses node-connector-statistics-and-port-number-map;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-port-stats {
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+        }
+    }
 }
index 0768119a88089e6cd049e5a94e5bef2286715df2..aaf3bd9fa8d1f9e8a88f3e9fbc713e7435c580b9 100644 (file)
@@ -112,4 +112,16 @@ module opendaylight-queue-statistics {
             uses queue-id-and-statistics-map;
         }
     }
+
+    augment "/multipart:multipart-request/multipart:multipart-request-body" {
+        case multipart-request-queue-stats {
+            leaf queue-id {
+                type queue-types:queue-id;
+            }
+
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+        }
+    }
 }
index 1a07a4340ce06a1d433bd7252cfa2a0397f5e9a6..43eeceb38d464e3b2767bc6e922909b75c0c8460 100644 (file)
@@ -118,8 +118,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.reply.multipart.reply.body.MultipartReplyQueueStatsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -206,7 +206,7 @@ public class MultipartReplyTranslatorUtil {
             .build();
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.multipart.reply.multipart.reply.body
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body
         .MultipartReplyTableFeatures translateTableFeatures(final MultipartReply msg,
                                                             final short version,
                                                             final ConvertorExecutor convertorExecutor) {
index c87190852c3aa47129f86bd931c9fbf211fed437..ad1c41dd36da4e98cf95d7af4ba202325f542136 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 
 import com.google.common.annotations.VisibleForTesting;
 
-public class ActionDeserializerInjector {
+class ActionDeserializerInjector {
 
     /**
      * Injects action deserializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}
index cae6b641ce38065947ad26812f89a332ff200040..de508a0f929a24d39bb0db897ebc27d9615a0f5d 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 
 import com.google.common.annotations.VisibleForTesting;
 
-public class InstructionDeserializerInjector {
+class InstructionDeserializerInjector {
 
     /**
      * Injects instruction deserializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}
index 082e299737ad21a0217c7ab665b6932e9ad2bb1a..19ebb8a094c0f53b1633e82189fab78984cf5442 100644 (file)
@@ -13,15 +13,12 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowplugin.impl.protocol.deserialization.key.MessageCodeMatchKey;
-import org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MatchDeserializer;
-import org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MatchDeserializer;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MatchEntryDeserializer;
 import org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MatchEntryDeserializerRegistry;
 import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
+import org.opendaylight.openflowplugin.impl.protocol.deserialization.key.MessageCodeMatchKey;
 import org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpOpEntryDeserializer;
 import org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpSourceHardwareAddressEntryDeserializer;
 import org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpSourceTransportAddressEntryDeserializer;
@@ -75,7 +72,7 @@ public class MatchDeserializerInjector {
      * Injects deserializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}
      * @param provider OpenflowJava deserializer extension provider
      */
-    public static void injectDeserializers(final DeserializerExtensionProvider provider) {
+    static void injectDeserializers(final DeserializerExtensionProvider provider) {
         for (MatchPath path : MatchPath.values()) {
             final MatchDeserializer deserializer = new MatchDeserializer(path);
             provider.registerDeserializer(
index 6c670b0d66e5a365f95d2fd55a89db62138dc699..367b9f19eb94e97fffccace436875e9f794c3bc9 100644 (file)
@@ -33,7 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
 
-public class MessageDeserializerInjector {
+class MessageDeserializerInjector {
 
     /**
      * Injects message deserializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}
index dd47f0fa43670c56e9ffffeb2324cbf7fe47502a..cf83b2861bcdad21b06a6bb24a53afbca80d085d 100644 (file)
@@ -33,7 +33,7 @@ import org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart.M
 import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 
-public class MultipartDeserializerInjector {
+class MultipartDeserializerInjector {
 
     /**
      * Injects message deserializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}
index 0e535da16fa7d2252cb18cce135d3f7c6dbf9fd5..3a0e4685be223e8ae71792e6fe4b5be7016cf594 100644 (file)
@@ -28,8 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.reply.MultipartReplyBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder;
index 8ec19b84b2d35c0e71f6c9ed7401cd26b7fd68a7..8812f3fad5a8f55283d6bbe1486a6a9a095b1fe5 100644 (file)
@@ -67,13 +67,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 /**
  * Util class for injecting new match serializers into OpenflowJava
  */
-public class MatchSerializerInjector {
+class MatchSerializerInjector {
 
     /**
      * Injects match serializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
      * @param provider OpenflowJava serializer extension provider
      */
-    public static void injectSerializers(final SerializerExtensionProvider provider) {
+    static void injectSerializers(final SerializerExtensionProvider provider) {
         final MatchSerializer serializer = new MatchSerializer();
         provider.registerSerializer(
                 new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class),
index e8997a43e76519b27b9e41f05dd11b3ed9b2126a..cf34d19d44986d86b884b888533a7aa8fa22e0a1 100644 (file)
@@ -19,10 +19,12 @@ import org.opendaylight.openflowplugin.impl.protocol.serialization.messages.Flow
 import org.opendaylight.openflowplugin.impl.protocol.serialization.messages.GroupMessageSerializer;
 import org.opendaylight.openflowplugin.impl.protocol.serialization.messages.MeterMessageSerializer;
 import org.opendaylight.openflowplugin.impl.protocol.serialization.messages.PortMessageSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMessageSerializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
 /**
@@ -38,11 +40,12 @@ class MessageSerializerInjector {
         // Inject new message serializers here using injector created by createInjector method
         final Function<Class<?>, Consumer<OFSerializer<? extends OfHeader>>> injector =
                 createInjector(provider, EncodeConstants.OF13_VERSION_ID);
-        
+
         injector.apply(FlowMessage.class).accept(new FlowMessageSerializer());
         injector.apply(MeterMessage.class).accept(new MeterMessageSerializer());
         injector.apply(PortMessage.class).accept(new PortMessageSerializer());
         injector.apply(GroupMessage.class).accept(new GroupMessageSerializer());
+        injector.apply(MultipartRequest.class).accept(new MultipartRequestMessageSerializer());
     }
 
     /**
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartMatchFieldSerializerInjector.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartMatchFieldSerializerInjector.java
new file mode 100644 (file)
index 0000000..389e628
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpOpMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpShaMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpSpaMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpThaMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpTpaMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthDstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthSrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthTypeMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4CodeMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4TypeMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6CodeMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6TypeMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPhyPortMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPortMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpDscpMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpEcnMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpProtoMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4DstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4SrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6DstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6ExtHdrMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6FlabelMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdSllMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTargetMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTllMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6SrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MetadataMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsBosMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsLabelMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsTcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.PbbIsidMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpDstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpSrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpDstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpFlagsMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpSrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TunnelIdMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpDstMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpSrcMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanPcpMatchFieldSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanVidMatchFieldSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpFlags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+
+/**
+ * Util class for injecting new multipart match field serializers into OpenflowJava
+ */
+class MultipartMatchFieldSerializerInjector {
+
+    /**
+     * Injects multipart match field serializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     */
+    static void injectSerializers(final SerializerExtensionProvider provider) {
+        // Inject new message serializers here using injector created by createInjector method
+        final Function<Class<? extends MatchField>, Consumer<OFSerializer<SetFieldMatch>>> injector =
+            createInjector(provider, EncodeConstants.OF13_VERSION_ID);
+
+        injector.apply(ArpOp.class).accept(new ArpOpMatchFieldSerializer());
+        injector.apply(ArpSha.class).accept(new ArpShaMatchFieldSerializer());
+        injector.apply(ArpSpa.class).accept(new ArpSpaMatchFieldSerializer());
+        injector.apply(ArpTha.class).accept(new ArpThaMatchFieldSerializer());
+        injector.apply(ArpTpa.class).accept(new ArpTpaMatchFieldSerializer());
+        injector.apply(EthDst.class).accept(new EthDstMatchFieldSerializer());
+        injector.apply(EthSrc.class).accept(new EthSrcMatchFieldSerializer());
+        injector.apply(EthType.class).accept(new EthTypeMatchFieldSerializer());
+        injector.apply(Icmpv4Code.class).accept(new Icmpv4CodeMatchFieldSerializer());
+        injector.apply(Icmpv4Type.class).accept(new Icmpv4TypeMatchFieldSerializer());
+        injector.apply(Icmpv6Code.class).accept(new Icmpv6CodeMatchFieldSerializer());
+        injector.apply(Icmpv6Type.class).accept(new Icmpv6TypeMatchFieldSerializer());
+        injector.apply(InPhyPort.class).accept(new InPhyPortMatchFieldSerializer());
+        injector.apply(InPort.class).accept(new InPortMatchFieldSerializer());
+        injector.apply(IpDscp.class).accept(new IpDscpMatchFieldSerializer());
+        injector.apply(IpEcn.class).accept(new IpEcnMatchFieldSerializer());
+        injector.apply(IpProto.class).accept(new IpProtoMatchFieldSerializer());
+        injector.apply(Ipv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
+        injector.apply(Ipv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
+        injector.apply(Ipv6Dst.class).accept(new Ipv6DstMatchFieldSerializer());
+        injector.apply(Ipv6Exthdr.class).accept(new Ipv6ExtHdrMatchFieldSerializer());
+        injector.apply(Ipv6Flabel.class).accept(new Ipv6FlabelMatchFieldSerializer());
+        injector.apply(Ipv6NdSll.class).accept(new Ipv6NdSllMatchFieldSerializer());
+        injector.apply(Ipv6NdTarget.class).accept(new Ipv6NdTargetMatchFieldSerializer());
+        injector.apply(Ipv6NdTll.class).accept(new Ipv6NdTllMatchFieldSerializer());
+        injector.apply(Ipv6Src.class).accept(new Ipv6SrcMatchFieldSerializer());
+        injector.apply(Metadata.class).accept(new MetadataMatchFieldSerializer());
+        injector.apply(MplsBos.class).accept(new MplsBosMatchFieldSerializer());
+        injector.apply(MplsLabel.class).accept(new MplsLabelMatchFieldSerializer());
+        injector.apply(MplsTc.class).accept(new MplsTcMatchFieldSerializer());
+        injector.apply(PbbIsid.class).accept(new PbbIsidMatchFieldSerializer());
+        injector.apply(SctpDst.class).accept(new SctpDstMatchFieldSerializer());
+        injector.apply(SctpSrc.class).accept(new SctpSrcMatchFieldSerializer());
+        injector.apply(TcpDst.class).accept(new TcpDstMatchFieldSerializer());
+        injector.apply(TcpFlags.class).accept(new TcpFlagsMatchFieldSerializer());
+        injector.apply(TcpSrc.class).accept(new TcpSrcMatchFieldSerializer());
+        injector.apply(TunnelId.class).accept(new TunnelIdMatchFieldSerializer());
+        // TODO: Finish implementation of Tunnel Ipv4 src and dst
+        injector.apply(TunnelIpv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
+        injector.apply(TunnelIpv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
+        injector.apply(UdpDst.class).accept(new UdpDstMatchFieldSerializer());
+        injector.apply(UdpSrc.class).accept(new UdpSrcMatchFieldSerializer());
+        injector.apply(VlanPcp.class).accept(new VlanPcpMatchFieldSerializer());
+        injector.apply(VlanVid.class).accept(new VlanVidMatchFieldSerializer());
+    }
+
+    /**
+     * Create injector that will inject new multipart match field features serializers into #{@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     * @param version Openflow version
+     * @return injector
+     */
+    @VisibleForTesting
+    static Function<Class<? extends MatchField>, Consumer<OFSerializer<SetFieldMatch>>> createInjector(
+        final SerializerExtensionProvider provider,
+        final byte version) {
+        return type -> serializer ->
+            provider.registerSerializer(
+                new MessageTypeKey<>(version, type),
+                serializer);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartSerializerInjector.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartSerializerInjector.java
new file mode 100644 (file)
index 0000000..4dda573
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestDescSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestExperimenterSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowAggregateStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowTableStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupDescSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupFeaturesSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterConfigSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterFeaturesSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestPortDescSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestPortStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestQueueStatsSerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestTableFeaturesSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.multipart.request.multipart.request.body.MultipartRequestFlowTableStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.request.multipart.request.body.MultipartRequestTableFeatures;
+
+/**
+ * Util class for injecting new multipart serializers into OpenflowJava
+ */
+class MultipartSerializerInjector {
+
+    /**
+     * Injects multipart serializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     */
+    static void injectSerializers(final SerializerExtensionProvider provider) {
+        // Inject new message serializers here using injector created by createInjector method
+        final Function<Class<? extends MultipartRequestBody>, Consumer<OFSerializer<MultipartRequestBody>>> injector =
+            createInjector(provider, EncodeConstants.OF13_VERSION_ID);
+
+        MultipartMatchFieldSerializerInjector.injectSerializers(provider);
+        MultipartTableFeaturesSerializerInjector.injectSerializers(provider);
+
+        injector.apply(MultipartRequestDesc.class).accept(new MultipartRequestDescSerializer());
+        injector.apply(MultipartRequestFlowTableStats.class).accept(new MultipartRequestFlowTableStatsSerializer());
+        injector.apply(MultipartRequestGroupDesc.class).accept(new MultipartRequestGroupDescSerializer());
+        injector.apply(MultipartRequestGroupFeatures.class).accept(new MultipartRequestGroupFeaturesSerializer());
+        injector.apply(MultipartRequestGroupStats.class).accept(new MultipartRequestGroupStatsSerializer());
+        injector.apply(MultipartRequestMeterFeatures.class).accept(new MultipartRequestMeterFeaturesSerializer());
+        injector.apply(MultipartRequestMeterStats.class).accept(new MultipartRequestMeterStatsSerializer());
+        injector.apply(MultipartRequestMeterConfig.class).accept(new MultipartRequestMeterConfigSerializer());
+        injector.apply(MultipartRequestPortDesc.class).accept(new MultipartRequestPortDescSerializer());
+        injector.apply(MultipartRequestPortStats.class).accept(new MultipartRequestPortStatsSerializer());
+        injector.apply(MultipartRequestQueueStats.class).accept(new MultipartRequestQueueStatsSerializer());
+        injector.apply(MultipartRequestFlowStats.class).accept(new MultipartRequestFlowStatsSerializer());
+        injector.apply(MultipartRequestFlowAggregateStats.class).accept(new MultipartRequestFlowAggregateStatsSerializer());
+        injector.apply(MultipartRequestExperimenter.class).accept(new MultipartRequestExperimenterSerializer());
+        injector.apply(MultipartRequestTableFeatures.class).accept(new MultipartRequestTableFeaturesSerializer());
+    }
+
+    /**
+     * Create injector that will inject new multipart serializers into #{@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     * @param version Openflow version
+     * @return injector
+     */
+    @VisibleForTesting
+    static Function<Class<? extends MultipartRequestBody>, Consumer<OFSerializer<MultipartRequestBody>>> createInjector(
+        final SerializerExtensionProvider provider,
+        final byte version) {
+        return type -> serializer ->
+            provider.registerSerializer(
+                new MessageTypeKey<>(version, type),
+                serializer);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartTableFeaturesSerializerInjector.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/MultipartTableFeaturesSerializerInjector.java
new file mode 100644 (file)
index 0000000..90972b7
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.ApplyActionsMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.ApplyActionsTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.ApplySetfieldMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.ApplySetfieldTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.InstructionsMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.InstructionsTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.MatchTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.NextTableMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.NextTableTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.WildcardsTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.WriteActionsMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.WriteActionsTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.WriteSetfieldMissTablePropertySerializer;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.WriteSetfieldTablePropertySerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Instructions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMiss;
+
+/**
+ * Util class for injecting new multipart table features serializers into OpenflowJava
+ */
+class MultipartTableFeaturesSerializerInjector {
+
+    /**
+     * Injects multipart table features serializers into provided {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     */
+    static void injectSerializers(final SerializerExtensionProvider provider) {
+        // Inject new message serializers here using injector created by createInjector method
+        final Function<Class<? extends TableFeaturePropType>, Consumer<OFSerializer<TableFeaturePropType>>> injector =
+            createInjector(provider, EncodeConstants.OF13_VERSION_ID);
+
+        injector.apply(Instructions.class).accept(new InstructionsTablePropertySerializer());
+        injector.apply(InstructionsMiss.class).accept(new InstructionsMissTablePropertySerializer());
+        injector.apply(NextTable.class).accept(new NextTableTablePropertySerializer());
+        injector.apply(NextTableMiss.class).accept(new NextTableMissTablePropertySerializer());
+        injector.apply(ApplyActions.class).accept(new ApplyActionsTablePropertySerializer());
+        injector.apply(ApplyActionsMiss.class).accept(new ApplyActionsMissTablePropertySerializer());
+        injector.apply(WriteActions.class).accept(new WriteActionsTablePropertySerializer());
+        injector.apply(WriteActionsMiss.class).accept(new WriteActionsMissTablePropertySerializer());
+        injector.apply(Match.class).accept(new MatchTablePropertySerializer());
+        injector.apply(Wildcards.class).accept(new WildcardsTablePropertySerializer());
+        injector.apply(WriteSetfield.class).accept(new WriteSetfieldTablePropertySerializer());
+        injector.apply(WriteSetfieldMiss.class).accept(new WriteSetfieldMissTablePropertySerializer());
+        injector.apply(ApplySetfield.class).accept(new ApplySetfieldTablePropertySerializer());
+        injector.apply(ApplySetfieldMiss.class).accept(new ApplySetfieldMissTablePropertySerializer());
+        // TODO: Add support for experimenters
+    }
+
+    /**
+     * Create injector that will inject new multipart table features serializers into #{@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}
+     * @param provider OpenflowJava serializer extension provider
+     * @param version Openflow version
+     * @return injector
+     */
+    @VisibleForTesting
+    static Function<Class<? extends TableFeaturePropType>, Consumer<OFSerializer<TableFeaturePropType>>> createInjector(
+        final SerializerExtensionProvider provider,
+        final byte version) {
+        return type -> serializer ->
+            provider.registerSerializer(
+                new MessageTypeKey<>(version, type),
+                serializer);
+    }
+
+}
index 4af3d12211726c721d09f343ed80907e4e176209..b8654060c58785af6e3b673c7d55c93448b26a0b 100644 (file)
@@ -24,6 +24,7 @@ public class SerializerInjector {
         MatchSerializerInjector.injectSerializers(provider);
         ActionSerializerInjector.injectSerializers(provider);
         InstructionSerializerInjector.injectSerializers(provider);
+        MultipartSerializerInjector.injectSerializers(provider);
         MessageSerializerInjector.injectSerializers(provider);
     }
 }
index 2d7cf3708d6267dbe98a3358f5133cf29f5bfd3c..d99feb7565f2d7be7e0adf7a8e86f70c3cb59675 100644 (file)
@@ -26,6 +26,7 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.impl.protocol.serialization.util.ActionUtil;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.InstructionUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.ActionList;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
@@ -193,12 +194,7 @@ public class FlowMessageSerializer extends AbstractMessageSerializer<FlowMessage
                         .map(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Instruction::getInstruction)
                         .filter(Objects::nonNull)
                         .map(i -> protocol.flatMap(p -> updateInstruction(i, p)).orElse(i))
-                        .forEach(i -> registry.<Instruction, OFSerializer<Instruction>>getSerializer(
-                                new MessageTypeKey<>(
-                                        EncodeConstants.OF13_VERSION_ID,
-                                        (Class<Instruction>) i.getImplementedInterface()))
-                                .serialize(i, outBuffer)
-                        ));
+                        .forEach(i -> InstructionUtil.writeInstruction(i, EncodeConstants.OF13_VERSION_ID, registry, outBuffer)));
     }
 
     /**
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestDescSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestDescSerializer.java
new file mode 100644 (file)
index 0000000..5733f5f
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestDescSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestExperimenterSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestExperimenterSerializer.java
new file mode 100644 (file)
index 0000000..9f62330
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import java.util.Optional;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ExperimenterSerializerKeyFactory;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
+import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
+import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter;
+
+public class MultipartRequestExperimenterSerializer implements OFSerializer<MultipartRequestBody>, SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestExperimenter multipartRequestExperimenter = MultipartRequestExperimenter
+            .class
+            .cast(multipartRequestBody);
+
+        try {
+            final OFSerializer<ExperimenterMessageOfChoice> serializer = registry
+                .getSerializer(new MessageTypeKey<>(
+                    EncodeConstants.OF13_VERSION_ID,
+                    multipartRequestExperimenter.getExperimenterMessageOfChoice().getImplementedInterface()));
+
+            serializer.serialize(multipartRequestExperimenter.getExperimenterMessageOfChoice(), byteBuf);
+        } catch (ClassCastException | IllegalStateException ex) {
+            Optional
+                .ofNullable(OFSessionUtil.getExtensionConvertorProvider().<ExperimenterMessageOfChoice, ExperimenterDataOfChoice>getMessageConverter(new TypeVersionKey<>(
+                    (Class<ExperimenterMessageOfChoice>)multipartRequestExperimenter.getExperimenterMessageOfChoice().getImplementedInterface(),
+                    OFConstants.OFP_VERSION_1_3)))
+                .ifPresent(converter -> {
+                    final OFSerializer<ExperimenterDataOfChoice> serializer = registry
+                        .getSerializer(ExperimenterSerializerKeyFactory
+                            .createMultipartRequestSerializerKey(
+                                EncodeConstants.OF13_VERSION_ID,
+                                converter.getExperimenterId().getValue(),
+                                converter.getType()));
+
+                    try {
+                        serializer.serialize(converter.convert(multipartRequestExperimenter.getExperimenterMessageOfChoice()), byteBuf);
+                    } catch (ConversionException e) {
+                        throw new IllegalStateException(e);
+                    }
+                });
+        }
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowAggregateStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowAggregateStatsSerializer.java
new file mode 100644 (file)
index 0000000..53c6762
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestFlowAggregateStatsSerializer implements OFSerializer<MultipartRequestBody>, SerializerRegistryInjector {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01 = 3;
+    private static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02 = 4;
+    private SerializerRegistry registry;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestFlowAggregateStats multipartRequestFlowAggregateStats = MultipartRequestFlowAggregateStats
+            .class
+            .cast(multipartRequestBody);
+
+        byteBuf.writeByte(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getTableId(), OFConstants.OFPTT_ALL).byteValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
+        byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getOutPort(), OFConstants.OFPP_ANY).intValue());
+        byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getOutGroup(), OFConstants.OFPG_ANY).intValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
+        byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getCookie(), new FlowCookie(OFConstants.DEFAULT_COOKIE)).getValue().longValue());
+        byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getCookieMask(), new FlowCookie(OFConstants.DEFAULT_COOKIE_MASK)).getValue().longValue());
+
+        registry.<Match, OFSerializer<Match>>getSerializer(
+            new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class))
+            .serialize(multipartRequestFlowAggregateStats.getMatch(), byteBuf);
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowStatsSerializer.java
new file mode 100644 (file)
index 0000000..bf150be
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestFlowStatsSerializer implements OFSerializer<MultipartRequestBody>, SerializerRegistryInjector {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01 = 3;
+    private static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02 = 4;
+    private SerializerRegistry registry;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestFlowStats multipartRequestFlowStats = MultipartRequestFlowStats
+            .class
+            .cast(multipartRequestBody);
+
+        byteBuf.writeByte(MoreObjects.firstNonNull(multipartRequestFlowStats.getTableId(), OFConstants.OFPTT_ALL).byteValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
+        byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowStats.getOutPort(), OFConstants.OFPP_ANY).intValue());
+        byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowStats.getOutGroup(), OFConstants.OFPG_ANY).intValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
+        byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowStats.getCookie(), new FlowCookie(OFConstants.DEFAULT_COOKIE)).getValue().longValue());
+        byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowStats.getCookieMask(), new FlowCookie(OFConstants.DEFAULT_COOKIE_MASK)).getValue().longValue());
+
+        registry.<Match, OFSerializer<Match>>getSerializer(
+            new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class))
+            .serialize(multipartRequestFlowStats.getMatch(), byteBuf);
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowTableStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestFlowTableStatsSerializer.java
new file mode 100644 (file)
index 0000000..c1bc804
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestFlowTableStatsSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupDescSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupDescSerializer.java
new file mode 100644 (file)
index 0000000..7bf868e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestGroupDescSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupFeaturesSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupFeaturesSerializer.java
new file mode 100644 (file)
index 0000000..3c7f7fa
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestGroupFeaturesSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestGroupStatsSerializer.java
new file mode 100644 (file)
index 0000000..b699996
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestGroupStatsSerializer implements OFSerializer<MultipartRequestBody> {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_GROUP_BODY = 4;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestGroupStats multipartRequestGroupStats = MultipartRequestGroupStats
+            .class
+            .cast(multipartRequestBody);
+
+        byteBuf.writeInt(MoreObjects
+            .firstNonNull(multipartRequestGroupStats.getGroupId(), new GroupId(OFConstants.OFPG_ALL))
+            .getValue().intValue());
+
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_GROUP_BODY);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializer.java
new file mode 100644 (file)
index 0000000..61081b2
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import java.util.Objects;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.messages.AbstractMessageSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.multipart.request.multipart.request.body.MultipartRequestFlowTableStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.request.multipart.request.body.MultipartRequestTableFeatures;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+public class MultipartRequestMessageSerializer extends AbstractMessageSerializer<MultipartRequest> implements SerializerRegistryInjector {
+    private static final byte PADDING_IN_MULTIPART_REQUEST_MESSAGE = 4;
+    private SerializerRegistry registry;
+
+    @Override
+    public void serialize(final MultipartRequest message, final ByteBuf outBuffer) {
+        final MultipartRequestBody multipartRequestBody = message.getMultipartRequestBody();
+        final MultipartType multipartType = getMultipartType(multipartRequestBody);
+
+        int index = outBuffer.writerIndex();
+        super.serialize(message, outBuffer);
+        outBuffer.writeShort(multipartType.getIntValue());
+        outBuffer.writeShort(ByteBufUtils.fillBitMask(0, message.isRequestMore()));
+        outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
+
+        final OFSerializer<MultipartRequestBody> serializer = registry
+            .getSerializer(new MessageTypeKey<>(
+                EncodeConstants.OF13_VERSION_ID,
+                multipartRequestBody.getImplementedInterface()));
+
+        serializer.serialize(multipartRequestBody, outBuffer);
+        outBuffer.setShort(index + 2, outBuffer.writerIndex() - index);
+    }
+
+    @Override
+    protected byte getMessageType() {
+        return 18;
+    }
+
+    private static MultipartType getMultipartType(final MultipartRequestBody multipartRequestBody) {
+        final Class<? extends DataContainer> clazz = multipartRequestBody.getImplementedInterface();
+
+        final MultipartType multipartType = MultipartRequestDesc.class.equals(clazz) ? MultipartType.OFPMPDESC
+            : MultipartRequestFlowTableStats.class.equals(clazz) ? MultipartType.OFPMPTABLE
+            : MultipartRequestGroupDesc.class.equals(clazz) ? MultipartType.OFPMPGROUPDESC
+            : MultipartRequestGroupFeatures.class.equals(clazz) ? MultipartType.OFPMPGROUPFEATURES
+            : MultipartRequestGroupStats.class.equals(clazz) ? MultipartType.OFPMPGROUP
+            : MultipartRequestMeterFeatures.class.equals(clazz) ? MultipartType.OFPMPMETERFEATURES
+            : MultipartRequestMeterStats.class.equals(clazz) ? MultipartType.OFPMPMETER
+            : MultipartRequestMeterConfig.class.equals(clazz) ? MultipartType.OFPMPMETERCONFIG
+            : MultipartRequestPortDesc.class.equals(clazz) ? MultipartType.OFPMPPORTDESC
+            : MultipartRequestPortStats.class.equals(clazz) ? MultipartType.OFPMPPORTSTATS
+            : MultipartRequestFlowStats.class.equals(clazz) ? MultipartType.OFPMPFLOW
+            : MultipartRequestFlowAggregateStats.class.equals(clazz) ? MultipartType.OFPMPAGGREGATE
+            : MultipartRequestTableFeatures.class.equals(clazz) ? MultipartType.OFPMPTABLEFEATURES
+            : MultipartRequestQueueStats.class.equals(clazz) ? MultipartType.OFPMPQUEUE
+            : MultipartRequestExperimenter.class.equals(clazz) ? MultipartType.OFPMPEXPERIMENTER
+            : null;
+
+        if (Objects.isNull(multipartType)) {
+            throw new IllegalArgumentException(clazz.toString() + " is not valid multipart type");
+        }
+
+        return multipartType;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterConfigSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterConfigSerializer.java
new file mode 100644 (file)
index 0000000..01c27c0
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestMeterConfigSerializer implements OFSerializer<MultipartRequestBody> {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY = 4;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestMeterConfig multipartRequestMeterConfig = MultipartRequestMeterConfig
+            .class
+            .cast(multipartRequestBody);
+
+        byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestMeterConfig.getMeterId(), new MeterId(OFConstants.OFPM_ALL))
+                .getValue().intValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterFeaturesSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterFeaturesSerializer.java
new file mode 100644 (file)
index 0000000..045f294
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestMeterFeaturesSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java
new file mode 100644 (file)
index 0000000..a962e7d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestMeterStatsSerializer implements OFSerializer<MultipartRequestBody> {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_METER_BODY = 4;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestMeterStats multipartRequestMeterStats = MultipartRequestMeterStats
+            .class
+            .cast(multipartRequestBody);
+
+        byteBuf.writeInt(MoreObjects
+            .firstNonNull(multipartRequestMeterStats.getMeterId(), new MeterId(OFConstants.OFPM_ALL)).getValue().intValue());
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortDescSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortDescSerializer.java
new file mode 100644 (file)
index 0000000..00dc4fe
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+
+public class MultipartRequestPortDescSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        // NOOP
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortStatsSerializer.java
new file mode 100644 (file)
index 0000000..a4a0a37
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import java.util.Objects;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
+import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats;
+
+public class MultipartRequestPortStatsSerializer implements OFSerializer<MultipartRequestBody> {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY = 4;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestPortStats multipartRequestPortStats = MultipartRequestPortStats
+            .class
+            .cast(multipartRequestBody);
+
+        if (Objects.isNull(multipartRequestPortStats.getNodeConnectorId())) {
+            byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
+        } else {
+            byteBuf.writeInt(InventoryDataServiceUtil
+                .portNumberfromNodeConnectorId(
+                    OpenflowVersion.OF13,
+                    multipartRequestPortStats.getNodeConnectorId()).intValue());
+        }
+
+        byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestQueueStatsSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestQueueStatsSerializer.java
new file mode 100644 (file)
index 0000000..120f6b0
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import com.google.common.base.MoreObjects;
+import io.netty.buffer.ByteBuf;
+import java.util.Objects;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
+import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats;
+
+public class MultipartRequestQueueStatsSerializer implements OFSerializer<MultipartRequestBody> {
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestQueueStats multipartRequestQueueStats = MultipartRequestQueueStats
+            .class
+            .cast(multipartRequestBody);
+
+        if (Objects.isNull(multipartRequestQueueStats.getNodeConnectorId())) {
+            byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
+        } else {
+            byteBuf.writeInt(InventoryDataServiceUtil
+                .portNumberfromNodeConnectorId(
+                    OpenflowVersion.OF13,
+                    multipartRequestQueueStats.getNodeConnectorId()).intValue());
+        }
+
+        byteBuf.writeInt(MoreObjects
+            .firstNonNull(multipartRequestQueueStats.getQueueId(), new QueueId(OFConstants.OFPQ_ALL)).getValue().intValue());
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestTableFeaturesSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestTableFeaturesSerializer.java
new file mode 100644 (file)
index 0000000..5fb6f5b
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import io.netty.buffer.ByteBuf;
+import java.util.Objects;
+import java.util.Optional;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.request.multipart.request.body.MultipartRequestTableFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TableProperties;
+
+public class MultipartRequestTableFeaturesSerializer implements OFSerializer<MultipartRequestBody>, SerializerRegistryInjector {
+
+    private static final byte PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY = 5;
+    private SerializerRegistry registry;
+
+    @Override
+    public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
+        final MultipartRequestTableFeatures multipartRequestTableFeatures = MultipartRequestTableFeatures
+            .class
+            .cast(multipartRequestBody);
+
+        Optional
+            .ofNullable(multipartRequestTableFeatures.getTableFeatures())
+            .ifPresent(tableFeatures -> tableFeatures
+                .stream()
+                .filter(Objects::nonNull)
+                .forEach(tableFeature -> {
+                    final int featureIndex = byteBuf.writerIndex();
+                    byteBuf.writeShort(EncodeConstants.EMPTY_LENGTH);
+                    byteBuf.writeByte(tableFeature.getTableId().byteValue());
+                    byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY);
+                    byteBuf.writeBytes(tableFeature.getName().getBytes());
+                    byteBuf.writeZero(32 - tableFeature.getName().getBytes().length);
+                    byteBuf.writeLong(tableFeature.getMetadataMatch().longValue());
+                    byteBuf.writeLong(tableFeature.getMetadataWrite().longValue());
+                    byteBuf.writeInt(ByteBufUtils.fillBitMask(0, tableFeature.getConfig().isDEPRECATEDMASK()));
+                    byteBuf.writeInt(tableFeature.getMaxEntries().intValue());
+                    serializeProperties(tableFeature.getTableProperties(), byteBuf);
+                    byteBuf.setShort(featureIndex, byteBuf.writerIndex() - featureIndex);
+                }));
+    }
+
+    @SuppressWarnings("unchecked")
+    private void serializeProperties(final TableProperties tableProperties, final ByteBuf byteBuf) {
+        Optional
+            .ofNullable(tableProperties)
+            .flatMap(properties -> Optional.ofNullable(properties.getTableFeatureProperties()))
+            .ifPresent(properties -> properties
+                .stream()
+                .filter(Objects::nonNull)
+                .forEach(property -> {
+                    final Class<? extends TableFeaturePropType> clazz = (Class<? extends TableFeaturePropType>) property
+                        .getTableFeaturePropType()
+                        .getImplementedInterface();
+
+                    registry.
+                        <TableFeaturePropType, OFSerializer<TableFeaturePropType>>getSerializer(
+                            new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, clazz))
+                        .serialize(property.getTableFeaturePropType(), byteBuf);
+                }));
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/AbstractTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/AbstractTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..349ae34
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
+
+public abstract class AbstractTablePropertySerializer<T extends TableFeaturePropType> implements OFSerializer<TableFeaturePropType> {
+
+    @Override
+    public void serialize(final TableFeaturePropType tableFeaturePropType, final ByteBuf byteBuf) {
+        final int startIndex = byteBuf.writerIndex();
+        byteBuf.writeShort(getType().getIntValue());
+        final int lengthIndex = byteBuf.writerIndex();
+        byteBuf.writeShort(EncodeConstants.EMPTY_LENGTH);
+
+        serializeProperty(getClazz().cast(tableFeaturePropType), byteBuf);
+
+        final int length = byteBuf.writerIndex() - startIndex;
+        byteBuf.setShort(lengthIndex, length);
+
+        int paddingRemainder = length % EncodeConstants.PADDING;
+        int padding = 0;
+
+        if (paddingRemainder != 0) {
+            padding = EncodeConstants.PADDING - paddingRemainder;
+        }
+
+        byteBuf.writeZero(padding);
+    }
+
+    protected abstract void serializeProperty(final T property, final ByteBuf byteBuf);
+    protected abstract TableFeaturesPropType getType();
+    protected abstract Class<T> getClazz();
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..bbe617f
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.ActionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss;
+
+public class ApplyActionsMissTablePropertySerializer extends AbstractTablePropertySerializer<ApplyActionsMiss> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final ApplyActionsMiss property, final ByteBuf byteBuf) {
+        property
+            .getApplyActionsMiss()
+            .getAction()
+            .stream()
+            .map(Action::getAction)
+            .forEach(action -> ActionUtil
+                .writeActionHeader(
+                    action,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS;
+    }
+
+    @Override
+    protected Class<ApplyActionsMiss> getClazz() {
+        return ApplyActionsMiss.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplyActionsTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..2275479
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.ActionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions;
+
+public class ApplyActionsTablePropertySerializer extends AbstractTablePropertySerializer<ApplyActions> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final ApplyActions property, final ByteBuf byteBuf) {
+        property
+            .getApplyActions()
+            .getAction()
+            .stream()
+            .map(Action::getAction)
+            .forEach(action -> ActionUtil
+                .writeActionHeader(
+                    action,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTAPPLYACTIONS;
+    }
+
+    @Override
+    protected Class<ApplyActions> getClazz() {
+        return ApplyActions.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..ba79674
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss;
+
+public class ApplySetfieldMissTablePropertySerializer extends AbstractTablePropertySerializer<ApplySetfieldMiss> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final ApplySetfieldMiss property, final ByteBuf byteBuf) {
+        property
+            .getApplySetfieldMiss()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS;
+    }
+
+    @Override
+    protected Class<ApplySetfieldMiss> getClazz() {
+        return ApplySetfieldMiss.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/ApplySetfieldTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..4767f79
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield;
+
+public class ApplySetfieldTablePropertySerializer extends AbstractTablePropertySerializer<ApplySetfield> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final ApplySetfield property, final ByteBuf byteBuf) {
+        property
+            .getApplySetfield()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTAPPLYSETFIELD;
+    }
+
+    @Override
+    protected Class<ApplySetfield> getClazz() {
+        return ApplySetfield.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..d5b1e97
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.InstructionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Instruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss;
+
+public class InstructionsMissTablePropertySerializer extends AbstractTablePropertySerializer<InstructionsMiss> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final InstructionsMiss property, final ByteBuf byteBuf) {
+        property
+            .getInstructionsMiss()
+            .getInstruction()
+            .stream()
+            .map(Instruction::getInstruction)
+            .forEach(instruction -> InstructionUtil
+                .writeInstructionHeader(
+                    instruction,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS;
+    }
+
+    @Override
+    protected Class<InstructionsMiss> getClazz() {
+        return InstructionsMiss.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/InstructionsTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..f5dcf71
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.InstructionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Instruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Instructions;
+
+public class InstructionsTablePropertySerializer extends AbstractTablePropertySerializer<Instructions> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final Instructions property, final ByteBuf byteBuf) {
+        property
+            .getInstructions()
+            .getInstruction()
+            .stream()
+            .map(Instruction::getInstruction)
+            .forEach(instruction -> InstructionUtil
+                .writeInstructionHeader(
+                    instruction,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTINSTRUCTIONS;
+    }
+
+    @Override
+    protected Class<Instructions> getClazz() {
+        return Instructions.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/MatchTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/MatchTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..06d5e5d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match;
+
+public class MatchTablePropertySerializer extends AbstractTablePropertySerializer<Match> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final Match property, final ByteBuf byteBuf) {
+        property
+            .getMatchSetfield()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTMATCH;
+    }
+
+    @Override
+    protected Class<Match> getClazz() {
+        return Match.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..64621de
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss;
+
+public class NextTableMissTablePropertySerializer extends AbstractTablePropertySerializer<NextTableMiss> {
+
+    @Override
+    protected void serializeProperty(final NextTableMiss property, final ByteBuf byteBuf) {
+        property
+            .getTablesMiss()
+            .getTableIds()
+            .forEach(byteBuf::writeByte);
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTNEXTTABLESMISS;
+    }
+
+    @Override
+    protected Class<NextTableMiss> getClazz() {
+        return NextTableMiss.class;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/NextTableTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..de1e41c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTable;
+
+public class NextTableTablePropertySerializer extends AbstractTablePropertySerializer<NextTable> {
+
+    @Override
+    protected void serializeProperty(final NextTable property, final ByteBuf byteBuf) {
+        property
+            .getTables()
+            .getTableIds()
+            .forEach(byteBuf::writeByte);
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTNEXTTABLES;
+    }
+
+    @Override
+    protected Class<NextTable> getClazz() {
+        return NextTable.class;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WildcardsTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WildcardsTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..9bc5953
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards;
+
+public class WildcardsTablePropertySerializer extends AbstractTablePropertySerializer<Wildcards> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final Wildcards property, final ByteBuf byteBuf) {
+        property
+            .getWildcardSetfield()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTWILDCARDS;
+    }
+
+    @Override
+    protected Class<Wildcards> getClazz() {
+        return Wildcards.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..7869880
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.ActionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss;
+
+public class WriteActionsMissTablePropertySerializer extends AbstractTablePropertySerializer<WriteActionsMiss> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final WriteActionsMiss property, final ByteBuf byteBuf) {
+        property
+            .getWriteActionsMiss()
+            .getAction()
+            .stream()
+            .map(Action::getAction)
+            .forEach(action -> ActionUtil
+                .writeActionHeader(
+                    action,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS;
+    }
+
+    @Override
+    protected Class<WriteActionsMiss> getClazz() {
+        return WriteActionsMiss.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteActionsTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..0556941
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.util.ActionUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActions;
+
+public class WriteActionsTablePropertySerializer extends AbstractTablePropertySerializer<WriteActions> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final WriteActions property, final ByteBuf byteBuf) {
+        property
+            .getWriteActions()
+            .getAction()
+            .stream()
+            .map(Action::getAction)
+            .forEach(action -> ActionUtil
+                .writeActionHeader(
+                    action,
+                    EncodeConstants.OF13_VERSION_ID,
+                    registry,
+                    byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTWRITEACTIONS;
+    }
+
+    @Override
+    protected Class<WriteActions> getClazz() {
+        return WriteActions.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldMissTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldMissTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..bd64f14
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMiss;
+
+public class WriteSetfieldMissTablePropertySerializer extends AbstractTablePropertySerializer<WriteSetfieldMiss> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final WriteSetfieldMiss property, final ByteBuf byteBuf) {
+        property
+            .getWriteSetfieldMiss()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS;
+    }
+
+    @Override
+    protected Class<WriteSetfieldMiss> getClazz() {
+        return WriteSetfieldMiss.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldTablePropertySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/WriteSetfieldTablePropertySerializer.java
new file mode 100644 (file)
index 0000000..043fe7e
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield;
+
+public class WriteSetfieldTablePropertySerializer extends AbstractTablePropertySerializer<WriteSetfield> implements SerializerRegistryInjector {
+
+    private SerializerRegistry registry;
+
+    @Override
+    protected void serializeProperty(final WriteSetfield property, final ByteBuf byteBuf) {
+        property
+            .getWriteSetfield()
+            .getSetFieldMatch()
+            .forEach(setFieldMatch -> registry
+                .<MatchField, OFSerializer<SetFieldMatch>>getSerializer(
+                    new MessageTypeKey<>(
+                        EncodeConstants.OF13_VERSION_ID,
+                        setFieldMatch.getMatchType()))
+                .serialize(setFieldMatch, byteBuf));
+    }
+
+    @Override
+    protected TableFeaturesPropType getType() {
+        return TableFeaturesPropType.OFPTFPTWRITESETFIELD;
+    }
+
+    @Override
+    protected Class<WriteSetfield> getClazz() {
+        return WriteSetfield.class;
+    }
+
+    @Override
+    public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
+        registry = serializerRegistry;
+    }
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/AbstractMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/AbstractMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..5e71323
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
+
+public abstract class AbstractMatchFieldSerializer implements OFSerializer<SetFieldMatch> {
+
+    @Override
+    public void serialize(final SetFieldMatch setFieldMatch, final ByteBuf byteBuf) {
+        byteBuf.writeShort(getOxmClassCode());
+
+        int fieldAndMask = getOxmFieldCode() << 1;
+        int length = getValueLength();
+
+        if (setFieldMatch.isHasMask()) {
+            fieldAndMask |= 1;
+            length *= 2;
+        }
+
+        byteBuf.writeByte(fieldAndMask);
+        byteBuf.writeByte(length);
+    }
+
+    protected abstract int getOxmClassCode();
+    protected abstract int getOxmFieldCode();
+    protected abstract int getValueLength();
+
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpOpMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpOpMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..31004bb
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class ArpOpMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ARP_OP;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpShaMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpShaMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..ae74abe
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class ArpShaMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ARP_SHA;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpSpaMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpSpaMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..305f4b8
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class ArpSpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ARP_SPA;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpThaMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpThaMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..2a93130
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class ArpThaMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ARP_THA;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpTpaMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/ArpTpaMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..d3ac917
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class ArpTpaMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ARP_TPA;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthDstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthDstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..fb85740
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class EthDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ETH_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthSrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthSrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..aa1927b
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class EthSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ETH_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthTypeMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/EthTypeMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..8c18274
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class EthTypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ETH_TYPE;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4CodeMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4CodeMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..6d7b19d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Icmpv4CodeMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ICMPV4_CODE;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4TypeMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv4TypeMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..7947f44
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Icmpv4TypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ICMPV4_TYPE;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6CodeMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6CodeMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..d6b8a4b
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Icmpv6CodeMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ICMPV6_CODE;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6TypeMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Icmpv6TypeMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..53e092f
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Icmpv6TypeMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.ICMPV6_TYPE;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPhyPortMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPhyPortMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..65355cf
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class InPhyPortMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IN_PHY_PORT;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPortMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/InPortMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..059be6d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class InPortMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IN_PORT;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpDscpMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpDscpMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..203d027
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class IpDscpMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IP_DSCP;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpEcnMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpEcnMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..211a9fd
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class IpEcnMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IP_ECN;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpProtoMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/IpProtoMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..b525109
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class IpProtoMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IP_PROTO;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4DstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4DstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..65bf2e8
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv4DstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV4_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4SrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv4SrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..25dc1ce
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv4SrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV4_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6DstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6DstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..5e6a5cd
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6DstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6ExtHdrMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6ExtHdrMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..aa1b50d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6ExtHdrMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_EXTHDR;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6FlabelMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6FlabelMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..20d813c
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6FlabelMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_FLABEL;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdSllMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdSllMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..b6403bb
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6NdSllMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_ND_SLL;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTargetMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTargetMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..723a937
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6NdTargetMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_ND_TARGET;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTllMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6NdTllMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..449612c
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6NdTllMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_ND_TLL;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.MAC_ADDRESS_LENGTH;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6SrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/Ipv6SrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..a7ea272
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class Ipv6SrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.IPV6_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MetadataMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MetadataMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..9cfacf9
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class MetadataMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.METADATA;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsBosMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsBosMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..8d043f8
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class MplsBosMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.MPLS_BOS;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsLabelMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsLabelMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..0127250
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class MplsLabelMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.MPLS_LABEL;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsTcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/MplsTcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..2b4b024
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class MplsTcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.MPLS_TC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/PbbIsidMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/PbbIsidMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..6378291
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class PbbIsidMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.PBB_ISID;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_3_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpDstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpDstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..3b9f3aa
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class SctpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.SCTP_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpSrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/SctpSrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..b929f40
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class SctpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.SCTP_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpDstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpDstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..585ef9d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class TcpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.TCP_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpFlagsMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpFlagsMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..b492eb3
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class TcpFlagsMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.EXPERIMENTER_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return EncodeConstants.ONFOXM_ET_TCP_FLAGS;
+    }
+
+    @Override
+    protected int getValueLength() {
+        // Increase length by experimenter ID length
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES + EncodeConstants.SIZE_OF_INT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpSrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TcpSrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..f04a031
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class TcpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.TCP_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TunnelIdMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/TunnelIdMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..96edb9f
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class TunnelIdMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.TUNNEL_ID;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpDstMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpDstMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..43e7fb3
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class UdpDstMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.UDP_DST;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpSrcMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/UdpSrcMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..265cc56
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class UdpSrcMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.UDP_SRC;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanPcpMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanPcpMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..0aa22ef
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class VlanPcpMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.VLAN_PCP;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
+    }
+}
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanVidMatchFieldSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/tablefeatures/matchfield/VlanVidMatchFieldSerializer.java
new file mode 100644 (file)
index 0000000..2f7f50e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+
+public class VlanVidMatchFieldSerializer extends AbstractMatchFieldSerializer {
+    @Override
+    protected int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
+
+    @Override
+    protected int getOxmFieldCode() {
+        return OxmMatchConstants.VLAN_VID;
+    }
+
+    @Override
+    protected int getValueLength() {
+        return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
+    }
+}
index f2bc24bf8f4521df185627c2430f41df9b4c0a92..6478b0e1fbd155a595baf8e4f994b80d93e62790 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.collect.Ordering;
 import io.netty.buffer.ByteBuf;
 import java.util.List;
 import java.util.Optional;
+import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
@@ -86,6 +87,45 @@ public class ActionUtil {
         }
     }
 
+    /**
+     * Serialize OpenFlow action header, using extension converter if available
+     * TODO: Remove also extension converters
+     *
+     * @param action    OpenFlowPlugin action
+     * @param version   OpenFlow version
+     * @param registry  serializer registry
+     * @param outBuffer output buffer
+     */
+    @SuppressWarnings("unchecked")
+    public static void writeActionHeader(Action action, short version, SerializerRegistry registry, ByteBuf outBuffer) {
+        try {
+            Optional.ofNullable(OFSessionUtil.getExtensionConvertorProvider())
+                .flatMap(provider ->
+                    (GeneralExtensionGrouping.class.isInstance(action)
+                        ? convertExtensionGrouping(provider, action, version)
+                        : convertGenericAction(provider, action, version))
+                        .map(ofjAction -> {
+                            final HeaderSerializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common
+                                .action.rev150203.actions.grouping.Action> serializer = registry
+                                .getSerializer(TypeKeyMakerFactory.createActionKeyMaker(version)
+                                    .make(ofjAction));
+
+                            serializer.serializeHeader(ofjAction, outBuffer);
+                            return action;
+                        })
+                ).orElseGet(() -> {
+                final HeaderSerializer<Action> serializer = registry.getSerializer(
+                    new MessageTypeKey<>(
+                        version, (Class<? extends Action>) action.getImplementedInterface()));
+
+                serializer.serializeHeader(action, outBuffer);
+                return action;
+            });
+        } catch (final IllegalStateException | ClassCastException e) {
+            LOG.warn("Header Serializer for action {} for version {} not found.", action.getImplementedInterface(), version);
+        }
+    }
+
     /**
      * Try to convert action that implements #{@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionGrouping}
      * to OpenFlowJava action
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/util/InstructionUtil.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/util/InstructionUtil.java
new file mode 100644 (file)
index 0000000..bd5de02
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.util;
+
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
+
+/**
+ * Utility class for instruction serialization
+ */
+public class InstructionUtil {
+
+    /**
+     * Serialize instruction
+     * @param instruction OpenFlow instruction
+     * @param version OpenFlow version
+     * @param registry OpenFlowJava serializer registry
+     * @param outBuffer output buffer
+     */
+    @SuppressWarnings("unchecked")
+    public static void writeInstruction(final Instruction instruction,
+                                        final short version,
+                                        final SerializerRegistry registry,
+                                        final ByteBuf outBuffer) {
+
+        registry.<Instruction, OFSerializer<Instruction>>getSerializer(
+            new MessageTypeKey<>(
+                EncodeConstants.OF13_VERSION_ID,
+                (Class<Instruction>) instruction.getImplementedInterface()))
+            .serialize(instruction, outBuffer);
+    }
+
+
+    /**
+     * Serialize instruction header
+     * @param instruction OpenFlow instruction
+     * @param version OpenFlow version
+     * @param registry OpenFlowJava serializer registry
+     * @param outBuffer output buffer
+     */
+    @SuppressWarnings("unchecked")
+    public static void writeInstructionHeader(final Instruction instruction,
+                                              final short version,
+                                              final SerializerRegistry registry,
+                                              final ByteBuf outBuffer) {
+
+        registry.<Instruction, HeaderSerializer<Instruction>>getSerializer(
+            new MessageTypeKey<>(
+                EncodeConstants.OF13_VERSION_ID,
+                (Class<Instruction>) instruction.getImplementedInterface()))
+            .serializeHeader(instruction, outBuffer);
+    }
+
+}
index 2c3db2a49820223f3427807913c262ffa726aa86..2bb0cbee8d6b9b4eb9fa6ac5f014dbe1c2f1c429 100644 (file)
@@ -203,7 +203,7 @@ class RpcContextImpl implements RpcContext {
 
         MdSalRegistrationUtils.registerServices(this, deviceContext, extensionConverterProvider, convertorExecutor);
 
-        if (isStatisticsRpcEnabled) {
+        if (isStatisticsRpcEnabled && !deviceContext.canUseSingleLayerSerialization()) {
             MdSalRegistrationUtils.registerStatCompatibilityServices(
                     this,
                     deviceContext,
index a1a93a3755a0c5f8dcf8ec6a4824cb3d79f62218..2378352515456ed5729123abcbf87be23f7cb621 100644 (file)
@@ -25,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.M
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeatures;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
index 5bb18eb70d14374793a1ff0853eb1c5f29d915b8..ab386259ec3565e1fda34cb99fb2e154f2e66077 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield;
diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializerTest.java
new file mode 100644 (file)
index 0000000..2a60b26
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
+
+import static org.junit.Assert.assertEquals;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.openflowplugin.impl.protocol.serialization.AbstractSerializerTest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDescBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequestBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
+
+public class MultipartRequestMessageSerializerTest extends AbstractSerializerTest {
+    // Multipart request message constants
+    private static final byte PADDING_IN_MULTIPART_REQUEST_MESSAGE = 4;
+    private static final short LENGTH = 16;
+    private static final Long XID = 42L;
+    private static final short VERSION = EncodeConstants.OF13_VERSION_ID;
+    private static final boolean IS_REQUEST_MORE = false;
+    private static final MultipartType MULTIPART_TYPE = MultipartType.OFPMPDESC;
+    private static final int MESSAGE_TYPE = 18;
+
+    // Message
+    private static final MultipartRequest MESSAGE = new MultipartRequestBuilder()
+            .setRequestMore(IS_REQUEST_MORE)
+            .setXid(XID)
+            .setVersion(VERSION)
+            .setMultipartRequestBody(new MultipartRequestDescBuilder()
+                    .build())
+            .build();
+
+    private MultipartRequestMessageSerializer serializer;
+
+
+    @Override
+    protected void init() {
+        serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, MultipartRequest.class)) ;
+    }
+
+    @Test
+    public void testSerialize() throws Exception {
+        final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
+        serializer.serialize(MESSAGE, out);
+
+        // Header
+        assertEquals(out.readByte(), VERSION);
+        assertEquals(out.readByte(), MESSAGE_TYPE);
+        assertEquals(out.readUnsignedShort(), LENGTH);
+        assertEquals(out.readInt(), XID.intValue());
+
+        // Body
+        assertEquals(out.readShort(), MULTIPART_TYPE.getIntValue());
+        assertEquals(out.readUnsignedShort(), ByteBufUtils.fillBitMask(0, IS_REQUEST_MORE));
+        out.skipBytes(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
+
+        assertEquals(out.readableBytes(), 0);
+    }
+
+}
\ No newline at end of file