Added the BufferId value on PacketIn. 48/10048/2
authorAndré Martins <aanm@ua.pt>
Mon, 18 Aug 2014 23:07:54 +0000 (00:07 +0100)
committerAndré Martins <aanm@ua.pt>
Mon, 18 Aug 2014 23:20:57 +0000 (00:20 +0100)
Depends on https://git.opendaylight.org/gerrit/#/c/9968/

Change-Id: I5f5eb93d9ed6383839103989121a99bc0841f428
Signed-off-by: André Martins <aanm@ua.pt>
drop-test/src/main/java/org/opendaylight/openflowplugin/outputtest/OutputTestCommandProvider.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PacketOutConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/translator/PacketInTranslator.java

index 84d0f17977a020209924004075fbb73069d4e92e..ed60bb4a198e1576ce5b8b6511f67bffcd39ca44 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.BufferId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder;
@@ -138,7 +139,7 @@ public class OutputTestCommandProvider implements CommandProvider {
             packet_out.setNode(ref);
             packet_out.setIngress(nIngressConRef);
             packet_out.setEgress(nEngressConRef);
-            packet_out.setBufferId(Long.valueOf(0xffffffffL));
+            packet_out.setBufferId(new BufferId(0xffffffffL));
 
             packetProcessingService.transmitPacket(packet_out.build());
         } else {
index 1201009b101ff657f7c0c3cac6c56609a52b0309..551dbcfe1b98a7459f09c5c756d48db65db3ac03 100644 (file)
@@ -68,7 +68,7 @@ public class PacketOutConvertor {
 
         // Build Buffer ID to be NO_OFP_NO_BUFFER
         if (inputPacket.getBufferId() != null) {
-            bufferId = inputPacket.getBufferId();
+            bufferId = inputPacket.getBufferId().getValue();
         }
 
         PortNumber outPort = null;
index 429da6e31fa367ce2ae62fc0f9b807d77c6e7108..0f3366dea53ce5c4ab142111ad4d6c90239972d2 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifPacketIn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifPacketInBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNotifUpdateFlowStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.BufferId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.ConnectionCookie;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceivedBuilder;
@@ -56,9 +57,10 @@ public class PacketInTranslator implements IMDMessageTranslator<OfHeader, List<D
 
         if (sc != null && msg instanceof PacketInMessage) {
             PacketInMessage message = (PacketInMessage)msg;
-            LOG.trace("PacketIn[v{}]: Cookie: {} Match.type: {}",
+            LOG.trace("PacketIn[v{}]: Cookie: {} Match.type: {}, BufferId: {}",
                     message.getVersion(), message.getCookie(),
-                    message.getMatch() != null ? message.getMatch().getType() : message.getMatch());
+                    message.getMatch() != null ? message.getMatch().getType() : message.getMatch(),
+                    message.getBufferId() != null ? message.getBufferId().toString() : "No buffer Id");
 
            // create a packet received event builder
            PacketReceivedBuilder pktInBuilder = new PacketReceivedBuilder();
@@ -119,6 +121,9 @@ public class PacketInTranslator implements IMDMessageTranslator<OfHeader, List<D
                    pktInBuilder.setPacketInReason(PacketInUtil.getMdSalPacketInReason(message.getReason()));
                    pktInBuilder.setTableId(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId(message.getTableId().getValue().shortValue()));
                    pktInBuilder.setIngress(InventoryDataServiceUtil.nodeConnectorRefFromDatapathIdPortno(dpid, port, ofVersion));
+                   if (message.getBufferId() != null) {
+                       pktInBuilder.setBufferId(new BufferId(message.getBufferId()));
+                   }
                    PacketReceived pktInEvent = pktInBuilder.build();
                    salPacketIn = Collections.<DataObject>singletonList(pktInEvent);
                }