module bgp-multiprotocol { yang-version 1; namespace "urn:opendaylight:params:xml:ns:yang:bgp-multiprotocol"; prefix "bgp-mp"; import ietf-inet-types { prefix inet; revision-date 2010-09-24; } import bgp-message { prefix bgp-msg; } import bgp-types { prefix bgp-t; } organization "Cisco Systems, Inc."; contact "Dana Kutenicsova "; description "This module contains the base data model of a BGP message. It rolls up the definitions contained in RFC4271 and draft-ietf-idr-ls-distribution-03. 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-09-18" { description "Initial revision."; reference "RFC4760"; } grouping bgp-table-type { leaf afi { type identityref { base bgp-t:address-family; } } leaf safi { type identityref { base bgp-t:subsequent-address-family; } } } grouping destination { choice nlri { case ipv4 { when "../../afi = ipv4"; leaf-list ipv4-prefixes { type inet:ipv4-prefix; } } case ipv6 { when "../../afi = ipv6"; leaf-list ipv6-prefixes { type inet:ipv6-prefix; } } } } augment "/bgp-msg:open/bgp-msg:bgp-parameters/bgp-msg:parameters" { case multiprotocol { list capabilities { container multiprotocol-capability { reference "http://tools.ietf.org/html/rfc4760#section-8"; container table-type { uses bgp-table-type; } } } } } augment "/bgp-msg:update/bgp-msg:path-attributes" { container mp-unreach-nlri { reference "http://tools.ietf.org/html/rfc4760#section-4"; uses bgp-table-type; container withdrawn-routes { // FIXME: 'uses destination'; choice nlri { case ipv4 { when "../../afi = ipv4"; leaf-list ipv4-prefixes { type inet:ipv4-prefix; } } case ipv6 { when "../../afi = ipv6"; leaf-list ipv6-prefixes { type inet:ipv6-prefix; } } } } } } augment "/bgp-msg:update/bgp-msg:path-attributes" { container mp-reach-nlri { reference "http://tools.ietf.org/html/rfc4760#section-3"; uses bgp-table-type; uses bgp-t:next-hop; container advertized-routes { // FIXME: 'uses destination'; choice nlri { case ipv4 { when "../../afi = ipv4"; leaf-list ipv4-prefixes { type inet:ipv4-prefix; } } case ipv6 { when "../../afi = ipv6"; leaf-list ipv6-prefixes { type inet:ipv6-prefix; } } } } leaf hop { type inet:ip-address; } } } }