- flow cookie [64b] is present at receivedPacket (to distinguish responsible flow)
- connection cookie [32b] is present at receivedPacket and is expected
to be copied into corresponding transmitPacketInput (to distinguish auxiliary connection)
- fixed sal-compatibility, l2switch/implementation, sal-binding-it
Change-Id: I331aa3a0f582219a1c604e21466c7a893ee4ed67
Signed-off-by: Michal Rehak <mirehak@cisco.com>
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie
public class MDFlowMapping {
hardTimeout = sourceFlow.hardTimeout as int
idleTimeout = sourceFlow.idleTimeout as int
- cookie = BigInteger.valueOf(sourceFlow.id)
+ cookie = new FlowCookie(BigInteger.valueOf(sourceFlow.id))
priority = sourceFlow.priority as int
val sourceActions = sourceFlow.actions;
val it = new FlowBuilder();
hardTimeout = sourceFlow.hardTimeout as int
idleTimeout = sourceFlow.idleTimeout as int
- cookie = BigInteger.valueOf(sourceFlow.id)
+ cookie = new FlowCookie(BigInteger.valueOf(sourceFlow.id))
priority = sourceFlow.priority as int
id = new FlowId(flowId)
hardTimeout = sourceFlow.hardTimeout as int
idleTimeout = sourceFlow.idleTimeout as int
- cookie = BigInteger.valueOf(sourceFlow.id)
+ cookie = new FlowCookie(BigInteger.valueOf(sourceFlow.id))
priority = sourceFlow.priority as int
val sourceActions = sourceFlow.actions;
target.setActions(actionFrom(actions, node));
}
- target.setId(source.getCookie().longValue());
+ target.setId(source.getCookie().getValue().longValue());
return target;
}
}
private void checkOdFlow(NodeFlow odNodeFlow) {
- assertEquals("Cookie is incorrect.", 9223372036854775807L, odNodeFlow.getCookie().longValue());
+ assertEquals("Cookie is incorrect.", 9223372036854775807L, odNodeFlow.getCookie().getValue().longValue());
assertEquals("Hard timeout is incorrect.", 32765, odNodeFlow.getHardTimeout().shortValue());
assertEquals("Iddle timeout is incorrect.", 32766, odNodeFlow.getIdleTimeout().shortValue());
assertEquals("Priority is incorrect.", 32767, odNodeFlow.getPriority().shortValue());
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
private FlowAddedBuilder prepareOdFlowCommon() {
FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
- odNodeFlowBuilder.setCookie(new BigInteger("9223372036854775807"));
+ odNodeFlowBuilder.setCookie(new FlowCookie(new BigInteger("9223372036854775807")));
odNodeFlowBuilder.setHardTimeout(32767);
odNodeFlowBuilder.setIdleTimeout(32767);
odNodeFlowBuilder.setPriority(32767);
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 {
}
leaf cookie {
- type uint64;
+ type flow-cookie;
}
leaf table_id {
}
leaf cookie_mask {
- type uint64;
+ type flow-cookie;
}
leaf buffer_id {
import opendaylight-match-types {prefix match-type;revision-date "2013-10-26";}
import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
import opendaylight-action-types {prefix action-type;revision-date "2013-11-12";}
+ import opendaylight-flow-types {prefix flow-type;revision-date "2013-10-26";}
revision "2013-07-09" {
description "";
}
- typedef cookie {
+ typedef connection-cookie {
type uint32;
}
}
notification packet-received {
- leaf cookie {
- type cookie;
+ leaf connection-cookie {
+ type connection-cookie;
+ }
+
+ leaf flow-cookie {
+ type flow-type:flow-cookie;
}
leaf table-id {
input {
uses inv:node-context-ref;
- leaf cookie {
- type cookie;
+ leaf connection-cookie {
+ type connection-cookie;
}
leaf egress {
type inv:node-connector-ref;
}
- leaf buffer-id {
+ leaf buffer-id {
type uint32;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.opendaylight.yangtools.yang.binding.RpcService;
*
*/
assertEquals(1, listener1.addedFlows.size());
- assertEquals(0, listener1.addedFlows.get(0).getCookie().intValue());
+ assertEquals(0, listener1.addedFlows.get(0).getCookie().getValue().intValue());
/**
* The registration of the Consumer 2. SalFlowListener is registered
*/
public static FlowAdded flowAdded(int i) {
FlowAddedBuilder ret = new FlowAddedBuilder();
- ret.setCookie(BigInteger.valueOf(i));
+ ret.setCookie(new FlowCookie(BigInteger.valueOf(i)));
return ret.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
static AddFlowInput createSampleAddFlow(NodeRef node, int cookie) {
AddFlowInputBuilder ret = new AddFlowInputBuilder();
ret.setNode(node);
- ret.setCookie(BigInteger.valueOf(cookie));
+ ret.setCookie(new FlowCookie(BigInteger.valueOf(cookie)));
return ret.build();
}
}
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
+
import org.opendaylight.controller.sample.l2switch.md.topology.NetworkGraphService;
import org.opendaylight.controller.sample.l2switch.md.util.InstanceIdentifierUtils;
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
.setBufferId(0L) //
.setHardTimeout(0) //
.setIdleTimeout(0) //
- .setCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement()))
+ .setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement())))
.setFlags(new FlowModFlags(false, false, false, false, false));
return macToMacFlow.build();