From da2605822607c263805a83778cc5311eb5484816 Mon Sep 17 00:00:00 2001 From: Michal Rehak Date: Fri, 27 Mar 2015 16:24:20 +0100 Subject: [PATCH] cleanup constants - added comments - renamed reserved qroup id (ANY -> ALL) Change-Id: I07a47278bd3dc2e53c3068a0642aae6a34c26add Signed-off-by: Michal Rehak --- .../openflowplugin/api/OFConstants.java | 20 ++++++++++++++----- .../common/MultipartRequestInputFactory.java | 2 +- ...pendaylightQueueStatisticsServiceImpl.java | 6 +++--- .../md/core/sal/OFRpcTaskFactory.java | 10 +++++----- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java index 1dfb4fa16d..f405a9dcd1 100644 --- a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java +++ b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java @@ -18,11 +18,11 @@ public final class OFConstants { throw new UnsupportedOperationException("OF plugin Constants holder class"); } - /** reserved port: process with normal L2/L3 switching */ + /** enum ofp_port_no, reserved port: process with normal L2/L3 switching */ public static final short OFPP_NORMAL = ((short)0xfffa); - /** reserved port: all physical ports except input port */ + /** enum ofp_port_no, reserved port: all physical ports except input port */ public static final short OFPP_ALL = ((short)0xfffc); - /** reserved port: local openflow port */ + /** enum ofp_port_no, reserved port: local openflow port */ public static final short OFPP_LOCAL = ((short)0xfffe); @@ -33,14 +33,24 @@ public final class OFConstants { public final static String OF_URI_PREFIX = "openflow:"; + /** enum ofp_table: Table numbering, wildcard table used for table config, flow stats and flow deletes. */ public static final Short OFPTT_ALL = 0xff; - public static final Long ANY = Long.parseLong("ffffffff", 16); + public static final Long ANY = 0xffffffffL; + /** Wildcard port used only for flow mod (delete) and flow stats requests. Selects + * all flows regardless of output port (including flows with no output port).*/ public static final Long OFPP_ANY = ANY; + /** enum ofp_group: For OFPFC_DELETE* commands, require matching entries to include this as an + * output group. A value of OFPG_ANY indicates no restriction. */ public static final Long OFPG_ANY = ANY; - public static final Long OFPQ_ANY = ANY; + /** Refers to all queues configured at the specified port. */ + public static final Long OFPQ_ALL = ANY; public static final BigInteger DEFAULT_COOKIE = BigInteger.ZERO; public static final BigInteger DEFAULT_COOKIE_MASK = BigInteger.ZERO; + /** indicates that no buffering should be applied and the whole packet is to be + * sent to the controller. */ public static final Long OFP_NO_BUFFER = 0xffffffffL; + /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be + * sent to the controller. */ public static final Integer OFPCML_NO_BUFFER = 0xffff; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartRequestInputFactory.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartRequestInputFactory.java index a90ca5515a..96c9f82251 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartRequestInputFactory.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartRequestInputFactory.java @@ -191,7 +191,7 @@ public final class MultipartRequestInputFactory { MultipartRequestQueueCaseBuilder multipartRequestQueueCaseBuilder = new MultipartRequestQueueCaseBuilder(); MultipartRequestQueueBuilder multipartRequestQueueBuilder = new MultipartRequestQueueBuilder(); multipartRequestQueueBuilder.setPortNo(OFConstants.OFPP_ANY); - multipartRequestQueueBuilder.setQueueId(OFConstants.OFPQ_ANY); + multipartRequestQueueBuilder.setQueueId(OFConstants.OFPQ_ALL); multipartRequestQueueCaseBuilder.setMultipartRequestQueue(multipartRequestQueueBuilder.build()); return multipartRequestQueueCaseBuilder.build(); case OFPMPGROUP: diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImpl.java index e8bbc48f68..9d5c67c837 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightQueueStatisticsServiceImpl.java @@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.impl.statistics.services; import com.google.common.base.Function; import com.google.common.util.concurrent.JdkFutureAdapters; import com.google.common.util.concurrent.ListenableFuture; +import java.util.concurrent.Future; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -31,7 +32,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216. import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService; import org.opendaylight.yangtools.yang.common.RpcResult; -import java.util.concurrent.Future; /** * @author joe @@ -57,7 +57,7 @@ public class OpendaylightQueueStatisticsServiceImpl extends CommonService implem // Select all ports mprQueueBuilder.setPortNo(OFConstants.OFPP_ANY); // Select all the ports - mprQueueBuilder.setQueueId(OFConstants.OFPQ_ANY); + mprQueueBuilder.setQueueId(OFConstants.OFPQ_ALL); caseBuilder.setMultipartRequestQueue(mprQueueBuilder.build()); // Set request body to main multipart request @@ -86,7 +86,7 @@ public class OpendaylightQueueStatisticsServiceImpl extends CommonService implem MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder(); MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder(); // Select all queues - mprQueueBuilder.setQueueId(OFConstants.OFPQ_ANY); + mprQueueBuilder.setQueueId(OFConstants.OFPQ_ALL); // Select specific port mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId( OpenflowVersion.get(version), input.getNodeConnectorId())); diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java index 226562f2fd..e5163f0706 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java @@ -185,7 +185,7 @@ public abstract class OFRpcTaskFactory { private OFRpcTaskFactory() { // hiding implicit constructor } - + /** * @param taskContext * @param input @@ -1272,7 +1272,7 @@ public abstract class OFRpcTaskFactory { createGetAllNodeConnectorsStatisticsTask( final OFRpcTaskContext taskContext, final GetAllNodeConnectorsStatisticsInput input, SwitchConnectionDistinguisher cookie) { - class OFRpcTaskImpl extends OFRpcTask> { + class OFRpcTaskImpl extends OFRpcTask> { public OFRpcTaskImpl(OFRpcTaskContext taskContext, SwitchConnectionDistinguisher cookie, GetAllNodeConnectorsStatisticsInput input) { @@ -1788,8 +1788,8 @@ public abstract class OFRpcTaskFactory { MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder(); // Select all ports mprQueueBuilder.setPortNo(OFConstants.OFPP_ANY); - // Select all the ports - mprQueueBuilder.setQueueId(OFConstants.OFPQ_ANY); + // Select all the queues + mprQueueBuilder.setQueueId(OFConstants.OFPQ_ALL); caseBuilder.setMultipartRequestQueue(mprQueueBuilder.build()); // Set request body to main multipart request @@ -1841,7 +1841,7 @@ public abstract class OFRpcTaskFactory { MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder(); MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder(); // Select all queues - mprQueueBuilder.setQueueId(OFConstants.OFPQ_ANY); + mprQueueBuilder.setQueueId(OFConstants.OFPQ_ALL); // Select specific port mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId( OpenflowVersion.get(taskContext.getSession().getFeatures().getVersion()), -- 2.36.6