use of org.opendaylight.genius.mdsalutil.FlowEntity in project netvirt by opendaylight.
the class ElanNodeListener method createLldpFlow.
private void createLldpFlow(BigInteger dpId, String dstMac, String flowName) {
List<MatchInfo> mkMatches = new ArrayList<>();
mkMatches.add(new MatchEthernetType(ElanConstants.LLDP_ETH_TYPE));
mkMatches.add(new MatchEthernetDestination(new MacAddress(dstMac)));
List<ActionInfo> listActionInfo = new ArrayList<>();
listActionInfo.add(new ActionPuntToController());
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(listActionInfo));
String flowId = dpId.toString() + NwConstants.ELAN_DMAC_TABLE + "lldp" + ElanConstants.LLDP_ETH_TYPE + dstMac;
FlowEntity lldpFlow = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE, flowId, 16, flowName, 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(lldpFlow);
}
use of org.opendaylight.genius.mdsalutil.FlowEntity in project netvirt by opendaylight.
the class ElanNodeListener method createL2ControlProtocolDropFlows.
private void createL2ControlProtocolDropFlows(BigInteger dpId) {
List<MatchInfo> mkMatches = new ArrayList<>();
MatchEthernetDestination matchEthDst = new MatchEthernetDestination(new MacAddress(ElanConstants.L2_CONTROL_PACKETS_DMAC), new MacAddress(ElanConstants.L2_CONTROL_PACKETS_DMAC_MASK));
mkMatches.add(matchEthDst);
List<ActionInfo> listActionInfo = new ArrayList<>();
listActionInfo.add(new ActionDrop());
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(listActionInfo));
String flowId = dpId.toString() + NwConstants.ELAN_DMAC_TABLE + "l2control" + ElanConstants.L2_CONTROL_PACKETS_DMAC + ElanConstants.L2_CONTROL_PACKETS_DMAC_MASK;
FlowEntity flow = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE, flowId, 15, "L2 control packets dMac Table Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(flow);
}
use of org.opendaylight.genius.mdsalutil.FlowEntity in project netvirt by opendaylight.
the class ElanNodeListener method addSmacLearnedTableFlow.
private void addSmacLearnedTableFlow(BigInteger dpId) {
// T50 - match on Reg4 and goto T51
List<MatchInfoBase> mkMatches = new ArrayList<>();
mkMatches.add(new NxMatchRegister(NxmNxReg4.class, LEARN_MATCH_REG4_VALUE));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
String flowRef = new StringBuffer().append(NwConstants.ELAN_SMAC_TABLE).append(NwConstants.FLOWID_SEPARATOR).append(LEARN_MATCH_REG4_VALUE).toString();
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE, flowRef, 10, "ELAN sMac Table Reg4 Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_SMAC.add(BigInteger.valueOf(LEARN_MATCH_REG4_VALUE)), mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.FlowEntity in project netvirt by opendaylight.
the class ElanInterfaceManager method installRemoteUnknownFlow.
private void installRemoteUnknownFlow(ElanInstance elanInfo, BigInteger dpId, long elanTag, WriteTransaction writeFlowGroupTx) {
if (isVxlanNetworkOrVxlanSegment(elanInfo) || ElanUtils.isVlan(elanInfo) || ElanUtils.isFlat(elanInfo)) {
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_UNKNOWN_DMAC_TABLE, getUnknownDmacFlowRef(NwConstants.ELAN_UNKNOWN_DMAC_TABLE, elanTag, /* SH flag */
true), 5, elanInfo.getElanInstanceName(), 0, 0, ElanConstants.COOKIE_ELAN_UNKNOWN_DMAC.add(BigInteger.valueOf(elanTag)), getMatchesForElanTag(elanTag, /* SH flag */
true), getInstructionsForOutGroup(ElanUtils.getElanLocalBCGId(elanTag)));
mdsalManager.addFlowToTx(flowEntity, writeFlowGroupTx);
}
}
use of org.opendaylight.genius.mdsalutil.FlowEntity in project netvirt by opendaylight.
the class ElanInterfaceManager method installLocalUnknownFlow.
private void installLocalUnknownFlow(ElanInstance elanInfo, BigInteger dpId, long elanTag, WriteTransaction writeFlowGroupTx) {
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_UNKNOWN_DMAC_TABLE, getUnknownDmacFlowRef(NwConstants.ELAN_UNKNOWN_DMAC_TABLE, elanTag, /* SH flag */
false), 5, elanInfo.getElanInstanceName(), 0, 0, ElanConstants.COOKIE_ELAN_UNKNOWN_DMAC.add(BigInteger.valueOf(elanTag)), getMatchesForElanTag(elanTag, /* SH flag */
false), getInstructionsForOutGroup(ElanUtils.getElanRemoteBCGId(elanTag)));
mdsalManager.addFlowToTx(flowEntity, writeFlowGroupTx);
}
Aggregations