use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase in project openflowplugin by opendaylight.
the class TypeKeyMakerFactory method createMatchEntriesKeyMaker.
/**
* Creates a key maker for MatchEntry instances.
*
* @param version openflow wire version that shall be used in lookup key
* @return lookup key
*/
public static TypeKeyMaker<MatchEntry> createMatchEntriesKeyMaker(short version) {
return new AbstractTypeKeyMaker<MatchEntry>(version) {
@Override
public MatchEntrySerializerKey<?, ?> make(MatchEntry entry) {
MatchEntrySerializerKey<?, ?> key;
key = new MatchEntrySerializerKey<>(getVersion(), entry.getOxmClass(), entry.getOxmMatchField());
if (entry.getOxmClass().equals(ExperimenterClass.class)) {
ExperimenterIdCase entryValue = (ExperimenterIdCase) entry.getMatchEntryValue();
key.setExperimenterId(entryValue.getExperimenter().getExperimenter().getValue());
return key;
}
key.setExperimenterId(null);
return key;
}
};
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase in project openflowplugin by opendaylight.
the class AbstractOxmExperimenterMatchEntrySerializer method serializeExperimenterId.
protected ExperimenterIdCase serializeExperimenterId(MatchEntry matchEntry, ByteBuf out) {
ExperimenterIdCase expCase = (ExperimenterIdCase) matchEntry.getMatchEntryValue();
out.writeInt(expCase.getExperimenter().getExperimenter().getValue().intValue());
return expCase;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase in project openflowplugin by opendaylight.
the class OnfOxmTcpFlagsSerializer method serialize.
@Override
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
ExperimenterIdCase expCase = serializeExperimenterId(entry, outBuffer);
TcpFlags tcpFlags = expCase.getAugmentation(TcpFlagsContainer.class).getTcpFlags();
outBuffer.writeShort(tcpFlags.getFlags());
if (entry.isHasMask()) {
outBuffer.writeBytes(tcpFlags.getMask());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase in project openflowplugin by opendaylight.
the class ActionExtensionHelper method processAlienAction.
/**
* Processes an alien action.
*
* @param action openflow action
* @param ofVersion openflow version
* @param actionPath openflow action path
* @return augmentation wrapper containing augmentation depending on matchPath
*/
public static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action processAlienAction(final Action action, final OpenflowVersion ofVersion, final ActionPath actionPath) {
ConvertorActionFromOFJava<Action, ActionPath> convertor = null;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null;
final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider();
if (Objects.isNull(extensionConvertorProvider)) {
return null;
}
if (action.getActionChoice() instanceof ExperimenterIdCase) {
ExperimenterIdCase actionCase = (ExperimenterIdCase) action.getActionChoice();
// TODO: EXTENSION PROPOSAL (action, OFJava to MD-SAL)
ExperimenterActionSerializerKey key = new ExperimenterActionSerializerKey(ofVersion.getVersion(), actionCase.getExperimenter().getExperimenter().getValue(), actionCase.getExperimenter().getSubType());
convertor = extensionConvertorProvider.getActionConverter(key);
} else if (action.getActionChoice() != null) {
ActionSerializerKey<?> key = new ActionSerializerKey(EncodeConstants.OF13_VERSION_ID, action.getActionChoice().getImplementedInterface(), null);
convertor = extensionConvertorProvider.getActionConverter(key);
}
if (convertor != null) {
alienAction = convertor.convert(action, actionPath);
}
return alienAction;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase in project openflowplugin by opendaylight.
the class OfToSalExperimenterIdCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull ExperimenterIdCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
if (data.getOxmMatchField().equals(TcpFlags.class)) {
final TcpFlagsMatchBuilder tcpFlagsMatchBuilder = data.getTcpFlagsMatchBuilder();
final TcpFlagsContainer tcpFlagsContainer = source.getAugmentation(TcpFlagsContainer.class);
if (tcpFlagsContainer != null) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.oxm.container.match.entry.value.experimenter.id._case.TcpFlags tcpFlags = tcpFlagsContainer.getTcpFlags();
tcpFlagsMatchBuilder.setTcpFlags(tcpFlags.getFlags());
byte[] mask = tcpFlags.getMask();
if (mask != null) {
tcpFlagsMatchBuilder.setTcpFlagsMask(ByteUtil.bytesToUnsignedShort(mask));
}
matchBuilder.setTcpFlagsMatch(tcpFlagsMatchBuilder.build());
}
}
return Optional.of(matchBuilder);
}
Aggregations