Search in sources :

Example 1 with Ipv4EroCase

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

the class Ipv4EroParser method serializeSubTlv.

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

Example 2 with Ipv4EroCase

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

the class Ipv4EroParser method parseIpv4EroCase.

static Ipv4EroCase parseIpv4EroCase(final ByteBuf buffer) {
    final Ipv4EroBuilder builder = new Ipv4EroBuilder();
    final BitArray flags = BitArray.valueOf(buffer, FLAGS_SIZE);
    builder.setLoose(flags.get(LOOSE));
    buffer.skipBytes(RESERVED_ERO);
    builder.setAddress(Ipv4Util.addressForByteBuf(buffer));
    return new Ipv4EroCaseBuilder().setIpv4Ero(builder.build()).build();
}
Also used : Ipv4EroCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv4EroCaseBuilder) Ipv4EroBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv4.ero._case.Ipv4EroBuilder) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)1 Ipv4EroCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv4EroCase)1 Ipv4EroCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.Ipv4EroCaseBuilder)1 Ipv4Ero (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv4.ero._case.Ipv4Ero)1 Ipv4EroBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev200120.binding.sub.tlvs.binding.sub.tlv.ipv4.ero._case.Ipv4EroBuilder)1