use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Icmpv6TypeEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short type = message.readUnsignedByte();
if (Objects.isNull(builder.getIcmpv6Match())) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder().setIcmpv6Type(type).build());
} else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Type())) {
builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match()).setIcmpv6Type(type).build());
} else {
throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Type");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class IpProtoEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short proto = message.readUnsignedByte();
if (Objects.isNull(builder.getIpMatch())) {
builder.setIpMatch(new IpMatchBuilder().setIpProtocol(proto).build());
} else if (Objects.isNull(builder.getIpMatch().getIpProtocol())) {
builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch()).setIpProtocol(proto).build());
} else {
throwErrorOnMalformed(builder, "ipMatch", "ipProtocol");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Ipv4SourceEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final Ipv4Address address = ByteBufUtils.readIetfIpv4Address(message);
if (hasMask) {
final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.GROUPS_IN_IPV4_ADDRESS);
if (IpConversionUtil.isArbitraryBitMask(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 Ipv6ExtHeaderEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final Ipv6ExtHeaderBuilder extHeaderBuilder = new Ipv6ExtHeaderBuilder().setIpv6Exthdr(message.readUnsignedShort());
if (hasMask) {
final byte[] mask = OxmDeserializerHelper.convertMask(message, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
extHeaderBuilder.setIpv6ExthdrMask(ByteUtil.bytesToUnsignedShort(mask));
}
if (Objects.isNull(builder.getLayer3Match())) {
builder.setLayer3Match(new Ipv6MatchBuilder().setIpv6ExtHeader(extHeaderBuilder.build()).build());
} else if (Ipv6Match.class.isInstance(builder.getLayer3Match()) && Objects.isNull(Ipv6Match.class.cast(builder.getLayer3Match()).getIpv6ExtHeader())) {
final Ipv6Match match = Ipv6Match.class.cast(builder.getLayer3Match());
builder.setLayer3Match(new Ipv6MatchBuilder(match).setIpv6ExtHeader(extHeaderBuilder.build()).build());
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6ExtHeader");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class Ipv6NdTllEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
if (Objects.isNull(builder.getLayer3Match())) {
builder.setLayer3Match(new Ipv6MatchBuilder().setIpv6NdTll(address).build());
} else if (Ipv6Match.class.isInstance(builder.getLayer3Match()) && Objects.isNull(Ipv6Match.class.cast(builder.getLayer3Match()).getIpv6NdTll())) {
final Ipv6Match match = Ipv6Match.class.cast(builder.getLayer3Match());
builder.setLayer3Match(new Ipv6MatchBuilder(match).setIpv6NdTll(address).build());
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTll");
}
}
Aggregations