use of org.opendaylight.genius.mdsalutil.actions.ActionLearn in project netvirt by opendaylight.
the class ElanNodeListener method setupTableMissSmacFlow.
private void setupTableMissSmacFlow(BigInteger dpId) {
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionPuntToController());
actionsInfos.add(new ActionLearn(0, tempSmacLearnTimeout, 0, ElanConstants.COOKIE_ELAN_LEARNED_SMAC, 0, NwConstants.ELAN_SMAC_LEARNED_TABLE, 0, 0, Arrays.asList(new ActionLearn.MatchFromField(NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getType(), NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getType(), NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getFlowModHeaderLenInt()), new ActionLearn.MatchFromField(NwConstants.NxmOfFieldType.NXM_NX_REG1.getType(), NwConstants.NxmOfFieldType.NXM_NX_REG1.getType(), ElanConstants.INTERFACE_TAG_LENGTH), new ActionLearn.CopyFromValue(LEARN_MATCH_REG4_VALUE, NwConstants.NxmOfFieldType.NXM_NX_REG4.getType(), 8))));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(actionsInfos));
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
List<MatchInfo> mkMatches = new ArrayList<>();
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE, getTableMissFlowRef(NwConstants.ELAN_SMAC_TABLE), 0, "ELAN sMac Table Miss Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_SMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
addSmacBaseTableFlow(dpId);
addSmacLearnedTableFlow(dpId);
}
use of org.opendaylight.genius.mdsalutil.actions.ActionLearn in project genius by opendaylight.
the class ActionInfoBuilderTest method learnActionValuesMatrix.
@Test
@Ignore("Needs to be rewritten")
public void learnActionValuesMatrix() {
ActionInfo actionInfo = new ActionLearn(1, 2, 3, BigInteger.valueOf(4), 5, (short) 6, 7, 8, Arrays.asList(new ActionLearn.CopyFromValue(2, 3, 4), new ActionLearn.OutputToPort(4, 5)));
assertEquals("(new ActionInfoBuilder => [" + System.lineSeparator() + " actionType = ActionType.learn" + System.lineSeparator() + " actionValues = #[" + System.lineSeparator() + " \"1\"," + System.lineSeparator() + " \"2\"," + System.lineSeparator() + " \"3\"," + System.lineSeparator() + " \"4\"," + System.lineSeparator() + " \"5\"," + System.lineSeparator() + " \"6\"," + System.lineSeparator() + " \"7\"," + System.lineSeparator() + " \"8\"" + System.lineSeparator() + " ]" + System.lineSeparator() + " actionValuesMatrix = #[" + System.lineSeparator() + " #[" + System.lineSeparator() + " \"COPY_FROM_VALUE\"," + System.lineSeparator() + " \"2\"," + System.lineSeparator() + " \"3\"," + System.lineSeparator() + " \"4\"" + System.lineSeparator() + " ]," + System.lineSeparator() + " #[" + System.lineSeparator() + " \"OUTPUT_TO_PORT\"," + System.lineSeparator() + " \"4\"," + System.lineSeparator() + " \"5\"" + System.lineSeparator() + " ]" + System.lineSeparator() + " ]" + System.lineSeparator() + "]).build()", generator.getExpression(actionInfo));
}
Aggregations