use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber in project openflowplugin by opendaylight.
the class OfToSalSctpDstCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull SctpDstCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final SctpMatchBuilder sctpMatchBuilder = data.getSctpMatchBuilder();
SctpDst sctpDst = source.getSctpDst();
PortNumber portNumber = sctpDst.getPort();
if (portNumber != null) {
sctpMatchBuilder.setSctpDestinationPort(portNumber);
matchBuilder.setLayer4Match(sctpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber in project openflowplugin by opendaylight.
the class OfToSalTcpDstCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull TcpDstCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final TcpMatchBuilder tcpMatchBuilder = data.getTcpMatchBuilder();
TcpDst tcpDst = source.getTcpDst();
PortNumber portNumber = tcpDst.getPort();
if (portNumber != null) {
tcpMatchBuilder.setTcpDestinationPort(portNumber);
matchBuilder.setLayer4Match(tcpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber in project openflowplugin by opendaylight.
the class OF10FlowModInputMessageFactory method deserialize.
@Override
// FB doesn't recognize Objects.requireNonNull
@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public FlowModInput deserialize(ByteBuf rawMessage) {
Objects.requireNonNull(registry);
FlowModInputBuilder builder = new FlowModInputBuilder();
builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class));
builder.setMatchV10(matchDeserializer.deserialize(rawMessage));
byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
rawMessage.readBytes(cookie);
builder.setCookie(new BigInteger(1, cookie));
builder.setCommand(FlowModCommand.forValue(rawMessage.readUnsignedShort()));
builder.setIdleTimeout(rawMessage.readUnsignedShort());
builder.setHardTimeout(rawMessage.readUnsignedShort());
builder.setPriority(rawMessage.readUnsignedShort());
builder.setBufferId(rawMessage.readUnsignedInt());
builder.setOutPort(new PortNumber((long) rawMessage.readUnsignedShort()));
builder.setFlagsV10(createFlowModFlagsFromBitmap(rawMessage.readUnsignedShort()));
CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF10_VERSION_ID);
List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF10_VERSION_ID, rawMessage.readableBytes(), rawMessage, keyMaker, registry);
builder.setAction(actions);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber in project openflowplugin by opendaylight.
the class OF10GetQueueConfigInputMessageFactory method deserialize.
@Override
public GetQueueConfigInput deserialize(ByteBuf rawMessage) {
GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
builder.setPort(new PortNumber((long) rawMessage.readUnsignedShort()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber in project openflowplugin by opendaylight.
the class PacketOutInputMessageFactory method deserialize.
@Override
public PacketOutInput deserialize(ByteBuf rawMessage) {
PacketOutInputBuilder builder = new PacketOutInputBuilder();
builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
builder.setBufferId(rawMessage.readUnsignedInt());
builder.setInPort(new PortNumber(rawMessage.readUnsignedInt()));
int actionsLen = rawMessage.readShort();
rawMessage.skipBytes(PADDING);
CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID);
List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, actionsLen, rawMessage, keyMaker, registry);
builder.setAction(actions);
byte[] data = new byte[rawMessage.readableBytes()];
rawMessage.readBytes(data);
builder.setData(data);
return builder.build();
}
Aggregations