use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValueBuilder in project openflowplugin by opendaylight.
the class CtMarkConvertor method convert.
/*
* (non-Javadoc)
*
* @see
* org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
* (org
* .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
* .rev140714.general.extension.grouping.Extension)
*/
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxCtMarkGrouping> matchGrouping = MatchUtil.CT_MARK_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
CtMarkCaseValueBuilder ctMarkCaseValueBuilder = new CtMarkCaseValueBuilder();
CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
ctMarkValuesBuilder.setCtMark(matchGrouping.get().getNxmNxCtMark().getCtMark());
ctMarkValuesBuilder.setMask(matchGrouping.get().getNxmNxCtMark().getMask());
ctMarkCaseValueBuilder.setCtMarkValues(ctMarkValuesBuilder.build());
MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark.class, Nxm1Class.class, ctMarkCaseValueBuilder.build());
ofMatch.setHasMask(true);
return ofMatch.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValueBuilder in project openflowplugin by opendaylight.
the class CtMarkCodec method deserialize.
@Override
public MatchEntry deserialize(ByteBuf message) {
final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
CtMarkCaseValueBuilder caseBuilder = new CtMarkCaseValueBuilder();
CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
if (matchEntryBuilder.isHasMask()) {
ctMarkValuesBuilder.setMask(message.readUnsignedInt());
}
ctMarkValuesBuilder.setCtMark(message.readUnsignedInt());
caseBuilder.setCtMarkValues(ctMarkValuesBuilder.build());
matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
return matchEntryBuilder.build();
}
Aggregations