Search in sources :

Example 1 with IpDscp

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();
}
Also used : IpDscpBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) IpDscpCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder)

Example 2 with IpDscp

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);
}
Also used : IpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder) Dscp(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp) IpDscp(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp) IpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) IpDscp(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp)

Example 3 with IpDscp

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");
    }
}
Also used : IpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder) Dscp(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp)

Aggregations

Dscp (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp)2 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)2 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 IpDscpCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder)1 IpDscp (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscp)1 IpDscpBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder)1