use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object in project bgpcep by opendaylight.
the class AbstractLabeledUnicastRIBSupport method extractCLabeledUnicastDestination.
/**
* Conversion from DataContainer to LabeledUnicastDestination Object
*
* @param route DataContainer
* @return LabeledUnicastDestination Object
*/
private CLabeledUnicastDestination extractCLabeledUnicastDestination(final DataContainerNode<? extends PathArgument> route) {
final CLabeledUnicastDestinationBuilder builder = new CLabeledUnicastDestinationBuilder();
builder.setPrefix(extractPrefix(route, PREFIX_TYPE_NID));
builder.setLabelStack(extractLabel(route, LABEL_STACK_NID, LV_NID));
builder.setPathId(PathIdUtil.buildPathId(route, routePathIdNid()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object in project bgpcep by opendaylight.
the class AbstractPrefixNlriParser method parsePrefixDescriptor.
private static PrefixDescriptors parsePrefixDescriptor(final ByteBuf buffer) {
final Map<QName, Object> tlvs = SimpleNlriTypeRegistry.getInstance().parseSubTlvs(buffer);
final PrefixDescriptorsBuilder builder = new PrefixDescriptorsBuilder();
builder.setMultiTopologyId((TopologyIdentifier) tlvs.get(MultiTopoIdTlvParser.MULTI_TOPOLOGY_ID_QNAME));
builder.setOspfRouteType((OspfRouteType) tlvs.get(OspfRouteTlvParser.OSPF_ROUTE_TYPE_QNAME));
builder.setIpReachabilityInformation((IpPrefix) tlvs.get(ReachTlvParser.IP_REACHABILITY_QNAME));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object in project bgpcep by opendaylight.
the class LinkstateNlriParser method extractLinkstateDestination.
public static CLinkstateDestination extractLinkstateDestination(final DataContainerNode<? extends PathArgument> linkstate) {
final CLinkstateDestinationBuilder builder = new CLinkstateDestinationBuilder();
serializeCommonParts(builder, linkstate);
final ChoiceNode objectType = (ChoiceNode) linkstate.getChild(OBJECT_TYPE_NID).get();
if (objectType.getChild(ADVERTISING_NODE_DESCRIPTORS_NID).isPresent()) {
serializeAdvertisedNodeDescriptor(builder, objectType);
} else if (objectType.getChild(LOCAL_NODE_DESCRIPTORS_NID).isPresent()) {
serializeLocalNodeDescriptor(builder, objectType);
} else if (objectType.getChild(NODE_DESCRIPTORS_NID).isPresent()) {
serializeNodeDescriptor(builder, objectType);
} else if (AbstractTeLspNlriCodec.isTeLsp(objectType)) {
builder.setObjectType(AbstractTeLspNlriCodec.serializeTeLsp(objectType));
} else {
LOG.warn("Unknown Object Type: {}.", objectType);
}
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object in project bgpcep by opendaylight.
the class RemoteNodeDescriptorTlvParser method parseTlvBody.
@Override
public RemoteNodeDescriptors parseTlvBody(final ByteBuf value) {
final Map<QName, Object> parsedSubTlvs = new HashMap<>();
final RemoteNodeDescriptorsBuilder builder = new RemoteNodeDescriptorsBuilder(parseNodeDescriptor(value, parsedSubTlvs));
builder.setBgpRouterId((Ipv4Address) parsedSubTlvs.get(BgpRouterIdTlvParser.BGP_ROUTER_ID_QNAME));
builder.setMemberAsn((AsNumber) parsedSubTlvs.get(MemAsNumTlvParser.MEMBER_AS_NUMBER_QNAME));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object in project bgpcep by opendaylight.
the class AbstractLocalNodeDescriptorTlvCodec method parseTlvBody.
@Override
public final LocalNodeDescriptors parseTlvBody(final ByteBuf value) {
final Map<QName, Object> parsedSubTlvs = new HashMap<>();
final LocalNodeDescriptorsBuilder builder = new LocalNodeDescriptorsBuilder(parseNodeDescriptor(value, parsedSubTlvs));
builder.setBgpRouterId((Ipv4Address) parsedSubTlvs.get(BgpRouterIdTlvParser.BGP_ROUTER_ID_QNAME));
builder.setMemberAsn((AsNumber) parsedSubTlvs.get(MemAsNumTlvParser.MEMBER_AS_NUMBER_QNAME));
return builder.build();
}
Aggregations