module network-topology-sr { yang-version 1; namespace "urn:opendaylight:params:xml:ns:yang:topology:sr"; prefix "sr"; import ietf-inet-types { prefix inet; revision-date 2013-07-15; } import network-topology { prefix nt; revision-date 2013-10-21; } organization "Cisco Systems, Inc."; contact "Robert Varga "; description "This module contains the Segment Routing extensions to the base network topology model. Copyright (c)2013 Cisco Systems, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"; revision "2013-08-19" { description "Initial revision."; reference ""; } typedef segment-id { type uint32; reference "http://tools.ietf.org/html/draft-filsfils-rtgwg-segment-routing-00#section-1.1"; } typedef segment-ref { type leafref { path "/nt:network-topology/nt:topology/nt:node/segments/segment-id"; } } grouping sr-link-attributes { leaf segment { type segment-ref; } } grouping sr-node-attributes { list segments { leaf segment-id { type segment-id; mandatory true; } key segment-id; choice segment-specification { case adjacency-case { container adjacency { leaf adjacency { type nt:link-ref; mandatory true; } } } case prefix-case { container prefix { leaf prefix { type inet:ip-prefix; mandatory true; } leaf node-sid { type boolean; default false; } } } } } } grouping topology-sr-type { container topology-sr { presence "indicates a Segment Routing-aware topology"; } } augment "/nt:network-topology/nt:topology/nt:topology-types" { uses topology-sr-type; } augment "/nt:network-topology/nt:topology/nt:link" { when "../../nt:topology-types/topology-sr"; uses sr-link-attributes; } augment "/nt:network-topology/nt:topology/nt:node" { when "../../nt:topology-types/topology-sr"; uses sr-node-attributes; } }