Search in sources :

Example 1 with PbbIsid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsid 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);
}
Also used : PbbIsid(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsid) ProtocolMatchFieldsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) PbbBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder)

Aggregations

MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)1 ProtocolMatchFieldsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder)1 PbbBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder)1 PbbIsid (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsid)1