use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createPbbMatch.
private static MatchBuilder createPbbMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x88E7L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// mpls
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
// match
protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[] { 0, 1, 0, 0 }).longValue()).build());
match.setProtocolMatchFields(protomatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction47.
private static InstructionsBuilder createAppyActionInstruction47() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// PBB
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[] { 0, 1, 0, 0 }).longValue()).build());
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
actionList.add(ab.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder in project openflowplugin by opendaylight.
the class OfToSalPbbIsidCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull PbbIsidCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final ProtocolMatchFieldsBuilder protocolMatchFieldsBuilder = data.getProtocolMatchFieldsBuilder();
PbbIsid pbbIsid = source.getPbbIsid();
if (pbbIsid != null) {
PbbBuilder pbbBuilder = new PbbBuilder();
pbbBuilder.setPbbIsid(pbbIsid.getIsid());
byte[] mask = pbbIsid.getMask();
if (mask != null) {
pbbBuilder.setPbbMask(ByteUtil.bytesToUnsignedMedium(mask));
}
protocolMatchFieldsBuilder.setPbb(pbbBuilder.build());
matchBuilder.setProtocolMatchFields(protocolMatchFieldsBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder in project openflowplugin by opendaylight.
the class MplsBosEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short mplsBos = message.readUnsignedByte();
if (Objects.isNull(builder.getProtocolMatchFields())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setMplsBos(mplsBos).build());
} else if (Objects.isNull(builder.getProtocolMatchFields().getMplsBos())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields()).setMplsBos(mplsBos).build());
} else {
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsBos");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder in project openflowplugin by opendaylight.
the class MplsTcEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short mplsTc = message.readUnsignedByte();
if (Objects.isNull(builder.getProtocolMatchFields())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setMplsTc(mplsTc).build());
} else if (Objects.isNull(builder.getProtocolMatchFields().getMplsTc())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields()).setMplsTc(mplsTc).build());
} else {
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsTc");
}
}
Aggregations