use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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.rev131005.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");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message in project openflowplugin by opendaylight.
the class Ipv6SourceEntryDeserializer 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.rev131005.Message in project openflowplugin by opendaylight.
the class MetadataEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final Metadata metadata = builder.getMetadata();
final byte[] metaByte = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(metaByte);
final MetadataBuilder metadataBuilder = new MetadataBuilder().setMetadata(new BigInteger(1, metaByte));
if (hasMask) {
final byte[] metaMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(metaMask);
metadataBuilder.setMetadataMask(new BigInteger(1, metaMask));
}
if (Objects.isNull(metadata)) {
builder.setMetadata(metadataBuilder.build());
} else {
throwErrorOnMalformed(builder, "metadata");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message in project openflowplugin by opendaylight.
the class PbbEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final long pbb = message.readUnsignedMedium();
final PbbBuilder pbbBuilder = new PbbBuilder().setPbbIsid(pbb);
if (hasMask) {
pbbBuilder.setPbbMask((long) message.readUnsignedMedium());
}
if (Objects.isNull(builder.getProtocolMatchFields())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setPbb(pbbBuilder.build()).build());
} else if (Objects.isNull(builder.getProtocolMatchFields().getPbb())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields()).setPbb(pbbBuilder.build()).build());
} else {
throwErrorOnMalformed(builder, "protocolMatchFields", "pbb");
}
}
Aggregations