Search in sources :

Example 1 with Ipv6EroCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCase in project bgpcep by opendaylight.

the class Ipv6EroParser method serializeSubTlv.

@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
    checkArgument(bindingSubTlv instanceof Ipv6EroCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
    final Ipv6Ero ipv6Ero = ((Ipv6EroCase) bindingSubTlv).getIpv6Ero();
    TlvUtil.writeTLV(getType(), serializeIpv6EroCase(ipv6Ero.getLoose(), ipv6Ero.getAddress()), aggregator);
}
Also used : Ipv6Ero(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv6.ero._case.Ipv6Ero) Ipv6EroCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCase)

Example 2 with Ipv6EroCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCase in project bgpcep by opendaylight.

the class Ipv6EroParser method parseIpv6EroCase.

public static Ipv6EroCase parseIpv6EroCase(final ByteBuf buffer) {
    final Ipv6EroBuilder builder = new Ipv6EroBuilder();
    final BitArray flags = BitArray.valueOf(buffer, Ipv4EroParser.FLAGS_SIZE);
    builder.setLoose(flags.get(Ipv4EroParser.LOOSE));
    buffer.skipBytes(Ipv4EroParser.RESERVED_ERO);
    builder.setAddress(Ipv6Util.addressForByteBuf(buffer));
    return new Ipv6EroCaseBuilder().setIpv6Ero(builder.build()).build();
}
Also used : Ipv6EroBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv6.ero._case.Ipv6EroBuilder) Ipv6EroCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCaseBuilder) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)1 Ipv6EroCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCase)1 Ipv6EroCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv6EroCaseBuilder)1 Ipv6Ero (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv6.ero._case.Ipv6Ero)1 Ipv6EroBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv6.ero._case.Ipv6EroBuilder)1