/** * Create a MD-SAL flow ID to be associated with a flow entry in a * VTN data flow. * * @param id A VTN flow ID. * @param index An index value that specifies a flow entry in a VTN * data flow. * @return A MD-SAL flow ID. */ public static FlowId createMdFlowId(BigInteger id, Integer index) { return new FlowId(ID_PREFIX + id + ID_SEPARATOR + index); }
/** * For flow without match specified (actually, only "drop all" flow) * * @param prefix String * @return FlowId */ public static FlowId newFlowId(String prefix) { return new FlowId(prefix); }
public static FlowId getDefaultInstance(String defaultValue) { return new FlowId(defaultValue); }
private FlowId createFlowId(EthernetMatch ethernetMatch, ArpMatch arpMatch) { StringBuilder sb = new StringBuilder(); sb.append(ARP_REPLY_TO_CONTROLLER_FLOW_NAME); sb.append("|").append(ethernetMatch); sb.append("|").append(arpMatch); return new FlowId(sb.toString()); }
private FlowKey makeAlienFlowKey() { final StringBuilder sBuilder = new StringBuilder(ALIEN_SYSTEM_FLOW_ID) .append(tableKey.getId()).append("-").append(unaccountedFlowsCounter.incrementAndGet()); final FlowId flowId = new FlowId(sBuilder.toString()); return new FlowKey(flowId); }
private FlowKey makeAlienFlowKey() { final StringBuilder sBuilder = new StringBuilder(ALIEN_SYSTEM_FLOW_ID) .append(tableKey.getId()).append("-").append(unaccountedFlowsCounter.incrementAndGet()); final FlowId flowId = new FlowId(sBuilder.toString()); return new FlowKey(flowId); }
private InstanceIdentifier<Flow> getFlowInstanceId(InstanceIdentifier<Table> tableId) { // generate unique flow key FlowId flowId = new FlowId(String.valueOf(flowIdInc.getAndIncrement())); FlowKey flowKey = new FlowKey(flowId); return tableId.child(Flow.class, flowKey); }
private static InstanceIdentifier<Flow> buildFlowPath(NodeConnectorRef nodeConnectorRef, TableKey flowTableKey) { // generate unique flow key FlowId flowId = new FlowId(String.valueOf(flowIdInc.getAndIncrement())); FlowKey flowKey = new FlowKey(flowId); return generateFlowInstanceIdentifier(nodeConnectorRef, flowTableKey, flowKey); }
private InstanceIdentifier<Flow> getFlowInstanceId(InstanceIdentifier<Table> tableId) { // generate unique flow key FlowId flowId = new FlowId(String.valueOf(flowIdInc.getAndIncrement())); FlowKey flowKey = new FlowKey(flowId); return tableId.child(Flow.class, flowKey); }
/** * @param nodeConnectorRef * @return */ private InstanceIdentifier<Flow> buildFlowPath(NodeConnectorRef nodeConnectorRef, TableKey flowTableKey) { // generate unique flow key FlowId flowId = new FlowId(String.valueOf(flowIdInc.getAndIncrement())); FlowKey flowKey = new FlowKey(flowId); return InstanceIdentifierUtils.generateFlowInstanceIdentifier(nodeConnectorRef, flowTableKey, flowKey); }
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) { return nodeIdent .child(Table.class, new TableKey(staleFlow.getTableId())) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow.class, new StaleFlowKey(new FlowId(staleFlow.getId()))); } }
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) { return nodeIdent .child(Table.class, new TableKey(staleFlow.getTableId())) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow.class, new StaleFlowKey(new FlowId(staleFlow.getId()))); }
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> getFlowInstanceIdentifier(NodeRef nodeRef, Flow flow) { return ((InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node>) nodeRef.getValue()) .augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(DEFAULT_TABLE_ID)) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, new FlowKey(new FlowId(flow.getId()))); }
public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow toMDFlow(final Flow sourceFlow, final String flowId) { return internalToMDFlow(sourceFlow) .setTableId((short)0) .setId(new FlowId(flowId)) .build(); }
private void removeFlowThatSendsThePacketOnAnExternalTunnel(long elanTag, BigInteger dpId, String extDeviceNodeId, String macToRemove, List<ListenableFuture<Void>> futures) { String flowId = getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, macToRemove, elanTag, false); Flow flowToRemove = new FlowBuilder().setId(new FlowId(flowId)).setTableId(NwConstants.ELAN_DMAC_TABLE).build(); futures.add(mdsalManager.removeFlow(dpId, flowToRemove)); }
private void removeTheDropFlow(long elanTag, BigInteger dpId, String extDeviceNodeId, String macToRemove, List<ListenableFuture<Void>> futures) { String flowId = getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, macToRemove, elanTag, true); Flow flowToRemove = new FlowBuilder().setId(new FlowId(flowId)).setTableId(NwConstants.ELAN_DMAC_TABLE).build(); futures.add(mdsalManager.removeFlow(dpId, flowToRemove)); }
@Override protected void remove(InstanceIdentifier<Node> identifier, Node del) { BigInteger dpnId = getDpnIdFromNodeId(del.getId()); if ( dpnId == null ) { return; } logger.debug("Removing L3VPN to ELAN default Fallback flow in LPortDispatcher table"); Flow flowToRemove = new FlowBuilder().setFlowName(L3_TO_L2_DEFAULT_FLOW_REF) .setId(new FlowId(L3_TO_L2_DEFAULT_FLOW_REF)) .setTableId(NwConstants.LPORT_DISPATCHER_TABLE).build(); mdsalMgr.removeFlow(dpnId, flowToRemove); }
public CheckedFuture<Void,TransactionCommitFailedException> removeFlowNew(BigInteger dpnId, Flow flowEntity) { s_logger.debug("Remove flow {}",flowEntity); Node nodeDpn = buildDpnNode(dpnId); FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getId())); InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build(); WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId ); return modification.submit(); }
private void removeUnknownDmacFlow(BigInteger dpId, ElanInstance elanInfo, WriteTransaction deleteFlowGroupTx, long elanTag) { Flow flow = new FlowBuilder().setId(new FlowId(getUnknownDmacFlowRef(NwConstants.ELAN_UNKNOWN_DMAC_TABLE, elanTag, /* SH flag */ false))).setTableId(NwConstants.ELAN_UNKNOWN_DMAC_TABLE).build(); mdsalManager.removeFlowToTx(dpId, flow, deleteFlowGroupTx); if (ElanUtils.isVxlan(elanInfo)) { Flow flow2 = new FlowBuilder().setId(new FlowId(getUnknownDmacFlowRef(NwConstants.ELAN_UNKNOWN_DMAC_TABLE, elanTag, /* SH flag */ true))).setTableId(NwConstants.ELAN_UNKNOWN_DMAC_TABLE) .build(); mdsalManager.removeFlowToTx(dpId, flow2, deleteFlowGroupTx); } }
public CheckedFuture<Void,TransactionCommitFailedException> installFlow(BigInteger dpId, Flow flow) { FlowKey flowKey = new FlowKey( new FlowId(flow.getId()) ); Node nodeDpn = buildDpnNode(dpId); InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class,flowKey).build(); WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction(); modification.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, true); return modification.submit(); }