use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project netvirt by opendaylight.
the class ElanDmacUtils method removeTheDropFlow.
private ListenableFuture<Void> removeTheDropFlow(long elanTag, BigInteger dpId, String extDeviceNodeId, String macToRemove) {
String flowId = ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, macToRemove, elanTag, true);
Flow flowToRemove = new FlowBuilder().setId(new FlowId(flowId)).setTableId(NwConstants.ELAN_DMAC_TABLE).build();
return ResourceBatchingManager.getInstance().delete(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flowToRemove, dpId));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project netvirt by opendaylight.
the class InterVpnLinkListener method removeVpnLinkEndpointFlows.
// We're catching Exception here to continue deleting as much as possible
// TODO Rework this so it's done in one transaction
@SuppressWarnings("checkstyle:IllegalCatch")
private void removeVpnLinkEndpointFlows(InterVpnLink del, String vpnUuid, String rd, List<BigInteger> dpns, int otherEndpointLportTag, String otherEndpointIpAddr, List<VrfEntry> vrfEntries, final boolean isVpnFirstEndPoint) {
String interVpnLinkName = del.getName();
LOG.debug("Removing endpoint flows for vpn {}. InterVpnLink={}. OtherEndpointLportTag={}", vpnUuid, interVpnLinkName, otherEndpointLportTag);
if (dpns == null) {
LOG.debug("VPN {} endpoint is not instantiated in any DPN for InterVpnLink {}", vpnUuid, interVpnLinkName);
return;
}
for (BigInteger dpnId : dpns) {
try {
// Removing flow from LportDispatcher table
String flowRef = InterVpnLinkUtil.getLportDispatcherFlowRef(interVpnLinkName, otherEndpointLportTag);
FlowKey flowKey = new FlowKey(new FlowId(flowRef));
Flow flow = new FlowBuilder().setKey(flowKey).setId(new FlowId(flowRef)).setTableId(NwConstants.LPORT_DISPATCHER_TABLE).setFlowName(flowRef).build();
mdsalManager.removeFlow(dpnId, flow);
// Also remove the 'fake' iface from the VpnToDpn map
InterVpnLinkUtil.removeIVpnLinkIfaceFromVpnFootprint(vpnFootprintService, vpnUuid, rd, dpnId);
} catch (Exception e) {
// Whatever happens it should not stop it from trying to remove as much as possible
LOG.warn("Error while removing InterVpnLink {} Endpoint flows on dpn {}. Reason: ", interVpnLinkName, dpnId, e);
}
}
// Removing flow from FIB and LFIB tables
LOG.trace("Removing flow in FIB and LFIB tables for vpn {} interVpnLink {} otherEndpointIpAddr {}", vpnUuid, interVpnLinkName, otherEndpointIpAddr);
cleanUpInterVPNRoutes(interVpnLinkName, vrfEntries, isVpnFirstEndPoint);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project netvirt by opendaylight.
the class ElanInterfaceManager method removeUnknownDmacFlow.
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_UNSET))).setTableId(NwConstants.ELAN_UNKNOWN_DMAC_TABLE).build();
mdsalManager.removeFlowToTx(dpId, flow, deleteFlowGroupTx);
if (isVxlanNetworkOrVxlanSegment(elanInfo)) {
Flow flow2 = new FlowBuilder().setId(new FlowId(getUnknownDmacFlowRef(NwConstants.ELAN_UNKNOWN_DMAC_TABLE, elanTag, SH_FLAG_SET))).setTableId(NwConstants.ELAN_UNKNOWN_DMAC_TABLE).build();
mdsalManager.removeFlowToTx(dpId, flow2, deleteFlowGroupTx);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project netvirt by opendaylight.
the class OpenFlow13Utils method createFlowBuilder.
public static FlowBuilder createFlowBuilder(final short table, final int priority, final BigInteger cookieValue, final String flowName, final String flowIdStr, MatchBuilder match, InstructionsBuilder isb) {
FlowBuilder flow = new FlowBuilder();
flow.setId(new FlowId(flowIdStr));
flow.setKey(new FlowKey(new FlowId(flowIdStr)));
flow.setTableId(table);
flow.setFlowName(flowName);
flow.setCookie(new FlowCookie(cookieValue));
flow.setCookieMask(new FlowCookie(cookieValue));
flow.setContainerName(null);
flow.setStrict(false);
flow.setMatch(match.build());
flow.setInstructions(isb.build());
flow.setPriority(priority);
flow.setHardTimeout(0);
flow.setIdleTimeout(0);
flow.setFlags(new FlowModFlags(false, false, false, false, false));
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
return flow;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project netvirt by opendaylight.
the class CountersServiceUtils method createFlowOnTable.
public static Flow createFlowOnTable(Match match, int priority, short tableId, BigInteger cookie, Integer timeout) {
FlowBuilder fb = new FlowBuilder();
if (match != null) {
fb.setMatch(match);
}
FlowId flowId = createFlowId();
fb.setTableId(tableId);
fb.setIdleTimeout(0).setHardTimeout(0);
fb.setId(flowId);
if (timeout != null) {
fb.setHardTimeout(timeout);
}
if (cookie != null) {
fb.setCookie(new FlowCookie(cookie));
}
fb.setPriority(priority);
Flow flow = fb.build();
return flow;
}
Aggregations