use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class SctpDestinationPortEntryDeserializer 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 SctpMatchBuilder().setSctpDestinationPort(new PortNumber(port)).build());
} else if (SctpMatch.class.isInstance(builder.getLayer4Match()) && Objects.isNull(SctpMatch.class.cast(builder.getLayer4Match()).getSctpDestinationPort())) {
builder.setLayer4Match(new SctpMatchBuilder(SctpMatch.class.cast(builder.getLayer4Match())).setSctpDestinationPort(new PortNumber(port)).build());
} else {
throwErrorOnMalformed(builder, "layer4Match", "sctpDestinationPort");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class IpEcnEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short ecn = message.readUnsignedByte();
if (Objects.isNull(builder.getIpMatch())) {
builder.setIpMatch(new IpMatchBuilder().setIpEcn(ecn).build());
} else if (Objects.isNull(builder.getIpMatch().getIpEcn())) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch()).setIpEcn(ecn).build());
} else {
throwErrorOnMalformed(builder, "ipMatch", "ipEcn");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Ipv6DestinationEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final Ipv6Address address = ByteBufUtils.readIetfIpv6Address(message);
if (hasMask) {
final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES);
if (IpConversionUtil.isIpv6ArbitraryBitMask(mask)) {
setArbitraryMatch(builder, address, mask);
} else {
setPrefixMatch(builder, address, mask);
}
} else {
setPrefixMatch(builder, address, null);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Ipv6FlabelEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final Ipv6LabelBuilder ipv6labelBuilder = new Ipv6LabelBuilder().setIpv6Flabel(new Ipv6FlowLabel(message.readUnsignedInt()));
if (hasMask) {
final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.SIZE_OF_INT_IN_BYTES);
ipv6labelBuilder.setFlabelMask(new Ipv6FlowLabel(ByteUtil.bytesToUnsignedInt(mask)));
}
if (Objects.isNull(builder.getLayer3Match())) {
builder.setLayer3Match(new Ipv6MatchBuilder().setIpv6Label(ipv6labelBuilder.build()).build());
} else if (Ipv6Match.class.isInstance(builder.getLayer3Match()) && Objects.isNull(Ipv6Match.class.cast(builder.getLayer3Match()).getIpv6Label())) {
final Ipv6Match match = Ipv6Match.class.cast(builder.getLayer3Match());
builder.setLayer3Match(new Ipv6MatchBuilder(match).setIpv6Label(ipv6labelBuilder.build()).build());
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6Label");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Ipv6NdTargetEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final Ipv6Address address = ByteBufUtils.readIetfIpv6Address(message);
if (Objects.isNull(builder.getLayer3Match())) {
builder.setLayer3Match(new Ipv6MatchBuilder().setIpv6NdTarget(address).build());
} else if (Ipv6Match.class.isInstance(builder.getLayer3Match()) && Objects.isNull(Ipv6Match.class.cast(builder.getLayer3Match()).getIpv6NdTarget())) {
final Ipv6Match match = Ipv6Match.class.cast(builder.getLayer3Match());
builder.setLayer3Match(new Ipv6MatchBuilder(match).setIpv6NdTarget(address).build());
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTarget");
}
}
Aggregations