use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.Aggregator in project bgpcep by opendaylight.
the class RangeTlvParser method serializeSubTlvs.
private static void serializeSubTlvs(final ByteBuf aggregator, final List<SubTlvs> subTlvs) {
for (final SubTlvs subTlv : subTlvs) {
ByteBuf buffer = Unpooled.buffer();
final RangeSubTlv rangeSubTlv = subTlv.getRangeSubTlv();
if (rangeSubTlv instanceof PrefixSidTlvCase) {
final PrefixSidTlv prefixSidTlv = ((PrefixSidTlvCase) rangeSubTlv).getPrefixSidTlv();
SrPrefixAttributesParser.serializePrefixAttributes(prefixSidTlv.getFlags(), prefixSidTlv.getAlgorithm(), prefixSidTlv.getSidLabelIndex(), buffer);
TlvUtil.writeTLV(PREFIX_SID, buffer, aggregator);
} else if (rangeSubTlv instanceof Ipv6PrefixSidTlvCase) {
final Ipv6PrefixSidTlv prefixSidTlv = ((Ipv6PrefixSidTlvCase) rangeSubTlv).getIpv6PrefixSidTlv();
Ipv6SrPrefixAttributesParser.serializePrefixAttributes(prefixSidTlv.getAlgorithm(), buffer);
TlvUtil.writeTLV(IPV6_PREFIX_SID, buffer, aggregator);
} else if (rangeSubTlv instanceof BindingSidTlvCase) {
final BindingSidTlvCase rangeTlv = (BindingSidTlvCase) rangeSubTlv;
BindingSidLabelParser.serializeBindingSidAttributes(rangeTlv.getWeight(), rangeTlv.getFlags(), rangeTlv.getBindingSubTlvs(), buffer);
TlvUtil.writeTLV(BINDING_SID, buffer, aggregator);
} else if (rangeSubTlv instanceof SidLabelTlvCase) {
buffer = SidLabelIndexParser.serializeSidValue(((SidLabelTlvCase) rangeSubTlv).getSidLabelIndex());
TlvUtil.writeTLV(SID_TYPE, buffer, aggregator);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.Aggregator in project bgpcep by opendaylight.
the class SimpleBindingSubTlvsRegistry method serializeBindingSubTlvs.
public void serializeBindingSubTlvs(final List<BindingSubTlvs> bindingSubTlvs, final ByteBuf aggregator) {
if (bindingSubTlvs != null) {
for (final BindingSubTlvs subTlv : bindingSubTlvs) {
final BindingSubTlv bindingSubTlv = subTlv.getBindingSubTlv();
final BindingSubTlvsSerializer serializer = handlers.getSerializer(bindingSubTlv.implementedInterface());
if (serializer == null) {
LOG.info("Unknown binding sub Tlv type {}", subTlv);
return;
}
serializer.serializeSubTlv(bindingSubTlv, aggregator);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.Aggregator in project bgpcep by opendaylight.
the class UnnumberedEroParser method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
checkArgument(bindingSubTlv instanceof UnnumberedInterfaceIdEroCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final UnnumberedInterfaceIdEro unnumberedEro = ((UnnumberedInterfaceIdEroCase) bindingSubTlv).getUnnumberedInterfaceIdEro();
TlvUtil.writeTLV(getType(), serializeUnnumberedIdEro(unnumberedEro.getLoose(), unnumberedEro.getRouterId(), unnumberedEro.getInterfaceId()), aggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.Aggregator in project bgpcep by opendaylight.
the class BackupUnnumberedParser method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
checkArgument(bindingSubTlv instanceof UnnumberedInterfaceIdBackupEroCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final UnnumberedInterfaceIdBackupEro unnumberedBackup = ((UnnumberedInterfaceIdBackupEroCase) bindingSubTlv).getUnnumberedInterfaceIdBackupEro();
TlvUtil.writeTLV(BACKUP_UNNUMBERED_ERO, serializeUnnumberedIdEro(unnumberedBackup.getLoose(), unnumberedBackup.getRouterId(), unnumberedBackup.getInterfaceId()), aggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.Aggregator in project bgpcep by opendaylight.
the class Ipv6BackupEro method serializeSubTlv.
@Override
public void serializeSubTlv(final BindingSubTlv bindingSubTlv, final ByteBuf aggregator) {
checkArgument(bindingSubTlv instanceof Ipv6EroBackupCase, "Wrong BindingSubTlv instance expected", bindingSubTlv);
final Ipv6EroBackup ipv6Backup = ((Ipv6EroBackupCase) bindingSubTlv).getIpv6EroBackup();
TlvUtil.writeTLV(getType(), Ipv6EroParser.serializeIpv6EroCase(ipv6Backup.getLoose(), ipv6Backup.getAddress()), aggregator);
}
Aggregations