use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.BindingSubTlv 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.BindingSubTlv in project bgpcep by opendaylight.
the class BackupUnnumberedParser method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
Preconditions.checkArgument(bindingSubTlv instanceof UnnumberedInterfaceIdBackupEroCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final UnnumberedInterfaceIdBackupEroCase unnumberedBackup = (UnnumberedInterfaceIdBackupEroCase) bindingSubTlv;
TlvUtil.writeTLV(BACKUP_UNNUMBERED_ERO, serializeUnnumberedIdEro(unnumberedBackup.isLoose(), unnumberedBackup.getRouterId(), unnumberedBackup.getInterfaceId()), aggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.BindingSubTlv in project bgpcep by opendaylight.
the class EroMetricParser method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
Preconditions.checkArgument(bindingSubTlv instanceof EroMetricCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final ByteBuf buffer = Unpooled.buffer();
buffer.writeInt(((EroMetricCase) bindingSubTlv).getEroMetric().getValue().intValue());
TlvUtil.writeTLV(getType(), buffer, aggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.BindingSubTlv in project bgpcep by opendaylight.
the class Ipv6BackupEro method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
Preconditions.checkArgument(bindingSubTlv instanceof Ipv6EroBackupCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final Ipv6EroBackupCase ipv6Backup = (Ipv6EroBackupCase) bindingSubTlv;
TlvUtil.writeTLV(getType(), Ipv6EroParser.serializeIpv6EroCase(ipv6Backup.isLoose(), ipv6Backup.getAddress()), aggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.binding.sub.tlvs.BindingSubTlv in project bgpcep by opendaylight.
the class SimpleBindingSubTlvsRegistry method serializeBindingSubTlvs.
public void serializeBindingSubTlvs(final List<BindingSubTlvs> bindingSubTlvs, final ByteBuf aggregator) {
for (final BindingSubTlvs subTlv : bindingSubTlvs) {
final BindingSubTlv bindingSubTlv = subTlv.getBindingSubTlv();
final BindingSubTlvsSerializer serializer = this.handlers.getSerializer(bindingSubTlv.getImplementedInterface());
if (serializer == null) {
LOG.info("Unknown binding sub Tlv type {}", subTlv);
return;
}
serializer.serializeSubTlv(bindingSubTlv, aggregator);
}
}
Aggregations