use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.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.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.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.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.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();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmUdpDstDeserializer method addUdpDstValue.
private static void addUdpDstValue(ByteBuf input, MatchEntryBuilder builder) {
UdpDstCaseBuilder caseBuilder = new UdpDstCaseBuilder();
UdpDstBuilder udpBuilder = new UdpDstBuilder();
udpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
caseBuilder.setUdpDst(udpBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class TcpDestinationPortEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final int port = message.readUnsignedShort();
if (Objects.isNull(builder.getLayer4Match())) {
builder.setLayer4Match(new TcpMatchBuilder().setTcpDestinationPort(new PortNumber(port)).build());
} else if (TcpMatch.class.isInstance(builder.getLayer4Match()) && Objects.isNull(TcpMatch.class.cast(builder.getLayer4Match()).getTcpDestinationPort())) {
builder.setLayer4Match(new TcpMatchBuilder(TcpMatch.class.cast(builder.getLayer4Match())).setTcpDestinationPort(new PortNumber(port)).build());
} else {
throwErrorOnMalformed(builder, "layer4Match", "tcpDestinationPort");
}
}
Aggregations