use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType in project bgpcep by opendaylight.
the class LinkstateNlriParser method serializeNodeDescriptor.
private static void serializeNodeDescriptor(final CLinkstateDestinationBuilder builder, final ChoiceNode objectType) {
final NodeCaseBuilder nodeBuilder = new NodeCaseBuilder();
// node descriptors
nodeBuilder.setNodeDescriptors(NodeNlriParser.serializeNodeDescriptors((ContainerNode) objectType.getChild(NODE_DESCRIPTORS_NID).get()));
builder.setObjectType(nodeBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType in project bgpcep by opendaylight.
the class LinkstateNlriParser method serializeAdvertisedNodeDescriptor.
private static void serializeAdvertisedNodeDescriptor(final CLinkstateDestinationBuilder builder, final ChoiceNode objectType) {
// prefix node descriptors
final PrefixCaseBuilder prefixBuilder = new PrefixCaseBuilder();
prefixBuilder.setAdvertisingNodeDescriptors(NodeNlriParser.serializeAdvNodeDescriptors((ContainerNode) objectType.getChild(ADVERTISING_NODE_DESCRIPTORS_NID).get()));
// prefix descriptors
final Optional<DataContainerChild<? extends PathArgument, ?>> prefixDescriptors = objectType.getChild(PREFIX_DESCRIPTORS_NID);
if (prefixDescriptors.isPresent()) {
prefixBuilder.setPrefixDescriptors(AbstractPrefixNlriParser.serializePrefixDescriptors((ContainerNode) prefixDescriptors.get()));
}
builder.setObjectType(prefixBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType in project bgpcep by opendaylight.
the class NodeNlriParser method serializeObjectType.
@Override
protected void serializeObjectType(final ObjectType objectType, final ByteBuf buffer) {
final NodeCase node = (NodeCase) objectType;
SimpleNlriTypeRegistry.getInstance().serializeTlv(NodeDescriptors.QNAME, node.getNodeDescriptors(), buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType in project bgpcep by opendaylight.
the class NodeNlriParser method parseObjectType.
@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
final NodeCaseBuilder builder = new NodeCaseBuilder();
builder.setNodeDescriptors(new NodeDescriptorsBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier) SimpleNlriTypeRegistry.getInstance().parseTlv(buffer)).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType in project bgpcep by opendaylight.
the class TeLspIpv4NlriParser method parseObjectType.
@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
final TeLspCaseBuilder builder = new TeLspCaseBuilder();
final Ipv4CaseBuilder ipv4CaseBuilder = new Ipv4CaseBuilder();
ipv4CaseBuilder.setIpv4TunnelSenderAddress(Ipv4Util.addressForByteBuf(buffer));
builder.setTunnelId(new TunnelId(buffer.readUnsignedShort()));
builder.setLspId(new LspId((long) buffer.readUnsignedShort()));
ipv4CaseBuilder.setIpv4TunnelEndpointAddress(Ipv4Util.addressForByteBuf(buffer));
return builder.setAddressFamily(ipv4CaseBuilder.build()).build();
}
Aggregations