*/
package org.opendaylight.openflowplugin.openflow.md.core.translator;
+import java.math.BigInteger;
+import java.util.Collections;
+import java.util.List;
import org.opendaylight.openflowplugin.api.openflow.md.core.IMDMessageTranslator;
import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.math.BigInteger;
-import java.util.Collections;
-import java.util.List;
/**
* translates packetIn from OF-API model to MD-SAL model, supports OF-1.3
*/
public class PacketInTranslator implements IMDMessageTranslator<OfHeader, List<DataObject>> {
- protected static final Logger LOG = LoggerFactory
+ private static final Logger LOG = LoggerFactory
.getLogger(PacketInTranslator.class);
@Override
if (message.getMatch() != null && message.getMatch().getMatchEntry() != null) {
List<MatchEntry> entries = message.getMatch().getMatchEntry();
for (MatchEntry entry : entries) {
- InPortCase inPortCase = ((InPortCase) entry.getMatchEntryValue());
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPort inPort = inPortCase.getInPort();
- if (inPort != null) {
- if (port == null) {
+ if(InPortCase.class.equals(entry.getMatchEntryValue().getImplementedInterface())) {
+ InPortCase inPortCase = ((InPortCase) entry.getMatchEntryValue());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPort inPort = inPortCase.getInPort();
+ if (inPort != null) {
port = inPort.getPortNumber().getValue();
- } else {
- LOG.warn("Multiple input ports discovered when walking through match entries (at least {} and {})",
- port, inPort.getPortNumber().getValue());
+ break;
}
}
}