Search in sources :

Example 1 with UnnumberedInterfaceIdEroCase

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

the class UnnumberedEroParser method parseUnnumberedEroCase.

static UnnumberedInterfaceIdEroCase parseUnnumberedEroCase(final ByteBuf buffer) {
    final UnnumberedInterfaceIdEroCaseBuilder builder = new UnnumberedInterfaceIdEroCaseBuilder();
    final BitArray flags = BitArray.valueOf(buffer, Ipv4EroParser.FLAGS_SIZE);
    builder.setLoose(flags.get(Ipv4EroParser.LOOSE));
    buffer.skipBytes(Ipv4EroParser.RESERVED_ERO);
    builder.setRouterId(buffer.readUnsignedInt());
    builder.setInterfaceId(buffer.readUnsignedInt());
    return builder.build();
}
Also used : UnnumberedInterfaceIdEroCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.binding.sub.tlv.UnnumberedInterfaceIdEroCaseBuilder) BitArray(org.opendaylight.protocol.util.BitArray)

Example 2 with UnnumberedInterfaceIdEroCase

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

the class UnnumberedEroParser method serializeSubTlv.

@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
    Preconditions.checkArgument(bindingSubTlv instanceof UnnumberedInterfaceIdEroCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
    final UnnumberedInterfaceIdEroCase unnumberedEro = (UnnumberedInterfaceIdEroCase) bindingSubTlv;
    TlvUtil.writeTLV(getType(), serializeUnnumberedIdEro(unnumberedEro.isLoose(), unnumberedEro.getRouterId(), unnumberedEro.getInterfaceId()), aggregator);
}
Also used : UnnumberedInterfaceIdEroCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.binding.sub.tlv.UnnumberedInterfaceIdEroCase)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)1 UnnumberedInterfaceIdEroCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.binding.sub.tlv.UnnumberedInterfaceIdEroCase)1 UnnumberedInterfaceIdEroCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.binding.sub.tlv.UnnumberedInterfaceIdEroCaseBuilder)1