use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createMatchFieldTblFeatureProp.
private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
// t10
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
setFieldMatchBld.setHasMask(false);
setFieldMatchBld.setMatchType(MplsLabel.class);
setFieldMatch.add(setFieldMatchBld.build());
MatchBuilder matchBld = new MatchBuilder();
MatchSetfieldBuilder matchSetfieldBld = new MatchSetfieldBuilder();
matchSetfieldBld.setSetFieldMatch(setFieldMatch);
matchBld.setMatchSetfield(matchSetfieldBld.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder in project openflowplugin by opendaylight.
the class Activator method createFlow.
private static Flow createFlow(String flowId, long groupId, int priority, short tableId) {
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setEthernetMatch(new EthernetMatchBuilder().setEthernetType(new EthernetTypeBuilder().setType(new EtherType(2048L)).build()).build());
FlowBuilder flowBuilder = new FlowBuilder();
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(createGroupInstructions(groupId).build());
flowBuilder.setPriority(priority);
flowBuilder.setCookie(new FlowCookie(new BigInteger(flowId + "" + priority)));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setHardTimeout(0);
flowBuilder.setIdleTimeout(0);
flowBuilder.setStrict(false);
flowBuilder.setContainerName(null);
flowBuilder.setId(new FlowId(flowId));
flowBuilder.setTableId(tableId);
flowBuilder.setKey(key);
flowBuilder.setFlowName("FlowWithGroupInstruction");
return flowBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder in project openflowplugin by opendaylight.
the class SalToOfSetVlanIdActionCase method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetVlanIdActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
matchBuilder.setOxmMatchField(VlanVid.class);
matchBuilder.setHasMask(false);
VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
VlanVidBuilder vlanVidBuilder = new VlanVidBuilder();
vlanVidBuilder.setCfiBit(true);
SetVlanIdAction setvlanidaction = source.getSetVlanIdAction();
vlanVidBuilder.setVlanVid(setvlanidaction.getVlanId().getValue());
vlanVidCaseBuilder.setVlanVid(vlanVidBuilder.build());
matchBuilder.setMatchEntryValue(vlanVidCaseBuilder.build());
List<MatchEntry> entries = new ArrayList<>();
entries.add(matchBuilder.build());
SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
setFieldBuilder.setMatchEntry(entries);
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalIcmpv4CodeCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Icmpv4CodeCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Icmpv4MatchBuilder icmpv4MatchBuilder = data.getIcmpv4MatchBuilder();
Icmpv4Code icmpv4Code = source.getIcmpv4Code();
Short v4code = icmpv4Code.getIcmpv4Code();
if (v4code != null) {
icmpv4MatchBuilder.setIcmpv4Code(v4code);
matchBuilder.setIcmpv4Match(icmpv4MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalInPhyPortCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull InPhyPortCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final OpenflowVersion ofVersion = OpenflowVersion.get(data.getVersion());
final BigInteger datapathId = data.getDatapathId();
final PortNumber portNumber = source.getInPhyPort().getPortNumber();
if (portNumber != null) {
matchBuilder.setInPhyPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathId, portNumber.getValue(), ofVersion));
}
return Optional.of(matchBuilder);
}
Aggregations