use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp in project openflowplugin by opendaylight.
the class MatchConvertorUtil method toOfIpDscp.
/**
* To of ip dscp match entry.
*
* @param ipDscp the ip dscp
* @return the match entry
*/
public static MatchEntry toOfIpDscp(final Dscp ipDscp) {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(OpenflowBasicClass.class);
matchEntryBuilder.setHasMask(false);
matchEntryBuilder.setOxmMatchField(IpDscp.class);
IpDscpCaseBuilder ipDscpCaseBuilder = new IpDscpCaseBuilder();
IpDscpBuilder ipDscpBuilder = new IpDscpBuilder();
ipDscpBuilder.setDscp(ipDscp);
ipDscpCaseBuilder.setIpDscp(ipDscpBuilder.build());
matchEntryBuilder.setMatchEntryValue(ipDscpCaseBuilder.build());
return matchEntryBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp in project openflowplugin by opendaylight.
the class OfToSalIpDscpCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull IpDscpCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final IpMatchBuilder ipMatchBuilder = data.getIpMatchBuilder();
IpDscp ipDscp = source.getIpDscp();
if (ipDscp != null) {
ipMatchBuilder.setIpDscp(new Dscp(ipDscp.getDscp().getValue()));
matchBuilder.setIpMatch(ipMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp in project openflowplugin by opendaylight.
the class IpDscpEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short dscp = message.readUnsignedByte();
if (Objects.isNull(builder.getIpMatch())) {
builder.setIpMatch(new IpMatchBuilder().setIpDscp(new Dscp(dscp)).build());
} else if (Objects.isNull(builder.getIpMatch().getIpDscp())) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch()).setIpDscp(new Dscp(dscp)).build());
} else {
throwErrorOnMalformed(builder, "ipMatch", "ipDscp");
}
}
Aggregations