import java.util.List;
import java.util.Optional;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
+import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
+import org.opendaylight.openflowplugin.impl.util.GroupUtil;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.FlowStatsResponseConvertorData;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData;
import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
return;
}
+ FlowStatsResponseConvertorData flowData = new FlowStatsResponseConvertorData(data.getVersion());
+ flowData.setDatapathId(data.getDatapathId());
+ flowData.setMatchPath(MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
FlowsStatisticsUpdateBuilder message = new FlowsStatisticsUpdateBuilder();
message.setId(node);
message.setMoreReplies(mpReply.getFlags().isOFPMPFREQMORE());
MultipartReplyFlowCase caseBody = (MultipartReplyFlowCase) mpReply.getMultipartReplyBody();
MultipartReplyFlow replyBody = caseBody.getMultipartReplyFlow();
final Optional<List<FlowAndStatisticsMapList>> flowAndStatisticsMapLists =
- convertorExecutor.convert(replyBody.getFlowStats(), data);
+ convertorExecutor.convert(replyBody.getFlowStats(), flowData);
message.setFlowAndStatisticsMapList(flowAndStatisticsMapLists.orElse(Collections.emptyList()));
message.setGroupCapabilitiesSupported(supportedCapabilities);
- message.setActions(getGroupActionsSupportBitmap(replyBody.getActionsBitmap()));
+ message.setActions(GroupUtil.extractGroupActionsSupportBitmap(replyBody.getActionsBitmap()));
listDataObject.add(message.build());
}
BigInteger bigIntXid = BigInteger.valueOf(xid);
return new TransactionId(bigIntXid);
}
-
- /*
- * Method returns the bitmap of actions supported by each group.
- *
- * @param actionsSupported
- * @return
- */
- static List<Long> getGroupActionsSupportBitmap(final List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType> actionsSupported) {
- List<Long> supportActionByGroups = new ArrayList<Long>();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType supportedActions : actionsSupported) {
- long supportActionBitmap = 0;
- supportActionBitmap |= supportedActions.isOFPATOUTPUT() ? (1 << 0) : 0;
- supportActionBitmap |= supportedActions.isOFPATCOPYTTLOUT() ? (1 << 11) : 0;
- supportActionBitmap |= supportedActions.isOFPATCOPYTTLIN() ? (1 << 12) : 0;
- supportActionBitmap |= supportedActions.isOFPATSETMPLSTTL() ? (1 << 15) : 0;
- supportActionBitmap |= supportedActions.isOFPATDECMPLSTTL() ? (1 << 16) : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHVLAN() ? (1 << 17) : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPVLAN() ? (1 << 18) : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHMPLS() ? (1 << 19) : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPMPLS() ? (1 << 20) : 0;
- supportActionBitmap |= supportedActions.isOFPATSETQUEUE() ? (1 << 21) : 0;
- supportActionBitmap |= supportedActions.isOFPATGROUP() ? (1 << 22) : 0;
- supportActionBitmap |= supportedActions.isOFPATSETNWTTL() ? (1 << 23) : 0;
- supportActionBitmap |= supportedActions.isOFPATDECNWTTL() ? (1 << 24) : 0;
- supportActionBitmap |= supportedActions.isOFPATSETFIELD() ? (1 << 25) : 0;
- supportActionBitmap |= supportedActions.isOFPATPUSHPBB() ? (1 << 26) : 0;
- supportActionBitmap |= supportedActions.isOFPATPOPPBB() ? (1 << 27) : 0;
- supportActionByGroups.add(Long.valueOf(supportActionBitmap));
- }
- return supportActionByGroups;
- }
-
}