use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlagsBuilder in project openflowplugin by opendaylight.
the class OnfOxmTcpFlagsDeserializer method addTcpFlagsAugmentation.
private static void addTcpFlagsAugmentation(ByteBuf input, ExperimenterIdCaseBuilder expCaseBuilder, boolean hasMask) {
TcpFlagsContainerBuilder flagsContainerBuilder = new TcpFlagsContainerBuilder();
TcpFlagsBuilder flagsBuilder = new TcpFlagsBuilder();
flagsBuilder.setFlags(input.readUnsignedShort());
if (hasMask) {
byte[] mask = new byte[EncodeConstants.SIZE_OF_SHORT_IN_BYTES];
input.readBytes(mask);
flagsBuilder.setMask(mask);
}
flagsContainerBuilder.setTcpFlags(flagsBuilder.build());
expCaseBuilder.addAugmentation(TcpFlagsContainer.class, flagsContainerBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlagsBuilder in project openflowplugin by opendaylight.
the class MatchConvertor method tcpFlagsMatch.
private static void tcpFlagsMatch(List<MatchEntry> matchEntryList, TcpFlagsMatch tcpFlagsMatch) {
ExperimenterIdCaseBuilder expIdCaseBuilder = new ExperimenterIdCaseBuilder();
if (tcpFlagsMatch != null) {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(ExperimenterClass.class);
matchEntryBuilder.setHasMask(false);
matchEntryBuilder.setOxmMatchField(TcpFlags.class);
TcpFlagsContainerBuilder tcpFlagsContainerBuilder = new TcpFlagsContainerBuilder();
TcpFlagsBuilder tcpFlagsBuilder = new TcpFlagsBuilder();
tcpFlagsBuilder.setFlags(tcpFlagsMatch.getTcpFlags());
if (tcpFlagsMatch.getTcpFlagsMask() != null) {
matchEntryBuilder.setHasMask(true);
tcpFlagsBuilder.setMask(ByteUtil.unsignedShortToBytes(tcpFlagsMatch.getTcpFlagsMask()));
}
tcpFlagsContainerBuilder.setTcpFlags(tcpFlagsBuilder.build());
// Set experimenter ID.
ExperimenterBuilder experimenterBuilder = new ExperimenterBuilder();
experimenterBuilder.setExperimenter(new ExperimenterId(OFApprovedExperimenterIds.MATCH_TCP_FLAGS_EXP_ID));
expIdCaseBuilder.setExperimenter(experimenterBuilder.build());
expIdCaseBuilder.addAugmentation(TcpFlagsContainer.class, tcpFlagsContainerBuilder.build());
matchEntryBuilder.setMatchEntryValue(expIdCaseBuilder.build());
matchEntryList.add(matchEntryBuilder.build());
}
}
Aggregations