module bgp-types { yang-version 1; namespace "urn:opendaylight:params:xml:ns:yang:bgp-types"; prefix "bgp-t"; import ietf-inet-types { prefix inet; revision-date 2010-09-24; } organization "Cisco Systems, Inc."; contact "Dana Kutenicsova "; description "This module contains the base concepts contained in RFC4271 and RFC4760. 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-19" { description "Initial revision."; reference "RFC4271, RFC4760"; } typedef bgp-origin { reference "http://tools.ietf.org/html/rfc4271#section-5"; description "Values of BGP Origin Path Attribute."; type enumeration { enum igp { value 0; } enum egp { value 1; } enum incomplete { value 2; } } } identity address-family { reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2"; } identity ipv4-address-family { base address-family; } identity ipv6-address-family { base address-family; } identity subsequent-address-family { reference "http://tools.ietf.org/html/rfc4760#section-6"; } identity unicast-subsequent-address-family { reference "http://tools.ietf.org/html/rfc4760#section-6"; base subsequent-address-family; } identity mpls-labeled-vpn-subsequent-address-family { reference "http://tools.ietf.org/html/rfc4760#section-6"; base subsequent-address-family; } typedef cluster-identifier { reference "http://tools.ietf.org/html/rfc4456#section-8"; type binary { length "4"; } } typedef short-as-number { type inet:as-number { range 0..65535; } } grouping bgp-aggregator { reference "http://tools.ietf.org/html/rfc4271#section-5.1.7"; description "BGP Path Attribute AGGREGATOR."; leaf as-number { // We are acting as a NEW speaker, so only four bytes are allowed type inet:as-number; } leaf network-address { type inet:ipv4-address; } } grouping community { reference "https://tools.ietf.org/html/rfc1997"; description "Community Path Attribute"; leaf as-number { type inet:as-number; } leaf semantics { type uint16; } } grouping extended-community { leaf comm-type { type uint8; } leaf comm-sub-type { type uint8; } choice extended-community { case as-specific-extended-community-case { container as-specific-extended-community { when "../comm-type = 0 and ../comm-sub-type = 0 or ../comm-type = 40 and ../comm-sub-type = 0"; leaf transitive { type boolean; } leaf global-administrator { type short-as-number; } leaf local-administrator { type binary { length "4"; } } } } case inet4-specific-extended-community-case { container inet4-specific-extended-community { when "../comm-type = 1 and ../comm-sub-type = 0 or ../comm-type = 41 and ../comm-sub-type = 0"; leaf transitive { type boolean; } leaf global-administrator { type inet:ipv4-address; } leaf local-administrator { type binary { length "2"; } } } } case opaque-extended-community-case { container opaque-extended-community { when "../comm-type = 3 and ../comm-sub-type = 0 or ../comm-type = 43 and ../comm-sub-type = 0"; leaf transitive { type boolean; } leaf value { type binary { length "6"; } } } } case route-target-extended-community-case { container route-target-extended-community { when "../comm-type = 1 and ../comm-sub-type = 2 or ../comm-type = 2 and ../comm-sub-type = 2 or ../comm-type = 3 and ../comm-sub-type = 2"; leaf global-administrator { type short-as-number; } leaf local-administrator { type binary { length "4"; } } } } case route-origin-extended-community-case { container route-origin-extended-community { when "../comm-type = 1 and ../comm-sub-type = 3 or ../comm-type = 2 and ../comm-sub-type = 3 or ../comm-type = 3 and ../comm-sub-type = 3"; leaf global-administrator { type short-as-number; } leaf local-administrator { type binary { length "4"; } } } } } } grouping next-hop { choice c-next-hop { case ipv4-next-hop-case { container ipv4-next-hop { reference "http://tools.ietf.org/html/rfc4271#section-5.1.3"; leaf global { type inet:ipv4-address; } } } case ipv6-next-hop-case { container ipv6-next-hop { reference "http://tools.ietf.org/html/rfc4760#section-3"; leaf global { type inet:ipv6-address; } leaf link-local { type inet:ipv6-address; } } } } } grouping as-path-segment { reference "http://tools.ietf.org/html/rfc4271#section-5.1.2"; choice c-segment { case a-set-case { container a-set { leaf-list as-set { type inet:as-number; } } } case a-list-case { container a-list { list as-sequence { leaf as { type inet:as-number; } } } } } } }